photopc-3.07/0000755000175000017500000000000011673670767010144 500000000000000photopc-3.07/epinfo.10000644000175000017500000001022707342636312011412 00000000000000.\" $Id: epinfo.1,v 1.7 2001/08/28 06:40:10 crosser Exp $ .\" .\" Copyright (c) 1997-1999 Eugene G. Crosser .\" Copyright (c) 1998,1999 Bruce D. Lightner (DOS/Windows support) .\" .\" You may distribute and/or use for any purpose modified or unmodified .\" copies of this software if you preserve the copyright notice above. .\" .\" THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY .\" KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE .\" COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE .\" USE OF THIS SOFTWARE. .\" .\" $Log: epinfo.1,v $ .\" Revision 1.7 2001/08/28 06:40:10 crosser .\" change website reference to sourceforge .\" .\" Revision 1.6 1999/04/28 08:40:45 crosser .\" remove extra section .\" .\" Revision 1.5 1999/03/21 20:22:09 crosser .\" sync format desc with actual program .\" .\" Revision 1.4 1999/03/13 13:10:13 crosser .\" reflect 3.00 changes .\" .\" Revision 1.3 1999/03/06 10:24:16 crosser .\" support Exif .\" .\" Revision 1.2 1998/10/18 13:18:27 crosser .\" Put RCS logs and I.D. into the source .\" .\" Revision 1.1 1997/08/17 08:59:54 crosser .\" Initial revision .\" .TH EPINFO 1 "24 May 1997" "PhotoPC manipulation tool" "User Commands" .SH NAME epinfo \- extract technical information from digital camera generated files .SH SYNOPSIS epinfo [-h] [-V] [-z] [-r] [-t] [-f fmt] [-T ] ... .SH DESCRIPTION This command extracts the contents of TIFF directory of Exif files or APP12 marker from JFIF files, parses it and optionaly finds specific data inside it. If used without .BR -T ", "-r " and "-t options, dumps the complete block data in human readable format. With .B -r and .B -t options, renames and changes timestamp of the files. .PP .SH "OPTIONS" .TP 0.5i .B -h This option produces a help screen of all options and commands. .TP 0.5i .B -V This option prints software revision information. .TP 0.5i .B -z This option sets no time-zone processing mode. Use this option if the camera's clock is set up shifted by the local timezone offset (as it is when you set it manually to the local time). .TP 0.5i .B -r Rename files, generating new name based on the time of snapshot and .B -f option value. .TP 0.5i .B -t Set timestamp of the files to the time of snapshots. .TP 0.5i .B -f timeformat This option allows to specify the format for automatically generated image file names; the value is used as the format string for strftime(3) function. By default, names of the format "MMDD_NNN.jpg" are generated, where MM is a month, DD is a day, and NNN is a count starting from 001. A good starting point for the timeformat value could be "%Y_%m_%d-%H_%M_%S.jpg". If the format string contains context "%%XXXd" where XXX are digits, it is taken for the count, i.e. if the file with such name is present, next count is tried. If the format string does not contain "%%XXXd" part, the count field, if necessary, is appended at the end of the name. A few single-character formats are used as shortcuts. "x" makes the name of seconds since the epoch in hexadecimal format (8 characters + ".jpg"), "d" - the same in decimal format (10 characters), "1" stands for default format "%m%d_%%03d.jpg", "2" stands for "%y%m%d%%02d.jpg", "3" stands for "%Y_%m_%d-%H_%M_%S.jpg" and 4 stands for "%Y/%m/%d/%H_%M_%S.jpg". The program attempts to create intermediate directories is necessary (and possible). .TP 0.5i .B -T Output the value of this keyword in the information block. Note that keywords are case sensitive. TagName .I DateTime has special meaning: if the file is .IR Exif ", it just prints the value of DateTime tag, and if the format is old .IR APP12 ", it outputs the value of .I TimeDate tag in the same format as Exif .IR DateTime ". .SH ARGUMENTS .TP 0.5i .B ... List of filenames to process. .SH EXAMPLES % epinfo -f3 -rt pic00001.jpg % epinfo -T FNumber 0512_003.jpg .SH OTHER NOTES The latest version of this tool can be found at http://photopc.sourceforge.net/ Trademarks are properties of their respective owners. .SH COPYRIGHT The program is copyrighted by Eugene G. Crosser and freely distributable. See README file for details. .SH SEE ALSO photopc(1) photopc-3.07/filetime.h0000644000175000017500000000134206672045137012021 00000000000000/* $Id: filetime.h,v 1.1 1999/03/11 22:57:35 crosser Exp $ */ /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: filetime.h,v $ Revision 1.1 1999/03/11 22:57:35 crosser Initial revision */ #ifndef FILETIME_H #define FILETIME_H int setfiletime(char *fname,time_t actime,time_t mtime,int usetimezone); #endif photopc-3.07/eph_priv.h0000644000175000017500000000750707133532273012043 00000000000000/* $Id: eph_priv.h,v 2.9 2000/07/14 06:35:39 crosser Exp $ */ /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: eph_priv.h,v $ Revision 2.9 2000/07/14 06:35:39 crosser reportedly some models return CAN instead of DC1 Revision 2.8 2000/05/09 13:20:54 crosser configure read() with alarm() better. Address signed vs. unsigned arguments other cleanups to make most notorious compilers happy Revision 2.7 1999/01/17 09:50:55 crosser increase WRT*DELAYs Revision 2.6 1998/12/06 08:40:34 crosser chnage iniitimeout for Nikon Revision 2.5 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 2.4 1998/08/28 22:01:48 crosser increase INITTIMEOUT to suite Nikon CP900 Revision 2.3 1998/08/01 12:30:50 crosser flushinput function Revision 2.2 1998/01/27 21:52:55 crosser delays for smart multi-chunk writes Revision 2.1 1998/01/18 02:16:45 crosser DOS support Revision 2.0 1998/01/02 19:20:11 crosser Added support for Win32 Revision 1.3 1997/11/03 23:25:11 crosser add immediate session finish command Revision 1.2 1997/09/12 09:42:35 crosser skip possible NULs prior to `camera signature' Revision 1.1 1997/08/17 08:59:54 crosser Initial revision */ #ifndef _EPH_PRIV_H #define _EPH_PRIV_H #include #define RETRIES 3 #ifdef USE_VMIN_AND_VTIME #define INITTIMEOUT 1700000L #define DATATIMEOUT 1100000L #define BIGDATATIMEOUT 1500000L #define ACKTIMEOUT 1100000L #define BIGACKTIMEOUT 1100000L #define EODTIMEOUT 1100000L #define CMDTIMEOUT 15000000L #else #define INITTIMEOUT 3000000L #define DATATIMEOUT 200000L #define BIGDATATIMEOUT 1500000L #define ACKTIMEOUT 400000L #define BIGACKTIMEOUT 800000L #define EODTIMEOUT 400000L #define CMDTIMEOUT 15000000L #endif /* Bruce and others say that adding 1ms delay before all writes is good. I think that they should rather be fine-tuned. */ #if 1 #define WRTPKTDELAY 1250L #define WRTCMDDELAY 1250L #define WRTPRMDELAY 1500L #define WRTDELAY 2000L #else #define WRTPKTDELAY 250L #define WRTCMDDELAY 250L #define WRTPRMDELAY 500L #define WRTDELAY 1000L #endif #define SPEEDCHGDELAY 100000L #define SKIPNULS 200 #define ACK 0x06 #define DC1 0x11 #define NAK 0x15 /*#define NAK 0x11*/ #define CAN 0x18 #define CMD_SETINT 0 #define CMD_GETINT 1 #define CMD_ACTION 2 #define CMD_SETVAR 3 #define CMD_GETVAR 4 #define PKT_CMD 0x1b #define PKT_DATA 0x02 #define PKT_LAST 0x03 #define SEQ_INITCMD 0x53 #define SEQ_CMD 0x43 #ifndef O_NDELAY #define O_NDELAY O_NONBLOCK #endif typedef struct _eph_pkthdr { unsigned char typ; unsigned char seq; } eph_pkthdr; size_t eph_readt(eph_iob *iob,char *buf,size_t length,long timeout_usec,int *rc); void eph_error(eph_iob *iob,int err,char *fmt,...); int eph_flushinput(eph_iob *iob); void eph_writeinit(eph_iob *iob); void eph_writeack(eph_iob *iob); void eph_writenak(eph_iob *iob); int eph_waitack(eph_iob *iob,long timeout_usec); int eph_waitcomplete(eph_iob *iob); int eph_waitsig(eph_iob *iob); int eph_waiteot(eph_iob *iob); int eph_writepkt(eph_iob *iob,int typ,int seq,char *data,size_t length); int eph_writecmd(eph_iob *iob,char *data,size_t length); int eph_writeicmd(eph_iob *iob,char *data,size_t length); int eph_readpkt(eph_iob *iob,eph_pkthdr *pkthdr,char *buf,size_t *length,long timeout_usec); int eph_setispeed(eph_iob *iob,long val); #endif photopc-3.07/photopc.c0000644000175000017500000017131507634372160011700 00000000000000#ifndef LINT static char *rcsid="$Id: photopc.c,v 2.87 2003/03/14 15:25:36 crosser Exp $"; #endif /* Copyright (c) 1997-2001 Eugene G. Crosser Copyright (c) 1998,1999 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: photopc.c,v $ Revision 2.87 2003/03/14 15:25:36 crosser dev version: trying to workaround phantom entries in the root directory Revision 2.86 2001/08/28 06:51:25 crosser oops, the value is multiplied by 10 before becoming 2 bytes And btw change dev subrelease Revision 2.85 2001/08/28 06:40:10 crosser change website reference to sourceforge Revision 2.84 2001/08/28 06:28:01 crosser try make zoom working on newer Oly Revision 2.83 2001/01/12 23:26:40 crosser new release, avoid strncasecmp, change copyright year Revision 2.82 2001/01/12 11:07:03 crosser If root directory is non-empty, skip it anyway because buggy models report non-zero number of pictures even when current directory is root. Also small fix in displaying time if it is unavailable Revision 2.81 2001/01/11 06:49:58 crosser minor cleanups on source make manual page in sync with the source Revision 2.80 2000/08/13 21:51:48 crosser More changes incorporated from John Bowman's version Revision 2.79 2000/07/14 06:35:39 crosser reportedly some models return CAN instead of DC1 Revision 2.78 2000/05/10 05:20:42 crosser more of Bowman's Nikon things Revision 2.76 2000/05/02 22:26:35 crosser A few things incorporated from John Bowman's Nikon specific diffs Revision 2.75 2000/03/14 21:15:35 crosser Nikon cp950 seems to report negative file size, try negate it. Revision 2.74 2000/02/17 21:29:55 crosser final cleanup for 3.04, change version change debugging levels Revision 2.73 2000/02/17 07:07:41 crosser cleanup for upcoming release Revision 2.72 2000/02/16 22:55:57 crosser backout some changes Revision 2.70 2000/02/16 22:04:03 crosser playing with order of things for Nikon... Do not print header if directory is empty. Revision 2.69 2000/02/13 11:15:01 crosser Kludge null setint for Nikon Revision 2.68 2000/02/08 06:09:54 crosser properly pass back return code through invocations of descend() Revision 2.67 2000/02/05 12:37:42 crosser Oops, resore the code that I have accidently deleted... Revision 2.66 2000/02/04 22:31:56 crosser Clean up things dealing with folder tree recursion. Fixed log entry in acconfig.h that conflicted with "configure" Revision 2.65 2000/02/01 22:04:15 crosser xchdir() function iterates thru path elements define DEVVERSION for extra verbosity Revision 2.64 2000/01/31 21:59:31 crosser Oops! trailing slash... Revision 2.63 2000/01/25 22:16:26 crosser more work trying to chdir properly. I wonder if chdir to multi-component path works at all. Now when path is built properly we'll be able to check it. If chdir-ing to something like "\DCIM\1000OLYM" is impossible we'll have to descend recursively from root every time! Oh boy :-( Revision 2.62 2000/01/24 20:25:23 crosser do better job in walking thru folder tree; credit to Sergey I. Panov Revision 2.61 2000/01/23 15:51:02 crosser work in progress on folder tree support Revision 2.60 2000/01/21 15:03:25 crosser Experimenting with support for models with folder structure Revision 2.59 1999/12/26 13:59:45 crosser sort frame list for erase command; new version 3.03 Revision 2.58 1999/12/11 14:10:15 crosser Support sgtty terminal control Proper "fake speed" handling (needed two values) Revision 2.57 1999/12/01 21:41:24 crosser add "pseudo" speed Revision 2.56 1999/11/17 13:48:08 crosser check if need to include getopt.h Revision 2.55 1999/10/17 13:13:55 crosser check validity of picsum data Revision 2.54 1999/10/09 10:52:47 crosser make filetime honor usetimezone flag. set reg4 in every place (I hope) before other registers are used that depend on the frame number. Revision 2.53 1999/08/01 23:28:06 crosser add RTPRIO Revision 2.52 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 2.51 1999/07/29 07:20:12 crosser remove revision.h Revision 2.50 1999/07/28 20:01:29 crosser reorder includes Revision 2.49 1999/04/11 11:10:09 crosser Add comment about the first usleep() call and do it on non-unix only Revision 2.48 1999/04/10 16:31:34 lightner Change bad switch printout to match bad command printout Add usleep(0L) call to calibrate delays at startup Revision 2.47 1999/03/22 06:08:44 lightner No showhelp() on bad command switches (Windows/DOS errors got lost!) Revision 2.46 1999/03/21 20:22:09 crosser help message typo properly check if the path name is directory if needed Revision 2.45 1999/03/13 13:27:43 crosser add tzset Revision 2.44 1999/03/13 13:10:45 crosser fix usage message Revision 2.43 1999/03/12 23:22:30 crosser cleanup timezone handling Revision 2.42 1999/03/12 10:36:41 crosser fix writing Revision 2.41 1999/03/12 10:06:23 crosser repair low memory model and misc changes Revision 2.40 1999/03/12 01:31:05 crosser cleanups Revision 2.39 1999/03/10 22:34:43 crosser set utime; cleanup Revision 2.38 1999/03/06 13:37:08 crosser Convert to autoconf-style Revision 2.37 1999/02/26 23:54:42 crosser Correct JFIF vs. Exif vs. JPEG things Revision 2.36 1999/02/08 09:37:40 crosser fix help message Revision 2.35 1999/01/17 13:41:34 crosser fix -V message Revision 2.34 1999/01/17 13:32:03 crosser change copyright info Revision 2.33 1999/01/17 09:41:45 crosser fix bug imposed with audio file handling Revision 2.32 1998/12/20 21:49:38 crosser implement "audio" command Revision 2.31 1998/12/06 08:42:43 crosser remove usleep()s - apparently they do not make any difference Revision 2.30 1998/12/06 08:40:34 crosser better way to obtain picture date for the file name Revision 2.29 1998/11/19 11:04:31 crosser clean up things when timedate is not available in the file Revision 2.28 1998/10/18 19:27:31 crosser Insert sleep()s before eph_action, see if it helps Nikon... Revision 2.27 1998/10/18 19:07:36 crosser renamed "list" to "llist", make new "list" that works on all models. Revision 2.26 1998/10/18 13:47:59 crosser change 3 and 4 -f patterns Revision 2.25 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 2.24 1998/08/08 22:59:42 crosser check error from fclose, change error reportd from fwrite Revision 2.23 1998/08/08 22:16:33 crosser More timezone things Revision 2.22 1998/08/08 14:00:33 crosser make things more Olympus friendly, work on zimezone handling Revision 2.21 1998/08/01 13:12:41 lightner Four port for DOS, minor fix Revision 2.20 1998/07/21 22:25:07 crosser Allow numeric resolutions: come models have more than three allregs do not display 14 and 15 reg to avoid hanging reporterr() print timeout error if -v specified Revision 2.19 1998/06/11 07:23:26 crosser fix bug with -last interval Revision 2.18 1998/06/07 18:41:40 crosser frame intervals, digital zoom Revision 2.17 1998/06/07 13:55:20 crosser fix download in low memory model Revision 2.16 1998/03/01 18:57:04 crosser preview command Revision 2.15 1998/02/27 04:37:11 lightner Fix progress report bug (total image size too large) Revision 2.14 1998/02/27 03:44:49 lightner Image download progress report bug (total bytes low if ! LOW_MEMORY) Revision 2.13 1998/02/26 00:50:39 crosser change timezone stuff change time output routine add error callback to suppress timeout messages maybe other misc things Revision 2.12 1998/02/25 22:43:40 crosser fix termios data saving Revision 2.11 1998/02/16 06:17:36 lightner Add -V option Add -z option (camera time is local time) Fix bug with MS dir names of form "A:/" Validate timezone processing under MS-DOS/Windows Fix spelling of "quiet" (quite->quiet) Revision 2.10 1998/02/13 23:02:40 crosser define type off_t on DOS Revision 2.9 1998/02/08 19:58:38 crosser Support low memory: chunked saving etc. Revision 2.8 1998/02/06 09:22:13 crosser comment buffer roundup, fix ISDIR define Revision 2.7 1998/02/05 23:31:23 lightner Special define for S_ISDIR macro if DOS Add extra 2048 bytes when allocating image buffer (avoids realloc()) Revision 2.6 1998/01/27 21:52:55 crosser upload command Revision 2.5 1998/01/18 02:16:45 crosser DOS support Revision 2.4 1998/01/11 21:20:21 crosser off command, malloc/free cleanup Revision 2.3 1998/01/05 22:02:14 crosser disable gebug printout about scheduling policy Revision 2.2 1998/01/04 13:55:57 crosser new commands: protect, list Change close mode Revision 2.1 1998/01/03 19:55:24 crosser locktoggle command new -f variants Revision 2.0 1998/01/02 19:20:11 crosser Added support for Win32 Revision 1.4 1997/12/24 00:36:17 crosser fix help message Revision 1.3 1997/12/24 00:19:13 crosser add new commands add formatted file names show more information in query Revision 1.2 1997/11/15 19:20:51 crosser photopc 600 specific commands/parameters and fix for making files when camera time not set Revision 1.1 1997/08/17 08:59:54 crosser Initial revision */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #ifdef HAVE_FCNTL_H #include #endif #include #ifdef STDC_HEADERS #include #include #endif #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #include #ifndef OPTARG_DEFINED #include #endif #ifdef UNIX #ifdef HAVE_SCHED_H #include #endif #ifdef HAVE_UNAME #include #endif #ifdef HAVE_UNISTD_H #include #endif #else #include "strcscmp.h" #endif #include "eph_io.h" #include "a12scan.h" #include "fnames.h" #include "ctimez.h" #include "filetime.h" #ifdef MAXPATH #undef MAXPATH #endif #define MAXPATH 256 #ifdef DOS #define MS_PROGRAM_NAMES #pragma warn -par #pragma warn -sus #endif #ifdef MSWINDOWS #define MS_PROGRAM_NAMES #define ERRNO GetLastError() #else #define ERRNO errno #endif #ifdef UNIX #define WRITEMODE "w" #define READMODE "r" #else #define WRITEMODE "wb" #define READMODE "rb" #endif #ifndef S_ISDIR #define S_ISDIR(st_mode) ((S_IFDIR & (st_mode)) ? 1 : 0) #endif #ifdef DEFAULT_DEVICE static char *device=DEFAULT_DEVICE; #else # ifdef UNIX static char *device="/dev/photopc"; # else static char *device="COM1:"; # endif #endif static int debug=0; static int quiet=0; static int usetimezone=1; static int setutime=0; static unsigned long filesize=0L; static long frame=0L; static char *nameformat=NULL; static int switchoff=0; static FILE *fp = NULL; static char *fname = NULL; static int have_folders=0; void file_abort_cleanup(void) { if (fp) { fclose(fp); fp=NULL; } if (fname) { printf("\ndeleting file %s\n", fname); unlink(fname); free(fname); fname=NULL; } } static long numphotos(eph_iob *iob) { long r10,r40; if (eph_getint(iob,40,&r40)) { r40=-1; } if (eph_getint(iob,10,&r10)) { r10=-1; } return (r10==-1)?r40:r10; } static int xchdir(eph_iob *iob,char *where) { char path[MAXPATH],*p; if (!have_folders) { fprintf(stderr,"no folders on this model\n"); return -1; } strncpy(path,where,sizeof(path)-1); path[sizeof(path)-1]='\0'; for (p=path;*p;p++) if (*p == '/') *p='\\'; if (path[0] == '\\') { if (eph_setvar(iob,84,"\\",1)) { fprintf(stderr,"could not chdir to \"\\\"\n"); return -1; } } for (p=strtok(path,"\\");p;p=strtok(NULL,"\\")) { if (eph_setvar(iob,84,p,(off_t)strlen(p))) { fprintf(stderr,"could not chdir to \"%s\"\n",p); return -1; } } return 0; } static int descend(eph_iob *iob,int depth,char *root,int(*each)(eph_iob *iob,char *path)) { long nfolders=0L,i; off_t f_size; char *folder,*p; char path[MAXPATH]; int rc; if (!have_folders) return (*each)(iob,root); if (depth > 10) { fprintf(stderr,"cannot be that deep (%d), error!\n",depth); return -1; } if (xchdir(iob,root)) { fprintf(stderr,"chdir to \"%s\" failed\n",root); return -1; } if ((rc=(*each)(iob,root)) != 0) { if (debug) printf("(*each)() returned %d\n",rc); return rc; } eph_getint(iob,83,&nfolders); if (debug) printf("descend: %s has %ld folders\n", root,nfolders); if (nfolders == 0L) return 0; folder=(char*)malloc(2048); f_size=2048; path[sizeof(path)-1]='\0'; for (i=1;i<=nfolders;i++) { eph_setint(iob,83,i); eph_getvar(iob,84,&folder,&f_size); if (debug) printf("depth=%4d i=%4ld:\n",depth,i); strncpy(path,root,sizeof(path)-2); if (path[strlen(path)-1] != '\\') strncat(path,"\\",sizeof(path)-2); strncat(path,folder,sizeof(path)-2); for (p=path+strlen(path)-1;(*p == ' ') && (p > path);p--) *p='\0'; if ((rc=descend(iob,depth+1,path,each))) { free(folder); return rc; } if (xchdir(iob,root)) { fprintf(stderr,"restore dir to \"%s\" failed\n",root); free(folder); return -1; } } free(folder); if (debug) printf("descend: full tree walked through\n"); return 0; } static int nonempty(eph_iob *iob,char *path) { long result; if (eph_getint(iob,10,&result)) { return -1; } if (result) { if (strlen(path) < 2) { if (!quiet) fprintf(stderr,"Buggy camera: nonempty root folder \"%s\", skip over\n",path); return 0; } if (!quiet) printf("Starting in folder \"%s\"\n",path); return 1; } else return 0; } int init(eph_iob *iob) { long ret; int rc; if (eph_getint(iob,1,&ret)) return -1; #if 0 (void)eph_setint(iob,77,1L); (void)eph_setint(iob,82,60L); #endif if ((rc=eph_setnullint(iob,83))) { if (debug) printf("setnullint(83) returned %d\n",rc); } if (eph_setvar(iob,84,"\\",1)) { if (debug) printf("No folders on this model\n"); } else { have_folders=1; } if (have_folders) if (descend(iob,0,"\\",nonempty) < 0) return -1; return 0; } int setclock(eph_iob *iob,int argc,char *argv[]) { time_t now,new; (void)time(&now); if (!usetimezone) { now+=zoneoffset(now); } if (eph_setint(iob,2,(long)now)) return -1; if (eph_getint(iob,2,(long*)&new)) return -1; if (labs(now-new) > 59L) { fprintf(stderr,"time we tried to set does not match the result\n"); return -1; } else { return 0; } } int resolution(eph_iob *iob,int argc,char *argv[]) { long val=0; if (strcasecmp(argv[1],"Lo") == 0) { val=1; } else if (strcasecmp(argv[1],"Hi") == 0) { val=2; } else if (strcasecmp(argv[1],"Ext") == 0) { val=3; } else if ((val=atol(argv[1])) == 0) { fprintf(stderr,"bad resolution `%s'\n",argv[1]); return -1; } return eph_setint(iob,1,val); } int shutter(eph_iob *iob,int argc,char *argv[]) { long val=0; int adjust=0; char buffer[]={0,0,0,0,10,0,0,0}; if (strcasecmp(argv[1],"Auto") == 0) { val=0L; } else if ((strlen(argv[1]) > 2) && (strncmp(argv[1],"1/",2) == 0)) { val=atol(argv[1]+2); if (val == 0) { fprintf(stderr,"bad shutter speed `%s'\n",argv[1]); return -1; } else { val=1000000L/val; } } else if (sscanf(argv[1],"plus%ld",&val) == 1) { adjust=1; } else if (sscanf(argv[1],"minus%ld",&val) == 1) { adjust=-1; } else if ((val=atol(argv[1])) == 0) { fprintf(stderr,"bad shutter speed `%s'\n",argv[1]); return -1; } if (adjust) { if (val == 0) { fprintf(stderr,"bad shutter adjustment `%s'\n",argv[1]); return -1; } else { val=val*adjust; } buffer[0]=(val>>0)&0xff; buffer[1]=(val>>8)&0xff; buffer[2]=(val>>16)&0xff; buffer[3]=(val>>24)&0xff; return eph_setvar(iob,69,buffer,sizeof(buffer)); } else return eph_setint(iob,3,val); } int aperture(eph_iob *iob,int argc,char *argv[]) { long val=0; if (strcasecmp(argv[1],"Auto") == 0) { val=0; } else if (strcasecmp(argv[1],"Lo") == 0) { val=1; } else if (strcasecmp(argv[1],"Med") == 0) { val=2; } else if (strcasecmp(argv[1],"Hi") == 0) { val=4; } else if ((val=atol(argv[1])) == 0) { fprintf(stderr,"bad aperture `%s'\n",argv[1]); return -1; } return eph_setint(iob,5,val); } int flash(eph_iob *iob,int argc,char *argv[]) { long val=0; if (strcasecmp(argv[1],"Auto") == 0) { val=0; } else if (strcasecmp(argv[1],"Force") == 0) { val=1; } else if (strcasecmp(argv[1],"Off") == 0) { val=2; } else if (strcasecmp(argv[1],"Antiredeye") == 0) { val=3; } else if (strcasecmp(argv[1],"Slowsync") == 0) { val=4; } else { fprintf(stderr,"bad flash mode `%s'\n",argv[1]); return -1; } return eph_setint(iob,7,val); } int autoshut_host(eph_iob *iob,int argc,char *argv[]) { long val=0; if ((val=atol(argv[1])) <= 0) { fprintf(stderr,"bad timer value `%s'\n",argv[1]); return -1; } return eph_setint(iob,0x17,val); } int autoshut_field(eph_iob *iob,int argc,char *argv[]) { long val=0; if ((val=atol(argv[1])) <= 0) { fprintf(stderr,"bad timer value `%s'\n",argv[1]); return -1; } return eph_setint(iob,0x18,val); } int lcd_autoshut(eph_iob *iob,int argc,char *argv[]) { long val=0; if ((val=atol(argv[1])) <= 0) { fprintf(stderr,"bad timer value `%s'\n",argv[1]); return -1; } return eph_setint(iob,38,val); } int lcd_brightness(eph_iob *iob,int argc,char *argv[]) { long val=0; if (((val=atol(argv[1])) <= 0) || (val > 7)) { fprintf(stderr,"bad brighness value `%s'\n",argv[1]); return -1; } return eph_setint(iob,35,val); } int setid(eph_iob *iob,int argc,char *argv[]) { return eph_setvar(iob,0x16,argv[1],(off_t)strlen(argv[1])); } int focus(eph_iob *iob,int argc,char *argv[]) { long val=0; if (strcasecmp(argv[1],"Macro") == 0) { val=1; } else if (strcasecmp(argv[1],"Normal") == 0) { val=2; } else if (strcasecmp(argv[1],"Infinity") == 0) { val=3; } else if ((val=atol(argv[1])) == 0) { fprintf(stderr,"bad focus mode `%s'\n",argv[1]); return -1; } return eph_setint(iob,33,val); } int adjust(eph_iob *iob,int argc,char *argv[]) { long val=0; if (strcasecmp(argv[1],"Normal") == 0) { val=0; } else if (strcasecmp(argv[1],"Contrast+") == 0) { val=1; } else if (strcasecmp(argv[1],"Contrast-") == 0) { val=2; } else if (strcasecmp(argv[1],"Brightness+") == 0) { val=3; } else if (strcasecmp(argv[1],"Brightness-") == 0) { val=4; } else if ((val=atol(argv[1])) == 0) { fprintf(stderr,"bad adjust mode `%s'\n",argv[1]); return -1; } return eph_setint(iob,19,val); } int whitebalance(eph_iob *iob,int argc,char *argv[]) { long val=0; if (strcasecmp(argv[1],"Auto") == 0) { val=0; } else if (strcasecmp(argv[1],"Sunny") == 0) { val=1; } else if (strcasecmp(argv[1],"Incandescent") == 0) { val=2; } else if (strcasecmp(argv[1],"Fluorescent") == 0) { val=3; } else if (strcasecmp(argv[1],"Flash") == 0) { val=5; } else if (strcasecmp(argv[1],"Preset") == 0) { val=6; } else if (strcasecmp(argv[1],"Cloudy") == 0) { val=255; } else if ((val=atol(argv[1])) == 0) { fprintf(stderr,"bad whitebalance mode `%s'\n",argv[1]); return -1; } return eph_setint(iob,20,val); } int metering(eph_iob *iob,int argc,char *argv[]) { long val=0; if (strcasecmp(argv[1],"Center-weighted") == 0) { val=2; } else if (strcasecmp(argv[1],"Spot") == 0) { val=3; } else if (strcasecmp(argv[1],"Matrix") == 0) { val=5; } else if ((val=atol(argv[1])) == 0) { fprintf(stderr,"bad metering mode `%s'\n",argv[1]); return -1; } return eph_setint(iob,70,val); } int color(eph_iob *iob,int argc,char *argv[]) { long val=0; if (eph_getint(iob,72,&val)) { if (strcasecmp(argv[1],"On") == 0) { val=1; } else if (strcasecmp(argv[1],"Off") == 0) { val=2; } else if ((val=atol(argv[1])) == 0) { fprintf(stderr,"bad color mode `%s'\n",argv[1]); return -1; } return eph_setint(iob,6,val); } else { if (strcasecmp(argv[1],"On") == 0) { val&=~16; } else if (strcasecmp(argv[1],"Off") == 0) { val|=16; } else { fprintf(stderr,"bad color mode `%s'\n",argv[1]); return -1; } return eph_setint(iob,72,val); } } int dzoom(eph_iob *iob,int argc,char *argv[]) { long val=0; long highbits; if (eph_getint(iob,72,&val)) return -1; highbits=(val & 0x1F) | 8; if (strcasecmp(argv[1],"Zero") == 0) { val=0; } else if (strcasecmp(argv[1],"AEL/WBL") == 0) { val |= 1; } else if (strcasecmp(argv[1],"Reset") == 0) { val &= 0xFFFE; } else if (strcasecmp(argv[1],"Fisheye") == 0) { val=(val & 0xFFF1) | 2; } else if (strcasecmp(argv[1],"Wide") == 0) { val=(val & 0xFFF1) | 4; } else if (strcasecmp(argv[1],"Telephoto") == 0) { val=(val & 0xFFF9); } else if (strcasecmp(argv[1],"Auto") == 0) { val=highbits & 0x17; } else if (strcasecmp(argv[1],"1.25X") == 0) { val=highbits | 0x0100; } else if (strcasecmp(argv[1],"1.6X") == 0) { val=highbits | 0x0200; } else if (strcasecmp(argv[1],"2.0X") == 0) { val=highbits | 0x0300; } else if (strcasecmp(argv[1],"2.5X") == 0) { val=highbits | 0x0400; } else if (strcasecmp(argv[1],"1.0X") == 0) { val=highbits | 0x0500; } else if (strcasecmp(argv[1],"Off") == 0) { val=highbits | 0x0500; } else if ((val=atol(argv[1])) == 0) { fprintf(stderr,"bad dzoom mode `%s'\n",argv[1]); return -1; } return eph_setint(iob,72,val); } int zoom(eph_iob *iob,int argc,char *argv[]) { double val; unsigned int code; char buffer[]={0,0,0,0,10,0,0,0}; if ((val=atof(argv[1])) <= 0.05 || val > 6553.0) { fprintf(stderr,"bad zoom value `%s'\n",argv[1]); return -1; } code=(unsigned int)(10.0*val-0.5); buffer[0]=code&0xff; buffer[1]=(code>>8)&0xff; return eph_setvar(iob,71,buffer,sizeof(buffer)); } int seti(eph_iob *iob,int argc,char *argv[]) { long reg; long val; if ((reg=atol(argv[1])) <= 0) { fprintf(stderr,"bad register value \"%s\"\n",argv[1]); return -1; } if (strspn(argv[2],"0123456789") != strlen(argv[2])) { fprintf(stderr,"bad set value \"%s\"\n",argv[2]); return -1; } val=atol(argv[2]); return eph_setint(iob,reg,val); } int setv(eph_iob *iob,int argc,char *argv[]) { long reg; if ((reg=atol(argv[1])) <= 0) { fprintf(stderr,"bad register value \"%s\"\n",argv[1]); return -1; } return eph_setvar(iob,reg,argv[2],(off_t)strlen(argv[2])); } int snapshot(eph_iob *iob,int argc,char *argv[]) { char zero=0; if (eph_action(iob,2,&zero,1)) return -1; else return 0; } int erase(eph_iob *iob,int argc,char *argv[]) { char zero=0; long frame; if ((frame=atol(argv[1])) <= 0) { fprintf(stderr,"bad frame number %s\n",argv[1]); return -1; } if (eph_setint(iob,4,frame)) return -1; if (eph_action(iob,7,&zero,1)) return -1; else return 0; } int protect(eph_iob *iob,int argc,char *argv[]) { char pmode; long frame; if (strcasecmp(argv[2],"On") == 0) { pmode=1; } else if (strcasecmp(argv[2],"Off") == 0) { pmode=0; } else { fprintf(stderr,"bad protect mode `%s'\n",argv[2]); return -1; } if ((frame=atol(argv[1])) <= 0) { fprintf(stderr,"bad frame number %s\n",argv[1]); return -1; } if (eph_setint(iob,4,frame)) return -1; if (eph_action(iob,9,&pmode,1)) return -1; else return 0; } int eraseall(eph_iob *iob,int argc,char *argv[]) { char zero=0; if (eph_action(iob,1,&zero,1)) return -1; else return 0; } int eraselast(eph_iob *iob,int argc,char *argv[]) { char zero=0; if (eph_action(iob,0,&zero,1)) return -1; else return 0; } int mode(eph_iob *iob,int argc,char *argv[]) { char val=0; if (strcasecmp(argv[1],"Off") == 0) { val=1; } else if (strcasecmp(argv[1],"Record") == 0) { val=2; } else if (strcasecmp(argv[1],"Play") == 0) { val=3; } else if (strcasecmp(argv[1],"Thumbnail") == 0) { val=6; } else if (strcasecmp(argv[1],"Next") == 0) { val=7; } else if (strcasecmp(argv[1],"Previous") == 0) { val=8; } else if ((val=atol(argv[1])) == 0) { fprintf(stderr,"bad mode `%s'\n",argv[1]); return -1; } if (eph_action(iob,8,&val,1)) return -1; else return 0; } int cmd(eph_iob *iob,int argc,char *argv[]) { long ccode; int intarg=-1; char chararg; if (strspn(argv[1],"0123456789") != strlen(argv[1])) { fprintf(stderr,"bad code value \"%s\"\n",argv[1]); return -1; } else ccode=atol(argv[1]); if (strspn(argv[2],"0123456789") == strlen(argv[2])) intarg=atol(argv[2]); if ((intarg >= 0) && (intarg <= 255)) { chararg=intarg; return eph_action(iob,ccode,&chararg,1); } else return eph_action(iob,ccode,argv[2],strlen(argv[2])); } static char *flashval[] = {"Auto","Force","Off","AntiRedeye","SlowSync"}; static char *resval[] = {"Unrecognized","Low","High","Extended"}; static char *macroval[] = {"Unrecognized","Macro","Normal","Infinity"}; static char *aperval[] = {"Auto","Low","Medium","High"}; static char *adjval[] = {"Normal","Contrast+","Contrast-","Brightness+", "Brightness-","Auto"}; static char *wbval[] = {"Auto","Sunny","Incandescent","Fluorescent", "Unrecognized","Flash","Preset"}; static char *meterval[] = {"Unrecognized","Unrecognized","Center","Spot", "Unrecognized","Matrix","Spot-AF-Area"}; static char *operval[] = {"Unrecognized","Off","Record","Play", "Unrecognized","Unrecognized","Thumbnail"}; int query(eph_iob *iob,int argc,char *argv[]) { long result; char *buffer; off_t bufsize; int rc; buffer=malloc(2048); if ((rc=eph_getint(iob,1,&result)) == 0) printf("Resolution: %lu - %s\n",(unsigned long)result, (result < 4)?resval[result]:"Model-specific"); else if (rc == DC1) printf("Resolution unavailable\n"); else goto failure; if ((rc=eph_getint(iob,2,&result)) == 0) { if ((result == 0L) || (result == -1L)) { printf("Camera time: not set (%ld)\n",result); } else { printf("Camera time: %s\n", ctimetz((time_t*)&result,usetimezone)); } } else if (rc == DC1) printf("Camera time unavailable\n"); else goto failure; if ((rc=eph_getint(iob,3,&result)) == 0) printf("Shutter: %lu (1/%lu)\n",(unsigned long)result, (unsigned long)(result?1000000/result:0L)); else if (rc == DC1) printf("Shutter unavailable\n"); else goto failure; if ((rc=eph_getint(iob,5,&result)) == 0) printf("Aperture: %lu - %s\n",(unsigned long)result, (result < 4)?aperval[result]:"Unrecognized"); else if (rc == DC1) printf("Aperture unavailable\n"); else goto failure; if ((rc=eph_getint(iob,6,&result)) == 0) printf("Color mode: %lu - %s\n",result, (result == 1)?"Color":(result == 2)?"B/W":"Unrecognized"); else if (rc == DC1) printf("Color mode unavailable\n"); else goto failure; if ((rc=eph_getint(iob,7,&result)) == 0) printf("Flash: %lu - %s\n",(unsigned long)result, (result < 5)?flashval[result]:"Unrecognized"); else if (rc == DC1) printf("Flash mode unavailable\n"); else goto failure; if ((rc=eph_getint(iob,10,&result)) == 0) printf("Frames in folder: %lu\n",(unsigned long)result); else if (rc == DC1) printf("Frames in folder unavailable\n"); else goto failure; if ((rc=eph_getint(iob,40,&result)) == 0) printf("Total frames: %lu\n",(unsigned long)result); else if (rc == DC1) printf("Total frames unavailable\n"); else goto failure; if ((rc=eph_getint(iob,11,&result)) == 0) printf("Frames left: %lu\n",(unsigned long)result); else if (rc == DC1) printf("Frames left unavailable\n"); else goto failure; if ((rc=eph_getint(iob,16,&result)) == 0) printf("Battery: %lu%%\n",(unsigned long)result); else if (rc == DC1) printf("Battery capacity unavailable\n"); else goto failure; if ((rc=eph_getint(iob,23,&result)) == 0) printf("Autoshut on host: %lu sec\n",(unsigned long)result); else if (rc == DC1) printf("Autoshut on host timer unavailable\n"); else goto failure; if ((rc=eph_getint(iob,24,&result)) == 0) printf("Autoshut on field: %lu sec\n",(unsigned long)result); else if (rc == DC1) printf("Autoshut on field timer unavailable\n"); else goto failure; if ((rc=eph_getint(iob,28,&result)) == 0) printf("Free memory: %lu bytes\n",(unsigned long)result); else if (rc == DC1) printf("Free memory size unavailable\n"); else goto failure; if ((rc=eph_getint(iob,33,&result)) == 0) printf("Macro mode: %lu - %s\n",result, (result < 4)?macroval[result]:"Unrecognized"); else if (rc == DC1) printf("Macro mode unavailable\n"); else goto failure; if ((rc=eph_getint(iob,34,&result)) == 0) printf("Operation mode: %lu - %s\n",result, (result < 7)?operval[result]:"Unrecognized"); else if (rc == DC1) printf("Operation mode unavailable\n"); else goto failure; if ((rc=eph_getint(iob,19,&result)) == 0) printf("Image adjust: %lu - %s\n",(unsigned long)result, (result < 6)?adjval[result]:"Unrecognized"); else if (rc == DC1) printf("Image adjust unavailable\n"); else goto failure; if ((rc=eph_getint(iob,20,&result)) == 0) printf("White balance: %lu - %s\n",(unsigned long)result, (result < 7)?wbval[result]: (result == 255)?"Cloudy":"Unrecognized"); else if (rc == DC1) printf("White balance unavailable\n"); else goto failure; if ((rc=eph_getint(iob,70,&result)) == 0) printf("Metering mode: %lu - %s\n",(unsigned long)result, (result < 7)?meterval[result]:"Unrecognized"); else if (rc == DC1) printf("Metering mode unavailable\n"); else goto failure; if ((rc=eph_getint(iob,35,&result)) == 0) printf("LCD brightness: %lu (of 7)\n",(unsigned long)result); else if (rc == DC1) printf("LCD brightness unavailable\n"); else goto failure; if ((rc=eph_getint(iob,38,&result)) == 0) printf("LCD autoshut: %lu sec\n",(unsigned long)result); else if (rc == DC1) printf("LCD autoshut timer unavailable\n"); else goto failure; /* bufsize=2048; buffer[0]='\0'; if ((rc=eph_getvar(iob,0x08,&buffer,&bufsize)) == 0) printf("Reg 8: \"%s\"\n",buffer); else if (rc == DC1) printf("Reg 8 unavailable\n"); else goto failure; */ bufsize=2048; buffer[0]='\0'; if ((rc=eph_getvar(iob,0x16,&buffer,&bufsize)) == 0) printf("Camera I.D.: \"%s\"\n",buffer); else if (rc == DC1) printf("Camera I.D. unavailable\n"); else goto failure; bufsize=2048; buffer[0]='\0'; if ((rc=eph_getvar(iob,0x19,&buffer,&bufsize)) == 0) printf("Serial No.: \"%s\"\n",buffer); else if (rc == DC1) printf("Serial No. unavailable\n"); else goto failure; bufsize=2048; buffer[0]='\0'; if ((rc=eph_getvar(iob,0x1a,&buffer,&bufsize)) == 0) printf("Version: \"%s\"\n",buffer); else if (rc == DC1) printf("Version unavailable\n"); else goto failure; bufsize=2048; buffer[0]='\0'; if ((rc=eph_getvar(iob,0x1b,&buffer,&bufsize)) == 0) printf("Model: \"%s\"\n",buffer); else if (rc == DC1) printf("Model unavailable\n"); else goto failure; bufsize=2048; buffer[0]='\0'; if ((rc=eph_getvar(iob,48,&buffer,&bufsize)) == 0) printf("Manufacturer: \"%s\"\n",buffer); else if (rc == DC1) printf("Manufacturer unavailable\n"); else goto failure; bufsize=2048; buffer[0]='\0'; if ((rc=eph_getvar(iob,69,&buffer,&bufsize)) == 0) { long adj=(long)(buffer[0]&0xff) +((long)(buffer[1]&0xff)<<8) +((long)(buffer[2]&0xff)<<16) +((long)(buffer[3]&0xff)<<24); printf("Shutter adjustment: %ld\n",adj); } else if (rc == DC1) printf("Shutter adjustment unavailable\n"); else goto failure; bufsize=2048; buffer[0]='\0'; if ((rc=eph_getvar(iob,71,&buffer,&bufsize)) == 0) { long ezoom=(long)(buffer[0]&0xff) +((long)(buffer[1]&0xff)<<8) +((long)(buffer[2]&0xff)<<16) +((long)(buffer[3]&0xff)<<24); printf("Effective zoom: %.1f\n",ezoom*.1); } else if (rc == DC1) printf("Effective zoom unavailable\n"); else goto failure; if ((rc=eph_getint(iob,72,&result)) == 0) printf("Digital zoom mode: %lu - %s\n", (unsigned long)result, (result <= 1)?"Off":"On"); else if (rc == DC1) printf("Digital zoom mode unavailable\n"); else goto failure; free(buffer); return 0; failure: free(buffer); return -1; } int count(eph_iob *iob,int argc,char *argv[]) { printf("%ld\n",numphotos(iob)); return 0; } int geti(eph_iob *iob,int argc,char *argv[]) { long res; long reg; if ((reg=atol(argv[1])) <= 0) { fprintf(stderr,"bad register value \"%s\"\n",argv[1]); return -1; } if (eph_getint(iob,reg,&res)) return -1; printf("Reg %ld=%ld\n",reg,res); return 0; } int getv(eph_iob *iob,int argc,char *argv[]) { char *buffer=malloc(2048); off_t bufsize=2048; int i; long reg; if ((reg=atol(argv[1])) <= 0) { fprintf(stderr,"bad register value \"%s\"\n",argv[1]); free(buffer); return -1; } buffer[0]='\0'; if (eph_getvar(iob,reg,&buffer,&bufsize)) { free(buffer); return -1; } printf("Reg %ld=\"",reg); for (i=0;i= ' ') && (buffer[i] <= 'z')) { printf("%c",buffer[i]); } else { printf("\\%03o",(unsigned char)buffer[i]); } } printf("\"\n"); free(buffer); return 0; } int camsum(eph_iob *iob,int argc,char *argv[]) { long res; char *buf=malloc(32); off_t bufsize=32; int i; if (eph_getvar(iob,46,&buf,&bufsize)) { fprintf(stderr,"cannot get summary data\n"); return -1; } for (i=0;i<32;i+=4) { res=(long)(buf[i]&0xff)+((long)(buf[i+1]&0xff)<<8)+ ((long)(buf[i+2]&0xff)<<16)+((long)(buf[i+3]&0xff)<<24); printf("%d: %08lx\n",i/4,res); } free(buf); return 0; } int picsum(eph_iob *iob,int argc,char *argv[]) { long res; char *buf=malloc(32); off_t bufsize=32; long frame; int i; if ((frame=atol(argv[1])) <= 0) { fprintf(stderr,"bad frame value \"%s\"\n",argv[1]); return -1; } if (eph_setint(iob,4,frame)) { fprintf(stderr,"cannot set frame frame \"%s\"\n",argv[1]); return -1; } if (eph_getvar(iob,47,&buf,&bufsize)) { fprintf(stderr,"cannot get summary data\n"); return -1; } for (i=0;i<32;i+=4) { res=(long)(buf[i]&0xff)+((long)(buf[i+1]&0xff)<<8)+ ((long)(buf[i+2]&0xff)<<16)+((long)(buf[i+3]&0xff)<<24); printf("%d: %08lx ",i/4,res); } printf("\n"); free(buf); return 0; } int allregs(eph_iob *iob,int argc,char *argv[]) { char *buffer; off_t bufsize; int i,rc; long j,max; long res; if ((max=atol(argv[1])) <= 0) { fprintf(stderr,"bad max register value \"%s\"\n",argv[1]); return -1; } for (j=0;j<=max;j++) { printf("%3ld ",j); /* do not query for image data because this may hang the camera if frame number is not set beforehand. On Olympus D-600L even reading length registers hang it. */ if (((j >= 12) && (j <= 15)) || (j == 39) || (j == 43) || (j == 44) || (j == 47)) { printf("Reg %ld not queried: dangerous...\n",j); continue; } if ((rc=eph_getint(iob,j,&res)) == DC1) { printf("N/A "); } else if (rc) { printf("FAIL "); } else { printf("%10ld ",res); } buffer=malloc(2048); buffer[0]='\0'; bufsize=2048; if ((rc=eph_getvar(iob,j,&buffer,&bufsize)) == DC1) { strcpy(buffer,"N/A"); } else if (rc) { strcpy(buffer,"FAIL"); } printf("\""); for (i=0;(i= ' ') && (buffer[i] <= 'z')) { printf("%c",buffer[i]); } else { printf("\\%03o",(unsigned char)buffer[i]); } } if (i < bufsize) printf(".."); printf("\"\n"); free(buffer); } return 0; } int listfiles(eph_iob *iob,char *path) { char *buffer; off_t bufsize; int rc; long res,j,max; if ((max=numphotos(iob)) < 0) { return -1; } if (have_folders) printf("%s: ",path); if (have_folders && max && (strlen(path) < 2)) { printf(" [%ld entr%s in root folder, likely bug]\n", max,(max==1)?"y":"ies"); return 0; } if (max) printf("total %lu\n" "No. Size R P Date and Time Filename\n", max); else printf("\n"); buffer=malloc(32); bufsize=32; for (j=1;j<=max;j++) { printf("%3ld ",j); if ((rc=eph_setint(iob,4,j)) == DC1) { printf("N/A\n"); break; } else if (rc) { printf("FAIL\n"); break; } if ((rc=eph_getint(iob,12,&res)) == DC1) { printf("N/A "); } else if (rc) { printf("FAIL "); } else { printf("%7ld ",res); } if ((rc=eph_getvar(iob,47,&buffer,&bufsize)) == DC1) { printf("N/A\n"); break; } else if (rc) { printf("FAIL\n"); break; } res=(long)(buffer[12]&0xff)+((long)(buffer[13]&0xff)<<8)+ ((long)(buffer[14]&0xff)<<16)+((long)(buffer[15]&0xff)<<24); printf("%01ld ",res); res=(long)(buffer[16]&0xff)+((long)(buffer[17]&0xff)<<8)+ ((long)(buffer[18]&0xff)<<16)+((long)(buffer[19]&0xff)<<24); printf("%c ",res?'P':'-'); res=(long)(buffer[20]&0xff)+((long)(buffer[21]&0xff)<<8)+ ((long)(buffer[22]&0xff)<<16)+((long)(buffer[23]&0xff)<<24); if (res > 0L) printf("%8s",ctimetz(&res,usetimezone)); else printf("N/A "); if ((rc=eph_getvar(iob,79,&buffer,&bufsize)) == DC1) { printf(" N/A\n"); } else if (rc) { printf(" FAIL\n"); } else { printf(" %s\n",buffer); } } free(buffer); return 0; } int llistfiles(eph_iob *iob, char *path) { char *buffer,*p; unsigned char *ress; off_t bufsize,ressize; int rc; long j,max; long res; if ((max=numphotos(iob)) < 0) { return -1; } if (have_folders) printf("%s: ",path); if (have_folders && max && (strlen(path) < 2)) { printf(" [%ld entr%s in root folder, likely bug]\n", max,(max==1)?"y":"ies"); return 0; } if (max) printf("total %lu\n" "No. P Size R F Shuttr Date and Time\n", max); else printf("\n"); for (j=1;j<=max;j++) { printf("%3ld ",j); if ((rc=eph_setint(iob,4,j)) == DC1) { printf("N/A\n"); break; } else if (rc) { printf("FAIL\n"); break; } if ((rc=eph_getint(iob,39,&res)) == DC1) { printf("N "); } else if (rc) { printf("F "); } else { printf("%c ",res?'P':'-'); } if ((rc=eph_getint(iob,12,&res)) == DC1) { printf("N/A "); } else if (rc) { printf("FAIL "); } else { printf("%7ld ",res); } buffer=malloc(2048); buffer[0]='\0'; bufsize=2048; if ((rc=eph_setint(iob,4,j)) == DC1) { printf("N/A\n"); break; } else if (rc) { printf("FAIL\n"); break; } if ((rc=eph_getvar(iob,15,&buffer,&bufsize)) == DC1) { printf("N/A\n"); break; } else if (rc) { printf("FAIL\n"); break; } ress=buffer; ressize=bufsize; a12scan(&ress,&ressize); p=a12search("Resolution",ress,ressize); res=-1L; if (p) { if (sscanf(p,"%lu",&res) != 1) res=-1L; } if (res != -1L) printf("%ld ",res); else printf("N "); p=a12search("Flash",ress,ressize); res=-1L; if (p) { if (sscanf(p,"%lu",&res) != 1) res=-1L; } if (res != -1L) printf("%c ",res?'F':'-'); else printf("N "); p=a12search("Shutter",ress,ressize); res=-1L; if (p) { if (sscanf(p,"%lu",&res) != 1) res=-1L; } if (res != -1L) printf("1/%-4ld ",res?1000000L/res:0L); else printf("N/A "); p=a12search("TimeDate",ress,ressize); res=-1L; if (p) { if (sscanf(p,"%lu",&res) != 1) res=-1L; } if (res != -1L) printf("%8s\n",ctimetz(&res,usetimezone)); else printf("N/A\n"); free(buffer); } return 0; } int list(eph_iob *iob,int argc,char *argv[]) { return descend(iob,0,"\\",listfiles); } int llist(eph_iob *iob,int argc,char *argv[]) { return descend(iob,0,"\\",llistfiles); } int cd(eph_iob *iob,int argc,char *argv[]) { return xchdir(iob,argv[1]); } static void reporterror(int errcode,char *errstr) { if ((errcode != ERR_TIMEOUT) || debug) fprintf(stderr,"Error %d: %s\n",errcode,errstr); } void running(off_t count) { if (!quiet && filesize) { printf("%lu: %lu of %lu\r",(unsigned long)frame, (unsigned long)count,filesize); fflush(stdout); } } int storing(char *data,size_t len) { if (fwrite(data,len,1,fp) != 1) { perror(fname); return -1; } return 0; } int retrfile(eph_iob *iob,int argc,char *argv[],int datatype) { char *filenm; char *buffer,*buf8i; off_t bufsize,buf8isize; long length,ilength,tlength,alength; off_t got; time_t pictime; unsigned char *res; off_t ressize; char *p; struct stat st; int dreg=0; #ifndef LOWMEMORY int needfillbuffer=0; #endif buf8isize=32; if ((buf8i=malloc((size_t)buf8isize)) == NULL) { perror("malloc buf8i"); return -1; } (void)sscanf(argv[1],"%ld",&frame); filenm=argv[2]; if (eph_setint(iob,4,frame)) return -1; if (eph_getint(iob,12,&ilength)) return -1; if (ilength < 0) { if (debug) fprintf(stderr, "uh-oh, size of frame in reg12 negative (%ld)," " will interpret as positive\n",ilength); ilength=-ilength; } if (eph_setint(iob,4,frame)) return -1; if (eph_getint(iob,13,&tlength)) return -1; if (datatype == AUDIO) { buf8isize=32; if (eph_setint(iob,4,frame)) return -1; if (eph_getvar(iob,43,&buf8i,&buf8isize) == 0) { alength=(long)(buf8i[4]&0xff)+((long)(buf8i[5]&0xff)<<8)+ ((long)(buf8i[6]&0xff)<<16)+((long)(buf8i[7]&0xff)<<24); } else alength=0; if (debug) printf("Compressed audio length: %lu\n", alength); filesize=length=alength; } else { filesize=length=tlength; if (datatype == IMAGE) { length+=ilength; filesize=ilength; } } pictime=0; buf8isize=32; if (eph_setint(iob,4,frame)) return -1; if (eph_getvar(iob,47,&buf8i,&buf8isize) == 0) { long ilength2; ilength2=(long)(buf8i[0]&0xff)+((long)(buf8i[1]&0xff)<<8)+ ((long)(buf8i[2]&0xff)<<16); if (ilength2 && (ilength == 0L)) { if (debug) fprintf(stderr, "uh-oh, size of frame in reg12 (%ld) " "is zero, will use size field from " "picture summary register (%ld)!\n", ilength,ilength2); ilength=ilength2; } if (ilength == ilength2) { pictime=(long)(buf8i[20]&0xff)+ ((long)(buf8i[21]&0xff)<<8)+ ((long)(buf8i[22]&0xff)<<16)+ ((long)(buf8i[23]&0xff)<<24); } else { if (!quiet) fprintf(stderr, "uh-oh, size of frame in reg12 (%ld) " "does not match size field from " "picture summary register (%ld), ignore " "summary data!\n", ilength,ilength2); } } if (debug) printf("got timestamp from reg47: %lu\n", pictime); free(buf8i); /* What happens next MM PT DT | 1 2 3 4 5 6 -----------+------------++------- N T | SA RT -- || -- WB o !0 I | BA RI -- || -- WB r A | BA RA -- || -- WB m --------+------------++------- a T | SA RT AN || -- WB l 0 I | BA RI AN || -- WB A | SA RT AN || RA WB -----------+------------++------- T | SA RT -- || -- WB !0 I | -- -- -- || RW -- L A | -- -- -- || RW -- o --------+------------++------- w T | SA RT AN || -- WB 0 I | SA RT AN || RW -- A | SA RT AN || RW -- -----------+------------++------- */ /*=== Stage 1: allocate buffer ===*/ bufsize=0; buffer=NULL; #ifdef LOWMEMORY if ((datatype == THUMBNAIL) || (pictime == 0)) bufsize=((tlength-1)/2048+2)*2048; #else if ((pictime == 0) && (datatype == AUDIO)) needfillbuffer=1; if ((datatype == THUMBNAIL) || ((pictime == 0) && (datatype == AUDIO))) bufsize=((tlength-1)/2048+2)*2048; else bufsize=((length-1)/2048+2)*2048; #endif /* ^ we should have had 1 here if we knew strict file size. Although, we do not. All we know is the size of image data chunk, and the size of thumbnail data chunk. For now, we add extra 2048 in hope that extra JPEG data would not be more than that. If it is, the buffer will be automatically realloc()'ed anyway. */ if (bufsize) { buffer=malloc((size_t)bufsize); if (buffer == NULL) { fprintf(stderr,"could not alloc %lu bytes\n", (unsigned long)bufsize); return -1; } /*=== Stage 2: read data into the buffer ===*/ got=bufsize; #ifdef LOWMEMORY dreg=15; #else switch (datatype) { case THUMBNAIL: dreg=15; break; case IMAGE: dreg=14; break; case AUDIO: if (pictime) dreg=44; else dreg=15; break; } #endif if (eph_setint(iob,4,frame)) return -1; if (eph_getvar(iob,dreg,&buffer,&got)) { free(buffer); return -1; } if (!quiet) printf("\n"); } /*=== Stage 3: analyze data in the buffer ===*/ if (pictime == 0) { res=buffer; ressize=bufsize; a12scan(&res,&ressize); p=a12search("TimeDate",res,ressize); pictime=(time_t)-1; if (p) { if (sscanf(p,"%lu",&pictime) != 1) pictime=(time_t)-1; } if (debug) printf("got timestamp from file: %lu\n", pictime); } if (!quiet) { printf("taken %s\n",ctimetz(&pictime,usetimezone)); } /*=== Stage 4: setup output file ===*/ if (strcmp(filenm,"-") == 0) { fp=stdout; } else { if ((stat(filenm,&st) == 0) && (S_ISDIR(st.st_mode))) { int flen; flen=strlen(filenm)+MAXFORMAT+5; fname=malloc((size_t)flen); if (fname == NULL) { if (buffer) free(buffer); return -1; } makename(fname,flen,filenm,datatype,pictime, nameformat,usetimezone); if (!quiet) printf("file \"%s\"\n",fname); } else { fname=malloc(strlen(filenm)+1); if (fname == NULL) { if (buffer) free(buffer); return -1; } strcpy(fname,filenm); } if ((fp=fopen(fname,WRITEMODE)) == NULL) { perror(fname); if (fname) free(fname); fname=NULL; if (buffer) free(buffer); return -1; } } /*=== Stage 5: read data into the buffer or right out to file ===*/ #ifdef LOWMEMORY if (datatype != THUMBNAIL) { if (buffer) free(buffer); buffer=NULL; bufsize=0; #else if (needfillbuffer) { #endif /* we still need to read the data itself */ if (eph_setint(iob,4,frame)) return -1; /* seems that some Agfa model needs setting reg4 again */ dreg=(datatype==AUDIO)?44:14; /* cannot be thumbnail here */ got=bufsize; if (eph_getvar(iob,dreg,buffer?&buffer:NULL,&got)) { file_abort_cleanup(); free(buffer); return -1; } if (!quiet) printf("\n"); } /*=== Stage 6: write out the buffer contents */ #ifdef LOWMEMORY if (datatype == THUMBNAIL) #endif { /* data is still in the buffer, just write it out */ if (fwrite(buffer,(size_t)got,1,fp) != 1) { perror(fname); file_abort_cleanup(); free(buffer); return -1; } } if (fp) { if (fclose(fp) < 0) { perror(fname); } fp=NULL; } if (fname) { if (setutime) { if (setfiletime(fname,pictime,pictime,usetimezone)) perror("setfiletime"); } free(fname); fname=NULL; } if (buffer) free(buffer); return 0; } int image(eph_iob *iob,int argc,char *argv[]) { return retrfile(iob,argc,argv,IMAGE); } int thumbnail(eph_iob *iob,int argc,char *argv[]) { return retrfile(iob,argc,argv,THUMBNAIL); } int audio(eph_iob *iob,int argc,char *argv[]) { return retrfile(iob,argc,argv,AUDIO); } int preview(eph_iob *iob,int argc,char *argv[]) { FILE *fp=NULL; char *buffer=NULL; off_t bufsize; char zero=0; int rc=-1; bufsize=2048; buffer=malloc((size_t)bufsize); if (buffer == NULL) { fprintf(stderr,"could not alloc %lu bytes\n", (unsigned long)bufsize); goto exit; } if (strcmp(argv[1],"-") == 0) fp=stdout; else if ((fp=fopen(argv[1],WRITEMODE)) == NULL) { fprintf(stderr,"could not open file %s: %s\n", argv[1],strerror(ERRNO)); goto exit; } if (eph_action(iob,5,&zero,1)) goto exit; if (eph_setint(iob,4,0L)) goto exit; if (eph_getvar(iob,14,&buffer,&bufsize)) goto exit; if (fwrite(buffer,(size_t)bufsize,1,fp) != 1) { perror(fname); goto exit; } else rc=0; exit: if (buffer) free(buffer); if (fp && !(fp == stdout)) { if (fclose(fp) < 0) { perror(fname); } } return rc; } #ifndef LOWMEMORY int upload(eph_iob *iob,int argc,char *argv[]) { FILE *fp=NULL; char *buffer=NULL; struct stat stbuf; long res; char zero=0; int rc=-1; if (stat(argv[1],&stbuf)) { fprintf(stderr,"upload cannot stat file \"%s\": %s\n", argv[1],strerror(errno)); goto failure; } if ((fp=fopen(argv[1],READMODE)) == NULL) { fprintf(stderr,"upload cannot open file \"%s\": %s\n", argv[1],strerror(errno)); goto failure; } if (stbuf.st_size == (size_t)0) { fprintf(stderr,"upload file \"%s\" has zero length\n", argv[1]); goto failure; } buffer=(char*)malloc((size_t)stbuf.st_size); if (buffer == NULL) { fprintf(stderr,"upload cannot allocate %lu bytes: %s\n", (unsigned long)stbuf.st_size,strerror(errno)); goto failure; } if (fread(buffer,(size_t)stbuf.st_size,1,fp) != 1) { fprintf(stderr,"upload cannot read from %s: %s\n", argv[1],strerror(errno)); goto failure; } if (eph_getint(iob,28,&res)) { fprintf(stderr,"upload cannot get free memory\n"); goto failure; } if (res < stbuf.st_size) { fprintf(stderr,"upload free memory %lu less than file size%lu\n", res,(unsigned long)stbuf.st_size); goto failure; } if (eph_setint(iob,32,0x0FEC000E)) { fprintf(stderr,"upload cannot cast magic spell\n"); goto failure; } frame=0; filesize=stbuf.st_size; if (eph_setvar(iob,29,buffer,stbuf.st_size)) { if (!quiet) printf("\n"); fprintf(stderr,"upload cannot write image\n"); goto failure; } if (!quiet) printf("\n"); if (eph_action(iob,11,&zero,1)) { fprintf(stderr,"upload cannot store image\n"); goto failure; } rc=0; failure: if (buffer) free(buffer); if (fp) fclose(fp); return rc; } #endif /* LOWMEMORY */ int off(eph_iob *iob,int argc,char *argv[]) { switchoff=1; return 0; } /* -------------------------------------------------------------------- */ typedef struct _range { int max; char *bits; } range_t; static int setbit(range_t *range,int index) { register int pos,shift; if (index > range->max) { char *tmp; int newsize; newsize=(index/128+1)*16; tmp=(char *)malloc((size_t)newsize); if (tmp == NULL) return -1; memset(tmp,0,(size_t)newsize); memcpy(tmp,range->bits,(size_t)(range->max)/8); if (range->max) free(range->bits); range->bits=tmp; range->max=newsize*8; } pos=index/8; shift=index%8; range->bits[pos] |= (1< range->max)) return 0; pos=index/8; shift=index%8; return ((range->bits[pos]) & (1<max) free(range->bits); range->max=0; } int iterate(int (*executor)(eph_iob *iob,int argc,char *argv[]), eph_iob *iob,int argc,char *argv[],int intvl,int filearg) { int rc=0; long bot,top,i,step; char buf[16],*p,*intvlarg; struct stat st; range_t range; int reorder=0; if (intvl == 0) return (*executor)(iob,argc,argv); if (intvl < 0) { reorder=1; intvl=-intvl; range.max=0; } if (filearg && (strchr(argv[intvl],',') || strchr(argv[intvl],'-'))) { if (stat(argv[filearg],&st) || !S_ISDIR(st.st_mode)) { fprintf(stderr,"Must specify directory for range\n"); return -1; } } intvlarg=argv[intvl]; argv[intvl]=buf; /* it's a bad taste to modify arg vector, but we won't use this argument anymore, so who cares... */ for (p=strtok(intvlarg,",");p;p=strtok(NULL,",")) { if (strcasecmp(p,"all") == 0) { bot=1; top=-1; } else if (strcasecmp(p,"last") == 0) { bot=-1; top=-1; } else if ((strcasecmp(p+strlen(p)-5,"-last") == 0) && (sscanf(p,"%ld-last",&bot) == 1)) { top=-1; } else if (sscanf(p,"%ld-%ld",&bot,&top) == 2) { /* do nothing */ ; } else if (sscanf(p,"%ld",&bot) == 1) { top=bot; } else { fprintf(stderr,"bad frames interval \"%s\"\n",p); return -1; } if (top < 1) { if ((top=numphotos(iob)) < 0) { fprintf(stderr,"could not get number of frames\n"); return -1; } if (bot < 1) bot=top; if (!quiet) printf("Processing %ld-%ld\n",bot,top); if (top == 0) { if (!quiet) printf("No frames\n"); return 0; } } if (top >= bot) step=1; else step=-1; top+=step; for (i=bot;i!=top;i+=step) { if (reorder) { if (setbit(&range,i)) { fprintf(stderr,"no memory for range\n"); return -1; } } else { sprintf(buf,"%ld",i); if ((rc=(*executor)(iob,argc,argv))) return rc; } } } if (reorder) { for (i=range.max;i>0;i--) if (bitset(&range,i)) { sprintf(buf,"%ld",i); if ((rc=(*executor)(iob,argc,argv))) break; } freebits(&range); } return rc; } /* -------------------------------------------------------------------- */ struct _cmdlist { char *cmd; /* Command name */ int argc; /* No of args for this command */ int intvl; /* Which arg is frame number/range */ int filearg; /* Which arg is the file/directory name */ int (*executor)(eph_iob *iob,int argc,char *argv[]); char *help; } cmdlist[] = { {"", 0,0,0, NULL, "== Query parameters =="}, {"query", 0,0,0, query, "" }, {"count", 0,0,0, count, "" }, {"list", 0,0,0, list, "" }, {"llist", 0,0,0, llist, "" }, {"cd", 1,0,0, cd, "" }, {"geti", 1,0,0, geti, "-" }, {"getv", 1,0,0, getv, "-" }, {"camsum", 0,0,0, camsum, "-" }, {"picsum", 1,1,0, picsum, "-" }, {"allregs", 1,0,0, allregs, "-" }, {"", 0,0,0, NULL, "== Do some actions ==" }, {"protect", 2,1,0, protect, " `On' | `Off'"}, {"erase", 1,-1,0, erase, "" }, {"eraseall", 0,0,0, eraseall, "" }, {"eraselast", 0,0,0, eraselast, "" }, {"snapshot", 0,0,0, snapshot, "" }, {"off", 0,0,0, off, "" }, {"", 0,0,0, NULL, "== Retreive files ==" }, {"image", 2,1,2, image, " " }, {"thumbnail", 2,1,2, thumbnail, " " }, {"audio", 2,1,2, audio, " " }, {"preview", 1,0,0, preview, "" }, #ifndef LOWMEMORY {"", 0,0,0, NULL, "== Upload files ==" }, {"upload", 1,0,0, upload, "" }, #endif {"", 0,0,0, NULL, "== Set parameters ==" }, {"mode", 1,0,0, mode, "`Record' | `Play' | `Thumbnail' | `Next' | `Previous'"}, {"resolution", 1,0,0, resolution, "`Hi' | `Lo' | `Ext' | "}, {"clock", 0,0,0, setclock, "" }, {"shutter", 1,0,0, shutter, "`Auto' | | 1/"}, {"aperture", 1,0,0, aperture, "`Auto' | `Lo' | `Med' | `Hi'"}, {"flash", 1,0,0, flash, "`Auto' | `Force' | `Off' | `AntiRedeye' | `SlowSync'"}, {"id", 1,0,0, setid, "" }, {"autoshut-host",1,0,0, autoshut_host, "" }, {"autoshut-field",1,0,0,autoshut_field, "" }, {"lcd-autoshut",1,0,0, lcd_autoshut, "" }, {"lcd-brightness",1,0,0,lcd_brightness, "1 to 7" }, {"focus", 1,0,0, focus, "`Macro' | `Normal' | `Infinity'"}, {"adjust", 1,0,0, adjust, "`Normal' | `Contrast+' | `Contrast-' | `Brightness+' | `Brightness-'"}, {"metering", 1,0,0, metering, "`Center-weighted' | `Spot' | `Matrix'"}, {"whitebalance",1,0,0, whitebalance, "`Normal' | `Sunny' | `Incandescent' | `Fluorescent' | `Flash' | `Preset' | `Cloudy'" }, {"color", 1,0,0, color, "`On' | `Off'" }, {"dzoom", 1,0,0, dzoom, "`On' | `Off' | "}, {"zoom", 1,0,0, zoom, "" }, {"seti", 2,0,0, seti, "- "}, {"setv", 2,0,0, setv, "- "}, {"cmd", 2,0,0, cmd, "- " }, {"", 0,0,0, NULL, "" }, {NULL, 0,0,0, NULL, NULL } }; /* -------------------------------------------------------------------- */ void showhelp(char *name) { int i; printf("usage: %s [-h] [-V] [-v[v]] [-q] [-z] [-t] [-f timeformat] [-s speed] [-l device] [command [params]] ...\n\n",name); printf("Options:\n\n"); printf("\t-h\t- show this help screen\n"); printf("\t-V\t- show software version number\n"); printf("\t-v\t- increase debugging verbosity\n"); printf("\t-q\t- do not show running download indicator\n"); printf("\t-z\t- suppress timezone conversions (camera's clock is local time)\n"); printf("\t-t\t- set modification time of the files to the time of snapshot\n"); printf("\t-f fmt\t- create file names using strftime(3) with the time of snapshot\n"); printf("\t\t\t fmt = 'd' - name is seconds since the epoch in decimal\n"); printf("\t\t\t fmt = 'x' - name is seconds since the epoch in hex\n"); #ifdef HAVE_STRFTIME printf("\t\t\t fmt = '1' - name is MMDD_CCC (default)\n"); printf("\t\t\t fmt = '2' - name is YYMMDDCC\n"); printf("\t\t\t fmt = '3' - name is YYYY_MM_DD-HH_MM_SS\n"); printf("\t\t\t fmt = '4' - name is YYYY/MM/DD/HH_MM_SS\n"); printf("\t\t\t otherwise make file names using strftime(3),\n"); printf("\t\t\t if fmt contains `%%%%NNNd' then place count there\n"); #endif printf("\t-s baud\t- set communication speed to 9600,19200,38400,57600 or 115200\n"); printf("\t\t\tdefault is %d\n",MAX_SPEED); printf("\t-S baud,baud\t- set \"pseudo\" speed (see manual)\n"); printf("\t-l dev\t- use device name instead of default %s\n\n",device); printf("Commands:\n"); for (i=0;cmdlist[i].cmd;i++) { if (cmdlist[i].help[0] == '-') continue; printf("%-20.20s%s\n",cmdlist[i].cmd,cmdlist[i].help); } printf("EXAMPLE:\n%s id \"Eugene Crosser www.average.org\" query\n",name); } void showversion(char *name) { #ifdef UNIX #if HAVE_UNAME #define OS uts.sysname struct utsname uts; if (uname(&uts)) { strncpy(uts.sysname,"Unix",sizeof(uts.sysname)); uts.sysname[sizeof(uts.sysname)-1]='\0'; } #else #define OS "Generic UNIX" #endif #endif #ifdef DOS #define OS "MS-DOS" #endif #ifdef MSWINDOWS #define OS "Windows 95/NT" #endif #ifndef OS #define OS "Unknown OS" #endif printf("%s version %s (%s) build %s (%s memory model)\n", name,VERSION,OS,__DATE__, #ifdef LOWMEMORY "low" #else "normal" #endif ); printf(" Copyright (c) 1997-2001 Eugene Crosser and Bruce Lightner\n"); printf(" URL: http://photopc.sourceforge.net/\n"); } int main(int argc,char *argv[]) { int c,i,rc=0; char *cmd; long speed=0L,ttspeed=0L,defttspeed=0L; eph_iob *iob; char *program = argv[0]; #ifdef MS_PROGRAM_NAMES char *q; /* remove program extension */ if ((q = strrchr(program, '.')) != NULL) *q = '\0'; /* remove directory */ if ((q = strrchr(program, '/')) != NULL) program = q + 1; if ((q = strrchr(program, '\\')) != NULL) program = q + 1; #endif #if HAVE_SCHED_SETSCHEDULER && USE_RTPRIO if (geteuid() == 0) { /* Try to set realtime priority */ struct sched_param sp; int rc,minp,maxp; minp=sched_get_priority_min(SCHED_FIFO); maxp=sched_get_priority_max(SCHED_FIFO); sp.sched_priority=minp+(maxp-minp)/2; if ((rc=sched_setscheduler(0,SCHED_FIFO,&sp)) == -1) fprintf(stderr,"failed to set realtime priority: %s\n", strerror(errno)); #if 0 if ((rc=sched_getscheduler(0)) == -1) fprintf(stderr,"getscheduler: %s\n",strerror(errno)); else if (sched_getparam(0,&sp) == -1) fprintf(stderr,"sched_getparm: %s\n", strerror(errno)); else printf("New scheduling policy: %d, prio %d\n", rc,sp.sched_priority); #endif /* Drop supervisor privelege */ (void)seteuid(getuid()); } #endif /* HAVE_SCHED_SETSCHEDULER */ #ifdef DEVVERSION printf("Dev ver: %s\n",rcsid); #endif while ((c=getopt(argc,argv,"l:s:S:f:vqhVzt")) != EOF) switch (c) { case 'l': device=optarg; break; case 's': /* real speed, physical in the line, tell the camera about it. */ speed=atol(optarg); break; case 'S': /* `pseudo' speed, tell this to the UNIX serial driver so that it will set real speed on the chip */ if (sscanf(optarg,"%ld,%ld",&defttspeed,&ttspeed) != 2) { fprintf(stderr,"bad `-S' setting, ignoring\n"); ttspeed=defttspeed=0L; } break; case 'f': nameformat=optarg; break; case 'v': debug++; break; case 'q': quiet=1; break; case 'h': showhelp(program); return 0; case 'V': showversion(program); return 0; case 'z': usetimezone=0; break; case 't': setutime=1; break; default: fprintf(stderr," run \"%s -h\" for help\n",program); return 1; } #ifdef DOS /* MS/DOS has silly assumptions about the timezone if TZ variable is not set. Hope the following will help in most cases, the results should be at least predictable... */ if (getenv("TZ") == NULL) { putenv("TZ=GMT0"); usetimezone = 0; } #endif tzset(); #ifndef UNIX /* Under DOS and Win32, usleep() is done with a local function that does self-calibration on first invokation. That's why the first call may cause overly big delay and break negotiation with the camera. */ usleep(0L); /* calibrate delay loops as required */ #endif #ifdef LOWMEMORY if (atexit(file_abort_cleanup) == -1) perror("error setting atexit function"); #endif #ifdef UNIX if (*device != '/') { char *p; p=device; device=malloc(strlen("/dev/")+strlen(p)+1); strcpy(device,"/dev/"); strcat(device,p); } #endif iob=eph_new(reporterror,NULL,running,storing,debug); if (!iob) { fprintf(stderr,"eph_new failed\n"); return 1; } if (eph_open(iob,device,speed,defttspeed,ttspeed)) { fprintf(stderr,"eph_open failed\n"); return 1; } if ((rc=init(iob))) { fprintf(stderr,"init failed\n"); goto exit; } while ((cmd=argv[optind])) { if (switchoff) { fprintf(stderr,"commands after \"off\" ignored\n"); goto exit; } for (i=0; cmdlist[i].cmd&&strcmp(cmd,cmdlist[i].cmd); i++) /* nothing */ ; if (cmdlist[i].cmd == NULL) { fprintf(stderr,"bad command \"%s\" ignored,",cmd); fprintf(stderr," run \"%s -h\" for help\n",program); optind++; continue; } if ((optind + cmdlist[i].argc) >= argc) { fprintf(stderr,"too few arguments for \"%s\" command\n",cmd); rc=1; goto exit; } if ((rc=iterate(cmdlist[i].executor, iob, cmdlist[i].argc+1, argv+optind, cmdlist[i].intvl, cmdlist[i].filearg))) { fprintf(stderr,"command \"%s\" failed, abort\n",cmd); goto exit; } optind+=cmdlist[i].argc; optind++; } exit: /* On older models, action 04 with zero parameter terminates session but leaves the camera ON. On Olympus 600 (at least) this command not only terminates session but also turns the camera off. So, the "off" command will turn off newer models and *just* terminate session more quickly on older. You may want to terminate the command array by "off" on models like PhotoPC 600 to decrease power consumption when the session is over. */ eph_close(iob,switchoff); eph_free(iob); return rc; } photopc-3.07/eph_io.h0000644000175000017500000000770507342634761011501 00000000000000/* $Id: eph_io.h,v 2.13 2001/08/28 06:28:01 crosser Exp $ */ /* Copyright (c) 1997-2000 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: eph_io.h,v $ Revision 2.13 2001/08/28 06:28:01 crosser try make zoom working on newer Oly Revision 2.12 2000/05/09 13:20:54 crosser configure read() with alarm() better. Address signed vs. unsigned arguments other cleanups to make most notorious compilers happy Revision 2.11 2000/05/02 22:26:35 crosser A few things incorporated from John Bowman's Nikon specific diffs Revision 2.10 2000/02/13 11:15:01 crosser Kludge null setint for Nikon Revision 2.9 1999/12/11 14:10:15 crosser Support sgtty terminal control Proper "fake speed" handling (needed two values) Revision 2.8 1999/12/01 21:41:23 crosser add "pseudo" speed Revision 2.7 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 2.6 1998/02/26 00:50:39 crosser misc changes Revision 2.5 1998/02/13 23:02:40 crosser define type off_t for DOS Revision 2.4 1998/02/08 19:58:38 crosser Support low memory: chunked saving etc. Revision 2.3 1998/02/03 18:47:51 lightner Fix typo: definded -> defined Revision 2.2 1998/01/18 02:16:45 crosser DOS support Revision 2.1 1998/01/04 13:55:57 crosser add param for close mode Revision 2.0 1998/01/02 19:20:11 crosser Added support for Win32 Revision 1.1 1997/08/17 08:59:54 crosser Initial revision */ #ifndef _EPH_IO_H #define _EPH_IO_H #include #ifdef DOS typedef long off_t; #endif #if defined(UNIX) #if defined(USE_TERMIOS) # include #elif defined(USE_SGTTY) # include #elif defined(USE_TERMIO) #include # error "termio unsupported, sorry" #else # error "no termios, sgtty or termio defined, no way to control the tty" #endif #elif defined(MSWINDOWS) #include #endif #include #ifndef DC1 #define DC1 0x11 #endif #define MAX_SPEED 115200 typedef struct _eph_iob { void (*errorcb)(int errcode,char *errstr); void *(*realloccb)(void *old,size_t length); void (*runcb)(off_t count); int (*storecb)(char *data,size_t size); int debug; #if defined(UNIX) int fd; #ifdef USE_ALARMED_READ long flag; #endif #if defined(USE_TERMIOS) struct termios savetios; #elif defined(USE_SGTTY) struct sgttyb savesgtty; #elif defined(USE_TERMIO) struct termio savetio; #endif #elif defined(MSWINDOWS) HANDLE fd; DCB savedcb; COMMTIMEOUTS savetimeouts,worktimeouts; #elif defined(DOS) int fd; #endif long timeout; } eph_iob; eph_iob *eph_new(void (*errorcb)(int errcode,char *errstr), void *(*realloccb)(void *old,size_t length), void (*runcb)(off_t count), int (*storecb)(char *data,size_t size), int debug); int eph_open(eph_iob *iob,char *device_name,long speed, long defttspeed,long ttspeed); int eph_close(eph_iob *iob,int newmodel); void eph_free(eph_iob *iob); int eph_setint(eph_iob *iob,int reg,long val); int eph_setnullint(eph_iob *iob,int reg); int eph_getint(eph_iob *iob,int reg,long *val); int eph_action(eph_iob *iob,int reg,char *val,size_t length); int eph_setvar(eph_iob *iob,int reg,char *val,off_t length); int eph_getvar(eph_iob *iob,int reg,char **val,off_t *length); #define ERR_BASE 10001 #define ERR_DATA_TOO_LONG 10001 #define ERR_TIMEOUT 10002 #define ERR_BADREAD 10003 #define ERR_BADDATA 10004 #define ERR_BADCRC 10005 #define ERR_BADSPEED 10006 #define ERR_NOMEM 10007 #define ERR_BADARGS 10008 #define ERR_EXCESSIVE_RETRY 10009 #define ERR_MAX 10010 #define REG_FRAME 4 #define REG_SPEED 17 #define REG_IMG 14 #define REG_TMN 15 #define REG_ZOOM 71 #endif photopc-3.07/photopc.10000644000175000017500000004603007347367721011621 00000000000000.\" $Id: photopc.1,v 2.35 2001/09/11 11:04:49 crosser Exp $ .\" .\" Copyright (c) 1997-1999 Eugene G. Crosser .\" Copyright (c) 1998,1999 Bruce D. Lightner (DOS/Windows support) .\" .\" You may distribute and/or use for any purpose modified or unmodified .\" copies of this software if you preserve the copyright notice above. .\" .\" THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY .\" KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE .\" COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE .\" USE OF THIS SOFTWARE. .\" .\" $Log: photopc.1,v $ .\" Revision 2.35 2001/09/11 11:04:49 crosser .\" detailed some actions in protocol.htm .\" .\" Revision 2.34 2001/08/28 06:40:10 crosser .\" change website reference to sourceforge .\" .\" Revision 2.33 2001/08/03 09:40:38 crosser .\" add "common problems" section, style changes .\" .\" Revision 2.32 2001/01/11 06:49:58 crosser .\" minor cleanups on source .\" make manual page in sync with the source .\" .\" Revision 2.31 2000/02/17 07:46:17 crosser .\" sync manual page .\" .\" Revision 2.30 1999/12/26 13:59:45 crosser .\" sort frame list for erase command; new version 3.03 .\" .\" Revision 2.29 1999/12/11 14:10:15 crosser .\" Support sgtty terminal control .\" Proper "fake speed" handling (needed two values) .\" .\" Revision 2.28 1999/12/01 21:41:23 crosser .\" add "pseudo" speed .\" .\" Revision 2.27 1999/06/24 04:28:45 crosser .\" note "number of rfames not updated" bug .\" .\" Revision 2.26 1999/06/07 20:05:08 crosser .\" Note on 32Mb card problem on Nikon .\" .\" Revision 2.25 1999/04/28 08:40:45 crosser .\" more Nikon bugs .\" .\" Revision 2.24 1999/03/21 20:22:09 crosser .\" sync format desc with actual program .\" .\" Revision 2.23 1999/03/13 13:10:13 crosser .\" reflect 3.00 changes .\" .\" Revision 2.22 1999/02/28 22:40:48 crosser .\" suggest audio compression is adpcm .\" .\" Revision 2.21 1999/02/26 23:54:42 crosser .\" Correct JFIF vs. Exif vs. JPEG things .\" .\" Revision 2.20 1999/01/17 14:16:50 crosser .\" copyright years .\" .\" Revision 2.19 1999/01/17 13:37:29 crosser .\" fix copyright info .\" .\" Revision 2.18 1998/12/20 21:58:58 crosser .\" Add audio command .\" .\" Revision 2.17 1998/12/06 08:40:34 crosser .\" more comapibility things .\" .\" Revision 2.16 1998/11/20 22:49:46 crosser .\" mention problems with CP900 .\" .\" Revision 2.15 1998/11/20 22:34:10 crosser .\" elaborate on list vs. llist .\" .\" Revision 2.14 1998/10/18 19:07:36 crosser .\" renamed "list" to "llist", make new "list" that works on all models. .\" .\" Revision 2.13 1998/10/18 13:18:27 crosser .\" Put RCS logs and I.D. into the source .\" .\" Revision 2.12 1998/08/08 22:16:33 crosser .\" reflect timezone related things .\" .\" Revision 2.11 1998/08/08 14:00:33 crosser .\" unimportant changes .\" .\" Revision 2.10 1998/07/21 22:56:52 crosser .\" fix CP 900 .\" .\" Revision 2.9 1998/06/07 18:41:40 crosser .\" frame intervals, digital zoom .\" .\" Revision 2.8 1998/06/07 13:55:20 crosser .\" compatibilities and credits .\" .\" Revision 2.7 1998/03/01 18:57:04 crosser .\" preview command .\" .\" Revision 2.6 1998/02/16 06:14:29 lightner .\" Add docs for -V and -z options .\" .\" Revision 2.5 1998/02/13 23:02:40 crosser .\" Point that upload does not work on LOWMEMORY model .\" .\" Revision 2.4 1998/01/27 21:52:55 crosser .\" upload command .\" .\" Revision 2.3 1998/01/18 02:24:31 crosser .\" change copyright .\" .\" Revision 2.2 1998/01/11 21:20:54 crosser .\" off command .\" .\" Revision 2.1 1998/01/04 13:55:57 crosser .\" New commands: protect, list .\" .\" Revision 2.0 1998/01/03 19:54:26 crosser .\" Windows support .\" locktoggle command .\" new -f variants .\" .\" Revision 1.2 1997/12/24 00:19:13 crosser .\" describe new commands .\" claim that we work with other digital cameras (do we really?) .\" .\" Revision 1.1 1997/08/17 08:59:54 crosser .\" Initial revision .\" .TH PHOTOPC 1 "24 May 1997" "PhotoPC manipulation tool" "User Commands" .SH NAME photopc \- utility to control digital cameras based on Sierra Imaging firmware .SH SYNOPSIS photopc [-h] [-V] [-v[v]] [-q] [-z] [-t] [-f timeformat] [-s ] [-S ] [-l ] [command [params] ] ... .SH DESCRIPTION This is a command line tool to manipulate digital still cameras that use certain control protocol, namely Agfa ePhoto line, Epson PhotoPC line, Olympus D-xxxL line, Sanyo and Nikon (at least CoolPix 9xx) cameras. It can set camera parameters, download and erase pictures, e.t.c. It was originally developed for Epson PhotoPC 500, now the author uses it with Olympus D-600L, results with other models may vary. .PP .SH "OPTIONS" .TP 0.5i .B -h This option produces a help screen of all options and commands. .TP 0.5i .B -V This option prints software revision information. .TP 0.5i .B -v This option enables verbose output. Using two -v options increases the level of verbosity. This is primarily meant for debugging. .TP 0.5i .B -q This option sets quiet mode. If it is not specified, the program will show running download progress indicator. .TP 0.5i .B -z This option sets no time-zone processing mode. Use this option if the camera's clock is (should be) set up shifted by the local timezone offset. .TP 0.5i .B -s speed This option allows setting the data rate to use when communicating with the camera. Valid rates are 9600, 19200, 38400, 57600 and 115200 (the default). .\" This is added on request by Detlev Droege .\" who says that on Next/OpenStep (and on other platforms too) `Special .\" serial I/O Cards exist which work on the doubble or quadruple speed .\" than the machine thinks they do' .TP 0.5i .B -S speed On some UNIX systems with some serial hardware/driver combinations you need to "lie" to the driver about the communication speed that you want to use at startup and during the session. Physical startup speed is always 19200. E.g., if on your system speeds up to 19200 are translated one to one, but in order to use 57600 baud you have to specify 50 baud, and you want to run at 57600, you'll need to specify .B photopc -s57600 -S19200,50 .I Another example: if your driver will use physical speed four times as high as you told it to set, and you want to run at default 115200 physical speed, specify .B photopc -S4800,28800 .I .TP 0.5i .B -t Set timestamp of generated files to the time of snapshot. .TP 0.5i .B -f timeformat This option allows to specify the format for automatically generated image file names; the value is used as the format string for strftime(3) function. By default, names of the format "MMDD_NNN.jpg" are generated, where MM is a month, DD is a day, and NNN is a count starting from 001. A good starting point for the timeformat value could be "%Y_%m_%d-%H_%M_%S.jpg". If the format string contains context "%%XXXd" where XXX are digits, it is taken for the count, i.e. if the file with such name is present, next count is tried. If the format string does not contain "%%XXXd" part, the count field, if necessary, is appended at the end of the name. A few single-character formats are used as shortcuts. "x" makes the name of seconds since the epoch in hexadecimal format (8 characters + ".jpg"), "d" - the same in decimal format (10 characters), "1" stands for default format "%m%d_%%03d.jpg", "2" stands for "%y%m%d%%02d.jpg", "3" stands for "%Y_%m_%d-%H_%M_%S.jpg" and 4 stands for "%Y/%m/%d/%H_%M_%S.jpg". The program attempts to create intermediate directories if necessary (and possible). .TP 0.5i .B -l device This allows specifying the serial device to use for communicating with the camera. The default is .I /dev/photopc (which is typically created as a (symbolic) link to the real device, e.g. /dev/ttyS0) in UNIX, and .I COM1: in DOS and Windows. Note that the program does not use UUCP style locks so you need to be certain that no other program, such as uugetty, uucico or mouse manager, is trying to access the same device. Another note: on some systems (notably Linux) terminal settings are kept across usage of the serial port by different programs. .B photopc may have troubles if, say, hardware flow control was kept turned on. Try "stty -F /dev/ttyXX sane" if you suspect that you are bitten by this. .SH COMMANDS After the options, one or more commands can be given in the command line. Some commands accept .B frame-list as a parameter. Frame list is a comma-separated list of tokens (no whitespace allowed), each of the tokens being a word .BR all ", or a single number, or two numbers separated by a dash (-), or a number followed by a dash and a word .B last (without whitespace). .TP 0.5i .B query Display all current camera settings. .TP 0.5i .B count Output the number of pictures stored in the camera. This is intended for use in shell scripts. .TP 0.5i .B list List information about frames stored in the camera. Fields displayed are: frame number, size of image file, protection state, resolution mode, timestamp and filename if available. Faster than .B llist but may not work with some (older) models. WARNING: this command changes current directory on models that support directory tree on the flash media. .TP 0.5i .B llist List more information about frames stored in the camera. Fields displayed are: frame number, protection state, size of image file, resolution mode, flash, shutter and timestamp. Slower than .B list and does not work with models that use .I Exif file format. WARNING: this command changes current directory on models that support directory tree on the flash media. .TP 0.5i .B cd On the models that support multiple directories on the flash media, change current directory as specified. The program chdir's to the first non-empty folder at the beginning. So, your first .B cd command .I must specify full path starting with a slash. If it where unix you could also .BI cd " ../something but here we do not have a way to move up one level. .TP 0.5i .B protect On | Off Change "protected" status of frames. Frame numbering starts at 1. The command will fail if the frame number is omitted, not numeric, or does not correspond to a stored frame. "Protected" frames cannot be erased with "erase" and "eraseall" commands or with the "erase" button on the camera. .TP 0.5i .B erase Erase frames. Frame numbering starts at 1. The command will fail if the frame number is omitted, not numeric, or does not correspond to a stored frame. To avoid unexpected results, list of frames specified for this command is sorted and processed in reverse order. .TP 0.5i .B eraseall Erase all stored frames. .TP 0.5i .B eraselast Erase most recently taken frame. .TP 0.5i .B snapshot Take a picture. .TP 0.5i .B off Switch off the camera. This command only has this effect on some models (notably Olympus D-600L). On other models, it just terminates the session immediately (otherwise the camera would be active several seconds after the last command). On models with big timeout, such as Photopc 600, it may be wise to always issue "off" at the end of command row, to decrease power consumption. All commands going after "off" are ignored. .TP 0.5i .B image Download an image or series of images from the camera to disk file(s) on the host computer. Frame numbering starts at 1. The command will fail if the frame number is omitted, not numeric, or does not correspond to a stored frame. Files are stored in JPEG (JFIF or Exif) format. Image file also contains a thumbnail portion, and set of parameters like the shutter speed, date and time, I.D. string and more. Directory must be specified if frame list is requested. If directory name is specified, downloaded file(s) will get unique names starting with month and date of snapshot, unless -f option is used, in which case unique names according to .B -f option setting. .TP 0.5i .B thumbnail Download a thumbnail image or series of thumbnails from the camera to disk file(s) on the host computer. Frame numbering starts at 1. The command will fail if the frame number is omitted, not numeric, or does not correspond to a stored frame. Files are stored in JPEG (JFIF or Exif) format. If the camera does not keep files in .I EXIF format, then the thumbnail file also contains a set of parameters like the shutter speed, date and time, I.D. string and more. Directory must be specified if frame list is requested. If directory name is specified, downloaded file(s) will get unique names according to .B -f option setting. .TP 0.5i .B audio Download an audio notice file or series of files from the camera to disk file(s) on the host computer. Frame numbering starts at 1. The command will fail if the frame number is omitted, not numeric, or does not correspond to a stored frame. Files are stored with ".wav" extention but the format is .I not RIFF WAV format. It is compressed in some way, probably with some variation of ADPCM. The program stores the raw data as provided by the camera, it is not playable as a normal .I .wav file. Directory must be specified if frame list is requested. If directory name is specified, downloaded file(s) will get unique names according to .B -f option setting. .TP 0.5i .B preview take a `preview' snapshot and save image as a . File is in JPEG (JFIF or Exif) format, and does not contain any additional data, just plain (very low resolution) image. .TP 0.5i .B upload Upload image file into the camera. This command is not enabled in LOWMEMORY version (i.e. under MS/DOS). .B WARNING! You cannot upload arbitrary JPEG file. Depending on the camera model, such attempt may result in the image not uploaded, not viewable, or even the camera "hung" needing to remove the batteries to make it work again. File previously downloaded from the same camera model is always uploadable. Otherwise, your milage may vary. .B photopc program does not perform any checks, so it's up to the user to provide the file in proper format. .TP 0.5i .B mode Record | Play | Thumbnail Set specified operation mode on certain models. .TP 0.5i .B resolution Hi | Lo | Ext | Set the camera to high, low or extended resolution mode. Exact meaning of the modes is model-dependant and may specify different image dimensions and/or JPEG compression rate. .TP 0.5i .B clock Set the camera's internal real-time clock using the current date and time from the host computer. Time of taking a snapshot is included inside the JPEG files produced. Note that the models which display the time on the LCD will then display GMT rather than local time. With .B -z option, time shifted by the timezone offset is set, and the LCD will display local time. Using unshifted (GMT) time in the camera seems a proper way to go. .TP 0.5i .B shutter Set the camera shutter speed. Units can be specified in microseconds or in traditional form like "1/250". Valid interval depends on the model. If a value outside the interval is specified, the camera will set the speed to the nearest margin of the valid interval. Special speed value .B auto will set automatic shutter. Note that this only works while the camera is connected to the host, and automatically turns the flash off. While disconnected, shutter speed is always set automatically. .TP 0.5i .B aperture Auto | Lo | Med | Hi Set the lense aperture on models that support it. .TP 0.5i .B flash Auto | Force | Off | AntiRedeye | SlowSync Set the camera flash mode. .TP 0.5i .B id Set the camera identifier string that is included inside the JPEG files produced. Only few models support this. .TP 0.5i .B autoshut-host Automatically shut off the camera after that many seconds of inactivity while connected to the computer (on the host). .TP 0.5i .B autoshut-field Automatically shut off the camera after that many seconds of inactivity while disconnected from the computer (in the field). .TP 0.5i .B lcd-autoshut Automatically shut off the LCD monitor after that many seconds of inactivity. .TP 0.5i .B lcd-brightness Set LCD brightness to the value (valid values are 1 to 7). .TP 0.5i .B focus Macro | Normal | Infinity Set the lens focusing mode. As far as I can tell, on fixed focus models macro only means force minimum aperture, not change the focal length. Only has effect in the same invocation with "snapshot" command. .TP 0.5i .B adjust Normal | Contrast+ | Contrast- | Brightness+ | Brightness- Set adjustment of picture brightness/contrast. .TP 0.5i .B metering Center-weighted | Spot | Matrix Set auto exposure metering mode. .TP 0.5i .B whitebalance Normal | Sunny | Incandescent | Fluorescent | Flash | Preset | Cloudy Set white balance. .TP 0.5i .B color On | Off Set color or B/W mode. .TP 0.5i .B dzoom On | Off | Set digital zoom on or off. Note that it .I may only work if low resolution was set prior to turning on digital zoom, and only have effect in the same invocation with "snapshot" command. Numeric values have model-dependant meaning. .TP 0.5i .B zoom Set optical zoom value on models that support it. .SH EXAMPLES % photopc query % photopc -f "image%H:%M:%S" eraseall snapshot image 1 . .SH OTHER NOTES The latest version of this tool can be found at http://photopc.sourceforge.net/ Trademarks are properties of their respective owners. .SH KNOWN BUGS On some models, powersaving timeouts are measured not in seconds but in 1/10 sec units. The program reports them as in seconds. Llist command relies on the format of thumbnail image that does not contain necessary information on some models (e.g. Nikon CP 900), this command does not work for these models. List command, on the contrary, do not display useful data on models that do not return it in the register 47 (e.g. Agfa 780). The program is known to have some timing problems talking to Nikon CP900 when the camera is "napping" in powersaving mode. Until the problem is solved, a workaround is to run the program this way: .B $ photopc && photopc .I Nikon seem to have some other problems too, especially when doing "actions" (e.g. snapshots, erase). Another Nikon problem: if 32Mb (or bigger?) memry card is inserted, the program cannot get the number of frames taken, and if "all" or "NN-last" range is specified for downloading, the program fails. Specify explicit range of frames. Also, with any card, number of frames taken is not updated immediately after the "snapshot" command (the same has been reported for other models). If you find how to find the correct number of frames, please let me know. .SH COPYRIGHT The program is copyrighted by Eugene G. Crosser and freely distributable. See README file for detailes. DOS and Windows support copyright Bruce D. Lightner .SH CREDITS The man page was originally written by Jeff Tranter , who also contributed a few bugfixes. Some information about the serial protocol obtained from Jun-ichiro "itojun" Itoh , Thierry Bousch and other contributors. .SH SEE ALSO epinfo(1), strftime(3), protocol description (protocol.htm in the source distribution). photopc-3.07/eph_read.c0000644000175000017500000001446507133532273011772 00000000000000#ifndef LINT static char *rcsid="$Id: eph_read.c,v 2.11 2000/07/14 06:35:39 crosser Exp $"; #endif /* Copyright (c) 1997-2000 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: eph_read.c,v $ Revision 2.11 2000/07/14 06:35:39 crosser reportedly some models return CAN instead of DC1 Revision 2.10 2000/05/09 13:20:54 crosser configure read() with alarm() better. Address signed vs. unsigned arguments other cleanups to make most notorious compilers happy Revision 2.9 2000/05/02 22:26:35 crosser A few things incorporated from John Bowman's Nikon specific diffs Revision 2.8 2000/05/02 12:13:32 crosser some better debugging output alarm() based timeouted read (build with "--without-select") Revision 2.7 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 2.6 1999/03/06 13:37:08 crosser Convert to autoconf-style Revision 2.5 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 2.4 1998/08/01 13:12:41 lightner change Windows logic and timeouts Revision 2.3 1998/01/18 02:16:45 crosser DOS support Revision 2.2 1998/01/05 19:49:14 lightner Win32 syntax error fixed: fd changed to iob->fd Revision 2.1 1998/01/03 19:57:13 crosser Fix Windows things, improve error reporting Revision 2.0 1998/01/02 19:20:11 crosser Added support for Win32 Revision 1.1 1997/08/17 08:59:54 crosser Initial revision */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #ifdef HAVE_FCNTL_H #include #endif #include #include "eph_io.h" #include "eph_priv.h" #ifdef MSWINDOWS #define ERRNO GetLastError() #else #define ERRNO errno #endif /* Platform-dependant implementation of read with timeout */ #if defined(MSWINDOWS) #include #include #include #include #define MIN_TIMEOUT (1000) /* 1 second...doesn't change so often! */ size_t eph_readt(eph_iob *iob,char *buf,size_t length,long timeout_usec,int *rc) { BOOL stat; DWORD rlen; DWORD timeout_ms; DWORD interval; DWORD multiplier; DWORD constant; if (timeout_usec == 0) { /* return immediately if no read data ready */ interval = MAXDWORD; multiplier = 0; constant = 0; } else { /* normal read timeout */ timeout_ms = timeout_usec/1000; if (timeout_ms < MIN_TIMEOUT) timeout_ms = MIN_TIMEOUT; interval = 0; multiplier = 0; constant = timeout_ms; } /* reset timeout intervals if changed */ if (interval != iob->worktimeouts.ReadIntervalTimeout || multiplier != iob->worktimeouts.ReadTotalTimeoutMultiplier || constant != iob->worktimeouts.ReadTotalTimeoutConstant) { iob->worktimeouts.ReadIntervalTimeout = interval; iob->worktimeouts.ReadTotalTimeoutMultiplier = multiplier; iob->worktimeouts.ReadTotalTimeoutConstant = constant; if (!SetCommTimeouts(iob->fd, &iob->worktimeouts)) { eph_error(iob,ERRNO, "SetCommTimeouts set error %s", strerror(ERRNO)); return (size_t)-1; } } *rc=0; stat = ReadFile(iob->fd,buf,length,&rlen,NULL); /* no timeout error if timeout was zero */ if ((!stat || (rlen == 0)) && (timeout_usec != 0)) { SetLastError((DWORD)ERROR_SEM_TIMEOUT); return (size_t)-1; } else { SetLastError((DWORD)0L); *rc = rlen ? 1 : 0; return (size_t)rlen; } } #elif defined(UNIX) #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif /* HAVE_SYS_SELECT_H */ #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #ifdef USE_ALARMED_READ #ifdef HAVE_SIGNAL_H #include #endif #ifdef HAVE_FCNTL_H #include #endif static RETSIGTYPE alrmhdl(int sig) {} size_t eph_readt(eph_iob *iob,char *buf,size_t length,long timeout_usec,int *rc) { int ret,timeout_sec; RETSIGTYPE *oldsig; if (length == 0) return 0; if (timeout_usec == 0L) { *rc=1; if (fcntl(iob->fd,F_SETFL,iob->flag|O_NDELAY) == -1) return (size_t)-1; ret=read(iob->fd,buf,length); if (fcntl(iob->fd,F_SETFL,iob->flag) == -1) return (size_t)-1; if ((ret == -1) && (errno == EAGAIN)) { ret=0; *rc=0; } return ret; } #ifdef HAVE_RESTARTABLE_SYSCALLS (void)siginterrupt(SIGALRM,1); #endif timeout_sec=timeout_usec/1000000; if (timeout_sec < 2) timeout_sec=2; oldsig=signal(SIGALRM,alrmhdl); alarm((unsigned)timeout_sec); *rc=1; ret=read(iob->fd,buf,length); if ((ret == -1) && (errno == EINTR)) { ret=0; *rc=0; } alarm(0); signal(SIGALRM,oldsig); return ret; } #else /* USE_ALARMED_READ */ size_t eph_readt(eph_iob *iob,char *buf,size_t length,long timeout_usec,int *rc) { fd_set rfds,wfds,efds; struct timeval timer; if (length == 0) return 0; FD_ZERO(&rfds); FD_ZERO(&wfds); FD_ZERO(&efds); FD_SET(iob->fd,&rfds); FD_SET(iob->fd,&efds); timer.tv_sec=timeout_usec / 1000000L; timer.tv_usec=timeout_usec % 1000000L; (*rc)=select((iob->fd)+1,&rfds,&wfds,&efds,&timer); if ((*rc) == 0) { return 0; } if (((*rc) < 0) || (FD_ISSET(iob->fd,&efds))) return (size_t)-1; return read(iob->fd,buf,length); } #endif /* USE_ALARMED_READ */ #elif defined(DOS) #include #include "comio.h" #include "usleep.h" #define TO_USECS (1L * 1000000L) size_t eph_readt(eph_iob *iob,char *buf,size_t length,long timeout_usec,int *rc) { int ch, reset = 0, rlen = 0; unsigned char *p = buf; if (length == 0) return 0; *rc = 0; start_time(); #if 0 while (elasped_usecs() <= ((unsigned long)TO_USECS + (length * 1000L))) #else while (elasped_usecs() <= (unsigned long)timeout_usec) #endif { while (ttchk()) { *rc = 0; reset = 1; if (rlen < 0) rlen = 0; ch = ttinc(); *(p++) = ch; if (++rlen >= length) { return (size_t)rlen; } } if (reset) { start_time(); reset = 0; } } return (size_t)rlen; } #else # error platform not defined #endif photopc-3.07/a12scan.h0000644000175000017500000000252406671571603011457 00000000000000/* $Id: a12scan.h,v 2.3 1999/03/10 22:34:43 crosser Exp $ */ /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: a12scan.h,v $ Revision 2.3 1999/03/10 22:34:43 crosser make app12 and exif scanning in different files Revision 2.2 1999/02/28 22:40:48 crosser Support Exif file format Revision 2.1 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 2.0 1998/02/13 23:01:13 crosser define type off_t for DOS Revision 1.3 1998/02/08 19:58:38 crosser Support low memory: chunked saving etc. Revision 1.2 1998/01/18 02:16:45 crosser DOS support Revision 1.1 1997/08/17 08:59:54 crosser Initial revision */ #ifndef _A12SCAN_H #define _A12SCAN_H #define MAXJPREFIX 8192L #ifdef DOS typedef long off_t; #endif int a12scan(unsigned char **buf,off_t *bufsize); unsigned char *a12search(char *key,unsigned char *buf,off_t bufsize); void a12dump(unsigned char *buf,off_t bufsize); #endif photopc-3.07/aclocal.m40000644000175000017500000010560411673670662011724 00000000000000# 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.68],, [m4_warning([this file was generated for autoconf 2.68. 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'.])]) # 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"]) ]) # Copyright (C) 1996, 1997, 2000, 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. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # 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])]) # 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 ]) # 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])]) # Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 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. # serial 5 AC_DEFUN([AM_C_PROTOTYPES], [AC_REQUIRE([AC_C_PROTOTYPES]) if test "$ac_cv_prog_cc_stdc" != no; then U= ANSI2KNR= else U=_ ANSI2KNR=./ansi2knr fi # Ensure some checks needed by ansi2knr itself. AC_REQUIRE([AC_HEADER_STDC]) AC_CHECK_HEADERS([string.h]) AC_SUBST([U])dnl AC_SUBST([ANSI2KNR])dnl _AM_SUBST_NOTMAKE([ANSI2KNR])dnl ]) AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # 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 photopc-3.07/strcscmp.h0000644000175000017500000000012306460263015012045 00000000000000#ifndef _STRCSCMP_H #define _STRCSCMP_H int strcasecmp(char *s1, char *s2); #endif photopc-3.07/eph_io.c0000644000175000017500000002763007300325757011467 00000000000000#ifndef LINT static char *rcsid="$Id: eph_io.c,v 2.20 2001/05/15 22:21:35 crosser Exp $"; #endif /* Copyright (c) 1997-1999 Eugene G. Crosser Copyright (c) 1998,1999 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: eph_io.c,v $ Revision 2.20 2001/05/15 22:21:35 crosser README - reflect CVS and www server change to sourceforge eph_io.c - make waitsig() skip 0xff's in addition to NULs Revision 2.19 2000/07/14 06:35:39 crosser reportedly some models return CAN instead of DC1 Revision 2.18 2000/05/09 13:20:54 crosser configure read() with alarm() better. Address signed vs. unsigned arguments other cleanups to make most notorious compilers happy Revision 2.17 2000/02/17 21:29:54 crosser final cleanup for 3.04, change version change debugging levels Revision 2.16 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 2.15 1999/07/28 19:29:18 crosser resort includes Revision 2.14 1999/04/22 04:14:54 crosser avoid GCC-isms Revision 2.13 1999/03/27 23:54:37 crosser backed out adding WRTDELAY: already done in eph_priv.h Revision 2.12 1999/03/22 05:59:31 lightner Add WRTDELAY to SMART CHUNKED WRITE's WRITE() Revision 2.11 1999/03/06 13:37:08 crosser Convert to autoconf-style Revision 2.10 1999/02/10 22:09:36 crosser strerror needs string.h with glibc2 Revision 2.9 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 2.8 1998/08/08 14:00:33 crosser fix typo Revision 2.7 1998/08/01 13:16:18 crosser move delays where they belong. Revision 2.6 1998/08/01 13:12:41 lightner change Windows logic and timeouts Revision 2.5 1998/08/01 12:30:50 crosser flushinput function Revision 2.4 1998/01/27 21:52:55 crosser add multi-block write Revision 2.3 1998/01/18 02:16:45 crosser DOS support Revision 2.2 1998/01/05 19:48:46 lightner Win32 syntax error fixed: i->length Revision 2.1 1998/01/03 19:57:13 crosser Fix Windows things, improve error reporting Revision 2.0 1998/01/02 19:20:11 crosser Added support for Win32 Revision 1.3 1997/12/24 00:19:13 crosser Change default speed to 115200 Revision 1.2 1997/09/12 09:42:35 crosser skip possible NULs prior to `camera signature' Revision 1.1 1997/08/17 08:59:54 crosser Initial revision */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef UNIX #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #ifdef HAVE_UNISTD_H #include #endif #endif #include #include #include #ifndef UNIX #include "usleep.h" #endif #include "eph_io.h" #include "eph_priv.h" #ifdef INT16 typedef unsigned INT16 uint16; #endif #ifdef MSWINDOWS #define ERRNO GetLastError() #else #define ERRNO errno #endif #ifdef HAVE_NANOSLEEP void shortsleep(long useconds) { struct timespec ts; ts.tv_sec=(long int)(useconds/1000000); ts.tv_nsec=(long int)(useconds%1000000)*1000ul; nanosleep(&ts,NULL); } #else /* HAVE_NANOSLEEP */ #define shortsleep(x) usleep(x) #endif /* HAVE_NANOSLEEP */ #if !defined(BYTE_BY_BYTE_WRITE) && !defined(SINGLE_BURST_WRITE) static struct _chunk { size_t offset; size_t size; long delay; } chunk[] = { { 0L, 1L, WRTPKTDELAY }, { 1L, 3L, WRTCMDDELAY }, { 4L, 0L, WRTPRMDELAY } }; #define MAXCHUNK 3 #endif /* System-specific WRITE implementation */ #if defined(DOS) #include "comio.h" #define WRITE(x,y,z) (dos_write(x,y,z) != z) int dos_write(int fd, void *buf, int length) { int i; unsigned char *p = buf; ttflui(); /* flush input buffer */ for (i = 0; i < length; ++i) { ttoc(*p++); } return length; } #elif defined(MSWINDOWS) #define WRITE(x,y,z) win_write(x,y,z) int win_write(HANDLE fd,void *buf,DWORD length) { DWORD nwrit; if (!WriteFile(fd,buf,length,&nwrit,NULL) || (nwrit != length)) return 1; else return 0; } #elif defined(UNIX) #define WRITE(x,y,z) (write(x,y,z) != z) #else # error "platform not defined" #endif int eph_writepkt(eph_iob *iob,int typ,int seq,char *data,size_t length) { uint16 crc=0; unsigned char buf[2054]; int i=0,j; if (length > (sizeof(buf)-6)) { eph_error(iob,ERR_DATA_TOO_LONG, "trying to write %ld in one pkt",(long)length); return -1; } buf[i++]=typ; buf[i++]=seq; buf[i++]=length&0xff; buf[i++]=length>>8; for (j=0;j<(int)length;j++) { crc+=(unsigned char)data[j]; buf[i++]=data[j]; } buf[i++]=crc&0xff; buf[i++]=crc>>8; if (iob->debug > 1) { printf("> (%d)",i); for (j=0;jfd,buf,(size_t)i)) { eph_error(iob,ERRNO,"pkt write error %s",strerror(ERRNO)); return -1; } #elif defined(BYTE_BY_BYTE_WRITE) /* It looks like the camera hates if data is sent at 115200 in one chunk. Thierry Bousch recommended to send data byte-by-byte with small delays. This really helps. */ shortsleep(WRTPKTDELAY); for (j=0;jfd,buf+j,1)) { eph_error(iob,ERRNO,"pkt write error %s",strerror(ERRNO)); return -1; } /* tcdrain()s do not seem to be necessary, at least on Linux... if (tcdrain(iob->fd)) { eph_error(iob,ERRNO,"pkt tcdrain error %s",strerror(ERRNO)); return -1; } */ } #else /* SMART CHUNKED WRITE */ for (j=0;jfd,buf+chunk[j].offset,(size_t)sz)) { eph_error(iob,ERRNO,"pkt write chunk %d(%d) error %s", j,(int)sz,strerror(ERRNO)); return -1; } } #endif return 0; } void eph_writeinit(eph_iob *iob) { unsigned char init=0; if (iob->debug > 1) printf("> INIT 00\n"); shortsleep(WRTDELAY); if (WRITE(iob->fd,&init,1)) { eph_error(iob,ERRNO,"init write error %s",strerror(ERRNO)); } } void eph_writeack(eph_iob *iob) { unsigned char ack=ACK; if (iob->debug > 1) printf("> ACK 06\n"); shortsleep(WRTDELAY); if (WRITE(iob->fd,&ack,1)) { eph_error(iob,ERRNO,"ack write errot %s",strerror(ERRNO)); } } void eph_writenak(eph_iob *iob) { unsigned char nak=NAK; if (iob->debug > 1) printf("> NAK 11\n"); shortsleep(WRTDELAY); if (WRITE(iob->fd,&nak,1)) { eph_error(iob,ERRNO,"nak write error %s",strerror(ERRNO)); } } int eph_readpkt(eph_iob *iob,eph_pkthdr *pkthdr,char *buffer, size_t *bufsize,long timeout_usec) { uint16 length,got; uint16 crc1=0,crc2; unsigned char buf[4]; int i,rc; i=eph_readt(iob,buf,1,timeout_usec,&rc); if (iob->debug > 1) printf ("pktstart: i=%d rc=%d char=0x%02x\n",i,rc,*buf); if (i < 0) { eph_error(iob,ERRNO,"pkt start read error %s",strerror(ERRNO)); return -1; } else if ((i == 0) && (rc == 0)) { eph_error(iob,ERR_TIMEOUT,"pkt start read timeout (%ld)", timeout_usec); return -2; } else if (i != 1) { eph_error(iob,ERR_BADREAD,"pkt start read %d, expected 1",i); return -1; } pkthdr->typ=buf[0]; if ((*buf != PKT_DATA) && (*buf != PKT_LAST)) { if ((*buf != NAK) && (*buf != DC1)) eph_error(iob,ERR_BADDATA,"pkt start got 0x%02x",*buf); return *buf; } got=0; while ((i=eph_readt(iob,buf+1+got,(unsigned)3-got,DATATIMEOUT,&rc)) > 0) { got+=i; } if (got != 3) { if (i < 0) { eph_error(iob,ERRNO,"pkt hdr read error %s (got %d)", strerror(ERRNO),got); return -1; } else if ((i == 0) && (rc == 0)) { eph_error(iob,ERR_TIMEOUT,"pkt hdr read timeout (%ld)", DATATIMEOUT); return -2; } else { eph_error(iob,ERR_BADREAD,"pkt hdr read return %d rc %d", i,rc); return -1; } } if (iob->debug > 1) printf("header: %02x %02x %02x %02x\n", buf[0],buf[1],buf[2],buf[3]); pkthdr->seq=buf[1]; length=(buf[3]<<8)|buf[2]; if (length > *bufsize) { eph_error(iob,ERR_DATA_TOO_LONG, "length in pkt header %lu bigger than buffer size %lu", (unsigned long)length,(unsigned long)*bufsize); return -1; } got=0; while ((i=eph_readt(iob,buffer+got,(unsigned)length-got,iob->timeout,&rc)) > 0) { got+=i; } if (got != length) { if (i < 0) { eph_error(iob,ERRNO,"pkt data read error %s",strerror(ERRNO)); return -1; } else if ((i == 0) && (rc == 0)) { eph_error(iob,ERR_TIMEOUT,"pkt data read timeout (%ld)", iob->timeout); return -2; } else { eph_error(iob,ERR_BADREAD, "pkt read return %d, rc %d",i,rc); return -1; } } for (i=0;i 0) { got+=i; } if (iob->debug > 1) printf ("crc: %02x %02x i=%d rc=%d\n",buf[0],buf[1],i,rc); if (got != 2) { if (i < 0) { eph_error(iob,ERRNO,"pkt crc read error %s",strerror(ERRNO)); return -1; } else if ((i == 0) && (rc == 0)) { eph_error(iob,ERR_TIMEOUT,"pkt crc read timeout (%ld)", DATATIMEOUT); return -2; } else { eph_error(iob,ERR_BADREAD,"pkt crc read return %d rc %d", i,rc); return -1; } } crc2=(buf[1]<<8)|buf[0]; if (crc1 != crc2) { if (iob->debug) printf("crc %04x != %04x\n",crc1,crc2); eph_error(iob,ERR_BADCRC, "crc received=0x%04x counted=0x%04x",crc2,crc1); return -1; } if (iob->debug > 1) { int j; printf("< %d,%d (%d)",pkthdr->typ,pkthdr->seq,length); if (iob->debug > 2) for (j=0;jtyp,pkthdr->seq,length); if (iob->debug > 2) for (j=0;j= ' ' && buffer[j] < 127) ? buffer[j] : '.'); } else printf(" ..."); printf("\n"); } (*bufsize)=length; return 0; } int eph_flushinput(eph_iob *iob) { unsigned char buf; int i,rc; i=eph_readt(iob,&buf,1,0L,&rc); if (iob->debug > 1) printf ("< %02x amount=%d rc=%d\n",buf,i,rc); if (i < 0) { eph_error(iob,ERRNO,"flushinput read error %s",strerror(ERRNO)); return -1; } else if ((i == 0) && (rc == 0)) { if (iob->debug) printf ("flushed: read %d amount=%d rc=%d\n",buf,i,rc); return 0; } else { eph_error(iob,ERR_BADREAD,"flushinput read %d expected 0",i); return -1; } } int eph_waitchar(eph_iob *iob,long timeout_usec) { unsigned char buf; int i,rc; i=eph_readt(iob,&buf,1,timeout_usec,&rc); if (iob->debug > 1) printf ("< %02x amount=%d rc=%d\n",buf,i,rc); if (i < 0) { eph_error(iob,ERRNO,"waitchar read error %s",strerror(ERRNO)); return -1; } else if ((i == 0) && (rc == 0)) { eph_error(iob,ERR_TIMEOUT,"waitchar read timeout (%ld)", timeout_usec); return -2; } else if (i != 1) { eph_error(iob,ERR_BADREAD,"waitchar read %d expected 1",i); return -1; } return buf; } int eph_waitack(eph_iob *iob,long timeout_usec) { int rc; if ((rc=eph_waitchar(iob,timeout_usec)) == ACK) return 0; if ((rc != DC1) && (rc != NAK) && (rc != CAN)) eph_error(iob,ERR_BADREAD,"eph_waitack got %d",rc); return rc; } int eph_waitcomplete(eph_iob *iob) { int rc; if ((rc=eph_waitchar(iob,CMDTIMEOUT)) == 0x05) return 0; if ((rc != DC1) && (rc != NAK)) eph_error(iob,ERR_BADREAD,"eph_waitcomplete got %d",rc); return rc; } int eph_waitsig(eph_iob *iob) { int rc,count=SKIPNULS; while ((((rc=eph_waitchar(iob,INITTIMEOUT)) == 0) || rc == 0xff) && (count-- > 0)) ; if (rc == 0x15) return 0; eph_error(iob,ERR_BADREAD,"eph_waitsig got %d",rc); return rc; } int eph_waiteot(eph_iob *iob) { int rc; if ((rc=eph_waitchar(iob,EODTIMEOUT)) == 0xff) return 0; if ((rc != DC1) && (rc != NAK)) eph_error(iob,ERR_BADREAD,"eph_waiteot got %d",rc); return rc; } photopc-3.07/missing0000755000175000017500000002623311500011217011431 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 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, see . # 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] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. 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 # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # 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). This is about non-GNU programs, so use $1 not # $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 $program 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 $? 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: photopc-3.07/readme.dos0000644000175000017500000001017307342636312012014 00000000000000/* $Id: readme.dos,v 1.9 2001/08/28 06:40:10 crosser Exp $ */ /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998,1999 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: readme.dos,v $ Revision 1.9 2001/08/28 06:40:10 crosser change website reference to sourceforge Revision 1.8 1999/03/22 06:16:24 lightner Fix typo Revision 1.6 1999/01/17 13:33:48 crosser change copyright info Revision 1.5 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 1.4 1998/08/09 17:02:22 crosser notes about the port speed and TZ variable Revision 1.3 1998/08/01 13:12:41 lightner *** empty log message *** Revision 1.2 1998/02/28 09:20:41 lightner no more file size limit Revision 1.1 1998/02/06 00:17:16 lightner Initial revision */ README.DOS This is a 16-bit MS-DOS version of Eugene G. Crosser's "photopc" digital camera software. This software is known to work with Agfa, Epson and Olympus cameras with 80x86-based PC's, laptops, and "palmtops" (e.g., HP200LX) running MS-DOS. The software has been found to run at the camera's fastest serial port speed (i.e., 115200 baud) on newer PCs. However, a reduced serial port speed (using the -s command line option) may be needed for proper operation on older PCs and laptops (and with most "palmtops", due to their slow processors). Note that the program's default serial port speed is 115200 baud. Note that due to the camera design, negotiation always starts at 19200 baud, so if your serial port only runs up to 9600, it won't work even despite 9600 is a valid communication speed for the program. The MS-DOS version also will run in a command window (i.e., "MS-DOS Prompt") under Windows 95 and Windows NT (but often times only at reduced serial port rates). This MS-DOS version was compiled under Borland International's 16-bit 80x86 compiler, Turbo C++ Version 3.00, using the "small" memory model. Refer to the makefile "makefile.dos" for compile instructions. Pay close attention on the `TZ' environment variable definition. If this variable is not set, or set improperly, MS/DOS makes very strange assumtion about your timezone, and result of setting and displaying of the camera internal clock may be unpredictable. LIMITATIONS: The MS-DOS code has been modified to support >64K byte images (using #define LOW_MEMORY). This was achieved by changing the program's logic to write image data to the disk file in 2048-byte chunks, as the data is being read from the camera. The other versions of the software (i.e., Unix/Windows) write the image to disk only after the entire image has been read from the camera (into a large in-memory buffer). The serial I/O package used by the MS-DOS version of "photopc.exe" supports serial ports COM1, COM2, COM3, and COM4, assuming the standard IRQ assignments (i.e., COM1 and COM3 use IRQ4 and COM2 and COM4 use IRQ3). The "photopc.exe" program installs an interrupt handler for the serial port at IRQ3 or IRQ4. This handler is removed on program exit, or if the user terminates the program with ^C or control-break. Other abnormal exits (e.g., hard disk I/O errors) may leave the the handler installed...which is sure to cause problems! This software makes use of a serial I/O package (comio.c) taken from a public-domain SIMTEL archive named "cvt100.zip" (VT100, A Simple VT100 Emulator in Turbo C 1.5 by Jerry Joplin), which was somehow derived from Kermit. These routines do not take advantage of the serial port queues available in modern PC chipsets (i.e., 16550 UARTS). Refer to the file "README" for more information. Please consult the following URL for the latest softweare information: http://photopc.sourceforge.net/ Trademarks are properties of their respective respected owners. Bruce D. Lightner (lightner@lightner.net) Sat Jul 25 17:37:40 pdt 1998 photopc-3.07/win32/0000755000175000017500000000000011673670767011106 500000000000000photopc-3.07/win32/version.h0000644000175000017500000000025311673670267012657 00000000000000/* win32/version.h. Generated from version.h.in by configure. */ /* Name of package */ #define PACKAGE "photopc" /* Version number of package */ #define VERSION "3.07" photopc-3.07/win32/version.h.in0000644000175000017500000000012506755230062013250 00000000000000/* Name of package */ #undef PACKAGE /* Version number of package */ #undef VERSION photopc-3.07/win32/Makefile0000644000175000017500000001264207012067007012446 00000000000000# $Id: Makefile,v 2.16 1999/11/09 18:55:03 crosser Exp $ # # Copyright (c) 1997,1998 Eugene G. Crosser # Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) # # You may distribute and/or use for any purpose modified or unmodified # copies of this software if you preserve the copyright notice above. # # THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY # KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE # COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE # USE OF THIS SOFTWARE. # # sample message # $Log: Makefile,v $ # Revision 2.16 1999/11/09 18:55:03 crosser # work on windows version # # Revision 2.15 1999/08/04 11:52:21 ady # test commit # # Revision 2.14 1999/08/01 23:25:11 crosser # move makefile to subdirectory, NOT working yet! # # Revision 2.13 1999/04/14 18:34:38 lightner # link with setargv to expand filenames # # Revision 2.12 1999/03/22 06:08:44 lightner # Add -DHAVE_RENAME # Fix overly long command line problem (add $(EXTRA_OBJS)) # Fix "make clean" to do full cleanup # # Revision 2.11 1999/03/12 23:22:30 crosser # define for new utime() code # # Revision 2.10 1999/03/12 10:06:23 crosser # setfiletime # # Revision 2.9 1999/03/10 22:34:43 crosser # sync with structure changes # # Revision 2.8 1999/01/17 13:37:29 crosser # fix copyright info # # Revision 2.7 1999/01/17 13:27:59 bruce # make win/dos versions in separate subdirs # # Revision 2.6 1998/10/18 13:18:27 crosser # Put RCS logs and I.D. into the source # # Revision 2.5 1998/02/16 06:12:02 lightner # Add dependancy for revision.h # # Revision 2.4 1998/02/08 19:58:38 crosser # Support low memory: chunked saving etc. # # Revision 2.3 1998/02/05 23:33:00 lightner # Fix make logic to allow debug # Fix "make clean" logic to remove MSVC++ "trash/debug" files # # Revision 2.2 1998/01/18 02:16:45 crosser # DOS support # HAVE_NANOSLEEP # # Revision 2.1 1998/01/03 12:50:02 crosser # fix for new name etc. # # Revision 2.0 1998/01/02 19:20:11 crosser # Added support for Win32 # # Revision 1.1 1998/01/02 00:49:34 crosser # Initial revision # # Modified by Bruce D. Lightner (lightner@lightner.net) on 1/2/98 to # support builds under Microsoft Windows 95/NT # # To "make" using Microsoft's Visual C++ toolset, ensure that your # PATH points to the proper development tools directory, verify that # the INCLUDE and LIB environment variables are set, then enter the # following commands: # # nmake clean # nmake srcdir = .. VPATH = .. OPTS = -DHAVE_CONFIG_H CC = cl #CFLAGS = -O2 -Zi CFLAGS = -O2 LD = cl LDFLAGS = $(CFLAGS) AR = lib # "-I." go first to include right config.h ! INC = -I. -I$(srcdir) ##### No need to touch anything below this line ##### LIBOBJS = eph_read.obj eph_iob.obj eph_err.obj \ eph_cmd.obj eph_io.obj eph_open.obj EXTRA_OBJS = getopt.obj usleep.obj strcscmp.obj \ a12scan.obj fnames.obj ctimez.obj filetime.obj \ exifscan.obj all: eph_io.lib photopc.exe epinfo.exe eph_io.lib: $(LIBOBJS) $(AR) /out:$@ $(LIBOBJS) photopc.exe: photopc.obj $(EXTRA_OBJS) eph_io.lib $(LD) $(LDFLAGS) -Fe$@ photopc.obj $(EXTRA_OBJS) eph_io.lib epinfo.exe: epinfo.obj $(EXTRA_OBJS) $(LD) $(LDFLAGS) -Fe$@ epinfo.obj $(EXTRA_OBJS) /link setargv.obj tidyup: del *.obj del vc*.pdb del eph_io.bak del photopc.vcp del photopc.ilk del photopc.pdb del epinfo.vcp del epinfo.ilk del epinfo.pdb clean: tidyup del eph_io.lib del photopc.exe del epinfo.exe MKOBJ = $(CPP) $(CFLAGS) $(OPTS) $(INC) -Fo$@ -c photopc.obj: $(srcdir)/photopc.c $(srcdir)/eph_io.h $(srcdir)/a12scan.h $(srcdir)/fnames.h $(srcdir)/ctimez.h $(srcdir)/filetime.h $(srcdir)/getopt.h $(srcdir)/strcscmp.h $(MKOBJ) -ophotopc.obj $(srcdir)/photopc.c epinfo.obj: $(srcdir)/epinfo.c $(srcdir)/a12scan.h $(srcdir)/exifscan.h $(srcdir)/fnames.h $(srcdir)/ctimez.h $(srcdir)/filetime.h $(srcdir)/getopt.h $(srcdir)/strcscmp.h $(MKOBJ) -oepinfo.obj $(srcdir)/epinfo.c a12scan.obj: $(srcdir)/a12scan.c $(srcdir)/a12scan.h $(MKOBJ) -oa12scan.obj $(srcdir)/a12scan.c exifscan.obj: $(srcdir)/exifscan.c $(srcdir)/exifscan.h $(MKOBJ) -oexifscan.obj $(srcdir)/exifscan.c fnames.obj: $(srcdir)/fnames.c $(srcdir)/fnames.h $(srcdir)/ctimez.h $(MKOBJ) -ofnames.obj $(srcdir)/fnames.c ctimez.obj: $(srcdir)/ctimez.c $(srcdir)/ctimez.h $(MKOBJ) -octimez.obj $(srcdir)/ctimez.c filetime.obj: $(srcdir)/filetime.c $(srcdir)/filetime.h $(srcdir)/ctimez.h $(MKOBJ) -ofiletime.obj $(srcdir)/filetime.c eph_read.obj: $(srcdir)/eph_read.c $(srcdir)/eph_io.h $(srcdir)/comio.h $(srcdir)/usleep.h $(MKOBJ) -oeph_read.obj $(srcdir)/eph_read.c eph_iob.obj: $(srcdir)/eph_iob.c $(srcdir)/eph_io.h $(MKOBJ) -oeph_iob.obj $(srcdir)/eph_iob.c eph_err.obj: $(srcdir)/eph_err.c $(srcdir)/eph_io.h $(srcdir)/eph_priv.h $(MKOBJ) -oeph_err.obj $(srcdir)/eph_err.c eph_cmd.obj: $(srcdir)/eph_cmd.c $(srcdir)/eph_io.h $(srcdir)/eph_priv.h $(MKOBJ) -oeph_cmd.obj $(srcdir)/eph_cmd.c eph_io.obj: $(srcdir)/eph_io.c $(srcdir)/eph_io.h $(srcdir)/eph_priv.h $(srcdir)/usleep.h $(srcdir)/comio.h $(MKOBJ) -oeph_io.obj $(srcdir)/eph_io.c eph_open.obj: $(srcdir)/eph_open.c $(srcdir)/eph_io.h $(srcdir)/eph_priv.h $(srcdir)/usleep.h $(srcdir)/comio.h $(srcdir)/usleep.h $(MKOBJ) -oeph_open.obj $(srcdir)/eph_open.c getopt.obj: $(srcdir)/getopt.c $(srcdir)/getopt.h $(MKOBJ) -ogetopt.obj $(srcdir)/getopt.c usleep.obj: $(srcdir)/usleep.c $(MKOBJ) -ousleep.obj $(srcdir)/usleep.c strcscmp.obj: $(srcdir)/strcscmp.c $(MKOBJ) -ostrcscmp.obj $(srcdir)/strcscmp.c photopc-3.07/win32/config.h0000644000175000017500000000247507145614164012440 00000000000000#include "version.h" /* Define if you have the strftime function. */ #define HAVE_STRFTIME 1 /* Define if you have the vprintf function. */ #define HAVE_VPRINTF 1 /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Integer 16bit type */ #define INT16 short /* Integer 3bit type */ #define INT32 long /* Platform definition */ #define MSWINDOWS 1 /* Low memory model */ /* #undef LOWMEMORY */ /* The number of bytes in a int. */ #define SIZEOF_INT 4 /* The number of bytes in a long. */ #define SIZEOF_LONG 4 /* The number of bytes in a short. */ #define SIZEOF_SHORT 2 /* Define if you have the getopt function. */ #define HAVE_GETOPT 1 /* Define if you have the mkdir function. */ #define HAVE_MKDIR 1 /* Define if you have the rename function. */ #define HAVE_RENAME 1 /* Define if you have the strerror function. */ #define HAVE_STRERROR 1 /* Define if you have the strspn function. */ #define HAVE_STRSPN 1 /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the header file. */ #define HAVE_STRING_H /* Define if you have the header file. */ #define HAVE_SYS_UTIME_H /* Define if compiler has function prototypes */ #define PROTOTYPES 1 /* is struct utimbuf defined in sys/utime.h */ #define HAVE_UTIMBUF 1 photopc-3.07/depcomp0000755000175000017500000004426711500011217011416 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see . # 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 cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp 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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi 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. -arch) eat=yes ;; -*|$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 "X$1" != 'X--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. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # 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 ;; 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: photopc-3.07/Makefile.in0000644000175000017500000010415211673670663012127 00000000000000# 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@ # FSF thinks that the source generated by a tool copyrighted # by FSF is also copyrighted by FSF. This might be true, but # still, if you read this text in Makefile.in or Makefile, then # be informed that the orifinal file, and the "meat" of the # package, is: # # Copyright (c) 1997-1999 Eugene G. Crosser # Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) # # You may distribute and/or use for any purpose modified or unmodified # copies of this software if you preserve the copyright notice above. # # THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY # KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE # COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE # USE OF THIS SOFTWARE. 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 = : ANSI2KNR = @ANSI2KNR@ bin_PROGRAMS = photopc$(EXEEXT) epinfo$(EXEEXT) subdir = . DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(top_srcdir)/configure \ $(top_srcdir)/dos/version.h.in \ $(top_srcdir)/win32/version.h.in acconfig.h ansi2knr.1 \ ansi2knr.c depcomp getopt.c install-sh missing usleep.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(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 = $(install_sh) -d CONFIG_HEADER = config.h $(top_builddir)/dos/version.h \ $(top_builddir)/win32/version.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)$(bindir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(includedir)" LIBRARIES = $(lib_LIBRARIES) ARFLAGS = cru libeph_io_a_AR = $(AR) $(ARFLAGS) libeph_io_a_LIBADD = am_libeph_io_a_OBJECTS = eph_read$U.$(OBJEXT) eph_iob$U.$(OBJEXT) \ eph_err$U.$(OBJEXT) eph_cmd$U.$(OBJEXT) eph_io$U.$(OBJEXT) \ eph_open$U.$(OBJEXT) libeph_io_a_OBJECTS = $(am_libeph_io_a_OBJECTS) PROGRAMS = $(bin_PROGRAMS) am_epinfo_OBJECTS = epinfo$U.$(OBJEXT) a12scan$U.$(OBJEXT) \ exifscan$U.$(OBJEXT) fnames$U.$(OBJEXT) ctimez$U.$(OBJEXT) \ filetime$U.$(OBJEXT) epinfo_OBJECTS = $(am_epinfo_OBJECTS) epinfo_DEPENDENCIES = @LIBOBJS@ am_photopc_OBJECTS = photopc$U.$(OBJEXT) a12scan$U.$(OBJEXT) \ fnames$U.$(OBJEXT) ctimez$U.$(OBJEXT) filetime$U.$(OBJEXT) \ exifscan$U.$(OBJEXT) photopc_OBJECTS = $(am_photopc_OBJECTS) photopc_DEPENDENCIES = @LIBOBJS@ libeph_io.a DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/dos -I$(top_builddir)/win32 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) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libeph_io_a_SOURCES) $(epinfo_SOURCES) \ $(EXTRA_epinfo_SOURCES) $(photopc_SOURCES) \ $(EXTRA_photopc_SOURCES) DIST_SOURCES = $(libeph_io_a_SOURCES) $(epinfo_SOURCES) \ $(EXTRA_epinfo_SOURCES) $(photopc_SOURCES) \ $(EXTRA_photopc_SOURCES) man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) HEADERS = $(include_HEADERS) 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)"; }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INT16 = @INT16@ INT32 = @INT32@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBPROGS = @LIBPROGS@ LIBS = @LIBS@ LN = @LN@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MV = @MV@ OBJEXT = @OBJEXT@ 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@ PROGS = @PROGS@ RANLIB = @RANLIB@ RM = @RM@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ U = @U@ VERSION = @VERSION@ 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@ 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_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ 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@ AUTOMAKE_OPTIONS = foreign ansi2knr lib_LIBRARIES = libeph_io.a include_HEADERS = eph_io.h man_MANS = photopc.1 epinfo.1 EXTRA_DIST = $(man_MANS) protocol.htm usage.htm readme.dos \ dos/Makefile dos/config.h dos/version.h \ win32/Makefile win32/config.h win32/version.h \ ChangeLog photopc_SOURCES = photopc.c a12scan.c a12scan.h fnames.c fnames.h \ ctimez.c ctimez.h filetime.c filetime.h \ exifscan.c exifscan.h eph_io.h EXTRA_photopc_SOURCES = comio.c comio.h getopt.h usleep.h strcscmp.h photopc_LDADD = @LIBOBJS@ libeph_io.a epinfo_SOURCES = epinfo.c a12scan.c a12scan.h exifscan.c exifscan.h \ fnames.c fnames.h ctimez.c ctimez.h \ filetime.c filetime.h EXTRA_epinfo_SOURCES = getopt.h epinfo_LDADD = @LIBOBJS@ libeph_io_a_SOURCES = eph_read.c eph_iob.c eph_err.c eph_cmd.c eph_io.c \ eph_open.c eph_io.h eph_priv.h all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign 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: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) $(top_srcdir)/acconfig.h ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ dos/version.h: dos/stamp-h2 @if test ! -f $@; then \ rm -f dos/stamp-h2; \ $(MAKE) $(AM_MAKEFLAGS) dos/stamp-h2; \ else :; fi dos/stamp-h2: $(top_srcdir)/dos/version.h.in $(top_builddir)/config.status @rm -f dos/stamp-h2 cd $(top_builddir) && $(SHELL) ./config.status dos/version.h win32/version.h: win32/stamp-h3 @if test ! -f $@; then \ rm -f win32/stamp-h3; \ $(MAKE) $(AM_MAKEFLAGS) win32/stamp-h3; \ else :; fi win32/stamp-h3: $(top_srcdir)/win32/version.h.in $(top_builddir)/config.status @rm -f win32/stamp-h3 cd $(top_builddir) && $(SHELL) ./config.status win32/version.h distclean-hdr: -rm -f config.h stamp-h1 dos/version.h dos/stamp-h2 win32/version.h win32/stamp-h3 install-libLIBRARIES: $(lib_LIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LIBRARIES)'; 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 " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \ $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; } @$(POST_INSTALL) @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ if test -f $$p; then \ $(am__strip_dir) \ echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \ ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \ else :; fi; \ done uninstall-libLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(libdir)' && rm -f "$$files" )"; \ cd "$(DESTDIR)$(libdir)" && rm -f $$files clean-libLIBRARIES: -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) libeph_io.a: $(libeph_io_a_OBJECTS) $(libeph_io_a_DEPENDENCIES) -rm -f libeph_io.a $(libeph_io_a_AR) libeph_io.a $(libeph_io_a_OBJECTS) $(libeph_io_a_LIBADD) $(RANLIB) libeph_io.a install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) epinfo$(EXEEXT): $(epinfo_OBJECTS) $(epinfo_DEPENDENCIES) @rm -f epinfo$(EXEEXT) $(LINK) $(epinfo_OBJECTS) $(epinfo_LDADD) $(LIBS) photopc$(EXEEXT): $(photopc_OBJECTS) $(photopc_DEPENDENCIES) @rm -f photopc$(EXEEXT) $(LINK) $(photopc_OBJECTS) $(photopc_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c ./ansi2knr: ansi2knr.$(OBJEXT) $(LINK) ansi2knr.$(OBJEXT) $(LIBS) ansi2knr.$(OBJEXT): $(CONFIG_HEADER) clean-krextra: -rm -f ansi2knr mostlyclean-kr: -test "$U" = "" || rm -f *_.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/usleep.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a12scan$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comio$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctimez$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eph_cmd$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eph_err$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eph_io$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eph_iob$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eph_open$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eph_read$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epinfo$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exifscan$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filetime$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnames$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/photopc$U.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) '$<'` a12scan_.c: a12scan.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/a12scan.c; then echo $(srcdir)/a12scan.c; else echo a12scan.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ comio_.c: comio.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/comio.c; then echo $(srcdir)/comio.c; else echo comio.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ ctimez_.c: ctimez.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ctimez.c; then echo $(srcdir)/ctimez.c; else echo ctimez.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ eph_cmd_.c: eph_cmd.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/eph_cmd.c; then echo $(srcdir)/eph_cmd.c; else echo eph_cmd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ eph_err_.c: eph_err.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/eph_err.c; then echo $(srcdir)/eph_err.c; else echo eph_err.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ eph_io_.c: eph_io.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/eph_io.c; then echo $(srcdir)/eph_io.c; else echo eph_io.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ eph_iob_.c: eph_iob.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/eph_iob.c; then echo $(srcdir)/eph_iob.c; else echo eph_iob.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ eph_open_.c: eph_open.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/eph_open.c; then echo $(srcdir)/eph_open.c; else echo eph_open.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ eph_read_.c: eph_read.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/eph_read.c; then echo $(srcdir)/eph_read.c; else echo eph_read.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ epinfo_.c: epinfo.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/epinfo.c; then echo $(srcdir)/epinfo.c; else echo epinfo.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ exifscan_.c: exifscan.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/exifscan.c; then echo $(srcdir)/exifscan.c; else echo exifscan.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ filetime_.c: filetime.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/filetime.c; then echo $(srcdir)/filetime.c; else echo filetime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ fnames_.c: fnames.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fnames.c; then echo $(srcdir)/fnames.c; else echo fnames.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ getopt_.c: getopt.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ photopc_.c: photopc.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/photopc.c; then echo $(srcdir)/photopc.c; else echo photopc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ usleep_.c: usleep.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/usleep.c; then echo $(srcdir)/usleep.c; else echo usleep.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ a12scan_.$(OBJEXT) comio_.$(OBJEXT) ctimez_.$(OBJEXT) \ eph_cmd_.$(OBJEXT) eph_err_.$(OBJEXT) eph_io_.$(OBJEXT) \ eph_iob_.$(OBJEXT) eph_open_.$(OBJEXT) eph_read_.$(OBJEXT) \ epinfo_.$(OBJEXT) exifscan_.$(OBJEXT) filetime_.$(OBJEXT) \ fnames_.$(OBJEXT) getopt_.$(OBJEXT) photopc_.$(OBJEXT) \ usleep_.$(OBJEXT) : $(ANSI2KNR) install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | 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=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | 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-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; test -n "$(includedir)" || 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_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ 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) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(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) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(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) @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 $(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 -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-am all-am: Makefile $(ANSI2KNR) $(LIBRARIES) $(PROGRAMS) $(MANS) \ $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(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-binPROGRAMS clean-generic clean-krextra \ clean-libLIBRARIES mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-libLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 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 $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \ uninstall-libLIBRARIES uninstall-man uninstall-man: uninstall-man1 .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ clean-binPROGRAMS clean-generic clean-krextra \ clean-libLIBRARIES ctags dist dist-all dist-bzip2 dist-gzip \ dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ distclean distclean-compile distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-includeHEADERS install-info \ install-info-am install-libLIBRARIES install-man install-man1 \ 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-kr pdf \ pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-includeHEADERS \ uninstall-libLIBRARIES uninstall-man uninstall-man1 # 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: photopc-3.07/configure0000755000175000017500000061127011673670664011776 00000000000000#! /bin/sh # From configure.in Id: configure.in,v 1.27 2011/12/19 17:15:22 crosser Exp . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68. # # # 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. as_myself= 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" 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. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$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 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'" 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= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="eph_iob.c" # 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_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS INT32 INT16 LN_S AR RANLIB LIBPROGS RM MV LN ECHO PROGS ANSI2KNR U 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 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_dependency_tracking enable_termios with_default_device with_int16 with_int32 enable_lomemory with_rtprio enable_alarmed_read ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # 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}' 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 this package 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/PACKAGE] --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 _ACEOF fi if test -n "$ac_init_help"; then 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] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-termios do not use POSIX terminal control (e.g. for NeXT) --enable-lowmemory Build lowmemory model --enable-alarmed-read Use blocking read() in conjunction with alarm() instead of select() based (e.g. for BeOS) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-default-device=DEVNAME serial device name /dev/photopc --with-int16=TYPE integer type that is 16 bits autodetect --with-int32=TYPE integer type that is 32 bits autodetect --without-rtprio Do not use realtime priority 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 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 the package provider. _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 configure generated by GNU Autoconf 2.68 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; ${as_lineno_stack:+:} 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; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_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 \${$3+:} false; 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; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # 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 \${$3+:} false; 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; ${as_lineno_stack:+:} 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 (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; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else 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; ${as_lineno_stack:+:} 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 $as_me, which was generated by GNU Autoconf 2.68. 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 # 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 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 ${ac_cv_path_install+:} false; 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 ${ac_cv_prog_STRIP+:} false; 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 ${ac_cv_prog_ac_ct_STRIP+:} false; 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 ${ac_cv_path_mkdir+:} false; 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 ${ac_cv_prog_AWK+:} false; 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 \${ac_cv_prog_make_${ac_make}_set+:} false; 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=photopc VERSION=3.07 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 -' ac_config_headers="$ac_config_headers config.h dos/version.h win32/version.h" 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 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 ${ac_cv_prog_CC+:} false; 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 ${ac_cv_prog_ac_ct_CC+:} false; 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 ${ac_cv_prog_CC+:} false; 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 ${ac_cv_prog_CC+:} false; 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 ${ac_cv_prog_CC+:} false; 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 ${ac_cv_prog_ac_ct_CC+:} false; 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 ${ac_cv_objext+:} false; 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 ${ac_cv_c_compiler_gnu+:} false; 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 ${ac_cv_prog_cc_g+:} false; 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 ${ac_cv_prog_cc_c89+:} false; 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 ${am_cv_CC_dependencies_compiler_type+:} false; 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$ac_cv_c_compiler_gnu" = "Xyes"; then CFLAGS="$CFLAGS -Wall" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for function prototypes" >&5 $as_echo_n "checking for function prototypes... " >&6; } if test "$ac_cv_prog_cc_c89" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define PROTOTYPES 1" >>confdefs.h $as_echo "#define __PROTOTYPES 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&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 { $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 ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" 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 ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { 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 ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin 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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _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 if test "$ac_cv_prog_cc_stdc" != no; then U= ANSI2KNR= else U=_ ANSI2KNR=./ansi2knr fi # Ensure some checks needed by ansi2knr itself. for ac_header in string.h do : ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRING_H 1 _ACEOF fi 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 \${ac_cv_prog_make_${ac_make}_set+:} false; 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 # Extract the first word of "echo", so it can be a program name with args. set dummy echo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECHO+:} false; then : $as_echo_n "(cached) " >&6 else case $ECHO in [\\/]* | ?:[\\/]*) ac_cv_path_ECHO="$ECHO" # 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_ECHO="$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_ECHO" && ac_cv_path_ECHO="echo" ;; esac fi ECHO=$ac_cv_path_ECHO if test -n "$ECHO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECHO" >&5 $as_echo "$ECHO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "ln", so it can be a program name with args. set dummy ln; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LN+:} false; then : $as_echo_n "(cached) " >&6 else case $LN in [\\/]* | ?:[\\/]*) ac_cv_path_LN="$LN" # 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_LN="$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_LN" && ac_cv_path_LN="ln" ;; esac fi LN=$ac_cv_path_LN if test -n "$LN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LN" >&5 $as_echo "$LN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MV+:} false; then : $as_echo_n "(cached) " >&6 else case $MV in [\\/]* | ?:[\\/]*) ac_cv_path_MV="$MV" # 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_MV="$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_MV" && ac_cv_path_MV="mv" ;; esac fi MV=$ac_cv_path_MV if test -n "$MV"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MV" >&5 $as_echo "$MV" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_RM+:} false; then : $as_echo_n "(cached) " >&6 else case $RM in [\\/]* | ?:[\\/]*) ac_cv_path_RM="$RM" # 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_RM="$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_RM" && ac_cv_path_RM="rm" ;; esac fi RM=$ac_cv_path_RM if test -n "$RM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 $as_echo "$RM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; 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 ${ac_cv_prog_ac_ct_RANLIB+:} false; 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 # 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 ${ac_cv_path_AR+:} false; then : $as_echo_n "(cached) " >&6 else case $AR in [\\/]* | ?:[\\/]*) ac_cv_path_AR="$AR" # 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_AR="$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_AR" && ac_cv_path_AR="ar" ;; esac fi AR=$ac_cv_path_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 { $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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _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 sys/time.h sys/select.h unistd.h sched.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 termios.h termio.h sgtty.h utime.h sys/utime.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 signal.h do : ac_fn_c_check_header_mongrel "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" if test "x$ac_cv_header_signal_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIGNAL_H 1 _ACEOF fi done # Check whether --enable-termios was given. if test "${enable_termios+set}" = set; then : enableval=$enable_termios; fi if test X$enable_termios != Xno && test X$ac_cv_header_termios_h = Xyes; then $as_echo "#define USE_TERMIOS 1" >>confdefs.h elif test X$ac_cv_header_sgtty_h = Xyes; then $as_echo "#define USE_SGTTY 1" >>confdefs.h elif test X$ac_cv_header_termio_h = Xyes; then $as_echo "#define USE_TERMIO 1" >>confdefs.h else as_fn_error $? "No usable terminal control (neither of termios/sgtty/termio)" "$LINENO" 5 fi { $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 ${ac_cv_c_const+:} false; 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 ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h 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 ${ac_cv_type_signal+:} false; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for restartable system calls" >&5 $as_echo_n "checking for restartable system calls... " >&6; } if ${ac_cv_sys_restartable_syscalls+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = 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 $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Exit 0 (true) if wait returns something other than -1, i.e. the pid of the child, which means that wait was restarted after getting the signal. */ $ac_includes_default #include #ifdef HAVE_SYS_WAIT_H # include #endif /* Some platforms explicitly require an extern "C" signal handler when using C++. */ #ifdef __cplusplus extern "C" void ucatch (int dummy) { } #else void ucatch (dummy) int dummy; { } #endif int main () { int i = fork (), status; if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); return 0; } signal (SIGINT, ucatch); status = wait (&i); if (status == -1) wait (&i); return status == -1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_sys_restartable_syscalls=yes else ac_cv_sys_restartable_syscalls=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_sys_restartable_syscalls" >&5 $as_echo "$ac_cv_sys_restartable_syscalls" >&6; } if test $ac_cv_sys_restartable_syscalls = yes; then $as_echo "#define HAVE_RESTARTABLE_SYSCALLS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm has tm_gmtoff" >&5 $as_echo_n "checking whether struct tm has tm_gmtoff... " >&6; } if ${ac_cv_tm_gmtoff+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif int main () { struct tm stm; stm.tm_gmtoff=0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_tm_gmtoff=yes else ac_cv_tm_gmtoff=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tm_gmtoff" >&5 $as_echo "$ac_cv_tm_gmtoff" >&6; } if test X$ac_cv_tm_gmtoff = Xyes; then $as_echo "#define HAVE_TM_GMTOFF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct utimbuf is defined" >&5 $as_echo_n "checking whether struct utimbuf is defined... " >&6; } if ${ac_cv_have_utimbuf+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #ifdef HAVE_UTIME_H # include #else # ifdef HAVE_SYS_UTIME_H # include # endif #endif int main () { struct utimbuf utb; utb.actime=0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_have_utimbuf=yes else ac_cv_have_utimbuf=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_utimbuf" >&5 $as_echo "$ac_cv_have_utimbuf" >&6; } if test X$ac_cv_have_utimbuf = Xyes; then $as_echo "#define HAVE_UTIMBUF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether optarg is defined in headers" >&5 $as_echo_n "checking whether optarg is defined in headers... " >&6; } if ${ac_cv_optarg_defined+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef STDC_HEADERS #include #endif #ifdef HAVE_UNISTD_H #include #endif int main () { char *xxx; xxx=optarg; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_optarg_defined=yes else ac_cv_optarg_defined=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_optarg_defined" >&5 $as_echo "$ac_cv_optarg_defined" >&6; } if test X$ac_cv_optarg_defined = Xyes; then $as_echo "#define OPTARG_DEFINED 1" >>confdefs.h fi # 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 ${ac_cv_sizeof_short+:} false; 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 ${ac_cv_sizeof_int+:} false; 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 ${ac_cv_sizeof_long+:} false; 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 # Check whether --with-default_device was given. if test "${with_default_device+set}" = set; then : withval=$with_default_device; fi if test "X$with_default_device" != "Xno" && test "X$with_default_device" != "Xyes" && test "X$with_default_device" != "X"; then cat >>confdefs.h <<_ACEOF #define DEFAULT_DEVICE "$with_default_device" _ACEOF fi # Check whether --with-int16 was given. if test "${with_int16+set}" = set; then : withval=$with_int16; fi if test "X$with_int16" != "Xno" && test "X$with_int16" != "Xyes" && test "X$with_int16" != "X"; then INT16=$with_int16 else if test "X$ac_cv_sizeof_short" = "X2"; then INT16=short else if test "X$ac_cv_sizeof_int" = "X2"; then INT16=int fi fi fi # Check whether --with-int32 was given. if test "${with_int32+set}" = set; then : withval=$with_int32; fi if test "X$with_int32" != "Xno" && test "X$with_int32" != "Xyes" && test "X$with_int32" != "X"; then INT32=$with_int32 else if test "X$ac_cv_sizeof_long" = "X4"; then INT32=long else if test "X$ac_cv_sizeof_int" = "X4"; then INT32=int fi fi fi : ${INT16=unknown} : ${INT32=unknown} cat >>confdefs.h <<_ACEOF #define INT16 $INT16 _ACEOF cat >>confdefs.h <<_ACEOF #define INT32 $INT32 _ACEOF # Check whether --enable-lomemory was given. if test "${enable_lomemory+set}" = set; then : enableval=$enable_lomemory; $as_echo "#define LOWMEMORY 1" >>confdefs.h fi # Check whether --with-rtprio was given. if test "${with_rtprio+set}" = set; then : withval=$with_rtprio; fi if test "X$with_rtprio" != "Xno"; then $as_echo "#define USE_RTPRIO 1" >>confdefs.h fi # Check whether --enable-alarmed_read was given. if test "${enable_alarmed_read+set}" = set; then : enableval=$enable_alarmed_read; $as_echo "#define USE_ALARMED_READ 1" >>confdefs.h fi for ac_func in rename mkdir strerror strspn select 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 for ac_func in uname cfmakeraw sched_setscheduler nanosleep 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 for ac_func in snooze do : ac_fn_c_check_func "$LINENO" "snooze" "ac_cv_func_snooze" if test "x$ac_cv_func_snooze" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SNOOZE 1 _ACEOF fi done for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done for ac_func in strftime do : ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" if test "x$ac_cv_func_strftime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRFTIME 1 _ACEOF else # strftime is in -lintl on SCO UNIX. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 $as_echo_n "checking for strftime in -lintl... " >&6; } if ${ac_cv_lib_intl_strftime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $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 strftime (); int main () { return strftime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_strftime=yes else ac_cv_lib_intl_strftime=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_intl_strftime" >&5 $as_echo "$ac_cv_lib_intl_strftime" >&6; } if test "x$ac_cv_lib_intl_strftime" = xyes; then : $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h LIBS="-lintl $LIBS" fi fi done ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep" if test "x$ac_cv_func_usleep" = xyes; 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" "getopt" "ac_cv_func_getopt" if test "x$ac_cv_func_getopt" = xyes; then : $as_echo "#define HAVE_GETOPT 1" >>confdefs.h else case " $LIBOBJS " in *" getopt.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getopt.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" if test "x$ac_cv_func_strcasecmp" = xyes; then : else LIBOBJS="$LIBOBJS strcscmp.o" fi $as_echo "#define UNIX 1" >>confdefs.h if test $ac_cv_header_termios_h != yes; then as_fn_error $? "Cannot work without termios!" "$LINENO" 5 fi if test $ac_cv_func_vprintf != yes; then as_fn_error $? "Cannot work without v*printf() functions!" "$LINENO" 5 fi if test $INT16 = unknown; then as_fn_error $? "Cannot determine 16bit integer type!" "$LINENO" 5 fi if test $INT32 = unknown; then as_fn_error $? "Cannot determine 32bit integer type!" "$LINENO" 5 fi case $VERSION in *dev*) $as_echo "#define DEVVERSION 1" >>confdefs.h ;; esac # This is necessary so that .o files in LIBOBJS are also built via # the ANSI2KNR-filtering rules. LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'` if test "X$with_rtprio" = "Xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ***" >&5 $as_echo "***" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: *** \"photopc\" program must be setuid root to use realtime priority" >&5 $as_echo "*** \"photopc\" program must be setuid root to use realtime priority" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ***" >&5 $as_echo "***" >&6; } fi ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be 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 if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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= 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 "${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 : "${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. as_myself= 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 $as_me, which was generated by GNU Autoconf 2.68. 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 the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.68, 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" _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 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "dos/version.h") CONFIG_HEADERS="$CONFIG_HEADERS dos/version.h" ;; "win32/version.h") CONFIG_HEADERS="$CONFIG_HEADERS win32/version.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES 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= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_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 -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # 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 {' >"$ac_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 >>"\$ac_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 >>"\$ac_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 < "$ac_tmp/subs1.awk" > "$ac_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 >"$ac_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_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; 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="$ac_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 >"$ac_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 "$ac_tmp/subs.awk" \ >$ac_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' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' 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 "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_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 "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_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 } ;; 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 photopc-3.07/ChangeLog0000644000175000017500000000000011673670756011622 00000000000000photopc-3.07/a12scan.c0000644000175000017500000000610206751136766011454 00000000000000#ifndef LINT static char *rcsid="$Id: a12scan.c,v 1.13 1999/08/01 21:36:54 crosser Exp $"; #endif /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: a12scan.c,v $ Revision 1.13 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 1.12 1999/03/10 22:34:43 crosser make app12 and exif scanning in different files Revision 1.11 1999/03/06 13:37:08 crosser Convert to autoconf-style Revision 1.10 1999/03/06 10:24:16 crosser support Exif Revision 1.9 1999/02/28 22:40:48 crosser Support Exif file format Revision 1.8 1998/11/20 20:14:27 crosser scan APP12 block without vendor name section Revision 1.7 1998/11/19 11:04:31 crosser do cleaner if "not found" Revision 1.6 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 1.5 1998/08/08 22:16:33 crosser Make jscan return the complete app12 contents, don't skip vendor info Revision 1.4 1998/02/08 19:58:38 crosser Support low memory: chunked saving etc. Revision 1.3 1998/01/18 02:16:45 crosser DOS support Revision 1.2 1997/12/24 00:19:13 crosser check return value from jscan Revision 1.1 1997/08/17 08:59:54 crosser Initial revision */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #ifdef STDC_HEADERS #include #include #endif #include "a12scan.h" int a12scan(unsigned char **buf,off_t *bufsize) { unsigned char *p; off_t length=0; p=*buf; while (p < ((*buf)+(*bufsize))) { while ((p < ((*buf)+(*bufsize))) && (*p != 0xff)) p++; while ((p < ((*buf)+(*bufsize))) && (*p == 0xff)) p++; if (*p == 0xD8) continue; length=(p[1]<<8)+p[2]; if (*p == 0xec) { p+=3; length-=3; break; } p+=length; } if (p >= ((*buf)+(*bufsize))) { (*bufsize)=0; (*buf)=NULL; return -1; } (*bufsize)=length; (*buf)=p; return 0; } unsigned char * a12search(char *key,unsigned char *buf,off_t bufsize) { unsigned char *p=buf; /* skip company name which is model-dependant */ while ((p < (buf+bufsize)) && (*p)) p++; while ((p < (buf+bufsize)) && (*p == '\0')) p++; if (p >= (buf+bufsize)) p=buf; while (p < (buf+bufsize)) { if (strncmp(p,key,strlen(key)) == 0) break; while ((p < (buf+bufsize)) && (*p != '\n')) p++; p++; } if (p >= (buf+bufsize)) return NULL; if (*(p+strlen(key)) != '=') return NULL; return p+strlen(key)+1; } void a12dump(unsigned char *buf,off_t bufsize) { unsigned char *p=buf; printf("%s\n",p); while ((p < (buf+bufsize)) && (*p)) p++; while ((p < (buf+bufsize)) && (*p == '\0')) p++; printf("%s\n",p); } photopc-3.07/acconfig.h0000644000175000017500000000431307133532273011770 00000000000000/* $Id: acconfig.h,v 1.9 2000/07/14 06:35:39 crosser Exp $ */ /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: acconfig.h,v $ Revision 1.9 2000/07/14 06:35:39 crosser reportedly some models return CAN instead of DC1 Revision 1.8 2000/05/09 13:20:54 crosser configure read() with alarm() better. Address signed vs. unsigned arguments other cleanups to make most notorious compilers happy Revision 1.7 2000/02/04 22:31:56 crosser Clean up things dealing with folder tree recursion. Fixed log entry in acconfig.h that conflicted with "configure" Revision 1.6 2000/02/01 22:04:15 crosser xchdir() function iterates thru path elements define a variable for extra verbosity Revision 1.5 1999/12/11 14:10:15 crosser Support sgtty terminal control Proper "fake speed" handling (needed two values) Revision 1.4 1999/11/17 13:48:08 crosser check if need to include getopt.h Revision 1.3 1999/11/09 18:55:03 crosser work on windows version Revision 1.2 1999/08/01 23:28:06 crosser add RTPRIO Revision 1.1 1999/07/29 06:48:17 crosser Initial revision */ /* Integer 16bit type */ #undef INT16 /* Integer 3bit type */ #undef INT32 /* Platform definition */ #undef UNIX #undef MSWINDOS #undef DOS /* Low memory model */ #undef LOWMEMORY /* Realtime priority */ #undef USE_RTPRIO /* struct tm has tm_gmtoff member */ #undef HAVE_TM_GMTOFF /* headers contain definition of optarg */ #undef OPTARG_DEFINED /* terminal control type */ #undef USE_TERMIOS #undef USE_SGTTY #undef USE_TERMIO /* is struct utimbuf defined in sys/utime.h */ #undef HAVE_UTIMBUF /* use blocking read() in conjunction with alarm() instead of select() */ #undef USE_ALARMED_READ /* devine for development versions - extra verbosity */ #undef DEVVERSION /* default device name */ #undef DEFAULT_DEVICE photopc-3.07/eph_cmd.c0000644000175000017500000002350607342634761011625 00000000000000#ifndef LINT static char *rcsid="$Id: eph_cmd.c,v 1.20 2001/08/28 06:28:01 crosser Exp $"; #endif /* Copyright (c) 1997-2000 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: eph_cmd.c,v $ Revision 1.20 2001/08/28 06:28:01 crosser try make zoom working on newer Oly Revision 1.19 2000/05/09 13:20:54 crosser configure read() with alarm() better. Address signed vs. unsigned arguments other cleanups to make most notorious compilers happy Revision 1.18 2000/05/02 22:26:35 crosser A few things incorporated from John Bowman's Nikon specific diffs Revision 1.17 2000/05/02 12:13:32 crosser some better debugging output alarm() based timeouted read (build with "--without-select") Revision 1.16 2000/02/13 11:15:01 crosser Kludge null setint for Nikon Revision 1.15 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 1.14 1999/07/28 19:56:31 crosser reorder includes Revision 1.13 1999/03/21 20:22:09 crosser change retry logic for first block (for Agfa 307) Revision 1.12 1999/03/06 13:37:08 crosser Convert to autoconf-style Revision 1.11 1999/01/21 09:12:56 crosser fix of retry logic from Richard Sharman Revision 1.10 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 1.9 1998/08/09 13:24:59 crosser cleanup for DOS Revision 1.8 1998/08/09 12:57:56 crosser make right running report on 16bit architecture Revision 1.7 1998/02/26 00:50:39 crosser extra error message Revision 1.6 1998/02/16 06:15:44 lightner Parameterize tmpbuf size; fix tmpbuf memory leak Revision 1.5 1998/02/08 19:58:38 crosser Support low memory: chunked saving etc. Revision 1.4 1998/02/05 23:29:17 lightner Force 32-bit math in eph_getint() Only realloc() an extra 2048 bytes when buffer too small (DOS only) Revision 1.3 1998/01/27 21:52:23 crosser add NANOSLEEP Revision 1.2 1998/01/18 02:16:45 crosser DOS support Revision 1.1 1997/08/17 08:59:54 crosser Initial revision */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "eph_io.h" #include "eph_priv.h" #define TMPBUF_SIZE (2048) #define MAYRETRY(rc) ((rc == -2) || (rc == NAK)) int eph_writecmd(eph_iob *iob,char *data,size_t length) { return eph_writepkt(iob,PKT_CMD,SEQ_CMD,data,length); } int eph_writeicmd(eph_iob *iob,char *data,size_t length) { return eph_writepkt(iob,PKT_CMD,SEQ_INITCMD,data,length); } int eph_setispeed(eph_iob *iob,long val) { unsigned char buf[6]; int rc; int count=0; buf[0]=CMD_SETINT; buf[1]=REG_SPEED; buf[2]=(val)&0xff; buf[3]=(val>>8)&0xff; buf[4]=(val>>16)&0xff; buf[5]=(val>>24)&0xff; do { if ((rc=eph_writeicmd(iob,buf,6))) return rc; rc=eph_waitack(iob,ACKTIMEOUT); } while (rc && (count++ < RETRIES)); if (count >= RETRIES) eph_error(iob,ERR_EXCESSIVE_RETRY, "excessive retries on setispeed"); if (iob->debug) printf("setispeed(%ld) rc=%d\n",val,rc); return rc; } int eph_setint(eph_iob *iob,int reg,long val) { unsigned char buf[6]; int rc; int count=0; buf[0]=CMD_SETINT; buf[1]=reg; buf[2]=(val)&0xff; buf[3]=(val>>8)&0xff; buf[4]=(val>>16)&0xff; buf[5]=(val>>24)&0xff; writeagain: if ((rc=eph_writecmd(iob,buf,6))) return rc; rc=eph_waitack(iob,(reg == REG_FRAME)?BIGACKTIMEOUT:ACKTIMEOUT); if (MAYRETRY(rc) && (count++ < RETRIES)) goto writeagain; if (count >= RETRIES) eph_error(iob,ERR_EXCESSIVE_RETRY, "excessive retries on setint"); if (iob->debug) printf("setint(%d,%ld) rc=%d\n",reg,val,rc); return rc; } int eph_setnullint(eph_iob *iob,int reg) { unsigned char buf[2]; int rc; int count=0; buf[0]=CMD_SETINT; buf[1]=reg; writeagain: if ((rc=eph_writecmd(iob,buf,2))) return rc; rc=eph_waitack(iob,(reg == REG_FRAME)?BIGACKTIMEOUT:ACKTIMEOUT); if (MAYRETRY(rc) && (count++ < RETRIES)) goto writeagain; if (count >= RETRIES) eph_error(iob,ERR_EXCESSIVE_RETRY, "excessive retries on setnullint"); if (iob->debug) printf("setnullint(%d) rc=%d\n",reg,rc); return rc; } int eph_getint(eph_iob *iob,int reg,long *val) { unsigned char buf[4]; eph_pkthdr pkt; int rc; size_t size=4; int count=0; (*val)=0L; buf[0]=CMD_GETINT; buf[1]=reg; writeagain: if ((rc=eph_writecmd(iob,buf,2))) return rc; readagain: rc=eph_readpkt(iob,&pkt,buf,&size,BIGDATATIMEOUT); if (MAYRETRY(rc) && (count++ < RETRIES)) goto writeagain; if ((rc == 0) && (pkt.typ == PKT_LAST) && (pkt.seq == 0)) { (*val)=((unsigned long)buf[0]) | ((unsigned long)buf[1]<<8) | ((unsigned long)buf[2]<<16) | ((unsigned long)buf[3]<<24); eph_writeack(iob); rc=0; goto fin; } else if ((rc == -1) && (count++ < RETRIES)) { eph_writenak(iob); goto readagain; } if (count >= RETRIES) eph_error(iob,ERR_EXCESSIVE_RETRY, "excessive retries on getint"); fin: if (iob->debug) printf("getint(%d)=%ld, rc=%d\n",reg,*val,rc); return rc; } int eph_action(eph_iob *iob,int reg,char *val,size_t length) { unsigned char buf[2050]; int rc; int count=0; if (length > (sizeof(buf) - 2)) { eph_error(iob,ERR_DATA_TOO_LONG,"arg action length %ld", (long)length); return -1; } buf[0]=CMD_ACTION; buf[1]=reg; memcpy(buf+2,val,length); writeagain: if ((rc=eph_writecmd(iob,buf,length+2))) return rc; rc=eph_waitack(iob,ACKTIMEOUT); if (MAYRETRY(rc) && (count++ < RETRIES)) goto writeagain; if (rc == 0) rc=eph_waitcomplete(iob); if (count >= RETRIES) eph_error(iob,ERR_EXCESSIVE_RETRY, "excessive retries on action"); if (iob->debug) printf("action(%d,%p(0x%02x),%u) rc=%d\n", reg,val, (length==1)?(val[0]&0xff):0, (unsigned int)length,rc); return rc; } int eph_setvar(eph_iob *iob,int reg,char *val,off_t olength) { unsigned char buf[2048]; int rc=0,seq=-1; int count=0; int pkttyp,pktseq; size_t pktsize,maywrite; off_t written=0; off_t length=olength; unsigned char *getpoint,*putpoint; getpoint=val; while (length && !rc) { if (seq == -1) { pkttyp=PKT_CMD; pktseq=SEQ_CMD; buf[0]=CMD_SETVAR; buf[1]=reg; putpoint=buf+2; maywrite=sizeof(buf)-2; pktsize=2; } else { pkttyp=PKT_DATA; pktseq=seq; putpoint=buf; maywrite=sizeof(buf); pktsize=0; (iob->runcb)(written); } if ((size_t)length <= maywrite) { maywrite=length; if (pkttyp == PKT_DATA) pkttyp=PKT_LAST; } memcpy(putpoint,getpoint,maywrite); pktsize+=maywrite; length-=maywrite; getpoint+=maywrite; written+=maywrite; seq++; writeagain: if ((rc=eph_writepkt(iob,pkttyp,pktseq,buf,pktsize))) goto fin; rc=eph_waitack(iob,(reg==REG_ZOOM)?BIGACKTIMEOUT:ACKTIMEOUT); if (MAYRETRY(rc) && (count++ < RETRIES)) goto writeagain; } if (count >= RETRIES) eph_error(iob,ERR_EXCESSIVE_RETRY, "excessive retries on setvar"); fin: if (iob->debug) printf("setvar(%d,\"%.60s\",%lu) rc=%d\n", reg,val,(unsigned long)olength,rc); return rc; } int eph_getvar(eph_iob *iob,int reg,char **buffer,off_t *bufsize) { unsigned char buf[2]; eph_pkthdr pkt; int rc; int count=0; unsigned char expect=0; off_t index; size_t readsize; char *ptr; char *tmpbuf=NULL; size_t tmpbufsize=0; if ((buffer == NULL) && (iob->storecb == NULL)) { eph_error(iob,ERR_BADARGS, "NULL buffer and no store callback for getvar"); return -1; } if (buffer == NULL) { tmpbuf=(iob->realloccb)(NULL,(size_t)TMPBUF_SIZE); tmpbufsize=TMPBUF_SIZE; if (tmpbuf == NULL) { eph_error(iob,ERR_NOMEM, "could not alloc %lu for tmpbuf in getvar", (long)TMPBUF_SIZE); return -1; } } buf[0]=CMD_GETVAR; buf[1]=reg; writeagain: if ((rc=eph_writecmd(iob,buf,2))) return rc; index=0; readagain: if (buffer) { /* read to memory reallocating it */ if (((*bufsize) - index) < 2048) { if (iob->debug) printf("reallocing %lu",(unsigned long)(*bufsize)); #ifdef LOWMEMORY /* small memory! round up to next 2048 boundary */ (*bufsize)=(((index + 2048)-1)/2048L+1)*2048L; #else /* multiply current size by 2 and round up to 2048 boundary */ (*bufsize)=((((*bufsize)*2)-1)/2048+1)*2048; #endif if (iob->debug) printf(" -> %lu\n",(unsigned long)(*bufsize)); (*buffer)=(iob->realloccb)(*buffer,(size_t)*bufsize); if ((*buffer) == NULL) { eph_error(iob,ERR_NOMEM, "could not realloc %lu for getvar", (long)*bufsize); return -1; } } ptr=(*buffer)+index; readsize=(*bufsize)-index; } else { /* pass data to store callback */ ptr=tmpbuf; readsize=tmpbufsize; } rc=eph_readpkt(iob,&pkt,ptr,&readsize, (expect || ((reg != REG_IMG) || (reg != REG_TMN)))? DATATIMEOUT:BIGDATATIMEOUT); if (MAYRETRY(rc) && (expect == 0) && (count++ < RETRIES)) { eph_writenak(iob); if (rc == -2) goto readagain; else goto writeagain; } if ((rc == 0) && ((pkt.seq == expect) || (pkt.seq == (expect-1)))) { count=0; if (pkt.seq == expect) { index+=readsize; expect++; (iob->runcb)(index); if (buffer == NULL) { if (iob->debug) printf("storing %lu at %08lx\n", (unsigned long)readsize, (unsigned long)ptr); if ((iob->storecb)(ptr,readsize)) return -1; } } eph_writeack(iob); if (pkt.typ == PKT_LAST) { if (buffer) (*bufsize)=index; if (tmpbuf) free(tmpbuf); return 0; } else goto readagain; } if ((rc <= 0) && (count++ < RETRIES)) { eph_writenak(iob); goto readagain; } if (tmpbuf) free(tmpbuf); if (count >= RETRIES) eph_error(iob,ERR_EXCESSIVE_RETRY, "excessive retries on getvar"); if (iob->debug) printf("getvar(%d) got %lu, rc=%d\n", reg,(unsigned long)(*bufsize),rc); return rc; } photopc-3.07/comio.c0000644000175000017500000003722106612365243011326 00000000000000#ifndef LINT static char *rcsid="$Id: comio.c,v 1.3 1998/10/18 13:18:27 crosser Exp $"; #endif /* $Log: comio.c,v $ Revision 1.3 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 1.2 1998/08/01 13:12:41 lightner Four com ports support Revision 1.1 1998/01/18 02:16:45 crosser Initial revision */ #include #include #define MDMDAT1 0x03F8 /* Address of modem port 1 data */ #define MDMCOM1 0x03FB /* Address of modem port 1 command */ #define MDMSTS1 0x03FD /* Address of modem port 1 status */ #define MDMDAT2 0x02F8 /* Address of modem port 2 data */ #define MDMCOM2 0x02FB /* Address of modem port 2 command */ #define MDMSTS2 0x02FD /* Address of modem port 2 status */ #define MDMDAT3 0x03E8 /* Address of modem port 3 data */ #define MDMCOM3 0x03EB /* Address of modem port 3 command */ #define MDMSTS3 0x03ED /* Address of modem port 3 status */ #define MDMDAT4 0x02E8 /* Address of modem port 4 data */ #define MDMCOM4 0x02EB /* Address of modem port 4 command */ #define MDMSTS4 0x02ED /* Address of modem port 4 status */ #define MDMINTV 0x000C /* Com 1 interrupt vector */ #define MDINTV2 0x000B /* Com 2 interrupt vector */ #define MDMINTO 0x0EF /* Mask to enable IRQ3 for port 1 */ #define MDINTO2 0x0F7 /* Mask to enable IRQ4 for port 2 */ #define MDMINTC 0x010 /* Mask to Disable IRQ4 for port 1 */ #define MDINTC2 0x008 /* Mask to Disable IRQ3 for port 2 */ #define INTCONT 0x0021 /* 8259 interrupt controller ICW2-3 */ #define INTCON1 0x0020 /* Address of 8259 ICW1 */ #define COM_BUFF_SIZE 2048 /* Communications port buffer size */ #define XOFFPT COM_BUFF_SIZE*3/4 /* chars in buff before sending XOFF */ #define XONPT COM_BUFF_SIZE*1/4 /* chars in buff to send XON after XOFF */ #define XOFF 0x13 /* XOFF value */ #define XON 0x11 /* XON value */ /*****************************************************************************/ /* function prototypes */ void TTinit(int port, long speed);/* Initialize the communications system */ int ttopen(); /* Open a port for communications */ int ttclose( void ); /* Close the communications port */ int ttchk( void ); /* Return count of received characters */ void ttoc( unsigned char ); /* Output a character to the com port */ int ttinc( void ); /* Input a character from circular buffer */ void ttflui( void ); /* Flush circular buffer of characters */ int dobaud( long ); /* Set the baud rate for the port */ void coms( int ); /* Establish modem data */ void serini( void ); /* Initialize the com port for interrupts */ void serrst( void ); /* Reset the com port to original settings */ void interrupt serint( void ); /* Com port receiver ISR */ /*****************************************************************************/ /* Global Data */ unsigned int port; /* COM port */ long speed; /* BAUD rate */ char parity[5]; /* Parity setting */ unsigned int databits; /* Number of Data bits */ unsigned int stopbits; /* Number of Stop bits */ /*****************************************************************************/ /* External variables */ /*****************************************************************************/ /* Local Static Data */ static char buffer[COM_BUFF_SIZE];/* Circular buffer */ static char *inptr; /* Pointer to input point of circular buff*/ static char *outptr; /* Pointer to output point of circular buff*/ static int count = 0; /* Number of characters in buffer */ struct mdminfo { /* struct to hold current com port info */ unsigned int mddat; /* 8250 data register */ unsigned int mdstat; /* 8250 line-status register */ unsigned int mdcom; /* 8250 line-control register */ unsigned char mden; /* 8259 IRQ enable mask */ unsigned char mddis; /* 8259 IRQ disable mask */ unsigned char mdintv; /* Interrupt for selected com port */ } modem ; void interrupt (*oldvec)(); /* Vector of previous com interrupt */ int portin = 0; /* Flag to indicate com port is open */ int xofsnt = 0; /* Flag to indicate an XOFF transmitted */ int xofrcv = 0; /* Flag to indicate an XOFF received */ /*****************************************************************************/ /* T T I N I T -- Initialize the communications system */ void TTinit(int new_port, long new_speed) { port = new_port; speed = new_speed; strcpy(parity,"NONE"); databits = 8; stopbits = 0; } /* T T O P E N -- Open the communications port */ ttopen() { if (portin == 0) { /* Ignore call if already open */ switch (port) { case 1: coms(1); /* COM 1 */ break; case 2: coms(2); /* COM 2 */ break; case 3: coms(3); /* COM 3 */ break; case 4: coms(4); /* COM 4 */ break; default: /* others not supported, return error */ return(-1); } dobaud(speed); /* Set baud rate */ serini(); /* enable interrupt handler */ } return(0); /* return success */ } /* T T C L O S E -- Close the communications port */ ttclose() { if (portin != 0) /* Ignore if port is already closed */ serrst(); /* otherwise disable interrupts */ return(0); /* return success */ } /* T T C H K -- Return a count of characters at the serial port */ ttchk() { return( count ); /* return maintained count */ } /* T T O C -- Output a character to the current serial port */ void ttoc( unsigned char c ) { while( (inportb(modem.mdstat) & 0x20) == 0 ) ; /* Wait til transmitter is ready */ outportb(modem.mddat,c); /* then output the character */ } /* T T F L U I -- Clear the input buffer of characters */ void ttflui() { #ifdef XONXOFF if (xofsnt){ /* Check if XON should be sent after XOFF */ xofsnt = 0; /* if so then reset XOFF sent status */ ttoc(XON); /* and send the XON */ } #endif disable(); /* NO interrupts allowed now */ inptr = outptr = buffer; /* Reset input out output pointers */ count = 0; /* Set received characters count to 0 */ enable(); /* Now interrupts are ok */ } /* T T I N C -- Read a character from serial ports circular buffer */ ttinc() { int c; register char * ptr; #ifdef XONXOFF if (count < XONPT && xofsnt){ /* Check if XON should be sent after XOFF */ xofsnt = 0; /* if so then reset XOFF sent status */ ttoc(XON); /* and send the XON */ } #endif while (count == 0) /* If no characters have arrived then */ ; /* wait til one arrives */ ptr = outptr; /* Save address of buffer output point */ c = *ptr++; /* Get this character and increment ptr */ /* See if circular buff should be wrapped */ if (ptr == &buffer[COM_BUFF_SIZE]) ptr = buffer; /* if so then save new output point */ disable(); /* NO interrupts allowed now */ outptr = ptr; /* Save the address of output point */ count--; /* Decrement count of received characters */ enable(); /* Interrupts can continue now */ return(c); /* Return the received character */ } /* D O B A U D -- Set the baud rate for the current port */ dobaud( long baudrate ) { unsigned char portval; unsigned char blo, bhi; switch (baudrate) { /* Get 8250 baud rate divisor values */ case 50: bhi = 0x9; blo = 0x00; break; case 75: bhi = 0x6; blo = 0x00; break; case 110: bhi = 0x4; blo = 0x17; break; case 150: bhi = 0x3; blo = 0x00; break; case 300: bhi = 0x1; blo = 0x80; break; case 600: bhi = 0x0; blo = 0xC0; break; case 1200: bhi = 0x0; blo = 0x60; break; case 1800: bhi = 0x0; blo = 0x40; break; case 2000: bhi = 0x0; blo = 0x3A; break; case 2400: bhi = 0x0; blo = 0x30; break; case 4800: bhi = 0x0; blo = 0x18; break; case 9600: bhi = 0x0; blo = 0x0C; break; case 19200: bhi = 0x0; blo = 0x06; break; case 38400: bhi = 0x0; blo = 0x03; break; case 57600: bhi = 0x0; blo = 0x02; break; case 115200: bhi = 0x0; blo = 0x01; break; default: /* Return failure if baud unsupported */ return(-1); } portval = inportb(modem.mdcom);/* Save current value of command register */ /* In order to set the baud rate the */ /* high bit of command data register is */ outportb(modem.mdcom,portval | 0x80 ); /* set before sending baud data */ outportb(modem.mddat,blo); /* Set LSB Baud-Rate divisor for baud */ outportb(modem.mddat + 1,bhi); /* Set MSB Baud-Rate divisor for baud */ outportb(modem.mdcom,portval); /* Reset original command register value */ return(0); /* Return success */ } /* C O M S -- Set up the modem structure for the specified com port */ void coms( int portid ) { if (portid == 1) { /* Port data for COM 1 */ modem.mddat = MDMDAT1; /* Port 1 Data register */ modem.mdstat = MDMSTS1; /* Port 1 Status register */ modem.mdcom = MDMCOM1; /* Port 1 Command register */ modem.mddis = MDMINTC; /* Port 1 8259 IRQ4 disable mask */ modem.mden = MDMINTO; /* Port 1 8259 IRQ4 enable mask */ modem.mdintv = MDMINTV; /* Port 1 interrupt number */ } else if (portid == 2) { /* Port data for COM 2 */ modem.mddat = MDMDAT2; /* Port 2 Data register */ modem.mdstat = MDMSTS2; /* Port 2 Status register */ modem.mdcom = MDMCOM2; /* Port 2 Command register */ modem.mddis = MDINTC2; /* Port 2 8259 IRQ4 disable mask */ modem.mden = MDINTO2; /* Port 2 8259 IRQ4 enable mask */ modem.mdintv = MDINTV2; /* Port 2 interrupt number */ } else if (portid == 3) { /* Port data for COM 3 */ modem.mddat = MDMDAT3; /* Port 3 Data register */ modem.mdstat = MDMSTS3; /* Port 3 Status register */ modem.mdcom = MDMCOM3; /* Port 3 Command register */ modem.mddis = MDMINTC; /* Port 3 8259 IRQ4 disable mask */ modem.mden = MDMINTO; /* Port 3 8259 IRQ4 enable mask */ modem.mdintv = MDMINTV; /* Port 3 interrupt number */ } else if (portid == 4) { /* Port data for COM 4 */ modem.mddat = MDMDAT4; /* Port 4 Data register */ modem.mdstat = MDMSTS4; /* Port 4 Status register */ modem.mdcom = MDMCOM4; /* Port 4 Command register */ modem.mddis = MDINTC2; /* Port 4 8259 IRQ4 disable mask */ modem.mden = MDINTO2; /* Port 4 8259 IRQ4 enable mask */ modem.mdintv = MDINTV2; /* Port 4 interrupt number */ } } /* S E R I N I -- initialize the serial port for interrupts */ void serini() { unsigned char portval; if (portin == 0) { /* Ignore if already open */ portin = 1; /* save port open status */ inptr = outptr = buffer; /* set circular buffer pointers */ count = 0; /* indicate no characters received */ oldvec=getvect(modem.mdintv);/* save old com interrupt */ setvect(modem.mdintv,serint);/* set SERINT as communications ISR */ portval = 0; /* Byte value to output to the Line */ /* Control Register (LCR) to set the */ /* Parity, Stopbits, Databits */ /* Start out with all bits zero */ if (strcmp(parity,"EVEN") == 0) portval |= 0x8; /* Set bit 3 on for odd parity */ else if (strcmp(parity,"ODD") == 0) portval |= 0x18; /* Set bits 3 and 4 on for even parity */ /* Leave bits 3 and 4 off for no parity */ if (stopbits == 2) /* Set bit 2 on if 2 Stopbits are used */ portval |= 0x4; /* Leave bit 2 off for 1 Stopbit */ if (databits == 6) /* Set bit 0 on for 6 data bits */ portval |= 0x1; else if (databits == 7) /* Set bit 1 on for 7 data bits */ portval |= 0x2; else if (databits == 8) /* Set bits 0 and 1 on for 8 data bits */ portval |= 0x3; /* Leave bits 0 and 1 off for 5 data bits */ outportb(modem.mdcom,portval); /* Output the settings to the LCR */ outportb(modem.mdcom + 1,0xb); /* Assert OUT2, RTS, DTR */ inportb(modem.mddat); /* Clear any left over characters */ outportb(modem.mddat+1,0x1); /* Enable receiver interrupts */ portval = inportb(INTCONT); /* Read 8259 interrupt enable mask */ outportb(INTCONT,modem.mden & portval); /*Set bit on for com IRQ */ } } /* S E R R S T -- Reset serial port interrupts */ void serrst() { unsigned char portval; if (portin != 0) { /* Ignore if interrupts already disabled */ portin = 0; /* save port closed status */ portval = inportb(INTCONT); /* Read 8259 interrupt enable mask */ outportb(INTCONT,modem.mddis | portval);/*Set bit off for com IRQ */ setvect(modem.mdintv,oldvec); /* return original interrupt vector */ } } /* S E R I N T -- Serial interrupt handler, recieves incoming characters */ void interrupt serint() { more: *inptr++=inportb(modem.mddat);/* Quickly read arriving character */ count++; /* Increment received count */ #ifdef XONXOFF if (count > XOFFPT && xofsnt != 1){ /* If buffer almost full then */ ttoc(XOFF); /* send an XOFF */ xofsnt = 1; /* and save XOFF sent status */ } #endif disable(); /* NO interrupts are allowed while */ /* new input pointer is stored */ if (inptr == &buffer[COM_BUFF_SIZE]) /* At end of circular buff? */ inptr = buffer; /* if so then save new output point */ enable(); /* Interrupts ok now */ #define LAST_LOOK #ifdef LAST_LOOK if (inportb(modem.mddat + 5) & 1) /* another character ready? */ goto more; #endif outportb(0x20,0x20); /* send End Of Interrupt to 8259 */ } photopc-3.07/dos/0000755000175000017500000000000011673670767010731 500000000000000photopc-3.07/dos/version.h0000644000175000017500000000025111673670267012500 00000000000000/* dos/version.h. Generated from version.h.in by configure. */ /* Name of package */ #define PACKAGE "photopc" /* Version number of package */ #define VERSION "3.07" photopc-3.07/dos/version.h.in0000644000175000017500000000012506755230062013073 00000000000000/* Name of package */ #undef PACKAGE /* Version number of package */ #undef VERSION photopc-3.07/dos/Makefile0000644000175000017500000001262706751153452012305 00000000000000# $Id: Makefile,v 2.9 1999/08/01 23:24:26 crosser Exp $ # # Copyright (c) 1997,1998 Eugene G. Crosser # Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) # # You may distribute and/or use for any purpose modified or unmodified # copies of this software if you preserve the copyright notice above. # # THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY # KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE # COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE # USE OF THIS SOFTWARE. # # $Log: Makefile,v $ # Revision 2.9 1999/08/01 23:24:26 crosser # DOS make in subdirectory # # Revision 2.8 1999/03/22 06:08:44 lightner # Fix logic to put ALL binaries into msdos/ # Add extra library to keep DOS link command line short # # Revision 2.7 1999/03/12 10:37:13 crosser # try workaround a problem with tmake # # Revision 2.6 1999/03/12 10:19:17 crosser # add ctrl-Z in the end # # Revision 2.5 1999/03/12 10:06:23 crosser # make usable with tc1.0 # # Revision 2.4 1999/03/10 22:34:43 crosser # sync with structure changes # # Revision 2.3 1999/01/17 13:27:59 bruce # make win/dos versions in separate subdirs # # Revision 2.2 1998/10/18 13:18:27 crosser # Put RCS logs and I.D. into the source # # Revision 2.1 1998/02/16 06:13:29 lightner # Add $(MODEL) and change to "small"; improve cleanup logic # # Revision 2.0 1998/02/13 23:01:50 crosser # remove $@ for work with make from TC1.0 # # Revision 1.2 1998/02/08 19:58:38 crosser # Support low memory: chunked saving etc. # # Revision 1.1 1998/01/18 02:16:45 crosser # Initial revision # # Modified by Bruce D. Lightner (lightner@lightner.net) on 1/8/98 to # support builds under Borland International Turbo C++ Version 3.0. # # To "make" using Borland International's Turbo C++ toolset, ensure that # your PATH points to the proper Turbo C++ binary directory, then enter # the following commands: # # make gclean # make srcdir = .. OPTS = -DHAVE_CONFIG_H CC = tcc #MODEL = -ml MODEL = -ms CFLAGS = $(MODEL) -O2 -G -wsus -wpar LD = tlink LDFLAGS = $(MODEL) -M AR = tlib # "-I." go first to include right config.h ! INC = -I. -I$(srcdir) ##### No need to touch anything below this line ##### LIBOBJS = eph_read.obj eph_iob.obj eph_err.obj eph_cmd.obj \ eph_io.obj eph_open.obj getopt.obj usleep.obj \ strcscmp.obj comio.obj LIBLIST1=+eph_read.obj+eph_iob.obj+eph_err.obj+eph_cmd.obj LIBLIST2=+eph_io.obj+eph_open.obj+getopt.obj+usleep.obj LIBLIST3=+strcscmp.obj+comio.obj LIB2OBJS=a12scan.obj fnames.obj ctimez.obj filetime.obj \ exifscan.obj LIB2LIST1=+a12scan.obj+fnames.obj+ctimez.obj+filetime.obj LIB2LIST2=+exifscan.obj .c.obj: $(CC) $(CFLAGS) $(OPTS) $(INC) -c $< all: eph_io.lib photopc.exe epinfo.exe eph_io.lib: $(LIBOBJS) del eph_io.lib $(AR) eph_io.lib $(LIBLIST1) $(AR) eph_io.lib $(LIBLIST2) $(AR) eph_io.lib $(LIBLIST3) del eph_io.bak ephextra.lib: $(LIB2OBJS) del ephextra.lib $(AR) ephextra.lib $(LIB2LIST1) $(AR) ephextra.lib $(LIB2LIST2) del ephextra.bak photopc.exe: photopc.obj eph_io.lib ephextra.lib $(CC) $(LDFLAGS) photopc.obj eph_io.lib ephextra.lib epinfo.exe: epinfo.obj eph_io.lib ephextra.lib $(CC) $(LDFLAGS) epinfo.obj eph_io.lib ephextra.lib tidyup: del ephextra.lib del ephextra.bak del eph_io.bak del *.map del *.obj clean: tidyup del eph_io.lib del photopc.exe del epinfo.exe rmdir $(T) MKOBJ = $(CC) $(CFLAGS) $(OPTS) $(INC) -c photopc.obj: $(srcdir)/photopc.c $(srcdir)/eph_io.h $(srcdir)/a12scan.h $(srcdir)/fnames.h $(srcdir)/ctimez.h $(srcdir)/filetime.h $(srcdir)/getopt.h $(srcdir)/strcscmp.h $(MKOBJ) -ophotopc.obj $(srcdir)/photopc.c epinfo.obj: $(srcdir)/epinfo.c $(srcdir)/a12scan.h $(srcdir)/exifscan.h $(srcdir)/fnames.h $(srcdir)/ctimez.h $(srcdir)/filetime.h $(srcdir)/getopt.h $(srcdir)/strcscmp.h $(MKOBJ) -oepinfo.obj $(srcdir)/epinfo.c a12scan.obj: $(srcdir)/a12scan.c $(srcdir)/a12scan.h $(MKOBJ) -oa12scan.obj $(srcdir)/a12scan.c exifscan.obj: $(srcdir)/exifscan.c $(srcdir)/exifscan.h $(MKOBJ) -oexifscan.obj $(srcdir)/exifscan.c fnames.obj: $(srcdir)/fnames.c $(srcdir)/fnames.h $(srcdir)/ctimez.h $(MKOBJ) -ofnames.obj $(srcdir)/fnames.c ctimez.obj: $(srcdir)/ctimez.c $(srcdir)/ctimez.h $(MKOBJ) -octimez.obj $(srcdir)/ctimez.c filetime.obj: $(srcdir)/filetime.c $(srcdir)/filetime.h $(srcdir)/ctimez.h $(MKOBJ) -ofiletime.obj $(srcdir)/filetime.c eph_read.obj: $(srcdir)/eph_read.c $(srcdir)/eph_io.h $(srcdir)/comio.h $(srcdir)/usleep.h $(MKOBJ) -oeph_read.obj $(srcdir)/eph_read.c eph_iob.obj: $(srcdir)/eph_iob.c $(srcdir)/eph_io.h $(MKOBJ) -oeph_iob.obj $(srcdir)/eph_iob.c eph_err.obj: $(srcdir)/eph_err.c $(srcdir)/eph_io.h $(srcdir)/eph_priv.h $(MKOBJ) -oeph_err.obj $(srcdir)/eph_err.c eph_cmd.obj: $(srcdir)/eph_cmd.c $(srcdir)/eph_io.h $(srcdir)/eph_priv.h $(MKOBJ) -oeph_cmd.obj $(srcdir)/eph_cmd.c eph_io.obj: $(srcdir)/eph_io.c $(srcdir)/eph_io.h $(srcdir)/eph_priv.h $(srcdir)/usleep.h $(srcdir)/comio.h $(MKOBJ) -oeph_io.obj $(srcdir)/eph_io.c eph_open.obj: $(srcdir)/eph_open.c $(srcdir)/eph_io.h $(srcdir)/eph_priv.h $(srcdir)/usleep.h $(srcdir)/comio.h $(srcdir)/usleep.h $(MKOBJ) -oeph_open.obj $(srcdir)/eph_open.c getopt.obj: $(srcdir)/getopt.c $(srcdir)/getopt.h $(MKOBJ) -ogetopt.obj $(srcdir)/getopt.c usleep.obj: $(srcdir)/usleep.c $(MKOBJ) -ousleep.obj $(srcdir)/usleep.c strcscmp.obj: $(srcdir)/strcscmp.c $(MKOBJ) -ostrcscmp.obj $(srcdir)/strcscmp.c comio.obj: $(srcdir)/comio.c $(MKOBJ) -ocomio.obj $(srcdir)/comio.c photopc-3.07/dos/config.h0000644000175000017500000000247507145614164012263 00000000000000#include "version.h" /* Define if you have the strftime function. */ #define HAVE_STRFTIME 1 /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Integer 16bit type */ #define INT16 short /* Integer 3bit type */ #define INT32 long /* Platform definition */ #define DOS 1 /* Low memory model */ #define LOWMEMORY 1 /* The number of bytes in a int. */ #define SIZEOF_INT 4 /* The number of bytes in a long. */ #define SIZEOF_LONG 4 /* The number of bytes in a short. */ #define SIZEOF_SHORT 2 /* Define if you have the getopt function. */ #define HAVE_GETOPT 1 /* Define if you have the mkdir function. */ #define HAVE_MKDIR 1 /* Define if you have the rename function. */ #define HAVE_RENAME 1 /* Define if you have the strerror function. */ #define HAVE_STRERROR 1 /* Define if you have the strspn function. */ #define HAVE_STRSPN 1 /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the header file. */ #define HAVE_STRING_H /* Define if you have the header file. */ #define HAVE_SYS_SELECT_H 1 /* Define if you have the header file. */ #define HAVE_UTIME_H 1 /* Define if compiler has function prototypes */ #define PROTOTYPES 1 /* is struct utimbuf defined in sys/utime.h */ #define HAVE_UTIMBUF 1 photopc-3.07/eph_iob.c0000644000175000017500000000566507024455507011635 00000000000000#ifndef LINT static char *rcsid="$Id: eph_iob.c,v 2.7 1999/12/11 14:10:15 crosser Exp $"; #endif /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: eph_iob.c,v $ Revision 2.7 1999/12/11 14:10:15 crosser Support sgtty terminal control Proper "fake speed" handling (needed two values) Revision 2.6 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 2.5 1999/07/28 19:58:59 crosser reorder includes Revision 2.4 1999/03/06 13:37:08 crosser Convert to autoconf-style Revision 2.3 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 2.2 1998/02/08 19:58:38 crosser Support low memory: chunked saving etc. Revision 2.1 1998/01/18 02:16:45 crosser DOS support Revision 2.0 1998/01/02 19:20:11 crosser Added support for Win32 Revision 1.1 1997/08/17 08:59:54 crosser Initial revision */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef STDC_HEADERS #include #include #endif #include #include "eph_io.h" static void deferrorcb(int errcode,char *errstr) { fprintf(stderr,"Error %d: %s\n",errcode,errstr); } static void * defrealloccb(void *old,size_t length) { if (old) return realloc(old,length); else return malloc(length); } static void defruncb(off_t count) { return; } eph_iob * eph_new(void (*errorcb)(int errcode,char *errstr), void *(*realloccb)(void *old,size_t length), void (*runcb)(off_t count), int (*storecb)(char *data,size_t size), int debug) { eph_iob *iob; iob=(eph_iob *)malloc(sizeof(eph_iob)); if (!iob) return iob; if (errorcb) iob->errorcb=errorcb; else iob->errorcb=deferrorcb; if (realloccb) iob->realloccb=realloccb; else iob->realloccb=defrealloccb; if (runcb) iob->runcb=runcb; else iob->runcb=defruncb; if (storecb) iob->storecb=storecb; else iob->storecb=NULL; iob->debug=debug; #if defined(MSWINDOWS) iob->fd=INVALID_HANDLE_VALUE; memset((char*)&iob->savedcb,0,sizeof(iob->savedcb)); memset((char*)&iob->savetimeouts,0,sizeof(iob->savetimeouts)); #elif defined(UNIX) iob->fd=-1; #if defined(USE_TERMIOS) memset((char*)&iob->savetios,0,sizeof(iob->savetios)); #elif defined(USE_SGTTY) memset((char*)&iob->savesgtty,0,sizeof(iob->savesgtty)); #elif defined(USE_TERMIO) memset((char*)&iob->savetio,0,sizeof(iob->savetio)); #endif #elif defined(DOS) iob->fd=-1; #else # error "platform not defined" #endif return iob; } void eph_free(eph_iob *iob) { free(iob); } photopc-3.07/usleep.c0000644000175000017500000001623207106010266011503 00000000000000#ifndef LINT static char *rcsid="$Id: usleep.c,v 2.9 2000/05/09 13:20:54 crosser Exp $"; #endif /* Copyright (c) 1997-1999 Eugene G. Crosser Copyright (c) 1998,1999 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: usleep.c,v $ Revision 2.9 2000/05/09 13:20:54 crosser configure read() with alarm() better. Address signed vs. unsigned arguments other cleanups to make most notorious compilers happy Revision 2.8 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 2.7 1999/04/22 04:14:54 crosser avoid GCC-isms Revision 2.6 1999/04/10 16:33:05 lightner Used calibrated spin loop for Win32 (like MSDOS) in place of Sleep() Speed upspin loop calibrarion for MSDOS Revision 2.5 1999/03/12 10:06:23 crosser fix typo Revision 2.4 1999/03/06 13:37:08 crosser Convert to autoconf-style Revision 2.3 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 2.2 1998/02/05 23:34:27 lightner Improve DOS logic short usleep() accuracy...use BIOS tick count Revision 2.1 1998/01/18 02:16:45 crosser DOS support Revision 2.0 1998/01/02 19:20:11 crosser Added support for Win32 */ #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #if defined(UNIX) #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_NANOSLEEP void usleep(unsigned int useconds) { struct timespec ts; ts.tv_sec=(long int)(useconds/1000000); ts.tv_nsec=(long int)(useconds%1000000)*1000ul; nanosleep (&ts, NULL); } #elif HAVE_SNOOZE extern void snooze(long long timeout); void usleep (unsigned long usec) { snooze((long long)usec); } #elif HAVE_SELECT #ifdef HAVE_SYS_SELECT_H #include #endif void usleep (unsigned long usec) { struct timeval timeout; timeout.tv_sec = usec / 1000000; timeout.tv_usec = usec - 1000000 * timeout.tv_sec; select(1, NULL, NULL, NULL, &timeout); } #else # error "cannot sleep: neither nanosleep nor select" #endif /* HAVE_NANOSLEEP / HAVE_SELECT */ #elif defined(MSWINDOWS) #include #include #include #include static unsigned long start_secs; static unsigned long start_usecs; static unsigned long end_usecs; static int calibrated = 0; volatile unsigned long dummy = 0; static double delay_factor = 1; #define DELAY_MARGIN 1.5 void start_time(void) { struct _timeb t; _ftime(&t); start_secs = t.time; start_usecs = 1000L * t.millitm; } unsigned long elasped_usecs(void) { struct _timeb t; _ftime(&t); end_usecs = 1000L * t.millitm + 1000000L * (t.time - start_secs); while (end_usecs < start_usecs) end_usecs += 60L * 1000000L; return end_usecs - start_usecs; } unsigned long spin_loop(double delay_factor) { unsigned long delay = delay_factor; unsigned long stop_usecs; #define CAL_TICKS 2 dummy = 0; start_time(); if (delay == 0) { /* sync with next clock tick */ while (elasped_usecs() == 0) ; stop_usecs = CAL_TICKS * 55000L + 1000L; } else { elasped_usecs(); stop_usecs = -1; } while (--delay > 0) { ++dummy; if (elasped_usecs() >= stop_usecs) break; } return dummy / CAL_TICKS; } void calibrate_delay(void) { # define MAX_LOOPS 3 int i; unsigned long loops, trial_loops; /* calibrate spin_loop() (returns loops per 18.2Hz PC timer tick */ loops = 0; for (i = 0; i < MAX_LOOPS; ++i) { trial_loops = spin_loop(0.0); if (trial_loops > loops) loops = trial_loops; } delay_factor = ((double)loops / 55000.0) * DELAY_MARGIN; calibrated = 1; /* printf("loops = %ld, delay_factor = %g\n", loops, delay_factor); */ } long usleep(long usecs) { if (!calibrated) calibrate_delay(); if (usecs > 1000000L) { Sleep((DWORD)usecs / 1000L); } else { spin_loop(delay_factor * usecs + 1); } } #elif defined(DOS) #include static unsigned long start_usecs; static unsigned long end_usecs; static int calibrated = 0; volatile unsigned long dummy = 0; double delay_factor = 1; #define DELAY_MARGIN 1.5 #ifndef USE_DOS_TIME unsigned long stop_tick; #ifndef NO_TICKS_MACRO #define get_bios_ticks() (*((volatile unsigned long far *)(MK_FP(0, 0x46c)))) #else /* !NO_TICKS_MACRO */ unsigned long get_bios_ticks(void) { static unsigned long far *p; if (!p) p = MK_FP(0, 0x46c); return *p; } #endif /* !NO_TICKS_MACRO */ #endif /* !USE_DOS_TIME */ void start_time(void) { #ifndef USE_DOS_TIME unsigned long t; t = get_bios_ticks() & 0xff; start_usecs = 55000L * t; #else struct dostime_t t; _dos_gettime(&t); start_usecs = 1000000L * t.second + 10000L * t.hsecond; #endif } unsigned long elasped_usecs(void) { #ifndef USE_DOS_TIME unsigned long t; t = get_bios_ticks() & 0xff; end_usecs = 55000L * t; while (end_usecs < start_usecs) end_usecs += 55000L * 0xff; #else struct dostime_t t; _dos_gettime(&t); end_usecs = 1000000L * t.second + 10000L * t.hsecond; while (end_usecs < start_usecs) end_usecs += 60L * 1000000L; #endif return end_usecs - start_usecs; } unsigned long spin_loop(double delay_factor) { unsigned long delay = delay_factor; #ifndef USE_DOS_TIME #define CAL_TICKS 2 dummy = 0; if (delay == 0) { unsigned long end_tick; unsigned long start_tick = get_bios_ticks(); /* sync with next clock tick */ while (start_tick == (end_tick = get_bios_ticks())) ; stop_tick = end_tick + CAL_TICKS; } else { stop_tick = get_bios_ticks() - 1; } #endif /* !USE_DOS_TIME */ while (--delay > 0) { ++dummy; #ifndef USE_DOS_TIME if (get_bios_ticks() == stop_tick) break; #endif } #ifndef USE_DOS_TIME return dummy / CAL_TICKS; #else return dummy; #endif } #ifndef USE_DOS_TIME void calibrate_delay(void) { # define MAX_LOOPS 3 int i; unsigned long loops, trial_loops; /* calibrate spin_loop() (returns loops per 18.2Hz PC timer tick */ loops = 0; for (i = 0; i < MAX_LOOPS; ++i) { trial_loops = spin_loop(0.0); if (trial_loops > loops) loops = trial_loops; } delay_factor = ((double)loops / 55000.0) * DELAY_MARGIN; calibrated = 1; /* printf("loops = %ld, delay_factor = %g\n", loops, delay_factor); */ } #else /* USE_DOS_TIME */ void calibrate_delay(void) { int i; unsigned long usecs; delay_factor = 1; for (i = 0; i < 32; ++i) { start_time(); spin_loop(delay_factor); usecs = elasped_usecs(); if (usecs >= 2L * 55L * 1000L) { delay_factor = delay_factor / usecs; break; } delay_factor = delay_factor * 4.0; } calibrated = 1; } #endif /* USE_DOS_TIME */ long usleep(long usecs) { if (!calibrated) calibrate_delay(); if (usecs > 200000) { start_time(); while (elasped_usecs() < usecs) ; } else { spin_loop(delay_factor * usecs + 1); } } #else # error platform not defined #endif photopc-3.07/filetime.c0000644000175000017500000000653207024455507012020 00000000000000#ifndef LINT static char *rcsid="$Id: filetime.c,v 1.7 1999/12/11 14:10:15 crosser Exp $"; #endif /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: filetime.c,v $ Revision 1.7 1999/12/11 14:10:15 crosser Support sgtty terminal control Proper "fake speed" handling (needed two values) Revision 1.6 1999/10/09 10:52:47 crosser make filetime honor usetimezone flag. set reg4 in every place (I hope) before other registers are used that depend on the frame number. Revision 1.5 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 1.4 1999/03/22 05:59:31 lightner Use gltimetz() instead of gmtime()/localtime() Revision 1.3 1999/03/12 23:22:30 crosser support windows Revision 1.2 1999/03/12 10:06:23 crosser make it work under unix and dos (no windows yet) Revision 1.1 1999/03/11 22:57:35 crosser Initial revision */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #ifdef DOS # include # include #else # ifdef HAVE_UTIME_H # include # endif # ifdef HAVE_SYS_UTIME_H # include # endif #endif #include "ctimez.h" #ifndef HAVE_UTIMBUF struct utimbuf { time_t actime; time_t modtime; }; #endif int setfiletime(char *fname,time_t actime,time_t mtime,int usetimezone) { #ifdef DOS int fd,rc; struct tm *ptm; #ifdef __TURBOC__ struct ftime ft; #else unsigned short dosdate,dostime; #endif /* yr = ((lrec.last_mod_file_date >> 9) & 0x7f) + (1980 - YRBASE); mo = ((lrec.last_mod_file_date >> 5) & 0x0f) - 1; dy = (lrec.last_mod_file_date & 0x1f) - 1; hh = (lrec.last_mod_file_time >> 11) & 0x1f; mm = (lrec.last_mod_file_time >> 5) & 0x3f; ss = (lrec.last_mod_file_time & 0x1f) * 2; */ if ((fd=open(fname,O_RDWR)) == -1) return -1; ptm=gltimetz(&mtime,usetimezone); #ifdef __TURBOC__ ft.ft_tsec=ptm->tm_sec/2; ft.ft_min=ptm->tm_min; ft.ft_hour=ptm->tm_hour; ft.ft_day=ptm->tm_mday; ft.ft_month=ptm->tm_mon+1; ft.ft_year=ptm->tm_year-80; rc=setftime(fd,&ft); #else dosdate=(ptm->tm_year-80)<<9; dosdate|=(ptm->tm_mon+1)<<5; dosdate|=(ptm->tm_mday); dostime=(ptm->tm_hour)<<11; dostime|=(ptm->tm_min)<<5; dostime|=(ptm->tm_sec/2); asm("movl %0, %%ebx": : "g" (fd)); asm("movl %0, %%ecx": : "g" (dostime)); asm("movl %0, %%edx": : "g" (dosdate)); asm("movl $0x5701, %eax"); asm("int $0x21": : : "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi"); asm("movl %%eax, %0": : "g" (rc)); #endif close(fd); return rc; #else /* UNIX or Windows */ struct utimbuf utb; if (!usetimezone) { actime-=zoneoffset(actime); mtime-=zoneoffset(mtime); } utb.actime=actime; utb.modtime=mtime; return utime(fname,&utb); #endif } photopc-3.07/exifscan.h0000644000175000017500000000155406671263073012030 00000000000000/* $Id: exifscan.h,v 1.1 1999/03/09 18:19:39 crosser Exp $ */ /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: exifscan.h,v $ Revision 1.1 1999/03/09 18:19:39 crosser Initial revision */ #ifndef _EXIFSCAN_H #define _EXIFSCAN_H #ifdef DOS typedef long off_t; #endif int exifscan(unsigned char **buf,off_t *bufsize); unsigned char *exifsearch(char *key,unsigned char *buf,off_t bufsize); void exifdump(unsigned char *buf,off_t bufsize); #endif photopc-3.07/ctimez.h0000644000175000017500000000175106675356103011523 00000000000000/* $Id: ctimez.h,v 1.4 1999/03/22 05:59:31 lightner Exp $ */ /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: ctimez.h,v $ Revision 1.4 1999/03/22 05:59:31 lightner Add prototype for gltimetz() Revision 1.3 1999/03/12 23:22:30 crosser clean zone handling Revision 1.2 1999/03/10 22:34:43 crosser notimezone -> usetimezone Revision 1.1 1999/03/09 18:30:22 crosser Initial revision */ #ifndef CTIMEZ_H #define CTIMEZ_H struct tm *gltimetz(time_t *clock,int usetimezone); char *ctimetz(time_t *clock,int usetimezone); time_t zoneoffset(time_t now); #endif photopc-3.07/eph_open.c0000644000175000017500000003221207145614164012011 00000000000000#ifndef LINT static char *rcsid="$Id: eph_open.c,v 2.25 2000/08/13 21:51:48 crosser Exp $"; #endif /* Copyright (c) 1997-2000 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: eph_open.c,v $ Revision 2.25 2000/08/13 21:51:48 crosser More changes incorporated from John Bowman's version Revision 2.24 2000/05/09 13:20:54 crosser configure read() with alarm() better. Address signed vs. unsigned arguments other cleanups to make most notorious compilers happy Revision 2.23 2000/05/02 22:26:35 crosser A few things incorporated from John Bowman's Nikon specific diffs Revision 2.22 2000/05/02 12:13:32 crosser some better debugging output alarm() based timeouted read (build with "--without-select") Revision 2.21 1999/12/13 23:26:52 crosser Fix minor bugs in sgtty support, reported to work now. Revision 2.20 1999/12/11 14:10:15 crosser Support sgtty terminal control Proper "fake speed" handling (needed two values) Revision 2.19 1999/12/01 21:41:23 crosser add "pseudo" speed Revision 2.18 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 2.17 1999/03/06 13:37:08 crosser Convert to autoconf-style Revision 2.16 1999/02/10 22:09:36 crosser strerror needs string.h with glibc2 Revision 2.15 1998/12/20 21:49:38 crosser move flushinput to more proper place Revision 2.14 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 2.13 1998/08/08 14:00:33 crosser make switchoff friendly to Olympus Revision 2.12 1998/08/01 13:12:41 lightner Four ports for DOS Revision 2.11 1998/08/01 12:30:50 crosser flushinput function Revision 2.10 1998/05/09 18:21:08 crosser change O_NONBLOCK to O_NDELAY (is it correct? I don't know. On most systems they are the same, but what if they are not? Tell me if you have problems.) Revision 2.9 1998/04/09 07:38:44 crosser fix semantics of the "switch off" arg Revision 2.8 1998/02/26 00:50:39 crosser change c_breake code for compatibility Revision 2.7 1998/02/25 22:47:24 crosser fix saving termios data Revision 2.6 1998/02/16 06:15:05 lightner Call _cexit() in ^C handler Revision 2.5 1998/01/27 21:52:55 crosser clean up error message, remove unneeded speep Revision 2.4 1998/01/18 02:16:45 crosser DOS support Revision 2.3 1998/01/05 19:47:49 lightner Win32 syntax error fixed: text->commtext Revision 2.2 1998/01/04 13:55:57 crosser add param for close mode Revision 2.1 1998/01/03 19:57:13 crosser Fix Windows things, improve error reporting Revision 2.0 1998/01/02 19:20:11 crosser Added support for Win32 Revision 1.4 1997/12/24 00:19:13 crosser Change default speed to 115200 Revision 1.3 1997/11/03 23:25:11 crosser add immediate session finish command Revision 1.2 1997/09/12 09:42:35 crosser skip possible NULs prior to `camera signature' Revision 1.1 1997/08/17 08:59:54 crosser Initial revision */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #if defined(MSWINDOWS) #include "usleep.h" #elif defined(UNIX) #ifdef HAVE_UNISTD_H #include #endif #include #elif defined(DOS) #include "comio.h" #include "usleep.h" #else # error platform not defined #endif #include #ifdef STDC_HEADERS #include #include #endif #ifdef HAVE_FCNTL_H #include #endif #include #include "eph_io.h" #include "eph_priv.h" #ifdef MSWINDOWS #define ERRNO GetLastError() #else #define ERRNO errno #endif #define DEFSPEED 19200 #if defined(MSWINDOWS) #define CLOSE CloseHandle #elif defined(UNIX) #define CLOSE close #elif defined(DOS) #define CLOSE(x) ttclose() void exit_cleanup(void) { ttclose(); } #define ABORT 0 int c_break(void) { printf("\naborting program...%c\n", 7); ttclose(); exit(255); /* will call any exit handlers */ /* notreached */ } #else # error platform not defined #endif #ifdef UNIX speed_t speed2flag(long ttspeed) { speed_t tspeed; switch (ttspeed) { case 50: tspeed=B50; break; case 75: tspeed=B75; break; case 150: tspeed=B150; break; case 300: tspeed=B300; break; case 600: tspeed=B600; break; case 1200: tspeed=B1200; break; case 2400: tspeed=B2400; break; case 4800: tspeed=B4800; break; case 9600: tspeed=B9600; break; case 19200: #ifdef B19200 tspeed=B19200; #else tspeed=EXTA; #endif break; case 38400: #ifdef B38400 tspeed=B38400; #else tspeed=EXTB; #endif break; case 57600: #ifdef B57600 tspeed=B57600; #else tspeed=(speed_t)-1; #endif break; case 115200: #ifdef B115200 tspeed=B115200; #else tspeed=(speed_t)-1; #endif break; default: tspeed=(speed_t)-1; break; } return tspeed; } #endif /* UNIX */ int eph_open(eph_iob *iob,char *devname,long speed,long defttspeed,long ttspeed) { #if defined(MSWINDOWS) DCB dcb = { 0 }; char commtext[80]; #elif defined(UNIX) #if defined(USE_TERMIOS) struct termios tios; #elif defined(USE_SGTTY) struct sgttyb sgtty; #elif defined(USE_TERMIO) struct termio tio; #endif speed_t tspeed; /* representation of speed sutable for termios */ speed_t deftspeed; #elif defined(DOS) int port; #else # error platform not defined #endif long ephspeed; /* representation of speed sutable for camera command */ int rc; int count=0; /* speed is real, tell it to the camera. ttspeed is what you have to tell to the serial driver to make it set real speed */ if (speed == 0) speed=MAX_SPEED; if (ttspeed == 0) ttspeed=speed; if (defttspeed == 0) defttspeed=DEFSPEED; switch (speed) { case 9600: ephspeed=1; break; case 19200: ephspeed=2; break; case 38400: ephspeed=3; break; case 57600: ephspeed=4; break; case 115200: ephspeed=5; break; default: eph_error(iob,ERR_BADSPEED,"specified speed %ld invalid",speed); return -1; } #if defined(UNIX) if ((tspeed=speed2flag(ttspeed)) == (speed_t)-1) { eph_error(iob,ERR_BADSPEED,"specified speed %ld unsupported", ttspeed); return -1; } if ((deftspeed=speed2flag(defttspeed)) == (speed_t)-1) { eph_error(iob,ERR_BADSPEED,"specified speed %ld unsupported", defttspeed); return -1; } #endif /* UNIX */ iob->timeout=DATATIMEOUT+((2048000000L)/speed)*10; if (iob->debug) printf("set timeout to %lu\n",DATATIMEOUT+iob->timeout); #if defined(DOS) if (strcasecmp(devname,"COM1:") == 0) { port = 1; } else if (strcasecmp(devname,"COM2:") == 0) { port = 2; } else if (strcasecmp(devname,"COM3:") == 0) { port = 3; } else if (strcasecmp(devname,"COM4:") == 0) { port = 4; } else { eph_error(iob,ERRNO,"device name %s not COM1:, COM2:, COM3: or COM4:", devname); return -1; } ctrlbrk(c_break); atexit(exit_cleanup); usleep(1); if (iob->debug) printf("delay factor: %g loops/usec\n",(float)delay_factor); TTinit(port, DEFSPEED); if (ttopen()) { errno=2; #elif defined(MSWINDOWS) if ((iob->fd=CreateFile(devname, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0)) == INVALID_HANDLE_VALUE) { #elif defined(UNIX) if ((iob->fd=open(devname,O_RDWR | O_NDELAY)) < 0) { #else # error platform not defined #endif if (strlen(devname) < 400) /* we have 512 byte buffer there */ eph_error(iob,ERRNO,"open %s error %s", devname,strerror(ERRNO)); return -1; } #if defined(MSWINDOWS) if (!GetCommState(iob->fd, &dcb)) { eph_error(iob,ERRNO,"GetCommState error %s",strerror(ERRNO)); CLOSE(iob->fd); return -1; } memcpy(&iob->savedcb,&dcb,sizeof(dcb)); memset((char*)&dcb,0,sizeof(dcb)); dcb.DCBlength = sizeof(dcb); sprintf(commtext, "%d,n,8,1", DEFSPEED); if (!BuildCommDCB(commtext, &dcb)) { eph_error(iob,ERRNO,"BuildCommDCB error %s",strerror(ERRNO)); CLOSE(iob->fd); return -1; } if (!SetCommState(iob->fd, &dcb)) { eph_error(iob,ERRNO,"SetCommState error %s",strerror(ERRNO)); CLOSE(iob->fd); return -1; } if (!GetCommTimeouts(iob->fd, &iob->savetimeouts)) { eph_error(iob,ERRNO,"GetCommTimeouts error %s",strerror(ERRNO)); CLOSE(iob->fd); return -1; } iob->worktimeouts.ReadIntervalTimeout=0; iob->worktimeouts.ReadTotalTimeoutMultiplier=1; iob->worktimeouts.ReadTotalTimeoutConstant=1000; iob->worktimeouts.WriteTotalTimeoutMultiplier=0; iob->worktimeouts.WriteTotalTimeoutConstant=0; if (!SetCommTimeouts(iob->fd, &iob->worktimeouts)) { eph_error(iob,ERRNO,"SetCommTimeouts initial attr error %s", strerror(ERRNO)); CLOSE(iob->fd); return -1; } #elif defined(UNIX) #if defined(USE_TERMIOS) if (tcgetattr(iob->fd,&tios) < 0) { eph_error(iob,ERRNO,"tcgetattr error %s",strerror(ERRNO)); close(iob->fd); return -1; } memcpy(&iob->savetios,&tios,sizeof(tios)); #ifdef HAVE_CFMAKERAW cfmakeraw(&tios); #else tios.c_iflag=0; tios.c_oflag=0; tios.c_lflag=0; #endif cfsetospeed(&tios,deftspeed); cfsetispeed(&tios,deftspeed); #ifdef USE_VMIN_AND_VTIME tios.c_cc[VMIN]=127; tios.c_cc[VTIME]=1; #else tios.c_cc[VMIN]=1; tios.c_cc[VTIME]=0; #endif tios.c_cflag|=(CS8|CLOCAL|CREAD); tios.c_cflag&=~(PARENB|PARODD #ifdef TRY_FLOW_CONTROL # ifdef CRTSXOFF |CRTSXOFF # endif # ifdef CRTSCTS |CRTSCTS # endif # ifdef CRTSFL |CRTSFL # endif #endif ); tios.c_iflag&=~INPCK; tios.c_iflag|=IGNBRK; if (tcsetattr(iob->fd,TCSANOW,&tios)) { eph_error(iob,ERRNO,"tcsetattr initial attr error %s", strerror(ERRNO)); close(iob->fd); return -1; } #elif defined(USE_SGTTY) if (ioctl(iob->fd, TIOCGETP, &sgtty) < 0) { eph_error(iob,ERRNO,"ioctl/TIOCGETP error %s",strerror(ERRNO)); close(iob->fd); return -1; } memcpy(&iob->savesgtty,&sgtty,sizeof(sgtty)); sgtty.sg_ispeed = deftspeed; sgtty.sg_ospeed = deftspeed; sgtty.sg_erase = 0; sgtty.sg_kill = 0; sgtty.sg_flags = RAW; if (ioctl(iob->fd, TIOCSETN, &sgtty) < 0) { eph_error(iob,ERRNO,"ioctl/TIOCSETN initial attr error %s", strerror(ERRNO)); close(iob->fd); return -1; } #elif defined(USE_TERMIO) # error "termio not supported" #endif /* terminal control selection */ #ifdef USE_ALARMED_READ if (((iob->flag)=fcntl(iob->fd,F_GETFL,0L)) == -1) { eph_error(iob,ERRNO,"fcntl(GETFL) failed: %s", strerror(ERRNO)); close(iob->fd); return -1; } iob->flag&=~O_NDELAY; if (fcntl(iob->fd,F_SETFL,iob->flag) == -1) { eph_error(iob,ERRNO,"fcntl(reset O_NDELAY) failed: %s", strerror(ERRNO)); close(iob->fd); return -1; } #endif #endif /* MSWINDOWS/UNIX; do nothing for DOS */ do { if (eph_flushinput(iob)) { eph_error(iob,ERRNO,"error flushing input: %s", strerror(ERRNO)); CLOSE(iob->fd); return -1; } eph_writeinit(iob); rc=eph_waitsig(iob); if (rc) usleep(500000L); } while (rc && (count++ < RETRIES)); if (rc) { CLOSE(iob->fd); return -1; } if (eph_setispeed(iob,ephspeed)) { eph_error(iob,ERRNO,"could not switch camera speed %d: %s", ephspeed,strerror(ERRNO)); CLOSE(iob->fd); return -1; } #if defined(MSWINDOWS) dcb.BaudRate = ttspeed; if (!SetCommState(iob->fd, &dcb)) { eph_error(iob,ERRNO,"SetCommState working attr error %s", strerror(ERRNO)); CLOSE(iob->fd); return -1; } #elif defined(UNIX) #if defined(USE_TERMIOS) cfsetospeed(&tios,tspeed); cfsetispeed(&tios,tspeed); if (tcsetattr(iob->fd,TCSANOW,&tios)) { eph_error(iob,ERRNO,"tcsetattr working attr error %s", strerror(ERRNO)); close(iob->fd); return -1; } #elif defined(USE_SGTTY) sgtty.sg_ispeed = tspeed; sgtty.sg_ospeed = tspeed; if (ioctl(iob->fd, TIOCSETN, &sgtty)) { eph_error(iob,ERRNO,"ioctl/TIOCSETN cound not reset attr: %s", strerror(ERRNO)); close(iob->fd); return -1; } #elif defined(USE_TERMIO) # error "termio not supported" #endif #elif defined(DOS) ttclose(); TTinit(port, ttspeed); if (ttopen()) { errno = 0; eph_error(iob,ERRNO,"dobaud set working attr error %s", strerror(ERRNO)); CLOSE(iob->fd); return -1; } #else # error platform not defined #endif usleep(SPEEDCHGDELAY); return 0; } int eph_close(eph_iob *iob,int switchoff) { if (switchoff) { char zero=0; eph_action(iob,4,&zero,1); /* Oly 600 does not send EOT if switched off by command eph_waiteot(iob); */ } else { eph_setispeed(iob,0L); } #if defined(MSWINDOWS) if (!SetCommState(iob->fd, &iob->savedcb)) eph_error(iob,ERRNO,"SetCommState reset attr error %s", strerror(ERRNO)); if (!SetCommTimeouts(iob->fd, &iob->savetimeouts)) eph_error(iob,ERRNO,"SetCommTimeouts reset attr error %s", strerror(ERRNO)); #elif defined(UNIX) #if defined(USE_TERMIOS) if (tcsetattr(iob->fd,TCSANOW,&iob->savetios)) eph_error(iob,ERRNO,"tcsetattr cound not reset attr: %s", strerror(ERRNO)); #elif defined(USE_SGTTY) if (ioctl(iob->fd, TIOCSETN, &iob->savesgtty)) eph_error(iob,ERRNO,"tcsetattr cound not reset attr: %s", strerror(ERRNO)); #elif defined(USE_TERMIO) # error "termio not supported" #endif #endif /* MSWINDOWS/UNIX; do nothing for DOS */ return CLOSE(iob->fd); } photopc-3.07/usage.htm0000644000175000017500000003114607342636312011671 00000000000000 Epson PhotoPC Software for Unix/Linux, Windows, and MS-DOS

Epson PhotoPC Software for Unix/Linux, Windows, and MS-DOS

This page describes "freeware" software which may be used to control and retrieve photos from Epson PhotoPC digital cameras under Unix/Linux, Microsoft Windows 95, Windows 98, Windows NT, and MS-DOS. This software also may work with Agfa ePhoto, Olympus D-xxxL/Z, Sanyo, Nikon Coolpix, Toshiba PDR-2, and other digital cameras based on firmware from Sierra Imaging, Inc..

The Camera

The Epson PhotoPC is one of a family of digital cameras based on Fujitsu's SPARCLite microprocessor and Sierra Imaging's chipsets and firmware. The least expensive Epson camera model produces quality photos in JPEG format at a resolution of 640x480 at a moderate price (~$250 "street price"). Other camera versions, including those from Olympus, produce higher-resolution JPEG images, up to 1280x1024 pixels, using a SRL format much like a conventional 35mm film camera, at a price closer to $1,000. All cameras compatible with this software offer a serial port connection to a PC for the purposes of downloading photos from the camera.

Supported camera models include: Agfa ePhoto 780, ePhoto 1280 and ePhoto 1680; Epson PhotoPC "classic", PhotoPC 500, PhotoPC 550 and PhotoPC 600; Nikon CoolPix 900S and CoolPix 900; Olympus D-220L, D-320L, D-340L, C-400L, C-400Z, D-400 Zoom, C-410L, D-500L, D-600L, D-600 Zoom, C-820L, C-840L, C-900 Zoom, C-1000L and C-1400L; Toshiba PDR-2; and Sanyo VPC-G200, VPC-G200EX, VPC-G210 and DSC-X300.

The Software

The software is command-line oriented, and does not make use of a graphical user interface (GIU). By using this software with a "batch file", or a Windows short-cut icon, photos can be quickly downloaded from the camera to a PC via a serial cable, with a minimum of effort.

The software is available for download (in source code form) for Unix/Linux platforms from the Eugene Crosser's (the author's) digital camera Web site, photopc.sourceforge.net. A list of compatible digital cameras can be found there. Software for MS-DOS, Microsoft Windows 95/98, and Microsoft Windows NT, in both executable and source code formats, can be found at Bruce Lightner's PhotoPC Web site, www.lightner.net/lightner/bruce/photopc/.

Documentation

Basic features
  • Query the camera
  • Download individual photos
  • Download entire camera
  • Delete individual photos
  • Delete all photos
  • Get photo count
The basic syntax for using photopc is:
  photopc [-h] [-v[v]] [-q] [-s speed] [-l device] [command [params]] ... 
Commands are normally entered at an "MS-DOS prompt". Under Windows, camera control commands can be entered using an "MS-DOS Prompt" window (sometimes referred to as a "DOS box" or "console window"), or invoked using a Windows "short-cut" icon (or a PIF).

To get help on using the program:

  photopc -h
This will print a brief (somewhat bewildering) summary of the program's options and commands. For a complete description of the program's options and commands see the photopc manual page. This file, "photopc.man", is included with the software source package in Unix `man' format.

Specifying the Camera Port

To specify the serial port to which the camera is attached:
  photopc -l device
where device is the name of the serial port (a.k.a. "line") which has the camera attached. Under Windows and/or MS-DOS, the allowable "device" names are "COM1:" and "COM2:". The default serial port is "COM1:". (Note: That's "dash-L" and not "dash-one"!)

Specifying the Serial Port Speed

To specify the speed of the serial port used to communicate with the camera:
  photopc -s speed
where speed is the requested baud rate: 9600, 19200, 38400, 57600 or 115200. The default speed is usually the highest. You may find that with older PCs a slower speed is needed for reliable operation.

Querying the Camera

To query the camera:
  photopc query 
This will dump the entire state of the camera including information like the number of photos taken, the amount of free memory, the current date/time set in the camera, the camera's model and serial number, the user-specified camera setting, etc.

Downloading a Single Photo

To download a single photo:
  photopc image num filename
where num is the number of the image to be downloaded and filename is the name of the file to receive the JPEG image. For example "photopc image 4 photo4.jpg" will download the 4th photo into the file "photo4.jpg".

Downloading the Entire Camera

To download all the photos in the camera:
  photopc image all directory
where directory is the name of the directory to receive the JPEG files.

For example, the command "photopc image all .", will downloaded all images from the camera into the current working directory, into files named "MMDD_CCC.jpg" where "MM" is the month the photo was taken, "DD" is the day of the month the photo was taken, and "CCC" is a sequence number.

The user can control the program's JPEG file naming algorithm using the "-f" option. Two useful options under MS-DOS are:

    -f 1    (image file names are MMDD_CCC.jpg (default))
    -f 2    (image file names are YYMMDDCC.jpg)
where "YY" is a two-digit year, "MM" is a two-digit month, "DD" is a two-digit day of the month (all based on the the time that the photo was taken), and "CC" (or "CCC") is a sequence number. The user actually has complete control over the file naming through the use of "-f" and a format string...the description of which is beyond the scope of this document.

Deleting a Single Photo

To delete a single photo:
  photopc erase num
where num is the number of the photo to be deleted.

Deleting All Photos

To erase all photos from the camera:
  photopc eraseall
This will delete all photos from the camera.

Getting a Photo Count

To get of count of photos in the camera:
  photopc count
This will report the number of photos currently stored in the camera.

Notes

Command/Switch Order

You can use commands in almost any combination. The program "switches" such as "-l" and "-s" can be placed anywhere on the command line. The commands (such as "query" and "image") are executed in the order given on the command line.

For example, to use serial port COM2 at 57600 baud to query the camera, then download all the images in the camera to the directory "/photos" on drive C: (in "YYMMDDCC.jpg" file name format):

  photopc -l com2: query -f 2 image all c:/photos -s 57600
A command such as this can be invoked as part of a Windows 95 "short-cut" icon, allowing quick, automatic downloading of a camera with a single mouse double-click.

Communication Problems

If you have trouble communicating with your camera, try lowering the serial port speed using the "-s" option. (Turning the camera on also solves many camera communication problems! :-)

If you interrupt communication with your camera by aborting the program (e.g., by enter ^C), you may have to turn the camera off and back on in order to restore proper communication.

If you find that the program cannot connect to your PC's serial port under Windows, first verify that no other program is using the serial port.

The MS-DOS version of "photopc" will work under Windows (even Windows 3.1), but often only at a reduced serial port speed. However, after running the MS-DOS version of the program one must first close the "MS-DOS window" (to release the serial port) before switching back to using the Windows version of "photopc".

Time Zones

Your camera has a real-time clock which can be set by the program. This internal clock is used to time-stamp photos as they are taken. By default, the program assumes that the clock in the camera is set to "universal time" (also known as GMT or Zulu time). Therefore, when the program displays times and/or automatically creates file names using photo time-stamps, "universal time" is converted into "local time" according to your computer's "time zone" setting. If you want to set your camera's internal clock to "local time", and not have the software apply a "time zone correction", then add the "no time zone" switch to the program's command line, as follows:
  photopc -z ... 
Under the MS-DOS operating system, the time zone is set using the "TZ" environment variable. The TZ environment variable can be set with the following MS-DOS command:
  set TZ=zzz[+/-]d[d][lll]
where "zzz" is a required three-character string with the name of the current time zone, "[+/-]d[d]" is a required field with an optionally signed number of one or two digits specifying the local time zone's difference from GMT in hours, and "lll"is an optional three-character field with the name of the local time zone during daylight savings time. This command should be placed in your AUTOEXEC.BAT file. For example, the following command sets the time zone to Pacific Time:
  set TZ=PST8PDT

Under MS-DOS, if the TZ environment variable is not set the program will not apply a time zone correction, giving the same program behavior as with the "-z" command line switch. Under MS-DOS, if the TZ variable is set, but does not satisfy the above described syntax, the time zone correction is undefined (i.e., probably wrong).

Under Windows, unless the "-z" command line switch is set, the program always will apply a time zone correction, as defined by the time zone setting in the Windows operating system. However, if the TZ variable is set (using to the above described syntax), then it overrides the Windows time zone setting, and the program will apply a time zone correction as defined by the TZ variable. Beware that if the TZ variable is set under Windows, but does not satisfy the above described syntax, the time zone correction is undefined (i.e., probably wrong).

Software Revision Level

You can determine the revision level of the program by using the following command:
  photopc -V 
Please include this information when reporting program bugs.

Software License

This software is copyright ©1997, 1998 by Eugene G. Crosser. Microsoft Windows and MS-DOS support is copyright ©1997, 1998, 1999 by Bruce D. Lightner.

You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above.

THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE.

Trademarks referenced herein are those of their respective owners.


Bruce D. Lightner, $Id: usage.htm,v 2.8 2001/08/28 06:40:10 crosser Exp $ photopc-3.07/ansi2knr.10000644000175000017500000000277111500011217011644 00000000000000.TH ANSI2KNR 1 "19 Jan 1996" .SH NAME ansi2knr \- convert ANSI C to Kernighan & Ritchie C .SH SYNOPSIS .I ansi2knr [--varargs] input_file [output_file] .SH DESCRIPTION If no output_file is supplied, output goes to stdout. .br There are no error messages. .sp .I ansi2knr recognizes function definitions by seeing a non-keyword identifier at the left margin, followed by a left parenthesis, with a right parenthesis as the last character on the line, and with a left brace as the first token on the following line (ignoring possible intervening comments). It will recognize a multi-line header provided that no intervening line ends with a left or right brace or a semicolon. These algorithms ignore whitespace and comments, except that the function name must be the first thing on the line. .sp The following constructs will confuse it: .br - Any other construct that starts at the left margin and follows the above syntax (such as a macro or function call). .br - Some macros that tinker with the syntax of the function header. .sp The --varargs switch is obsolete, and is recognized only for backwards compatibility. The present version of .I ansi2knr will always attempt to convert a ... argument to va_alist and va_dcl. .SH AUTHOR L. Peter Deutsch wrote the original ansi2knr and continues to maintain the current version; most of the code in the current version is his work. ansi2knr also includes contributions by Francois Pinard and Jim Avera . photopc-3.07/Makefile.am0000644000175000017500000000433007300330112012061 00000000000000## $Id: Makefile.am,v 1.7 2001/05/15 22:40:10 crosser Exp $ ## # FSF thinks that the source generated by a tool copyrighted # by FSF is also copyrighted by FSF. This might be true, but # still, if you read this text in Makefile.in or Makefile, then # be informed that the orifinal file, and the "meat" of the # package, is: # # Copyright (c) 1997-1999 Eugene G. Crosser # Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) # # You may distribute and/or use for any purpose modified or unmodified # copies of this software if you preserve the copyright notice above. # # THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY # KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE # COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE # USE OF THIS SOFTWARE. ## ## $Log: Makefile.am,v $ ## Revision 1.7 2001/05/15 22:40:10 crosser ## Added ChangeLog to EXTRA_DIST ## ## Revision 1.6 1999/11/09 18:55:02 crosser ## work on windows version ## ## Revision 1.5 1999/08/14 09:00:33 crosser ## Create version.h's in dos and win23 directories ## ## Revision 1.4 1999/08/01 23:28:06 crosser ## multiple enhancements ## ## Revision 1.3 1999/08/01 12:37:10 crosser ## typo ## ## Revision 1.2 1999/08/01 12:31:00 crosser ## add options, make notice about the copyright ## ## Revision 1.1 1999/07/29 07:53:33 crosser ## Initial revision ## AUTOMAKE_OPTIONS = foreign ansi2knr bin_PROGRAMS = photopc epinfo lib_LIBRARIES = libeph_io.a include_HEADERS = eph_io.h man_MANS = photopc.1 epinfo.1 EXTRA_DIST = $(man_MANS) protocol.htm usage.htm readme.dos \ dos/Makefile dos/config.h dos/version.h \ win32/Makefile win32/config.h win32/version.h \ ChangeLog photopc_SOURCES = photopc.c a12scan.c a12scan.h fnames.c fnames.h \ ctimez.c ctimez.h filetime.c filetime.h \ exifscan.c exifscan.h eph_io.h EXTRA_photopc_SOURCES = comio.c comio.h getopt.h usleep.h strcscmp.h photopc_LDADD = @LIBOBJS@ libeph_io.a epinfo_SOURCES = epinfo.c a12scan.c a12scan.h exifscan.c exifscan.h \ fnames.c fnames.h ctimez.c ctimez.h \ filetime.c filetime.h EXTRA_epinfo_SOURCES = getopt.h epinfo_LDADD = @LIBOBJS@ libeph_io_a_SOURCES = eph_read.c eph_iob.c eph_err.c eph_cmd.c eph_io.c \ eph_open.c eph_io.h eph_priv.h photopc-3.07/getopt.c0000644000175000017500000006004306453236753011526 00000000000000/* 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 roland@gnu.ai.mit.edu before changing it! Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc. This program 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, 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* 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 #ifdef HAVE_CONFIG_H #if defined (emacs) || defined (CONFIG_BROKETS) /* We use instead of "config.h" so that a compilation using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h (which it would do because it found this file in $srcdir). */ #include #else #include "config.h" #endif #endif #ifndef __STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include #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. */ #if defined (_LIBC) || !defined (__GNU_LIBRARY__) /* 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 #endif /* GNU C library. */ /* 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 "getopt.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 EOF, 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. */ /* XXX 1003.2 says this must be 1 before any call. */ int optind = 0; /* 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 EOF with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; #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 /* Avoid depending on library functions or files whose names are inconsistent. */ char *getenv (); 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. */ #ifndef __STDC__ /* 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; /* 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. */ 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. */ 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; } /* 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; } /* 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. */ static const char * _getopt_initialize (optstring) 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 = 1; nextchar = NULL; /* 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 (getenv ("POSIXLY_CORRECT") != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; 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 `EOF'. 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. */ #if NLS #include "nl_types.h" #endif 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; { optarg = NULL; #if NLS libc_nls_init(); #endif if (optind == 0) optstring = _getopt_initialize (optstring); if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ 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 && (argv[optind][0] != '-' || argv[optind][1] == '\0')) 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 EOF; } /* 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 ((argv[optind][0] != '-' || argv[optind][1] == '\0')) { if (ordering == REQUIRE_ORDER) return EOF; 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; 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 ((nameend - nextchar) == (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 /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) #if NLS fprintf (stderr, catgets(_libc_cat, GetoptSet, GetoptAmbiguous, "%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); #else fprintf (stderr, "%s: option `%s' is ambiguous\n", argv[0], argv[optind]); #endif nextchar += strlen (nextchar); optind++; 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 (opterr) { if (argv[optind - 1][1] == '-') /* --option */ #if NLS fprintf (stderr, catgets(_libc_cat, GetoptSet, GetoptNoArgumentsAllowed1, "%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 NLS fprintf (stderr, catgets(_libc_cat, GetoptSet, GetoptNoArgumentsAllowed2, "%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 } nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) #if NLS fprintf (stderr, catgets(_libc_cat, GetoptSet, GetoptRequiresArgument1, "%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); #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; } /* 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 (opterr) { if (argv[optind][1] == '-') /* --option */ #if NLS fprintf (stderr, catgets(_libc_cat, GetoptSet, GetoptUnrecognized1, "%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 NLS fprintf (stderr, catgets(_libc_cat, GetoptSet, GetoptUnrecognized2, "%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 } nextchar = (char *) ""; optind++; 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 (opterr) { /* 1003.2 specifies the format of this message. */ #if NLS fprintf (stderr, catgets(_libc_cat, GetoptSet, GetoptIllegal, "%s: illegal option -- %c\n"), argv[0], c); #else fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c); #endif } optopt = c; return '?'; } 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 (opterr) { /* 1003.2 specifies the format of this message. */ #if NLS fprintf (stderr, catgets(_libc_cat, GetoptSet, GetoptRequiresArgument2, "%s: option requires an argument -- %c\n"), argv[0], c); #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 /* _LIBC or not __GNU_LIBRARY__. */ #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 == EOF) 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 */ photopc-3.07/configure.in0000644000175000017500000002102111673670452012360 00000000000000dnl Process this file with autoconf to produce a configure script. AC_REVISION([$Id: configure.in,v 1.27 2011/12/19 17:15:22 crosser Exp $])dnl dnl $Log: configure.in,v $ dnl Revision 1.27 2011/12/19 17:15:22 crosser dnl bump version to 3.07; copyright year to 2011 dnl dnl Revision 1.26 2010/02/03 19:45:08 crosser dnl Bump version dnl dnl Revision 1.25 2003/03/14 15:25:35 crosser dnl dev version: trying to workaround phantom entries in the root directory dnl dnl Revision 1.24 2001/08/28 06:51:25 crosser dnl oops, the value is multiplied by 10 before becoming 2 bytes dnl And btw change dev subrelease dnl dnl Revision 1.23 2001/05/15 22:41:52 crosser dnl release dev1 dnl dnl Revision 1.22 2001/01/12 23:26:38 crosser dnl new release, avoid strncasecmp, change copyright year dnl dnl Revision 1.21 2000/08/13 21:51:48 crosser dnl More changes incorporated from John Bowman's version dnl dnl Revision 1.20 2000/07/14 06:35:39 crosser dnl reportedly some models return CAN instead of DC1 dnl dnl Revision 1.19 2000/05/09 13:20:54 crosser dnl configure read() with alarm() better. dnl Address signed vs. unsigned arguments dnl other cleanups to make most notorious compilers happy dnl dnl Revision 1.18 2000/05/02 12:13:32 crosser dnl some better debugging output dnl alarm() based timeouted read (build with "--without-select") dnl dnl Revision 1.17 2000/03/14 21:15:35 crosser dnl Nikon cp950 seems to report negative file size, try negate it. dnl dnl Revision 1.16 2000/02/17 21:29:54 crosser dnl final cleanup for 3.04, change version dnl change debugging levels dnl dnl Revision 1.15 2000/02/01 22:04:15 crosser dnl xchdir() function iterates thru path elements dnl define DEVVERSION for extra verbosity dnl dnl Revision 1.14 2000/01/23 15:51:01 crosser dnl work in progress on folder tree support dnl dnl Revision 1.13 1999/12/26 13:59:45 crosser dnl sort frame list for erase command; new version 3.03 dnl dnl Revision 1.12 1999/12/11 14:10:15 crosser dnl Support sgtty terminal control dnl Proper "fake speed" handling (needed two values) dnl dnl Revision 1.11 1999/12/01 21:41:23 crosser dnl add "pseudo" speed dnl dnl Revision 1.10 1999/11/29 05:39:11 crosser dnl make release 3.02 dnl dnl Revision 1.9 1999/11/17 13:48:08 crosser dnl check if need to include getopt.h dnl dnl Revision 1.8 1999/11/09 18:55:03 crosser dnl work on windows version dnl dnl Revision 1.7 1999/09/19 12:33:11 crosser dnl Mention comlite32 in the README dnl dnl Revision 1.6 1999/08/14 09:00:33 crosser dnl Create version.h's in dos and win23 directories dnl dnl Revision 1.5 1999/08/01 23:28:06 crosser dnl multiple enhancements dnl dnl Revision 1.4 1999/03/12 23:22:30 crosser dnl check utime and timezone things dnl dnl Revision 1.3 1999/03/12 10:06:23 crosser dnl fix bad checks dnl dnl Revision 1.2 1999/03/10 22:34:43 crosser dnl check rename func dnl dnl Revision 1.1 1999/03/06 13:16:06 crosser dnl Initial revision dnl AC_INIT(eph_iob.c) AM_INIT_AUTOMAKE(photopc, 3.07) AM_CONFIG_HEADER(config.h dos/version.h win32/version.h) dnl Checks for programs. AC_LANG_C AC_PROG_CC if test "X$ac_cv_prog_gcc" = "Xyes"; then CFLAGS="$CFLAGS -Wall" fi AM_C_PROTOTYPES AC_PROG_MAKE_SET AC_SUBST(PROGS)dnl AC_PATH_PROG(ECHO, echo, echo)dnl AC_PATH_PROG(LN, ln, ln)dnl AC_PATH_PROG(MV, mv, mv)dnl AC_PATH_PROG(RM, rm, rm)dnl AC_SUBST(LIBPROGS)dnl AC_PROG_INSTALL AC_PROG_RANLIB AC_PATH_PROG(AR, ar, ar)dnl AC_PROG_LN_S dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h sys/time.h sys/select.h unistd.h sched.h) AC_CHECK_HEADERS(termios.h termio.h sgtty.h utime.h sys/utime.h) AC_CHECK_HEADERS(signal.h) AC_ARG_ENABLE(termios, [ --disable-termios do not use POSIX terminal control (e.g. for NeXT)]) if test X$enable_termios != Xno && test X$ac_cv_header_termios_h = Xyes; then AC_DEFINE(USE_TERMIOS) elif test X$ac_cv_header_sgtty_h = Xyes; then AC_DEFINE(USE_SGTTY) elif test X$ac_cv_header_termio_h = Xyes; then AC_DEFINE(USE_TERMIO) else AC_MSG_ERROR([No usable terminal control (neither of termios/sgtty/termio)]) fi dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM AC_TYPE_SIGNAL AC_SYS_RESTARTABLE_SYSCALLS AC_MSG_CHECKING([whether struct tm has tm_gmtoff]) AC_CACHE_VAL(ac_cv_tm_gmtoff, [AC_TRY_COMPILE([ #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif ], [ struct tm stm; stm.tm_gmtoff=0; ], ac_cv_tm_gmtoff=yes, ac_cv_tm_gmtoff=no)])dnl AC_MSG_RESULT($ac_cv_tm_gmtoff) if test X$ac_cv_tm_gmtoff = Xyes; then AC_DEFINE(HAVE_TM_GMTOFF) fi AC_MSG_CHECKING([whether struct utimbuf is defined]) AC_CACHE_VAL(ac_cv_have_utimbuf, [AC_TRY_COMPILE([ #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #ifdef HAVE_UTIME_H # include #else # ifdef HAVE_SYS_UTIME_H # include # endif #endif ], [ struct utimbuf utb; utb.actime=0; ], ac_cv_have_utimbuf=yes, ac_cv_have_utimbuf=no)])dnl AC_MSG_RESULT($ac_cv_have_utimbuf) if test X$ac_cv_have_utimbuf = Xyes; then AC_DEFINE(HAVE_UTIMBUF) fi AC_MSG_CHECKING([whether optarg is defined in headers]) AC_CACHE_VAL(ac_cv_optarg_defined, [AC_TRY_COMPILE([ #include #ifdef STDC_HEADERS #include #endif #ifdef HAVE_UNISTD_H #include #endif ], [ char *xxx; xxx=optarg; ], ac_cv_optarg_defined=yes, ac_cv_optarg_defined=no)])dnl AC_MSG_RESULT($ac_cv_optarg_defined) if test X$ac_cv_optarg_defined = Xyes; then AC_DEFINE(OPTARG_DEFINED) fi AC_CHECK_SIZEOF(short,2) AC_CHECK_SIZEOF(int,4) AC_CHECK_SIZEOF(long,4) AC_ARG_WITH(default_device, [ --with-default-device=DEVNAME serial device name [/dev/photopc]]) if test "X$with_default_device" != "Xno" && test "X$with_default_device" != "Xyes" && test "X$with_default_device" != "X"; then AC_DEFINE_UNQUOTED(DEFAULT_DEVICE,"$with_default_device")dnl fi dnl define INT16 and INT32 AC_ARG_WITH(int16, [ --with-int16=TYPE integer type that is 16 bits [autodetect]]) if test "X$with_int16" != "Xno" && test "X$with_int16" != "Xyes" && test "X$with_int16" != "X"; then INT16=$with_int16 else if test "X$ac_cv_sizeof_short" = "X2"; then INT16=short else if test "X$ac_cv_sizeof_int" = "X2"; then INT16=int fi fi fi AC_ARG_WITH(int32, [ --with-int32=TYPE integer type that is 32 bits [autodetect]]) if test "X$with_int32" != "Xno" && test "X$with_int32" != "Xyes" && test "X$with_int32" != "X"; then INT32=$with_int32 else if test "X$ac_cv_sizeof_long" = "X4"; then INT32=long else if test "X$ac_cv_sizeof_int" = "X4"; then INT32=int fi fi fi : ${INT16=unknown} : ${INT32=unknown} AC_SUBST(INT16)dnl AC_SUBST(INT32)dnl AC_DEFINE_UNQUOTED(INT16,$INT16)dnl AC_DEFINE_UNQUOTED(INT32,$INT32)dnl dnl Define LOWMEMORY model AC_ARG_ENABLE(lomemory, [ --enable-lowmemory Build lowmemory model], AC_DEFINE(LOWMEMORY)) dnl Use RT priority (default yes) AC_ARG_WITH(rtprio, [ --without-rtprio Do not use realtime priority]) if test "X$with_rtprio" != "Xno"; then AC_DEFINE(USE_RTPRIO) fi AC_ARG_ENABLE(alarmed_read, [ --enable-alarmed-read Use blocking read() in conjunction with alarm() instead of select() based (e.g. for BeOS)], AC_DEFINE(USE_ALARMED_READ)) dnl Checks for library functions. AC_CHECK_FUNCS(rename mkdir strerror strspn select) AC_CHECK_FUNCS(uname cfmakeraw sched_setscheduler nanosleep) AC_CHECK_FUNCS(snooze) dnl this is BeOS replacement for usleep() AC_FUNC_VPRINTF AC_FUNC_STRFTIME AC_REPLACE_FUNCS(usleep getopt) AC_CHECK_FUNC(strcasecmp, [], [LIBOBJS="$LIBOBJS strcscmp.o"]) dnl this sould be done after determining the target system type... AC_DEFINE(UNIX) dnl check if all necessary functions are detected if test $ac_cv_header_termios_h != yes; then AC_MSG_ERROR([Cannot work without termios!]) fi if test $ac_cv_func_vprintf != yes; then AC_MSG_ERROR([Cannot work without v*printf() functions!]) fi if test $INT16 = unknown; then AC_MSG_ERROR([Cannot determine 16bit integer type!]) fi if test $INT32 = unknown; then AC_MSG_ERROR([Cannot determine 32bit integer type!]) fi case $VERSION in *dev*) AC_DEFINE(DEVVERSION);; esac # This is necessary so that .o files in LIBOBJS are also built via # the ANSI2KNR-filtering rules. LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'` if test "X$with_rtprio" = "Xyes"; then AC_MSG_RESULT([***]) AC_MSG_RESULT([*** "photopc" program must be setuid root to use realtime priority]) AC_MSG_RESULT([***]) fi AC_OUTPUT(Makefile) photopc-3.07/config.h.in0000644000175000017500000001514611673670700012101 00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* $Id: acconfig.h,v 1.9 2000/07/14 06:35:39 crosser Exp $ */ /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: acconfig.h,v $ Revision 1.9 2000/07/14 06:35:39 crosser reportedly some models return CAN instead of DC1 Revision 1.8 2000/05/09 13:20:54 crosser configure read() with alarm() better. Address signed vs. unsigned arguments other cleanups to make most notorious compilers happy Revision 1.7 2000/02/04 22:31:56 crosser Clean up things dealing with folder tree recursion. Fixed log entry in acconfig.h that conflicted with "configure" Revision 1.6 2000/02/01 22:04:15 crosser xchdir() function iterates thru path elements define a variable for extra verbosity Revision 1.5 1999/12/11 14:10:15 crosser Support sgtty terminal control Proper "fake speed" handling (needed two values) Revision 1.4 1999/11/17 13:48:08 crosser check if need to include getopt.h Revision 1.3 1999/11/09 18:55:03 crosser work on windows version Revision 1.2 1999/08/01 23:28:06 crosser add RTPRIO Revision 1.1 1999/07/29 06:48:17 crosser Initial revision */ /* Integer 16bit type */ #undef INT16 /* Integer 3bit type */ #undef INT32 /* Platform definition */ #undef UNIX #undef MSWINDOS #undef DOS /* Low memory model */ #undef LOWMEMORY /* Realtime priority */ #undef USE_RTPRIO /* struct tm has tm_gmtoff member */ #undef HAVE_TM_GMTOFF /* headers contain definition of optarg */ #undef OPTARG_DEFINED /* terminal control type */ #undef USE_TERMIOS #undef USE_SGTTY #undef USE_TERMIO /* is struct utimbuf defined in sys/utime.h */ #undef HAVE_UTIMBUF /* use blocking read() in conjunction with alarm() instead of select() */ #undef USE_ALARMED_READ /* devine for development versions - extra verbosity */ #undef DEVVERSION /* default device name */ #undef DEFAULT_DEVICE /* Define to 1 if you have the `cfmakeraw' function. */ #undef HAVE_CFMAKERAW /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `getopt' function. */ #undef HAVE_GETOPT /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_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 the `nanosleep' function. */ #undef HAVE_NANOSLEEP /* Define to 1 if you have the `rename' function. */ #undef HAVE_RENAME /* Define to 1 if system calls automatically restart after interruption by a signal. */ #undef HAVE_RESTARTABLE_SYSCALLS /* Define to 1 if you have the header file. */ #undef HAVE_SCHED_H /* Define to 1 if you have the `sched_setscheduler' function. */ #undef HAVE_SCHED_SETSCHEDULER /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the header file. */ #undef HAVE_SGTTY_H /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the `snooze' function. */ #undef HAVE_SNOOZE /* 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 `strerror' function. */ #undef HAVE_STRERROR /* 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 `strspn' function. */ #undef HAVE_STRSPN /* 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_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 header file. */ #undef HAVE_SYS_UTIME_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIO_H /* Define to 1 if you have the `uname' function. */ #undef HAVE_UNAME /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Name of package */ #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 to 1 if the C compiler supports function prototypes. */ #undef PROTOTYPES /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* 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 /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Define like PROTOTYPES; this can be used by system headers. */ #undef __PROTOTYPES /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `long int' if does not define. */ #undef off_t /* Define to `unsigned int' if does not define. */ #undef size_t photopc-3.07/fnames.c0000644000175000017500000001404607227253625011474 00000000000000#ifndef LINT static char *rcsid="$Id: fnames.c,v 1.7 2001/01/11 06:49:57 crosser Exp $"; #endif /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: fnames.c,v $ Revision 1.7 2001/01/11 06:49:57 crosser minor cleanups on source make manual page in sync with the source Revision 1.6 2000/05/09 13:20:54 crosser configure read() with alarm() better. Address signed vs. unsigned arguments other cleanups to make most notorious compilers happy Revision 1.5 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 1.4 1999/03/27 23:52:29 crosser remove old check for valid pictm because it's not needed with gltimetz Revision 1.3 1999/03/22 05:59:31 lightner Include for Win32 compile Use gltimetz() instead of gmtime()/localtime() Revision 1.2 1999/03/10 22:34:43 crosser clenup Revision 1.1 1999/03/09 18:36:34 crosser Initial revision */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #include #include "fnames.h" #include "ctimez.h" #if defined(MSWINDOWS) #include #endif #ifdef MSWINDOWS #define MS_PROGRAM_NAMES #define ERRNO GetLastError() #else #define ERRNO errno #endif static char *shortcut[][4] = { { "%m%d_%%03d.jpg", "%y%m%d%%02d.jpg", "%Y_%m_%d-%H_%M_%S.jpg", "%Y/%m/%d/%H_%M_%S.jpg" }, { "%m%d-%%03d.jpg", "%y%m%d%%02d.jpt", /* this is not a typo */ "%Y_%m_%d-%H_%M_%S-t.jpg", "%Y/%m/%d/%H_%M_%S-t.jpg" }, { "%m%d_%%03d.wav", "%y%m%d%%02d.wav", "%Y_%m_%d-%H_%M_%S.wav", "%Y/%m/%d/%H_%M_%S.wav" } }; #define MAXSHORTCUT '4' static int ftype=0; void makename(char *fname,int flen,char *filenm,int datatype, time_t pictime,char *nameformat,int usetimezone) { int count; struct stat st; struct tm *pictm; int hascount=0; int width=0; int maxcount; char *ifslash; char *p; if ((filenm[0] == '\0') || (filenm[strlen(filenm)-1] == '\\') || (filenm[strlen(filenm)-1] == '/' )) { ifslash=""; } else { ifslash="/"; } pictm=gltimetz(&pictime,usetimezone); if (nameformat) { if (strlen(nameformat) == 1) { if (*nameformat == 'd') { ftype=1; nameformat="%010lu"; } else if (*nameformat == 'x') { ftype=1; nameformat="%08lx"; #ifdef HAVE_STRFTIME } else if ((*nameformat >= '1') && (*nameformat <= MAXSHORTCUT)) { ftype=2; nameformat= shortcut[datatype][(*nameformat)-'1']; #endif } else { fprintf(stderr, "invalid shortcut `-f %c', using default\n", *nameformat); nameformat=NULL; } } else { #ifdef HAVE_STRFTIME ftype=2; #else fprintf(stderr, "format `-f %s' unsupported, using default\n", nameformat); nameformat=NULL; #endif } } if (nameformat && (ftype == 2)) { /* see if there is a field for count */ enum {deflt,escaped,pc1,pc2,digit} state=deflt; for (p=nameformat;*p;p++) switch (state) { case deflt: switch (*p) { case '\\': state=escaped; break; case '%': state=pc1; break; default: state=deflt; break; } break; case escaped: state=deflt; break; case pc1: switch (*p) { case '%': state=pc2; break; default: state=deflt; break; } break; case pc2: if ((*p >= '0') && (*p <= '9')) { state=digit; width*=10; width+=(*p-'0'); } else state=deflt; break; case digit: if ((*p >= '0') && (*p <= '9')) { state=digit; width*=10; width+=(*p-'0'); } else state=deflt; if (*p == 'd') hascount++; break; } } if (hascount > 1) { fprintf(stderr,"bad `-f %s' option: more than one count fields\n", nameformat); hascount=0; width=0; } if (hascount && ((width < 1) || (width > 8))) { fprintf(stderr,"bad count field width in `-f %s' option\n", nameformat); hascount=0; width=0; } switch (width) { case 1: maxcount=10; break; case 2: maxcount=100; break; default: maxcount=1000; break; } for (count=1;counttm_mon+1, pictm->tm_mday, (datatype==THUMBNAIL)?"-":"_", count, (datatype==AUDIO)?"wav":"jpg"); if ((stat(fname,&st) < 0) && (ERRNO == ENOENT)) { break; } } else if (ftype == 1) { char timestr[MAXFORMAT+1]; char ext[5]; sprintf(timestr,nameformat,pictime); if (count == 1) ext[0]='\0'; else sprintf(ext,".%03d",count-1); sprintf(fname,"%s%s%s%s", filenm, ifslash, timestr, ext); if ((stat(fname,&st) < 0) && (ERRNO == ENOENT)) { break; } #ifdef HAVE_STRFTIME } else if (ftype == 2) { char timestr[MAXFORMAT+1]; char timestr2[MAXFORMAT+1]; char ext[5]; if (hascount) { (void)strftime(timestr2,(size_t)MAXFORMAT-width, nameformat,pictm); sprintf(timestr,timestr2,count); } else { (void)strftime(timestr,MAXFORMAT, nameformat,pictm); } if ((hascount) || (count == 1)) ext[0]='\0'; else sprintf(ext,".%03d",count-1); sprintf(fname,"%s%s%s%s", filenm, ifslash, timestr, ext); if ((stat(fname,&st) < 0) && (ERRNO == ENOENT)) { break; } #endif /* HAVE_STRFTIME */ } } /* Just for case (we should not have overwritten the buffer) */ fname[flen-1]='\0'; /* OK, now time to create intermediate directories */ #ifdef HAVE_MKDIR for (p=fname+strlen(filenm);*p;p++) if (*p == '/') { *p='\0'; (void)mkdir(fname,0777); *p='/'; } #endif } photopc-3.07/install-sh0000755000175000017500000003253711500011217012042 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # 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. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # 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 $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: photopc-3.07/ctimez.c0000644000175000017500000000661107012067007011502 00000000000000#ifndef LINT static char *rcsid="$Id: ctimez.c,v 1.7 1999/11/09 18:55:03 crosser Exp $"; #endif /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: ctimez.c,v $ Revision 1.7 1999/11/09 18:55:03 crosser work on windows version Revision 1.6 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 1.5 1999/03/27 23:47:05 crosser cosmetic Revision 1.4 1999/03/22 05:59:31 lightner Add gltimetz() routine for Win32 localtime/gmtime() NULL pointer returns Revision 1.3 1999/03/12 23:22:30 crosser clean zone handling Revision 1.2 1999/03/10 22:34:43 crosser notimezone -> usetimezone Revision 1.1 1999/03/09 18:30:22 crosser Initial revision */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #include "ctimez.h" struct tm * gltimetz(time_t *clock,int usetimezone) { struct tm *tm; static struct tm null_tm; if (usetimezone) tm=localtime(clock); else tm=gmtime(clock); if (!tm) { /* Windows can return NULL!! */ null_tm.tm_sec = 0; /* Seconds after minute (0-59) */ null_tm.tm_min = 0; /* Minutes after hour (0-59) */ null_tm.tm_hour = 0; /* Hours since midnight (0-23) */ null_tm.tm_mday = 1; /* Day of month (1-31) */ null_tm.tm_mon = 0; /* Month (0-11; January=0) */ null_tm.tm_year = 0; /* Year (current year minus 1900) */ null_tm.tm_wday = 1; /* Day of week (0-6; Sunday=0) */ null_tm.tm_yday = 0; /* Day of year (0-365; January 1=0) */ null_tm.tm_isdst = 0; /* Always 0 for gmtime */ tm = &null_tm; } return tm; } char * ctimetz(time_t *clock,int usetimezone) { static char tmbuf[80]; struct tm *camtm; char *timefmt; if ((*clock) == (time_t)-1) { strcpy(tmbuf,"N/A"); return tmbuf; } camtm=gltimetz(clock,usetimezone); #ifdef HAVE_STRFTIME if (usetimezone) timefmt="%a %b %d %H:%M:%S %Y %Z"; else timefmt="%a %b %d %H:%M:%S %Y"; (void)strftime(tmbuf,sizeof(tmbuf),timefmt,camtm); #else strncpy(tmbuf,asctime(camtm),sizeof(tmbuf)); tmbuf[sizeof(tmbuf)-1]='\0'; /* paranoia */ tmbuf[strlen(tmbuf)-1]='\0'; /* remove newline */ #endif return tmbuf; } time_t zoneoffset(time_t now) { #ifndef HAVE_TM_GMTOFF struct tm gtm; time_t offset; #endif struct tm ltm; ltm=*localtime(&now); #ifdef HAVE_TM_GMTOFF return ltm.tm_gmtoff; #else /* Compute timezone difference in seconds. This is the difference between gmtime() and locatime() return values. */ gtm=*gmtime(&now); /* Assume we are never more than 24 hours away. */ offset=gtm.tm_yday-ltm.tm_yday; if (offset > 1) offset=-24; else if (offset < -1) offset=24; else offset*=24; offset+=gtm.tm_hour-ltm.tm_hour; offset*=60; offset+=gtm.tm_min-ltm.tm_min; offset*=60; offset+=gtm.tm_sec-ltm.tm_sec; return -offset; #endif } photopc-3.07/getopt.h0000644000175000017500000001063306453236753011533 00000000000000/* Declarations for getopt. Copyright (C) 1989, 1990, 1991, 1992, 1993 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. */ #ifndef _GETOPT_H #define _GETOPT_H 1 #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 EOF, 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; /* 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 __STDC__ 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 #if __STDC__ #if defined(__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 /* not __GNU_LIBRARY__ */ 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); #else /* not __STDC__ */ extern int getopt (); extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); #endif /* not __STDC__ */ #ifdef __cplusplus } #endif #endif /* _GETOPT_H */ photopc-3.07/comio.h0000644000175000017500000000232506612365243011330 00000000000000/* $Id: comio.h,v 1.2 1998/10/18 13:18:27 crosser Exp $ */ /* $Log: comio.h,v $ Revision 1.2 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 1.1 1998/01/18 02:16:45 crosser Initial revision */ #ifndef _COMIO_H #define _COMIO_H /* function prototypes */ void TTinit(int port, long speed);/* Initialize the communications system */ int ttopen(); /* Open a port for communications */ int ttclose( void ); /* Close the communications port */ int ttchk( void ); /* Return count of received characters */ void ttoc( unsigned char ); /* Output a character to the com port */ int ttinc( void ); /* Input a character from circular buffer */ void ttflui( void ); /* Flush circular buffer of characters */ int dobaud( long ); /* Set the baud rate for the port */ void coms( int ); /* Establish modem data */ void serini( void ); /* Initialize the com port for interrupts */ void serrst( void ); /* Reset the com port to original settings */ void interrupt serint( void ); /* Com port receiver ISR */ #endif photopc-3.07/ansi2knr.c0000644000175000017500000004745511500011217011736 00000000000000/* Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved. */ /*$Id: ansi2knr.c,v 1.14 2003/09/06 05:36:56 eggert Exp $*/ /* Convert ANSI C function definitions to K&R ("traditional C") syntax */ /* ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. No author or distributor accepts responsibility to anyone for the consequences of using it or for whether it serves any particular purpose or works at all, unless he says so in writing. Refer to the GNU General Public License (the "GPL") for full details. Everyone is granted permission to copy, modify and redistribute ansi2knr, but only under the conditions described in the GPL. A copy of this license is supposed to have been given to you along with ansi2knr so you can know your rights and responsibilities. It should be in a file named COPYLEFT, or, if there is no file named COPYLEFT, a file named COPYING. Among other things, the copyright notice and this notice must be preserved on all copies. We explicitly state here what we believe is already implied by the GPL: if the ansi2knr program is distributed as a separate set of sources and a separate executable file which are aggregated on a storage medium together with another program, this in itself does not bring the other program under the GPL, nor does the mere fact that such a program or the procedures for constructing it invoke the ansi2knr executable bring any other part of the program under the GPL. */ /* * Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]] * --filename provides the file name for the #line directive in the output, * overriding input_file (if present). * If no input_file is supplied, input is read from stdin. * If no output_file is supplied, output goes to stdout. * There are no error messages. * * ansi2knr recognizes function definitions by seeing a non-keyword * identifier at the left margin, followed by a left parenthesis, with a * right parenthesis as the last character on the line, and with a left * brace as the first token on the following line (ignoring possible * intervening comments and/or preprocessor directives), except that a line * consisting of only * identifier1(identifier2) * will not be considered a function definition unless identifier2 is * the word "void", and a line consisting of * identifier1(identifier2, <>) * will not be considered a function definition. * ansi2knr will recognize a multi-line header provided that no intervening * line ends with a left or right brace or a semicolon. These algorithms * ignore whitespace, comments, and preprocessor directives, except that * the function name must be the first thing on the line. The following * constructs will confuse it: * - Any other construct that starts at the left margin and * follows the above syntax (such as a macro or function call). * - Some macros that tinker with the syntax of function headers. */ /* * The original and principal author of ansi2knr is L. Peter Deutsch * . Other authors are noted in the change history * that follows (in reverse chronological order): lpd 2000-04-12 backs out Eggert's changes because of bugs: - concatlits didn't declare the type of its bufend argument; - concatlits didn't recognize when it was inside a comment; - scanstring could scan backward past the beginning of the string; when - the check for \ + newline in scanstring was unnecessary. 2000-03-05 Paul Eggert Add support for concatenated string literals. * ansi2knr.c (concatlits): New decl. (main): Invoke concatlits to concatenate string literals. (scanstring): Handle backslash-newline correctly. Work with character constants. Fix bug when scanning backwards through backslash-quote. Check for unterminated strings. (convert1): Parse character constants, too. (appendline, concatlits): New functions. * ansi2knr.1: Document this. lpd 1999-08-17 added code to allow preprocessor directives wherever comments are allowed lpd 1999-04-12 added minor fixes from Pavel Roskin for clean compilation with gcc -W -Wall lpd 1999-03-22 added hack to recognize lines consisting of identifier1(identifier2, xxx) as *not* being procedures lpd 1999-02-03 made indentation of preprocessor commands consistent lpd 1999-01-28 fixed two bugs: a '/' in an argument list caused an endless loop; quoted strings within an argument list confused the parser lpd 1999-01-24 added a check for write errors on the output, suggested by Jim Meyering lpd 1998-11-09 added further hack to recognize identifier(void) as being a procedure lpd 1998-10-23 added hack to recognize lines consisting of identifier1(identifier2) as *not* being procedures lpd 1997-12-08 made input_file optional; only closes input and/or output file if not stdin or stdout respectively; prints usage message on stderr rather than stdout; adds --filename switch (changes suggested by ) lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with compilers that don't understand void, as suggested by Tom Lane lpd 1996-01-15 changed to require that the first non-comment token on the line following a function header be a left brace, to reduce sensitivity to macros, as suggested by Tom Lane lpd 1995-06-22 removed #ifndefs whose sole purpose was to define undefined preprocessor symbols as 0; changed all #ifdefs for configuration symbols to #ifs lpd 1995-04-05 changed copyright notice to make it clear that including ansi2knr in a program does not bring the entire program under the GPL lpd 1994-12-18 added conditionals for systems where ctype macros don't handle 8-bit characters properly, suggested by Francois Pinard ; removed --varargs switch (this is now the default) lpd 1994-10-10 removed CONFIG_BROKETS conditional lpd 1994-07-16 added some conditionals to help GNU `configure', suggested by Francois Pinard ; properly erase prototype args in function parameters, contributed by Jim Avera ; correct error in writeblanks (it shouldn't erase EOLs) lpd 1989-xx-xx original version */ /* Most of the conditionals here are to make ansi2knr work with */ /* or without the GNU configure machinery. */ #if HAVE_CONFIG_H # include #endif #include #include #if HAVE_CONFIG_H /* For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h). This will define HAVE_CONFIG_H and so, activate the following lines. */ # if STDC_HEADERS || HAVE_STRING_H # include # else # include # endif #else /* not HAVE_CONFIG_H */ /* Otherwise do it the hard way */ # ifdef BSD # include # else # ifdef VMS extern int strlen(), strncmp(); # else # include # endif # endif #endif /* not HAVE_CONFIG_H */ #if STDC_HEADERS # include #else /* malloc and free should be declared in stdlib.h, but if you've got a K&R compiler, they probably aren't. */ # ifdef MSDOS # include # else # ifdef VMS extern char *malloc(); extern void free(); # else extern char *malloc(); extern int free(); # endif # endif #endif /* Define NULL (for *very* old compilers). */ #ifndef NULL # define NULL (0) #endif /* * The ctype macros don't always handle 8-bit characters correctly. * Compensate for this here. */ #ifdef isascii # undef HAVE_ISASCII /* just in case */ # define HAVE_ISASCII 1 #else #endif #if STDC_HEADERS || !HAVE_ISASCII # define is_ascii(c) 1 #else # define is_ascii(c) isascii(c) #endif #define is_space(c) (is_ascii(c) && isspace(c)) #define is_alpha(c) (is_ascii(c) && isalpha(c)) #define is_alnum(c) (is_ascii(c) && isalnum(c)) /* Scanning macros */ #define isidchar(ch) (is_alnum(ch) || (ch) == '_') #define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_') /* Forward references */ char *ppdirforward(); char *ppdirbackward(); char *skipspace(); char *scanstring(); int writeblanks(); int test1(); int convert1(); /* The main program */ int main(argc, argv) int argc; char *argv[]; { FILE *in = stdin; FILE *out = stdout; char *filename = 0; char *program_name = argv[0]; char *output_name = 0; #define bufsize 5000 /* arbitrary size */ char *buf; char *line; char *more; char *usage = "Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n"; /* * In previous versions, ansi2knr recognized a --varargs switch. * If this switch was supplied, ansi2knr would attempt to convert * a ... argument to va_alist and va_dcl; if this switch was not * supplied, ansi2knr would simply drop any such arguments. * Now, ansi2knr always does this conversion, and we only * check for this switch for backward compatibility. */ int convert_varargs = 1; int output_error; while ( argc > 1 && argv[1][0] == '-' ) { if ( !strcmp(argv[1], "--varargs") ) { convert_varargs = 1; argc--; argv++; continue; } if ( !strcmp(argv[1], "--filename") && argc > 2 ) { filename = argv[2]; argc -= 2; argv += 2; continue; } fprintf(stderr, "%s: Unrecognized switch: %s\n", program_name, argv[1]); fprintf(stderr, usage); exit(1); } switch ( argc ) { default: fprintf(stderr, usage); exit(0); case 3: output_name = argv[2]; out = fopen(output_name, "w"); if ( out == NULL ) { fprintf(stderr, "%s: Cannot open output file %s\n", program_name, output_name); exit(1); } /* falls through */ case 2: in = fopen(argv[1], "r"); if ( in == NULL ) { fprintf(stderr, "%s: Cannot open input file %s\n", program_name, argv[1]); exit(1); } if ( filename == 0 ) filename = argv[1]; /* falls through */ case 1: break; } if ( filename ) fprintf(out, "#line 1 \"%s\"\n", filename); buf = malloc(bufsize); if ( buf == NULL ) { fprintf(stderr, "Unable to allocate read buffer!\n"); exit(1); } line = buf; while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL ) { test: line += strlen(line); switch ( test1(buf) ) { case 2: /* a function header */ convert1(buf, out, 1, convert_varargs); break; case 1: /* a function */ /* Check for a { at the start of the next line. */ more = ++line; f: if ( line >= buf + (bufsize - 1) ) /* overflow check */ goto wl; if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL ) goto wl; switch ( *skipspace(ppdirforward(more), 1) ) { case '{': /* Definitely a function header. */ convert1(buf, out, 0, convert_varargs); fputs(more, out); break; case 0: /* The next line was blank or a comment: */ /* keep scanning for a non-comment. */ line += strlen(line); goto f; default: /* buf isn't a function header, but */ /* more might be. */ fputs(buf, out); strcpy(buf, more); line = buf; goto test; } break; case -1: /* maybe the start of a function */ if ( line != buf + (bufsize - 1) ) /* overflow check */ continue; /* falls through */ default: /* not a function */ wl: fputs(buf, out); break; } line = buf; } if ( line != buf ) fputs(buf, out); free(buf); if ( output_name ) { output_error = ferror(out); output_error |= fclose(out); } else { /* out == stdout */ fflush(out); output_error = ferror(out); } if ( output_error ) { fprintf(stderr, "%s: error writing to %s\n", program_name, (output_name ? output_name : "stdout")); exit(1); } if ( in != stdin ) fclose(in); return 0; } /* * Skip forward or backward over one or more preprocessor directives. */ char * ppdirforward(p) char *p; { for (; *p == '#'; ++p) { for (; *p != '\r' && *p != '\n'; ++p) if (*p == 0) return p; if (*p == '\r' && p[1] == '\n') ++p; } return p; } char * ppdirbackward(p, limit) char *p; char *limit; { char *np = p; for (;; p = --np) { if (*np == '\n' && np[-1] == '\r') --np; for (; np > limit && np[-1] != '\r' && np[-1] != '\n'; --np) if (np[-1] == 0) return np; if (*np != '#') return p; } } /* * Skip over whitespace, comments, and preprocessor directives, * in either direction. */ char * skipspace(p, dir) char *p; int dir; /* 1 for forward, -1 for backward */ { for ( ; ; ) { while ( is_space(*p) ) p += dir; if ( !(*p == '/' && p[dir] == '*') ) break; p += dir; p += dir; while ( !(*p == '*' && p[dir] == '/') ) { if ( *p == 0 ) return p; /* multi-line comment?? */ p += dir; } p += dir; p += dir; } return p; } /* Scan over a quoted string, in either direction. */ char * scanstring(p, dir) char *p; int dir; { for (p += dir; ; p += dir) if (*p == '"' && p[-dir] != '\\') return p + dir; } /* * Write blanks over part of a string. * Don't overwrite end-of-line characters. */ int writeblanks(start, end) char *start; char *end; { char *p; for ( p = start; p < end; p++ ) if ( *p != '\r' && *p != '\n' ) *p = ' '; return 0; } /* * Test whether the string in buf is a function definition. * The string may contain and/or end with a newline. * Return as follows: * 0 - definitely not a function definition; * 1 - definitely a function definition; * 2 - definitely a function prototype (NOT USED); * -1 - may be the beginning of a function definition, * append another line and look again. * The reason we don't attempt to convert function prototypes is that * Ghostscript's declaration-generating macros look too much like * prototypes, and confuse the algorithms. */ int test1(buf) char *buf; { char *p = buf; char *bend; char *endfn; int contin; if ( !isidfirstchar(*p) ) return 0; /* no name at left margin */ bend = skipspace(ppdirbackward(buf + strlen(buf) - 1, buf), -1); switch ( *bend ) { case ';': contin = 0 /*2*/; break; case ')': contin = 1; break; case '{': return 0; /* not a function */ case '}': return 0; /* not a function */ default: contin = -1; } while ( isidchar(*p) ) p++; endfn = p; p = skipspace(p, 1); if ( *p++ != '(' ) return 0; /* not a function */ p = skipspace(p, 1); if ( *p == ')' ) return 0; /* no parameters */ /* Check that the apparent function name isn't a keyword. */ /* We only need to check for keywords that could be followed */ /* by a left parenthesis (which, unfortunately, is most of them). */ { static char *words[] = { "asm", "auto", "case", "char", "const", "double", "extern", "float", "for", "if", "int", "long", "register", "return", "short", "signed", "sizeof", "static", "switch", "typedef", "unsigned", "void", "volatile", "while", 0 }; char **key = words; char *kp; unsigned len = endfn - buf; while ( (kp = *key) != 0 ) { if ( strlen(kp) == len && !strncmp(kp, buf, len) ) return 0; /* name is a keyword */ key++; } } { char *id = p; int len; /* * Check for identifier1(identifier2) and not * identifier1(void), or identifier1(identifier2, xxxx). */ while ( isidchar(*p) ) p++; len = p - id; p = skipspace(p, 1); if (*p == ',' || (*p == ')' && (len != 4 || strncmp(id, "void", 4))) ) return 0; /* not a function */ } /* * If the last significant character was a ), we need to count * parentheses, because it might be part of a formal parameter * that is a procedure. */ if (contin > 0) { int level = 0; for (p = skipspace(buf, 1); *p; p = skipspace(p + 1, 1)) level += (*p == '(' ? 1 : *p == ')' ? -1 : 0); if (level > 0) contin = -1; } return contin; } /* Convert a recognized function definition or header to K&R syntax. */ int convert1(buf, out, header, convert_varargs) char *buf; FILE *out; int header; /* Boolean */ int convert_varargs; /* Boolean */ { char *endfn; char *p; /* * The breaks table contains pointers to the beginning and end * of each argument. */ char **breaks; unsigned num_breaks = 2; /* for testing */ char **btop; char **bp; char **ap; char *vararg = 0; /* Pre-ANSI implementations don't agree on whether strchr */ /* is called strchr or index, so we open-code it here. */ for ( endfn = buf; *(endfn++) != '('; ) ; top: p = endfn; breaks = (char **)malloc(sizeof(char *) * num_breaks * 2); if ( breaks == NULL ) { /* Couldn't allocate break table, give up */ fprintf(stderr, "Unable to allocate break table!\n"); fputs(buf, out); return -1; } btop = breaks + num_breaks * 2 - 2; bp = breaks; /* Parse the argument list */ do { int level = 0; char *lp = NULL; char *rp = NULL; char *end = NULL; if ( bp >= btop ) { /* Filled up break table. */ /* Allocate a bigger one and start over. */ free((char *)breaks); num_breaks <<= 1; goto top; } *bp++ = p; /* Find the end of the argument */ for ( ; end == NULL; p++ ) { switch(*p) { case ',': if ( !level ) end = p; break; case '(': if ( !level ) lp = p; level++; break; case ')': if ( --level < 0 ) end = p; else rp = p; break; case '/': if (p[1] == '*') p = skipspace(p, 1) - 1; break; case '"': p = scanstring(p, 1) - 1; break; default: ; } } /* Erase any embedded prototype parameters. */ if ( lp && rp ) writeblanks(lp + 1, rp); p--; /* back up over terminator */ /* Find the name being declared. */ /* This is complicated because of procedure and */ /* array modifiers. */ for ( ; ; ) { p = skipspace(p - 1, -1); switch ( *p ) { case ']': /* skip array dimension(s) */ case ')': /* skip procedure args OR name */ { int level = 1; while ( level ) switch ( *--p ) { case ']': case ')': level++; break; case '[': case '(': level--; break; case '/': if (p > buf && p[-1] == '*') p = skipspace(p, -1) + 1; break; case '"': p = scanstring(p, -1) + 1; break; default: ; } } if ( *p == '(' && *skipspace(p + 1, 1) == '*' ) { /* We found the name being declared */ while ( !isidfirstchar(*p) ) p = skipspace(p, 1) + 1; goto found; } break; default: goto found; } } found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' ) { if ( convert_varargs ) { *bp++ = "va_alist"; vararg = p-2; } else { p++; if ( bp == breaks + 1 ) /* sole argument */ writeblanks(breaks[0], p); else writeblanks(bp[-1] - 1, p); bp--; } } else { while ( isidchar(*p) ) p--; *bp++ = p+1; } p = end; } while ( *p++ == ',' ); *bp = p; /* Make a special check for 'void' arglist */ if ( bp == breaks+2 ) { p = skipspace(breaks[0], 1); if ( !strncmp(p, "void", 4) ) { p = skipspace(p+4, 1); if ( p == breaks[2] - 1 ) { bp = breaks; /* yup, pretend arglist is empty */ writeblanks(breaks[0], p + 1); } } } /* Put out the function name and left parenthesis. */ p = buf; while ( p != endfn ) putc(*p, out), p++; /* Put out the declaration. */ if ( header ) { fputs(");", out); for ( p = breaks[0]; *p; p++ ) if ( *p == '\r' || *p == '\n' ) putc(*p, out); } else { for ( ap = breaks+1; ap < bp; ap += 2 ) { p = *ap; while ( isidchar(*p) ) putc(*p, out), p++; if ( ap < bp - 1 ) fputs(", ", out); } fputs(") ", out); /* Put out the argument declarations */ for ( ap = breaks+2; ap <= bp; ap += 2 ) (*ap)[-1] = ';'; if ( vararg != 0 ) { *vararg = 0; fputs(breaks[0], out); /* any prior args */ fputs("va_dcl", out); /* the final arg */ fputs(bp[0], out); } else fputs(breaks[0], out); } free((char *)breaks); return 0; } photopc-3.07/epinfo.c0000644000175000017500000002572111673670452011506 00000000000000#ifndef LINT static char *rcsid="$Id: epinfo.c,v 2.25 2011/12/19 17:15:22 crosser Exp $"; #endif /* Copyright (c) 1997-2011 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: epinfo.c,v $ Revision 2.25 2011/12/19 17:15:22 crosser bump version to 3.07; copyright year to 2011 Revision 2.24 2011/12/19 17:03:12 crosser Give DateTimeOriginal precedence over DateTime so the file times refer to the moment of taking the picture, not the time of last edit. Revision 2.23 2009/01/08 09:14:21 crosser if DateTime not present (e.g. in Nokia cameraphone[s]), try DateTimeOriginal Revision 2.22 2001/08/28 06:40:10 crosser change website reference to sourceforge Revision 2.21 2001/01/12 23:26:38 crosser new release, avoid strncasecmp, change copyright year Revision 2.20 2000/05/09 13:20:54 crosser configure read() with alarm() better. Address signed vs. unsigned arguments other cleanups to make most notorious compilers happy Revision 2.19 1999/11/17 13:48:08 crosser check if need to include getopt.h Revision 2.18 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 2.17 1999/07/29 07:20:12 crosser remove revision.h Revision 2.16 1999/04/28 08:34:34 crosser paranoid stuff Revision 2.15 1999/04/27 20:56:02 lightner Debug command-line file name wildcards under MS-DOS Revision 2.14 1999/04/22 05:01:09 crosser define frc Revision 2.13 1999/04/22 04:54:17 crosser process dos wildcards Revision 2.12 1999/03/27 23:47:23 crosser change gmtime to gltimetz (possible null pointer under Windows) Revision 2.11 1999/03/21 20:22:09 crosser help message typo Revision 2.10 1999/03/13 13:27:43 crosser add tzset Revision 2.9 1999/03/12 23:22:30 crosser clean zone handling Revision 2.8 1999/03/12 10:06:23 crosser new setfiletime Revision 2.7 1999/03/10 22:34:43 crosser lots of new functionality (rename, setutime) etc. Revision 2.6 1999/03/06 13:37:08 crosser Convert to autoconf-style Revision 2.5 1999/02/28 22:40:48 crosser Support Exif file format Revision 2.4 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 2.3 1998/02/13 23:02:40 crosser use proper open mode on DOS Revision 2.2 1998/02/08 19:58:38 crosser Support low memory: chunked saving etc. Revision 2.1 1998/01/18 02:16:45 crosser DOS support Revision 2.0 1998/01/02 19:20:11 crosser Added support for Win32 Revision 1.2 1997/12/24 00:19:13 crosser Do not check vendor identifier Revision 1.1 1997/08/17 08:59:54 crosser Initial revision */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifdef STDC_HEADERS #include #include #endif #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #ifdef __TURBOC__ #include #endif #include "a12scan.h" #include "exifscan.h" #include "fnames.h" #include "ctimez.h" #include "filetime.h" #ifndef OPTARG_DEFINED #include #endif #ifdef UNIX #ifdef HAVE_UNAME #include #endif #ifdef HAVE_UNISTD_H #include #endif #define READMODE "r" #else #include "strcscmp.h" #define READMODE "rb" #define MS_PROGRAM_NAMES #endif #ifdef DOS #define MS_PROGRAM_NAMES #pragma warn -par #pragma warn -sus #endif static int usetimezone=1; static int setutime=0; static int dorename=0; static char *nameformat=NULL; static char *tag=NULL; void showhelp(char *name) { printf("usage: %s [-h] [-V] [-z] [-r] [-t] [-f fmt] [-T TagName] ...\n\n",name); printf("Options:\n\n"); printf("\t-h\t- show this help screen\n"); printf("\t-V\t- show software version number\n"); printf("\t-z\t- suppress timezone conversions (camera's clock is local time)\n"); printf("\t-r\t- rename files to the timestamp\n"); printf("\t-t\t- set modification time of the files to the time of snapshot\n"); printf("\t-f fmt\t- rename files using strftime(3) with the time of snapshot\n"); printf("\t\t\t fmt = 'd' - name is seconds since the epoch in decimal\n"); printf("\t\t\t fmt = 'x' - name is seconds since the epoch in hex\n"); #ifdef HAVE_STRFTIME printf("\t\t\t fmt = '1' - name is MMDD_CCC (default)\n"); printf("\t\t\t fmt = '2' - name is YYMMDDCC\n"); printf("\t\t\t fmt = '3' - name is YYYY_MM_DD-HH_MM_SS\n"); printf("\t\t\t fmt = '4' - name is YYYY/MM/DD/HH_MM_SS\n"); printf("\t\t\t otherwise make file names using strftime(3),\n"); printf("\t\t\t if fmt contains `%%%%NNNd' then place count there\n"); #endif } void showversion(char *name) { #ifdef UNIX #if HAVE_UNAME #define OS uts.sysname struct utsname uts; if (uname(&uts)) { strncpy(uts.sysname,"Unix",sizeof(uts.sysname)); uts.sysname[sizeof(uts.sysname)-1]='\0'; } #else #define OS "Generic UNIX" #endif #endif #ifdef DOS #define OS "MS-DOS" #endif #ifdef MSWINDOWS #define OS "Windows 95/NT" #endif #ifndef OS #define OS "Unknown OS" #endif printf("%s version %s (%s) build %s (%s memory model)\n", name,VERSION,OS,__DATE__, #ifdef LOWMEMORY "low" #else "normal" #endif ); printf(" Copyright (c) 1997-2001 Eugene Crosser and Bruce Lightner\n"); printf(" URL: http://photopc.sourceforge.net/\n"); } int main(int argc,char *argv[]) { char *fname; char newname[MAXFORMAT+1]; FILE *fp; struct stat st; unsigned char *buf,*res,*p,*q; off_t bufsize,ressize; int c,rc=0; char *program = argv[0]; enum {NONE,APP12,EXIF} fformat; time_t ptime; struct tm *ptm,ptms; #ifdef __TURBOC__ struct ffblk ffb; int frc; char *w, *pp, fbuf[MAXFORMAT+1]; #endif #ifdef MS_PROGRAM_NAMES /* remove program extension */ if ((q = strrchr(program, '.')) != NULL) *q = '\0'; /* remove directory */ if ((q = strrchr(program, '/')) != NULL) program = q + 1; if ((q = strrchr(program, '\\')) != NULL) program = q + 1; #endif while ((c=getopt(argc,argv,"hVzrtf:T:")) != EOF) switch (c) { case 'f': nameformat=optarg; break; case 'T': tag=optarg; break; case 'z': usetimezone=0; break; case 't': setutime=1; break; case 'r': dorename=1; break; case 'h': showhelp(program); return 0; case 'V': showversion(program); return 0; default: showhelp(program); return 1; } if (!argv[optind]) { showhelp(program); return -1; } #ifdef DOS /* MS/DOS has silly assumptions about the timezone if TZ variable is not set. Hope the following will help in most cases, the results should be at least predictable... */ if (getenv("TZ") == NULL) { putenv("TZ=GMT0"); usetimezone = 0; } #endif tzset(); #ifdef __TURBOC__ while (w=argv[optind]) for (frc=findfirst(argv[optind++],&ffb,0); !frc;frc=findnext(&ffb)) { strncpy(fbuf,w,sizeof(fbuf)-1); fbuf[sizeof(fbuf)-1]='\0'; fname = fbuf; if ((pp=strrchr(fname,'/'))!=NULL) { *++pp = '\0'; strcat(fname,ffb.ff_name); } else if ((pp=strrchr(fname,'\\'))!=NULL) { *++pp = '\0'; strcat(fname,ffb.ff_name); } else if ((pp=strrchr(fname,':'))!=NULL) { *++pp = '\0'; strcat(fname,ffb.ff_name); } else { fname = ffb.ff_name; } #else while ((fname=argv[optind++])) { #endif if ((fp=fopen(fname,READMODE)) == NULL) { perror(fname); rc++; continue; } if (fstat(fileno(fp),&st)) { perror(fname); fclose(fp); rc++; continue; } #ifdef LOWMEMORY if (st.st_size > MAXJPREFIX) bufsize=MAXJPREFIX; else #endif bufsize=st.st_size; buf=malloc((size_t)bufsize); if (buf == NULL) { perror("malloc"); fclose(fp); rc++; continue; } if (fread(buf,(size_t)bufsize,1,fp) != 1) { perror("read"); free(buf); fclose(fp); rc++; continue; } fclose(fp); res=buf; ressize=bufsize; fformat=NONE; if (a12scan(&res,&ressize) == 0) fformat=APP12; else { res=buf; ressize=bufsize; if (exifscan(&res,&ressize) == 0) fformat=EXIF; } if (fformat == NONE) { fprintf(stderr,"No camera-specific information in the file\n"); free(buf); rc++; continue; } if (dorename || setutime) { if (tag) { fprintf(stderr,"-T cannot be used with -r and -t\n"); free(buf); rc++; continue; } if (fformat == APP12) { p=a12search("TimeDate",res,ressize); if ((p == NULL) || (sscanf(p,"%lu",&ptime) != 1)) { fprintf(stderr, "TimeDate key not found\n"); ptime=-1; } } else { p=exifsearch("DateTimeOriginal",res,ressize); if (p == NULL) p=exifsearch("DateTime",res,ressize); if ((p == NULL) || (sscanf(p,"\"%d:%d:%d %d:%d:%d\"", &ptms.tm_year, &ptms.tm_mon, &ptms.tm_mday, &ptms.tm_hour, &ptms.tm_min, &ptms.tm_sec) != 6)) { fprintf(stderr, "DateTime key not found\n"); ptime=-1; } else { if (ptms.tm_mon) ptms.tm_mon-=1; if (ptms.tm_year) ptms.tm_year-=1900; ptime=mktime(&ptms); ptime+=zoneoffset(ptime); } } if (ptime == -1) { fprintf(stderr,"cannot rename/setutime\n"); free(buf); rc++; continue; } if (dorename) { makename(newname,MAXFORMAT,"",IMAGE, ptime,nameformat,usetimezone); printf("rename %s -> %s\n",fname,newname); #ifdef HAVE_RENAME if (rename(fname,newname)) { perror("rename"); rc++; } else fname=newname; /* for setutime */ #else if (link(fname,newname)) { perror("link"); rc++; } else { if (unlink(fname)) perror("unlink"); fname=newname; /* for setutime */ } #endif } if (setutime) { printf("set modtime %s: %s\n", fname,ctimetz(&ptime,usetimezone)); if (setfiletime(fname,st.st_atime,ptime, usetimezone)) { perror("setfiletime"); rc++; } } } else if (tag && (fformat == APP12) && (strcmp(tag,"DateTime") == 0)) { p=a12search("TimeDate",res,ressize); if (p && (sscanf(p,"%lu",&ptime) == 1)) { ptm=gltimetz(&ptime,0); printf("\"%04d:%02d:%02d %02d:%02d:%02d\"\n", ptm->tm_year+1900, ptm->tm_mon+1, ptm->tm_mday, ptm->tm_hour, ptm->tm_min, ptm->tm_sec); } else { fprintf(stderr,"TimeDate key not found\n"); free(buf); rc++; continue; } } else if (tag) { if (fformat == APP12) p=a12search(tag,res,ressize); else p=exifsearch(tag,res,ressize); if (p == NULL) { fprintf(stderr,"Key not found\n"); free(buf); rc++; continue; } if ((q=strchr(p,'\n'))) *q='\0'; if ((q=strchr(p,'\r'))) *q='\0'; printf("%s\n",p); } else { if (fformat == APP12) a12dump(res,ressize); else exifdump(res,ressize); } free(buf); } return rc; } photopc-3.07/protocol.htm0000644000175000017500000005373607676474160012452 00000000000000 Serial Protocol of Some Digital Cameras

Disclaimer: This description is completely unofficial. Most of the information presented here is discovered by me, Eugene Crosser, while snooping the serial line and by trial and error. I never had an official protocol description, have never seen any related software source code, and have never done reverse engineering of any related software. This description may be incomplete, inaccurate or completely wrong. You are warned.

Some information is taken from `camediaplay' package by Jun-ichiro Itoh <itojun@itojun.org>, from the findings of Thierry Bousch <bousch%linotte.uucp@topo.math.u-psud.fr> TsuruZoh Tachibanaya <tsuruzoh@butaman.ne.jp> and from other (open) sources and not checked by me.


Serial Protocol of Some Digital Cameras

Several models of digital cameras, namely Epson, Sanyo, Agfa and Olympus cameras, seem to use the same protocol for communication with the host. Follows the description of the high-level protocol they use over the serial line.

Protocol Basics

The host and the camera exchange with data packets and individual bytes. Serial line paramaters used are: 8bit, no parity. No flow control is used. All arithmetic data is transmitted least significant byte first ("little endian").

Protocol Elements

The elementary units of the protocol are:
Initialization ByteNUL 0x00
Action Complete NotificationENQ 0x05
Positive AchnowledgementACK 0x06
Unable to Execute CommandDC1 0x11
Negative Acknowledgement,
also Camera Signature
NAK 0x15
PacketVariable length sequence of bytes
Termination Byte
0xff

Packet structure

The packet has the following structure:
OffsetLengthMeaning
01Packet type
11Packet subtype/sequence
22Length of data
4variableData
-22checksum

Known packet types are:
TypeDescription
0x02Data packet that is not last in sequence
0x03Data packet that is last in sequence
0x1bCommand packet

Data packets that are sent in responce to a single command are numbered starting from zero. If all requested data fits in one packet, it has type 0x03 and sequence 0.

Command packet has subtype 0x43 or 0x53. Only the first command packet in a session has subtype 0x53.

Maximum length of data field in a packet is 2048 bytes, which yields in 2054 total packet length.

Checksum is a simple 16 bit arithmetic sum of all bytes in the data field. As already mentioned above, length and checksum values are transmitted least significant byte first.

Flow of Control

A communication session flow is as follows:
HostCamera
Port speed set to 19200 baud
Host sends init byte 0x00
Camera responds with signature 0x15
Host sends command packet with subtype 0x53 and "set speed" command
Camera sends ACK 0x06
Port speed set to the new value
Host sends command
Camera responds with either ACK plus optionally "action taken" notifier or data packet sequence
Host sends ACK to every data packet
... Command - reply cycle repeated ...
Camera sends 0xff and resets after a few seconds (value is model-dependant) of inactivity

If the camera does not respond to a command in reasonable time, or responds with a NAK, the command can be resent. If the camera does not provide a complete data packet in reasonable time, or the data packet is corrupt (checksum does not match), the host can request resending of the packet by sending NAK instead of ACK.

Command format and codes

Command is a sequence of bytes sent in the data field of a command packet. Command format is as follows:
OffsetLengthDescription
01Command code
11Register number or subcode
2variableOptional argument

Five command codes are known:
CodeArgumentDescription
0int32Set value of integer register
1noneRead value of integer register
2vdataTake action unrelated to registers
3vdataSet value of vdata register
4noneRead value of vdata register

Commands 0 and 3 are replied with a single ACK 0x06. Command 2 is replied with an ACK 0x06 followed by an "action complete" notifier 0x05. Commands 1 and 4 are replied with a sequence of data packets, each of them must be ACK'ed by the host.

Command 0 must be issued with a 4 byte argument containg the new value for the register (bytes in "LSB first" order). Command 2 typically is issued with a single zero byte as an argument. Command 3 is issued with an argument of variable number of bytes. If this is a printable string, it should not include the trailing zero byte.

Camera replies to the command 1 with a single data packet containing 4 bytes of a 32bit integer (in "LSB first" order). Camera replies to the command 4 with a sequence of data packets with variable number of data bytes. Note that if a printable string is returned, it is terminated with a zero byte, and thus may be safely printed or otherwise treated as a normal C language character string.

Registers

The following registers are known (read/writablity info is inaccurate):
No.TypeR/WDescription
1int32R/WResolution: 1 - Std, 2 - Hi, 3 - Ext, other values possible
2int32R/WClock in UNIX time_t format
3int32R/WShutter speed (microseconds), 0 - auto
4int32 WCurrent frame number (or animation number if hi order byte is 0xff)
5int32R/WAperture: 0 - Auto, 1 - Low, 2 - Med, 3 - ?, 4 - Hi
6int32R/WColor mode: 1 - Color, 2 - B/W
7int32R/WFlash mode: 0 - Auto, 1 - Force, 2 - Off, 3 - Anti RedEye, 4 - Slow sync
8int32R/WUnknown (128)
9int32R/WUnknown (128)
10int32R No. of frames in current folder
11int32R No. of frames left
12int32R Length of current frame *
13int32R Length of current thumbnail *
14vdataR Current frame data *
15vdataR Current thumbnail data *
16int32R Battery capacity percentage
17int32R/WCommunication speed 1 - 9600 .. 5 - 115200, 6 - 230400, 256 - 9600 .. 264 - 911600 (sync?)
18int32R Unknown (1)
19int32R/WBright/Contrast: 0 - Normal, 1 - Contrast+, 2 - Contrast-, 3 - Brightnes+, 4 - Brightnes-
20int32R/WWhite balance: 0 - Auto, 1 - Sunny, 2 - Incandescent, 3 - Fluorescent, 5 - Flash, 6- White preset, 255 - Cloudy
21vdataR/WUnused
22vdataR/WCamera I.D.
23int32R/WAutoshut on host timer (seconds)
24int32R/WAutoshut in field timer (seconds)
25vdataR/WSerial No. (string)
26vdataR Version
27vdataR/WModel
28int32R Available memory left
29vdataR/WUpload image data to this register
30int32 WLED: 0 - Off, 1 - On, 2 - Blink
31vdataR Unknown ("\0")
32int32R Put "magic spell" 0x0FEC000E here before uploading image data
33int32R/WFocus mode: 1 - Macro, 2 - Normal, 3 - Infinity/fisheye
34int32R Operation mode: 1 - Off, 2 - Record, 3-Play, 6-Thumbnail
35int32R/WLCD brightness 1 to 7
36int32R Unknown (3)
37vdataR Unknown ("\0")
38int32R LCD autoshut timer (seconds)
39int32R Protection state of current frame *
40int32R True No. of frames taken
41int32R/WLCD date format: 1 - 'YY MM DD, 2 - DD MM 'HH
42vdataR Unknown ("")
43vdataR Audio data description block *
0: expanded .wav length
1: compressed .wav length
3: Unknown (0)
4: Unknown (0)
5: Unknown (0)
6: Unknown (0)
7: Unknown (0)
44vdataR Audio data *
45vdataR Unknown ("")
46vdataR Camera summary data: 32 bytes with copies of 8 other registers
0: Reg 1 (Resolution)
1: Reg 35 (LCD brightness) or Reg 7 (Flash mode)
2: Reg 10 (Frames taken) or Unknown
3: Unknown (0) or Unknown
4: Unknown (0) or Reg 16 (Battery capacity)
5: Unknown (0) or Reg 10 (Frames taken)
6: Unknown (0) or Reg 11 (Frames left)
7: Number of animations taken
47vdataR Picture summary data: 32 bytes or 8 int32's *
0: Hi order byte: unknown, next 3 bytes: Length of current image
1: Length of current thumbnail
2: Audio data length (expanded)
3: Resolution
4: Protection state
5: TimeDate
6: Unknown (0)
7: Animation type: 1 - 10ms, 2 - 20ms
48vdataR Manufacturer
49vdataR Unknown ("")
50int32R Unknown (0)
51int32R/WCard detected: 1 - No, 2 - Yes
52vdataR/WUnknown ("")
53int32R/WLanguage: 3 - english, 4 - french, 5 - german, 6 - italian, 8 - spanish, 10 - dutch
54-59vdataR Unknown ("")
60int32R True No. of frames taken
61-68vdataR Unknown ("")
69vdataR Exposure Compensation 8 bytes
0: compensation value -20 to +20
1: 0
2: 0
3: 0
4: 10
5: 0
6: 0
7: 0
70int32R/WExp. meter: 2 - Center weighted, 3 - Spot, 5 - Multi element matrix
71vdataR/WEffective zoom in tenths of millimeters: 8 bytes
0: LSB
1: MSB
2: 0
3: 0
4: 10
5: 0
6: 0
7: 0
72int32R/WBitmap: 1 - AEL/WBL, 2 - Fisheye, 4 - Wide, 8 - Manual zoom, 16 - B/W, 256 - 1.25x, 512 - 1.6x, 768 - 2.0x, 1024 - 2.5x, 1280 - off
73-76vdataR Unknown ("")
77int32 WSize of data packet from camera
(default 0x800)
78vdataR Unknown ("")
79vdataR Filename of current frame *
80-81vdataR Unknown ("")
82int32 WSession inactivity timeout
83int32R/WFolder navigation
When read, return number of folders on the card.
When written without data, reset folder system (?)
Or select current folder by its number
84vdataR/WCurrent folder name (may read or set)
85vdataR Unknown ("")
86int32R/WDigital zoom; 0 - 1X, otherwise zoom factor x 100 (i.e. in percent)
87-90vdataR Unknown ("")
91vdataR Current folder I.D. and name
* Note: Marked registers only become useful for reading after setting register 4. If value of 0 assigned to register 4 after doing action 5, subsequent retrieval of picture data gives the "live preview".

For command 2, the second byte is action code not register number. The following action codes are known:
CodeArgumentDescription
0single zero byteErase last picure
1single zero byteErase all picures (but not animations)
2single zero byteTake picture
4single zero byteFinish session immediately
5single zero byteTake preview snapshot (retreivable as frame zero)
6single byteCalibration / testing. Arg value:
1 Calibrate autofocus
3 Test zoom/exposure
4-6 Store 0 in Reg 32
9 Load LCD Brightness (0-31) from Reg 32
10 Load LCD size (25 for Nikon Coolpix 950) from Reg 32
11 LCD Saturation (0-32) from Reg 32
13 LCD Red-Green (0-32) from Reg 32
14 LCD Blue (0-32) from Reg 32
15 Store -1 in Reg 32
16 Multi shot (locks up if lcd is on)
17 Take picture
18 Store -1 in Reg 32
20-23 locks up if lcd is on
24-255 Store -1 in Reg 32
7single zero byteErase current frame *
8single byteSwitch LCD mode. Arg value:
1 - Off
2 - Record
3 - Play (show current frame fullscreen)
4 - preview thumbnails (?)
5 - Thumbnail view (smaller?)
6 - Thumbnail view (larger?)
7 - Next
8 - Previous
9single byteSet protection state of current frame to the value of parameter (binary 0 or 1)*
11single zero byteStore freshly uploaded image into NVRAM (see appendix A)
12single byteLCD test. Arg value:
0 - white
1 - gray
2 - black
3 - red
4 - green
5 - blue
6 - test pattern
* Note: actions 7 and 9 only useful after setting register 0x04.


Appendix A

Date: Sun, 14 Jul 2002 01:28:39 +0200 (CEST)
From: =?iso-8859-1?Q?Peter_=C5strand?= <astrand(at)lysator.liu.se>
To: allyn(at)fratkin.com, <wolfgang(at)charlotte.wsrcc.com>, <crosser(at)average.org>
Subject: Upload on Olympus C-860L


FYI. 

Tonight, I've been struggling with uploading arbitrary pictures to my 
Olympus C-860L. I've finally found out that for the camera to accept the 
picture, to two conditions must be met:

1) The subsampling must be 2x1, 1x1, 1x1
2) The EXIF info must be just like the pictures the camera itself 
produces. 

So, I've made a small script to fix this. Feel free to include it in FAQs 
and/or photopc dists. 

/more/data/pics/olympus-reference-pic.jpg is just some picture taken with 
the camera. 

photopc-upload-all:

#!/bin/sh

TMPFILE=`mktemp /tmp/photopc-upload.XXXXXX` || exit 1

for file in $@; do 
    echo Converting $file...
    djpeg $file | cjpeg -sample 2x1 > $TMPFILE
    jhead -te /more/data/pics/olympus-reference-pic.jpg $TMPFILE
    echo Uploading $file...
    photopc upload $TMPFILE
    sleep 2;
done

rm -f $TMPFILE


-- 
/Peter Åstrand <astrand(at)lysator.liu.se>

Appendix B

Some Nikon models support an extension to the protocol described above, specifically designed for remote control units. This protocol allows to control zoom, emulate half-depress of the shutter release button, bulb operation and possibly more. <vladimir.vyskocil(at)wanadoo.fr> compiled a partial description of this protocol, available here.


Please mail your corrections/additions to <crosser at average dot org>
See http://photopc.sourceforge.net/ for possible updates.


photopc-3.07/fnames.h0000644000175000017500000000163506671571603011502 00000000000000/* $Id: fnames.h,v 1.2 1999/03/10 22:34:43 crosser Exp $ */ /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: fnames.h,v $ Revision 1.2 1999/03/10 22:34:43 crosser clenup Revision 1.1 1999/03/09 18:36:34 crosser Initial revision */ #ifndef FNAMES_H #define FNAMES_H #define MAXFORMAT 200 /* datatype values */ #define IMAGE 0 #define THUMBNAIL 1 #define AUDIO 2 void makename(char *fname,int flen,char *filenm,int datatype, time_t pictime,char *nameformat,int usetimezone); #endif photopc-3.07/eph_err.c0000644000175000017500000000471106751136766011654 00000000000000#ifndef LINT static char *rcsid="$Id: eph_err.c,v 2.6 1999/08/01 21:36:54 crosser Exp $"; #endif /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: eph_err.c,v $ Revision 2.6 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 2.5 1999/07/28 19:57:52 crosser reorder includes Revision 2.4 1999/03/06 13:37:08 crosser Convert to autoconf-style Revision 2.3 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 2.2 1998/01/18 02:16:45 crosser DOS support Revision 2.1 1998/01/03 19:57:13 crosser Fix Windows things, improve error reporting Revision 2.0 1998/01/02 19:20:11 crosser Added support for Win32 Revision 1.1 1997/08/17 08:59:54 crosser Initial revision */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "eph_io.h" #include "eph_priv.h" static char *eph_errmsg[] = { /* 10001 */ "Data too long", /* 10002 */ "Timeout", /* 10003 */ "Unexpected amount of data read", /* 10004 */ "Bad packet header received", /* 10005 */ "Bad CRC on packet", /* 10006 */ "Bad speed value", /* 10007 */ "No memory", /* 10008 */ "Bad arguments", /* 10009 */ "", /* 10010 */ "", /* 10011 */ "", /* 10012 */ "", /* 10013 */ "", /* 10014 */ "", /* 10015 */ "", }; #ifndef HAVE_STRERROR char *strerror(int err) { static char buf[32]; sprintf(buf,"System error %d",err); return buf; } #endif /* We do not do any buffer override checks here because we are sure that the function is called *only* from within our library. */ void eph_error (eph_iob *iob,int err,char *fmt,...) { va_list ap; char *msg=NULL; char msgbuf[512]; va_start(ap,fmt); if (fmt) { vsprintf(msgbuf,fmt,ap); } else { if ((err >= ERR_BASE) && (err < ERR_MAX)) { msg=eph_errmsg[err-ERR_BASE]; } else { msg=strerror(err); } strcpy(msgbuf,msg); } va_end(ap); (iob->errorcb)(err,msgbuf); } photopc-3.07/usleep.h0000644000175000017500000000165406612365243011523 00000000000000/* $Id: usleep.h,v 2.2 1998/10/18 13:18:27 crosser Exp $ */ /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: usleep.h,v $ Revision 2.2 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 2.1 1998/01/18 02:16:45 crosser DOS support Revision 2.0 1998/01/02 19:20:11 crosser Added support for Win32 */ #ifndef _USLEEP_H #define _USLEEP_H void usleep(long usecs); #ifdef DOS extern double delay_factor; void start_time(void); unsigned long elasped_usecs(void); #endif #endif photopc-3.07/README0000644000175000017500000002235207332470626010735 00000000000000 $Id: README,v 2.24 2001/08/03 09:40:38 crosser Exp $ Copyright (c) 1997-2001 Eugene G. Crosser Copyright (c) 1998,1999 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. This is a library and a command-line frontend to manipulate digital still cameras based on Fujitsu chipset and Sierra Imaging firmware. The program is known to work with Agfa, Epson, Olympus, Sanyo and Nikon (at least CoolPix 900, 950 and 8x0 but not CoolPix 600!) cameras. The cameras typically come with software for Windows and for Mac, and no description of the protocol. With this tool, they are managable from a UNIX box. Bruce D. Lightner has added support for Win32 and DOS platforms. Note that the program does not have any GUI, it is plain command-line even on Windows. I tried it under Linux/x86, FreeBSD, Solaris/SPARC and HP/UX, and it should be straightforward for other UNIX systems. Generally, UNIX system requirements are: - ANSI C compiler (theoretically should work with K&R but unchecked) - POSIX termios or BSD sgtty - presence of a 16bit integer type - serial port (with or without `modem control'). On UNIX, first run "./configure". Then, typing `make' will result in building the library and executables in the current directory. `make install' will install the executables, library and manual pages. If your `make' supports VPATH (e.g. GNU make), it is possible to build objects and executables in a different directory; create target directory and run /path/to/photopc/configure. If you are building from CVS source see instructions at the end of this file. When building on NeXT, you may need to specify --without-termios because termios is reportedly broken on NeXT. The program will use BSD sgtty style terminal control then. When building on BeOS, you may need to specify --enable-alarmed-read because on BeOS select() reportedly only works on network sockets and not on other type of streams. On UNIX systems that have sched_setcheduler() function the program can set itself "realtime priority". That makes it less vulnerable to possible timeouts caused by high system load, and, more important, it makes possible to use high-resolution mode of nanosleep() function. That means that it may run a bit faster (but you probably will not notice anyway). Make the progrem setuid root to use this mode. There is hopefully no danger because it revokes root privileges really early (even before processing command-line options). If you are so paranoid that you don't want even to compile in this feature, run configure with --without-rtprio option. To build for DOS and WIN32, chdir to "dos" or "win32" directories respectively and there type "make" (or "nmake"). You need compiler installed on your system. TurboC works under DOS, "Development Studio" (or how do they call it?) - under Win32. .zip distribution includes DOS and Win32 binaries pre-built for you. The runtime parameters are rather clear (hopefully). Running `photopc -h | more' will print the list of options and commands. If you are going to use the library for your own application and need the docs, tell me and I will write them. Included file `protocol.htm' contains description of the protocol used by the camera. `usage.htm' is a "casual" user's guide, full description is in the man pages. If you run the program on a DOS box, you may want a JPEG viewer; I've been told that a good free viewer `LXPIC' can be found at http://home.t-online.de/home/stefan.peichl. Also, there is a tool that may help in discovering serial protocols (although *I* did not use it when I examined that camera's protocol): http://www.endymion.com/portfolio/software/comlite32.htm Many commands may be unimplemented, esp. those specific for newer models. If you know how to do things that the program currently cannot do, please let me know. Two MOST COMMON PROBLEMS that you may face running the program are: ^^^^^^^^^^^^^^^^^^^^ 1. You run the program, but nothing happens with the camera, and the program says "Error 10003: eph_waitsig got -2" several times. a) Camera not powered up, or not in "communication mode". b) Cable incorrectly wired, or bad contact. c) Computer serial chip is not wired to the right connector or disabled in the BIOS. d) OS driver not properly configured (e.g. "setserial" was not run on Linux, or wrong interrupt was assigned). e) Some other program is using the port (e.g. gpm or {a,m,uu}getty). 2. When you download pictures and disk activity happens, download aborts due to excessive retries. Serial driver is loosing incoming bytes. This usually happens on Linux with ATA disk(s) when the driver is configured to run in PIO mode with disabled interrupts. Read the documentation on "hdparm" command and try playing with various driver modes. (Beware that on some combinations of chipset/disk this may cause data corruption!) Other possible causes are interrupt shared with another device, or another program trying to use the same serial port. I can be contacted at , fresh version of this tool (if any) and related information can be got from the SorceForge at http://photopc.sourceforge.net/. For CVS see bottom of this file. Some earlier and modified versions of the code accompanied by Win32 and DOS executables and archived in .zip format can be found at http://www.lightner.net/lightner/bruce/photopc/ Thanks to Jeff Tranter for contributing the man page and a few bugfixes, Bruce Lightner for Windows and DOS support, Thierry Bousch for many details of the protocol and advice, Sergey I. Panov for invaluable investigation of the folder navigation means, John Bowman for Nikon specific parts and other people who helped me to track down problems and learn more about the protocol. Trademarks are properties of their respective respected owners. --- APPENDIX: Building from CVS source. ^^^^^^^^ You must have cvs, autoconf and automake installed on your system. $ cd $your_src_dir $ cvs -d :pserver:anonymous@cvs.photopc.sourceforge.net:/cvsroot/photopc login Password: ( -- just press "Enter" for empty password) $ cvs -d :pserver:anonymous@cvs.photopc.sourceforge.net:/cvsroot/photopc checkout photopc $ cd photopc $ aclocal $ autoheader $ automake --add-missing $ autoconf $ ./configure --$various_options $ make $ sudo make install ========================================================================== $Log: README,v $ Revision 2.24 2001/08/03 09:40:38 crosser add "common problems" section, style changes Revision 2.23 2001/05/28 21:44:46 crosser fix cvs command in README Revision 2.22 2001/05/15 22:21:35 crosser README - reflect CVS and www server change to sourceforge eph_io.c - make waitsig() skip 0xff's in addition to NULs Revision 2.21 2000/05/09 13:20:54 crosser configure read() with alarm() better. Address signed vs. unsigned arguments other cleanups to make most notorious compilers happy Revision 2.20 2000/05/02 22:26:35 crosser A few things incorporated from John Bowman's Nikon specific diffs Revision 2.19 2000/01/24 20:25:23 crosser do better job in walking thru folder tree; credit to Sergey I. Panov Revision 2.18 1999/11/24 21:51:25 crosser instruction about building from cvs source Revision 2.17 1999/09/19 12:33:11 crosser Mention comlite32 in the README Revision 2.16 1999/08/26 16:11:57 crosser Change README to reflect new directory structure Revision 2.15 1999/08/01 22:13:10 crosser mention reltime priority things Revision 2.14 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 2.13 1999/04/28 08:28:53 crosser just don't like long copyrights Revision 2.12 1999/04/27 20:55:35 lightner Fix MS-DOS/Win32 makefile instructions Revision 2.11 1999/03/22 05:59:31 lightner Fix docs: Windows binaries go to win32/ Revision 2.10 1999/03/21 20:21:04 crosser mention configure Revision 2.9 1999/01/17 09:51:16 crosser change Bruce's address Revision 2.8 1998/10/18 13:18:27 crosser Put RCS logs and I.D. into the source Revision 2.7 1998/07/21 22:56:52 crosser fix CP 900 Revision 2.6 1998/06/07 13:55:20 crosser compatibilities and credits Revision 2.5 1998/05/09 18:22:42 crosser say that devices with modem control are allowable, minor fixes Revision 2.4 1998/03/01 18:57:04 crosser more credits Revision 2.3 1998/02/06 09:04:59 crosser mention DOS version Revision 2.2 1998/01/18 02:22:28 crosser change copyright Revision 2.1 1998/01/05 22:02:14 crosser add reference to Bruce's site Revision 2.0 1998/01/02 19:20:11 crosser Added support for Win32 Revision 1.4 1997/12/24 00:30:14 crosser add vendors, add url, add credits. Revision 1.3 1997/11/15 19:29:47 crosser update for release 1.7 Revision 1.2 1997/11/12 09:50:27 crosser mention photopc600, minor changes Revision 1.1 1997/08/17 09:06:54 crosser Initial revision photopc-3.07/exifscan.c0000644000175000017500000002110007106010266011774 00000000000000#ifndef LINT static char *rcsid="$Id: exifscan.c,v 1.5 2000/05/09 13:20:54 crosser Exp $"; #endif /* Copyright (c) 1997,1998 Eugene G. Crosser Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support) You may distribute and/or use for any purpose modified or unmodified copies of this software if you preserve the copyright notice above. THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE. */ /* $Log: exifscan.c,v $ Revision 1.5 2000/05/09 13:20:54 crosser configure read() with alarm() better. Address signed vs. unsigned arguments other cleanups to make most notorious compilers happy Revision 1.4 1999/08/01 21:36:54 crosser Modify source to suit ansi2knr (I hate the style that ansi2knr requires but you don't expect me to write another smarter ansi2knr implementation, right?) Revision 1.3 1999/03/12 10:06:23 crosser avoid strncmp Revision 1.2 1999/03/10 22:34:43 crosser separate from app12 scan Revision 1.1 1999/03/09 18:19:39 crosser Initial revision */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #ifdef STDC_HEADERS #include #include #endif #include "exifscan.h" int exifscan(unsigned char **buf,off_t *bufsize) { unsigned char *p; off_t length=0; p=*buf; while (p < ((*buf)+(*bufsize))) { while ((p < ((*buf)+(*bufsize))) && (*p != 0xff)) p++; while ((p < ((*buf)+(*bufsize))) && (*p == 0xff)) p++; if (*p == 0xD8) continue; length=(p[1]<<8)+p[2]; if ((*p == 0xe1) && (strcasecmp(p+3,"Exif")==0)) { p+=3; length-=3; break; } p+=length; } if (p >= ((*buf)+(*bufsize))) { (*bufsize)=0; (*buf)=NULL; return -1; } (*bufsize)=length; (*buf)=p; return 0; } static struct _exifdict { int tag; char *name; } exifdict[] = { {0xFE, "NewSubFileType"}, {0x100, "ImageWidth"}, {0x101, "ImageLength"}, {0x102, "BitsPerSample"}, {0x103, "Compression"}, {0x106, "PhotometricInterpretation"}, {0x10A, "FillOrder"}, {0x10D, "DocumentName"}, {0x10E, "ImageDescription"}, {0x10F, "Make"}, {0x110, "Model"}, {0x111, "StripOffsets"}, {0x112, "Orientation"}, {0x115, "SamplesPerPixel"}, {0x116, "RowsPerStrip"}, {0x117, "StripByteCounts"}, {0x11A, "XResolution"}, {0x11B, "YResolution"}, {0x11C, "PlanarConfiguration"}, {0x128, "ResolutionUnit"}, {0x12D, "TransferFunction"}, {0x131, "Software"}, {0x132, "DateTime"}, {0x13B, "Artist"}, {0x13E, "WhitePoint"}, {0x13F, "PrimaryChromaticities"}, {0x156, "TransferRange"}, {0x200, "JPEGProc"}, {0x201, "JPEGInterchangeFormat"}, {0x202, "JPEGInterchangeFormatLength"}, {0x211, "YCbCrCoefficients"}, {0x212, "YCbCrSubSampling"}, {0x213, "YCbCrPositioning"}, {0x214, "ReferenceBlackWhite"}, {0x828D, "CFARepeatPatternDim"}, {0x828E, "CFAPattern"}, {0x828F, "BatteryLevel"}, {0x8298, "Copyright"}, {0x829A, "ExposureTime"}, {0x829D, "FNumber"}, {0x83BB, "IPTC/NAA"}, {0x8769, "ExifOffset"}, {0x8773, "InterColorProfile"}, {0x8822, "ExposureProgram"}, {0x8824, "SpectralSensitivity"}, {0x8825, "GPSInfo"}, {0x8827, "ISOSpeedRatings"}, {0x8828, "OECF"}, {0x9000, "ExifVersion"}, {0x9003, "DateTimeOriginal"}, {0x9004, "DateTimeDigitized"}, {0x9101, "ComponentsConfiguration"}, {0x9102, "CompressedBitsPerPixel"}, {0x9201, "ShutterSpeedValue"}, {0x9202, "ApertureValue"}, {0x9203, "BrightnessValue"}, {0x9204, "ExposureBiasValue"}, {0x9205, "MaxApertureValue"}, {0x9206, "SubjectDistance"}, {0x9207, "MeteringMode"}, {0x9208, "LightSource"}, {0x9209, "Flash"}, {0x920A, "FocalLength"}, {0x927C, "MakerNote"}, {0x9286, "UserComment"}, {0x9290, "SubSecTime"}, {0x9291, "SubSecTimeOriginal"}, {0x9292, "SubSecTimeDigitized"}, {0xA000, "FlashPixVersion"}, {0xA001, "ColorSpace"}, {0xA002, "ExifImageWidth"}, {0xA003, "ExifImageLength"}, {0xA005, "InteroperabilityOffset"}, {0xA20B, "FlashEnergy"}, {0xA20C, "SpatialFrequencyResponse"}, {0xA20E, "FocalPlaneXResolution"}, {0xA20F, "FocalPlaneYResolution"}, {0xA210, "FocalPlaneResolutionUnit"}, {0xA214, "SubjectLocation"}, {0xA215, "ExposureIndex"}, {0xA217, "SensingMethod"}, {0xA300, "FileSource"}, {0xA301, "SceneType"}, {0, NULL} }; static int typlens[] = {1,1,2,4,8,1,1,2,4,8}; static int s2n_intel(unsigned char *data,int length,int sign) { int i,msb,val=0; for (i=0;i buflen) { if (buf) free(buf); buf=(unsigned char*)malloc((size_t)len); } if (buf == NULL) return ""; sprintf(buf,"\"%s\"",data+offset); } else { int k; int sig; len=count*22+3; if (len > buflen) { if (buf) free(buf); buf=(unsigned char*)malloc((size_t)len); } if (buf == NULL) return ""; buf[0]='\0'; if ((typ == 6) || (typ >= 8)) sig=1; else sig=0; if (count > 1) sprintf(buf,"("); for (k=0;k 1) sprintf(buf+strlen(buf),")"); } return buf; } static unsigned char * exifmatch(unsigned char *data,int offset,int tag, int typ,int typlen,int count,void *priv) { int i; int needtag=0; unsigned char *rc; for (i=0;exifdict[i].tag;i++) { if (strcmp(exifdict[i].name,(char*)priv) == 0) { needtag=exifdict[i].tag; break; } } if (tag == 0x8769) { rc=exifwalk(data,offset,exifmatch,priv); if (rc) return rc; } else if (tag == 0xA005) { rc=exifwalk(data,offset,exifmatch,priv); if (rc) return rc; } if (needtag == tag) return exifstr(data,offset,tag,typ,typlen,count); else return NULL; } static unsigned char * exifprt(unsigned char *data,int offset,int tag, int typ,int typlen,int count,void *priv) { unsigned char *rc; int i; char *tagname=NULL,badtag[32]; for (i=0;exifdict[i].tag;i++) { if (exifdict[i].tag == tag) { tagname=exifdict[i].name; break; } } if (tagname == NULL) { sprintf(badtag,"TAG#%d",tag); tagname=badtag; } if (tag == 0x8769) { printf("\n"); rc=exifwalk(data,offset,exifprt,priv); printf("\n"); if (rc) return rc; } else if (tag == 0xA005) { printf("\n"); rc=exifwalk(data,offset,exifprt,priv); printf("\n"); if (rc) return rc; } else { printf("%s=%s\n",tagname, exifstr(data,offset,tag,typ,typlen,count)); } return NULL; } static unsigned char * exifwalk(unsigned char *data,int where, unsigned char *(*each)( unsigned char *data,int offset,int tag, int typ,int typlen,int count,void *priv), void *priv) { unsigned char *rc=NULL; int i; if (where == 0) { switch (data[0]) { case 'I': s2n=s2n_intel; break; case 'M': s2n=s2n_motorola; break; default: return NULL; } where=S2N(data+4,4,0); } else where=S2N(data+where,4,0); for (i=where;i;i=S2N(data+i+2+(12*S2N(data+i,2,0)),4,0)) { int ifsnum=S2N(data+i,2,0); int j; for (j=0;j 10)) continue; typlen=typlens[typ-1]; count=S2N(data+entry+4,4,0); offset=entry+8; if (count*typlen > 4) offset=S2N(data+offset,4,0); if ((rc=(*each)(data,offset,tag,typ, typlen,count,priv))) return rc; } } return NULL; } unsigned char * exifsearch(char *key,unsigned char *buf,off_t bufsize) { if (buf == NULL) return NULL; return exifwalk(buf+6,0,exifmatch,(void*)key); } void exifdump(unsigned char *buf,off_t bufsize) { if (buf == NULL) return; exifwalk(buf+6,0,exifprt,NULL); }