├── NEWS ├── Makefile.am ├── .gitignore ├── AUTHORS ├── tests ├── Makefile.am ├── test_inverse.c ├── test_swap.c └── Makefile.in ├── src ├── Makefile.am ├── global_macro.h ├── command_line.h ├── makefile_mingw ├── compile_date_time.h ├── variant.h ├── check_modbus.h ├── variant.c ├── check_modbus.1 ├── check_modbus.c ├── Makefile.in └── command_line.c ├── configure.ac ├── ChangeLog ├── README ├── missing ├── install-sh ├── INSTALL ├── depcomp ├── Makefile.in └── COPYING /NEWS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS=src tests 2 | 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | 9 | # Compiled Static libraries 10 | *.lai 11 | *.la 12 | *.a 13 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Roman Suchkov aka Fineson 3 | Miroslaw Lach 4 | -------------------------------------------------------------------------------- /tests/Makefile.am: -------------------------------------------------------------------------------- 1 | check_PROGRAMS=test_swap test_inverse 2 | test_swap_SOURCES=test_swap.c ../src/variant.h ../src/variant.c 3 | test_inverse_SOURCES=test_inverse.c ../src/variant.h ../src/variant.c 4 | 5 | TESTS=$(check_PROGRAMS) 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | # man1_MANS=check_modbus.1 2 | dist_man_MANS = check_modbus.1 3 | bin_PROGRAMS=check_modbus 4 | check_modbus_SOURCES=compile_date_time.h command_line.c command_line.h check_modbus.c variant.h variant.c check_modbus.h global_macro.h 5 | -------------------------------------------------------------------------------- /src/global_macro.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLOBAL_MACRO_H_ 2 | #define _GLOBAL_MACRO_H_ 3 | 4 | #define STR(S) #S // STR(blabla) = "blabla" 5 | #define XSTR(S) STR(S) // STR(_version) = "v1.0" if _version = "v1.0" 6 | 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/command_line.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMMAND_LINE_H_ 2 | #define _COMMAND_LINE_H_ 3 | 4 | #include "check_modbus.h" 5 | 6 | int parse_command_line(modbus_params_t* params, int argc, char **argv); 7 | void print_settings(modbus_params_t* params); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/makefile_mingw: -------------------------------------------------------------------------------- 1 | # was build using MinGW (non-official build with gcc 4.4.5) 2 | MinGW=c:\MinGW\bin 3 | PATH := ${MinGW};${PATH} 4 | 5 | all: 6 | gcc -DPACKAGE_VERSION="0.31" -Lc:/mingw/msys/1.0/local/lib -Ic:/mingw/msys/1.0/local/include check_modbus.c variant.c -lmodbus -o check_modbus.exe 7 | -------------------------------------------------------------------------------- /tests/test_inverse.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "../src/variant.h" 8 | 9 | int test_inverse(int format) 10 | { 11 | data_t before, after; 12 | int size_words; 13 | int i; 14 | 15 | before.format = format; 16 | after.format = format; 17 | 18 | size_words = sizeof_data_t( &before ); /* sizeof_data_t returs size in words */ 19 | for(i=0; i 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "../src/variant.h" 8 | 9 | int test_swap(int format) 10 | { 11 | data_t before, after; 12 | int size_bytes; 13 | int i; 14 | 15 | before.format = format; 16 | after.format = format; 17 | 18 | size_bytes = 2*sizeof_data_t( &before ); /* sizeof_data_t returns size in words */ 19 | for(i=0; i= 3.0.0) 9 | - support of many data formats (unsigned/signed int16_t, int32_t, float, double) 10 | - support of several data orders (LSB, MSB and some others) 11 | - retries can be sent to get reliable answer 12 | - supports performance data 13 | - supports creation dump of the registers (binary, hexadecimal, decimal) 14 | - support binary dump as an input source for data (useful for off-line data) 15 | 16 | 17 | In general, plugin can be build as usual 18 | 19 | ./configure 20 | make 21 | make install 22 | 23 | 24 | When you are trying to build plugin under MinGW, then maybe you will need to define path for libmodbus explicitly. 25 | 26 | libmodbus is installed by default in /usr/local/lib. In MinGW you will need to run 27 | 28 | ./configure LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include 29 | 30 | instead of just ./configure 31 | 32 | 33 | For usage details see manual page or run ./check_modbus --help. -------------------------------------------------------------------------------- /src/variant.h: -------------------------------------------------------------------------------- 1 | #ifndef _VARIANT_H_ 2 | #define _VARIANT_H_ 3 | 4 | #include 5 | 6 | typedef struct 7 | { 8 | union 9 | { 10 | uint8_t bytes[256]; 11 | uint16_t words[128]; 12 | 13 | uint8_t byte; 14 | int8_t sbyte; 15 | 16 | uint16_t word; 17 | int16_t sword; 18 | 19 | uint32_t dword; 20 | int32_t sdword; 21 | 22 | uint64_t qword; 23 | int64_t sqword; 24 | 25 | float real; 26 | double long_real; 27 | } val; 28 | int8_t format; 29 | uint8_t arr_size; 30 | } data_t; 31 | 32 | 33 | enum 34 | { 35 | FORMAT_MIN_SUPPORTED= 0, 36 | FORMAT_SIGNED_WORD, 37 | FORMAT_UNSIGNED_WORD, 38 | FORMAT_SIGNED_DWORD, 39 | FORMAT_UNSIGNED_DWORD, 40 | FORMAT_SIGNED_QWORD, 41 | FORMAT_UNSIGNED_QWORD, 42 | FORMAT_FLOAT, 43 | FORMAT_DOUBLE, 44 | FORMAT_DUMP_BIN, 45 | FORMAT_DUMP_HEX, 46 | FORMAT_DUMP_DEC, 47 | FORMAT_MAX, 48 | FORMAT_MAX_SUPPORTED = FORMAT_DOUBLE+1, 49 | FORMAT_DUMP_MIN = FORMAT_DUMP_BIN-1, 50 | FORMAT_DUMP_MAX = FORMAT_DUMP_DEC+1 51 | }; 52 | 53 | 54 | 55 | int sizeof_data_t(data_t* data); /* returns size in words */ 56 | void printf_data_t(data_t* data); 57 | double value_data_t(data_t* data); 58 | void init_data_t(data_t* data, int8_t format,uint8_t size); 59 | void clear_data_t(data_t* data); 60 | void reorder_data_t(data_t* data, int swap_bytes, int inverse_words); 61 | int equal_data_t(data_t* data1, data_t* data2); 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/check_modbus.h: -------------------------------------------------------------------------------- 1 | #ifndef _CHECK_MODBUS_H_ 2 | #define _CHECK_MODBUS_H_ 3 | 4 | #include "variant.h" 5 | #include "modbus/modbus.h" 6 | 7 | 8 | #if LIBMODBUS_VERSION_MAJOR >= 3 9 | #define SERIAL_PARITY_DEFAULT 'N' 10 | #endif 11 | 12 | enum 13 | { 14 | RESULT_OK = 0, 15 | RESULT_WARNING, 16 | RESULT_CRITICAL, 17 | RESULT_ERROR, 18 | RESULT_UNKNOWN, 19 | RESULT_PRINT_HELP, 20 | RESULT_WRONG_ARG, 21 | RESULT_ERROR_CONNECT, 22 | RESULT_ERROR_READ, 23 | RESULT_UNSUPPORTED_FUNCTION, 24 | RESULT_UNSUPPORTED_FORMAT 25 | }; 26 | 27 | typedef struct 28 | { 29 | char* mport; // Port number 30 | int devnum; // Device modbus address 31 | int sad; // register/bit address 32 | int nf; // Number of function 33 | double warn_range; // Warning range 34 | double crit_range; // Critical range 35 | char *host; // IP address or host name 36 | 37 | #if LIBMODBUS_VERSION_MAJOR >= 3 38 | char *serial; // serial port name 39 | int serial_mode; // serial port mode (RS232/RS485) 40 | int serial_bps; // serial port speed 41 | char serial_parity; // serial port parity mode 42 | int serial_data_bits; // serial port data bits 43 | int serial_stop_bits; // serial port stop bit 44 | #endif 45 | char* file; // input binary dump file 46 | 47 | int nc; // Null flag 48 | int nnc; // No null flag 49 | int tries; // tries 50 | int format; // data format 51 | int swap_bytes; // bytes order 52 | int inverse_words; // words order 53 | int verbose; // verbose 54 | 55 | int perf_min_en; 56 | int perf_max_en; 57 | 58 | double perf_min; // min value for performance data 59 | double perf_max; // max value for performance data 60 | int perf_data; // enable performance data 61 | char* perf_label; // label for performance data 62 | 63 | int dump; // enable dump mode 64 | int dump_format; // output format of the dump 65 | int dump_size; // number of input registers/bits included in the dump 66 | } modbus_params_t; 67 | 68 | 69 | 70 | enum 71 | { 72 | MBF_MIN_SUPPORTED= 0, 73 | MBF001_READ_COIL_STATUS, // 0x01 <- STD CODES 74 | MBF002_READ_INPUT_STATUS, // 0x02 75 | MBF003_READ_HOLDING_REGISTERS, // 0x03 76 | MBF004_READ_INPUT_REGISTERS, // 0x04 77 | MBF_MAX_SUPPORTED 78 | }; 79 | 80 | enum 81 | { 82 | DUMP_FMT_MIN_SUPPORTED=0, 83 | DUMP_FMT_BIN, 84 | DUMP_FMT_HEX, 85 | DUMP_FMT_DEC, 86 | DUMP_FMT_MAX_SUPPORTED 87 | }; 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /src/variant.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "variant.h" 4 | 5 | /* returns size in words */ 6 | int sizeof_data_t(data_t* data) 7 | { 8 | int size = 0; 9 | switch( data->format ) 10 | { 11 | case FORMAT_DUMP_BIN: 12 | case FORMAT_DUMP_HEX: 13 | case FORMAT_DUMP_DEC: 14 | size = data->arr_size/2; 15 | break; 16 | case FORMAT_SIGNED_WORD: 17 | case FORMAT_UNSIGNED_WORD: 18 | size = 1; 19 | break; 20 | case FORMAT_FLOAT: 21 | case FORMAT_SIGNED_DWORD: 22 | case FORMAT_UNSIGNED_DWORD: 23 | size = 2; 24 | break; 25 | case FORMAT_DOUBLE: 26 | case FORMAT_SIGNED_QWORD: 27 | case FORMAT_UNSIGNED_QWORD: 28 | size = 4; 29 | break; 30 | default: 31 | printf("Sizeof_data_t(): Unsupported format (%d)\n", data->format); 32 | break; 33 | } 34 | return size; 35 | } 36 | 37 | 38 | 39 | void clear_data_t(data_t* data) 40 | { 41 | int i; 42 | for(i=0;ival);i++) 43 | { 44 | data->val.bytes[i] = 0; 45 | } 46 | } 47 | 48 | 49 | 50 | void init_data_t(data_t* data, int8_t format,uint8_t size) 51 | { 52 | clear_data_t( data ); 53 | data->format = format; 54 | data->arr_size = size; 55 | } 56 | 57 | 58 | 59 | double value_data_t(data_t* data) 60 | { 61 | double tmp; 62 | switch( data->format ) 63 | { 64 | case FORMAT_SIGNED_WORD: 65 | tmp = data->val.sword; 66 | break; 67 | case FORMAT_UNSIGNED_WORD: 68 | tmp = data->val.word; 69 | break; 70 | case FORMAT_SIGNED_DWORD: 71 | tmp = data->val.sdword; 72 | break; 73 | case FORMAT_UNSIGNED_DWORD: 74 | tmp = data->val.dword; 75 | break; 76 | case FORMAT_SIGNED_QWORD: 77 | tmp = data->val.sqword; 78 | break; 79 | case FORMAT_UNSIGNED_QWORD: 80 | tmp = data->val.qword; 81 | break; 82 | case FORMAT_FLOAT: 83 | tmp = data->val.real; 84 | break; 85 | default: 86 | tmp = 0; 87 | } 88 | return tmp; 89 | } 90 | 91 | void printf_data_t(data_t* data) 92 | { 93 | int size = 0; 94 | int i; 95 | switch( data->format ) 96 | { 97 | case FORMAT_SIGNED_WORD: 98 | printf("%d", data->val.word); 99 | break; 100 | case FORMAT_UNSIGNED_WORD: 101 | printf("%u", data->val.word); 102 | break; 103 | case FORMAT_SIGNED_DWORD: 104 | printf("%ld", data->val.sdword); 105 | break; 106 | case FORMAT_UNSIGNED_DWORD: 107 | printf("%lu", data->val.dword); 108 | break; 109 | case FORMAT_SIGNED_QWORD: 110 | printf("%lld", data->val.sqword); 111 | break; 112 | case FORMAT_UNSIGNED_QWORD: 113 | printf("%llu", data->val.qword); 114 | break; 115 | case FORMAT_FLOAT: 116 | printf("%f", data->val.real); 117 | break; 118 | case FORMAT_DOUBLE: 119 | printf("%Lf", data->val.long_real); 120 | break; 121 | case FORMAT_DUMP_BIN: 122 | fwrite( data->val.bytes, 1, data->arr_size, stdout); 123 | break; 124 | case FORMAT_DUMP_HEX: 125 | for( i=0; iarr_size;) 126 | { 127 | printf("%X ", data->val.bytes[i++]); 128 | if ( (i%16) == 0) printf("\n"); 129 | } 130 | printf("\n"); 131 | break; 132 | case FORMAT_DUMP_DEC: 133 | for( i=0; iarr_size;) 134 | { 135 | printf("%d ", data->val.bytes[i++]); 136 | if ( (i%16) == 0) printf("\n"); 137 | } 138 | printf("\n"); 139 | break; 140 | 141 | default: 142 | printf("Printf_data_t(): Unsupported format (%d)\n", data->format); 143 | } 144 | } 145 | 146 | uint16_t swap_bytes(uint16_t word) 147 | { 148 | return ((word & 0xFF00)>>8) | ((word & 0x00FF)<<8); 149 | } 150 | 151 | 152 | void reorder_data_t(data_t* data, int swap, int inverse_words) 153 | { 154 | int size = sizeof_data_t( data ); 155 | int i, j; 156 | uint16_t word; 157 | data_t tmp; 158 | 159 | tmp = *data; 160 | for( i = 0; ival.words[i] = swap ? swap_bytes(word) : word; 165 | } 166 | 167 | } 168 | 169 | int equal_data_t(data_t* data1,data_t* data2) 170 | { 171 | int size = sizeof_data_t( data1 ); 172 | int i; 173 | 174 | if ( data1->format != data2->format ) return 0; 175 | 176 | for( i=0; ival.bytes[i] != data2->val.bytes[i]) return 0; 178 | 179 | return 1; 180 | } 181 | -------------------------------------------------------------------------------- /src/check_modbus.1: -------------------------------------------------------------------------------- 1 | .TH check_modbus 1 "February 2013" "" "" 2 | .SH NAME 3 | check_modbus - tool to monitor state of different devices in Nagios using Modbus-TCP/RTU protocols. 4 | 5 | .SH SYNOPSIS 6 | .TP 7 | \fBcheck_modbus\fR [ options ] [ \-\-ip= | \-H ] hostname \-f function 8 | .TP 9 | \fBcheck_modbus\fR [ options ] [ \-\-serial= | \-S ] serial_port \-f function 10 | .TP 11 | \fBcheck_modbus\fR [ options ] \-\-file filename \-f function 12 | .SH DESCRIPTION 13 | .SS Dump mode 14 | Dump mode allows to save up to 127 16-bit registers as a binary file and process this file later using \fBcheck_modbus\fR or any other program. 15 | It can used in following cases: 16 | .RS 17 | .TP 18 | - slave device can not handle several TCP/IP connections, 19 | .TP 20 | - slave device use RS232/RS485 interface. Therefore only one connection is allowed, 21 | .TP 22 | - slave devices uses non-standard data format. 23 | .RE 24 | .TP 25 | Firstly the binary dump file should be created. 26 | .RS 27 | .TP 28 | check_modbus --ip=plc01 -a 1 -f 4 --dump --dump_format 1 --dump_size 60 > file.dump 29 | .RE 30 | .TP 31 | Afterwards many parameters can be analyzed from created dump file. 32 | .RS 33 | .TP 34 | .PD 0 35 | check_modbus --file=file.dump -F 7 -f 4 -a 20 -w 100 -c 150 36 | .TP 37 | check_modbus --file=file.dump -F 7 -f 4 -a 18 -w 100 -c 150 38 | .TP 39 | check_modbus --file=file.dump -F 7 -f 4 -a 16 -w 100 -c 150 40 | .TP 41 | check_modbus --file=file.dump -F 1 -f 4 -a 1 -w 100 -c 150 42 | .TP 43 | check_modbus --file=file.dump -F 2 -f 4 -a 2 -w 100 -c 150 44 | .RE 45 | .PD 46 | .TP 47 | Only \fBbinary\fR dump format can by used as an input source for \fBcheck_modbus\fR. Other formats (hexadecimal and decimal) may be useful for other programs. 48 | .SH OPTIONS 49 | .TP 50 | .B \-v, \-\-verbose 51 | turn on verbose mode. Additional debug information (settings, modbus debug ) will be printed 52 | .TP 53 | .B \-h, \-\-help 54 | print help for a command 55 | .TP 56 | .B \-H, \-\-ip 57 | IP address or hostname. IPv6 address can be used here as well. 58 | .TP 59 | .B \-p, \-\-port 60 | TCP port number used for Modbus-TCP. By default is 502. 61 | .TP 62 | .B \-S, \-\-serial 63 | Serial port to use 64 | .TP 65 | .B \-b, \-\-serial_bps 66 | Serial port speed. Default is 9600 bps. 67 | .TP 68 | .B \-\-serial_mode 69 | RS mode of serial port. Default is 0. 70 | .RS 71 | .PD 0 72 | .TP 73 | 0 74 | - 75 | RS232 76 | .TP 77 | 1 78 | - 79 | RS485 80 | .RE 81 | .PD 82 | .TP 83 | .B \-\-serial_parity 84 | Serial port parity settings. Default none. Allowed values: none/N, even/E, odd/O 85 | .TP 86 | .B \-\-serial_data_bits 87 | Serial port number of data bits. Default 8. Allowed values: 5, 6, 7, 8. 88 | .TP 89 | .B \-\-serial_stop_bits 90 | Serial port number of stop bits. Default 1. Allowed values: 1, 2 91 | .TP 92 | .B \-\-file 93 | Use binary input file as a source for data instead of communicating with device using TCP/IP or serial ports. 94 | .TP 95 | .B \-d, \-\-device 96 | Device modbus number. Default 1 97 | .TP 98 | .B \-a, \-\-adress 99 | Register or bit address. Default 1 100 | .TP 101 | .B \-t, \-\-try 102 | Number of tries to connect modbus device. It's useful to get reliable answer from the device in noisy environment. Default 1. 103 | .TP 104 | .B \-F, \-\-format 105 | Data format. Default 1 (signed word) 106 | .RS 107 | .PD 0 108 | .TP 109 | 1 110 | - int16_t 111 | .TP 112 | 2 113 | - uint16_t 114 | .TP 115 | 3 116 | - int32_t 117 | .TP 118 | 4 119 | - uint32_t 120 | .TP 121 | 5 122 | - int64_t 123 | .TP 124 | 6 125 | - uint64_t 126 | .TP 127 | 7 128 | - float 129 | .TP 130 | 8 131 | - double 132 | .PD 133 | .RE 134 | .TP 135 | .B \-s, \-\-swapbytes 136 | Swap bytes in each incomming word 137 | .TP 138 | .B \-i, \-\-inverse 139 | Inverse order of \fBwords\fR in the packet. To convert data from big-endian to little-endian or the other way use both options \fB-i\f\R and \fB-s\fR at the same time. 140 | .TP 141 | .B \-f, \-\-function 142 | Used modbus function. 143 | .RS 144 | .PD 0 145 | .TP 146 | 1 147 | - Read coils 148 | .TP 149 | 2 150 | - Read input discretes 151 | .TP 152 | 3 153 | - Read holding registers 154 | .TP 155 | 4 156 | - Read input registers 157 | .PD 158 | .RE 159 | .TP 160 | .B \-n, \-\-null 161 | If the query will get zero, program returns the critical signal 162 | .TP 163 | .B \-N, \-\-not_null 164 | If the query will get non-zero valur, program returns the critical signal 165 | .TP 166 | .B \-w, \-\-warning 167 | Warning range 168 | .TP 169 | .B \-c, \-\-critical 170 | Critical range. Warning range and critical range parameters works together. 171 | .RS 172 | .PD 0 173 | .TP 174 | .TP 175 | 1. warning range < critical range 176 | .PD 177 | .TP 178 | .PD 0 179 | .TP 180 | x < warning range - OK 181 | .TP 182 | warning range <= x < critical range - warning signal 183 | .TP 184 | critical range <= x - critical signal 185 | .PD 186 | 187 | .TP 188 | .TP 189 | 2. warning range > critical range 190 | .PD 191 | .TP 192 | .PD 0 193 | .TP 194 | x < critical range - critical signal 195 | .TP 196 | critical range <= x < warning range - warning signal 197 | .TP 198 | warning range <= x - OK 199 | .PD 200 | .RE 201 | 202 | .TP 203 | .B \-m, \-\-perf_min 204 | Minimum value for performance data 205 | .TP 206 | .B \-M, \-\-perf_max 207 | Maximum value for performance data 208 | .TP 209 | .B \-P, \-\-perf_data 210 | Enable showing performance data. By default performance data is disabled 211 | .TP 212 | .B \-L, \-\-perf_label 213 | Label for performance data 214 | .TP 215 | .B \-\-dump 216 | Dump incomming registers and bits to stdout instead of analyze their values. Dump mode disables showing performances data as well as critical/warning signalization. 217 | .TP 218 | .B \-\-dump_format 219 | Format of output dump. Default 1 (binary). 220 | .RS 221 | .PD 0 222 | .TP 223 | 1 224 | - binary 225 | .TP 226 | 2 227 | - hexadecimal 228 | .TP 229 | 3 230 | - decimal 231 | .PD 232 | .RE 233 | 234 | .TP 235 | .B \-\-dump_size 236 | Number of registers/bits in output dump. The dump starts from address given by parameter \fB\-a, \-\-address\fR. 237 | .SH EXIT STATUS 238 | Program can return the following codes: 239 | .TP 240 | 0 241 | - value is OK 242 | .TP 243 | 1 244 | - warning level 245 | .TP 246 | 2 247 | - critical level 248 | .TP 249 | 3 250 | - general error 251 | .TP 252 | 4 253 | - unknown error) 254 | .TP 255 | 5 256 | - help information were returned 257 | .TP 258 | 6 259 | - wrong arguments 260 | .TP 261 | 7 262 | - connection error 263 | .TP 264 | 8 265 | - read error 266 | .TP 267 | 9 268 | - unsupported function 269 | .TP 270 | 10 271 | - unsupported format 272 | 273 | .SH EXAMPLES 274 | .TP 275 | check_modbus --ip=192.168.1.123 -a 13 -f 4 -F 7 -w 123.4 -c 234.5 276 | read float value from modbus address 13 using Modbus-TCP 277 | .TP 278 | check_modbus --ip=192.168.1.123 -a 15 -f 4 -w 2345 -c 1234 279 | read signed integer value from modbus address 15 280 | .TP 281 | check_modbus --ip=plc01 --try=5 -d 2 -a 20 -f 2 -n 282 | .TP 283 | check_modbus --ip=plc01 -a 1 -f 4 --dump --dump_format 1 --dump_size 60 > file.dump 284 | save 60 registers from plc01 to the file.dump in binary format. All these registers can be analyzed later off-line or even on the other machine. See next example. 285 | .TP 286 | check_modbus --file=file.dump -F 7 -f 4 -a 20 -w 100 -c 150 287 | Off-line analization of data from a dump file. 288 | .TP 289 | check_modbus --serial=/dev/ttyS0 -d 2 -a 7 -f 4 -n 290 | .SH AUTHORS 291 | .PD 0 292 | .TP 293 | Andrey Skvortsov 294 | .TP 295 | Mirosław Lach 296 | .SH NOTES 297 | All bug reports can be posted on the GitHub page https://github.com/AndreySV/check_modbus 298 | .SH COPYRIGHT 299 | License GPLv3+: GNU GPL version 3 or later . 300 | .br 301 | This is free software: you are free to change and redistribute it. 302 | There is NO WARRANTY, to the extent permitted by law. 303 | -------------------------------------------------------------------------------- /src/check_modbus.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "check_modbus.h" 8 | #include "compile_date_time.h" 9 | #include "command_line.h" 10 | 11 | 12 | 13 | 14 | 15 | int read_data(modbus_t* mb, FILE* f, modbus_params_t* params, data_t* data) 16 | { 17 | int rc; 18 | int size = sizeof_data_t( data ); 19 | int sad = params->sad; 20 | 21 | if (params->verbose) printf("read_data\n"); 22 | clear_data_t( data ); 23 | if (mb != NULL) 24 | { 25 | switch (params->nf) 26 | { 27 | case MBF001_READ_COIL_STATUS: 28 | rc = modbus_read_bits(mb, sad, size , data->val.bytes); 29 | rc = ((rc == -1) || (rc!=size)) ? RESULT_ERROR_READ : RESULT_OK; 30 | break; 31 | case MBF002_READ_INPUT_STATUS: 32 | rc = modbus_read_input_bits(mb, sad, size, data->val.bytes); 33 | rc = ((rc == -1) || (rc!=size)) ? RESULT_ERROR_READ : RESULT_OK; 34 | break; 35 | case MBF003_READ_HOLDING_REGISTERS: 36 | rc = modbus_read_registers(mb, sad, size, data->val.words); 37 | rc = ((rc == -1) || (rc!=size)) ? RESULT_ERROR_READ : RESULT_OK; 38 | break; 39 | case MBF004_READ_INPUT_REGISTERS: 40 | rc = modbus_read_input_registers(mb, sad, size, data->val.words); 41 | rc = ((rc == -1) || (rc!=size)) ? RESULT_ERROR_READ : RESULT_OK; 42 | break; 43 | default: 44 | rc = RESULT_UNSUPPORTED_FUNCTION; 45 | break; 46 | } 47 | } 48 | 49 | 50 | if (f != NULL ) 51 | { 52 | int read; 53 | if (fseek(f, sad*sizeof(data->val.words[0]), SEEK_SET)) 54 | { 55 | fprintf( stderr, "Can not seek in file\n"); 56 | return RESULT_ERROR; 57 | } 58 | 59 | read = fread( data->val.words, sizeof(data->val.words[0]), size, f); 60 | 61 | if (read != size) 62 | { 63 | fprintf( stderr, "Read only %d words from file, but need %\nd", read, size); 64 | return RESULT_ERROR_READ; 65 | } 66 | rc = RESULT_OK; 67 | } 68 | 69 | if (rc == RESULT_OK) reorder_data_t( data, params->swap_bytes, params->inverse_words ); 70 | 71 | if (params->verbose) printf("read_data rc: %d\n", rc); 72 | return rc; 73 | } 74 | 75 | 76 | 77 | 78 | 79 | void print_error( int rc ) 80 | { 81 | switch( rc ) 82 | { 83 | case RESULT_ERROR_CONNECT: 84 | fprintf( stderr, "Connection failed: %s\n:", modbus_strerror(errno) ); 85 | break; 86 | case RESULT_ERROR_READ: 87 | fprintf( stderr, "Read failed: %s\n", modbus_strerror(errno) ); 88 | break; 89 | case RESULT_UNSUPPORTED_FORMAT: 90 | fprintf( stderr, "Invalid data format\n"); 91 | break; 92 | case RESULT_UNSUPPORTED_FUNCTION: 93 | fprintf( stderr, "Invalid function number\n"); 94 | break; 95 | case RESULT_OK: 96 | break; 97 | default: 98 | fprintf( stderr, "Unsupported return code (%d)\n", rc); 99 | break; 100 | } 101 | } 102 | 103 | void print_performance_data(modbus_params_t* params, data_t* data) 104 | { 105 | if (params->perf_data) 106 | { 107 | printf("\t\t|'%s'=", params->perf_label); 108 | printf_data_t( data ); 109 | printf(";%lf;%lf;", params->warn_range, params->crit_range); 110 | if (params->perf_min_en) printf("%lf", params->perf_min ); 111 | printf(";"); 112 | if (params->perf_max_en) printf("%lf", params->perf_max ); 113 | } 114 | } 115 | 116 | int print_result(modbus_params_t* params, data_t* data) 117 | { 118 | int rc = RESULT_UNKNOWN; 119 | double result, warn_range, crit_range; 120 | 121 | 122 | if (params->verbose) printf("print_result\n"); 123 | 124 | result = value_data_t(data); 125 | warn_range = params->warn_range; 126 | crit_range = params->crit_range; 127 | 128 | if (params->nc != params->nnc ) 129 | { 130 | if (params->nc == 1 ) rc = ( result == 0 ) ? RESULT_CRITICAL : RESULT_OK; 131 | if (params->nnc == 1 ) rc = ( result != 0 ) ? RESULT_CRITICAL : RESULT_OK; 132 | } 133 | else 134 | { 135 | if ( warn_range <= crit_range) 136 | { 137 | if ( result >= crit_range) rc = RESULT_CRITICAL; 138 | else rc = ( result >= warn_range) ? RESULT_WARNING : RESULT_OK; 139 | } 140 | else 141 | { 142 | if ( result <= crit_range) rc = RESULT_CRITICAL; 143 | else rc = ( result <= warn_range) ? RESULT_WARNING : RESULT_OK; 144 | } 145 | } 146 | 147 | 148 | switch(rc) 149 | { 150 | case RESULT_OK: 151 | printf("Ok: "); 152 | break; 153 | case RESULT_WARNING: 154 | printf("Warning: "); 155 | break; 156 | case RESULT_CRITICAL: 157 | printf("Critical: "); 158 | break; 159 | case RESULT_UNKNOWN: 160 | printf("Unknown result"); 161 | break; 162 | } 163 | 164 | if (params->verbose) printf("print_result rc: %d\n", rc); 165 | printf_data_t( data ); 166 | print_performance_data( params, data ); 167 | 168 | printf("\n"); 169 | 170 | return rc; 171 | } 172 | 173 | int init_connection(modbus_params_t* params,modbus_t** mb,FILE** f) 174 | { 175 | int rc; 176 | struct timeval response_timeout; 177 | 178 | *mb = NULL; 179 | *f = NULL; 180 | 181 | rc = RESULT_OK; 182 | if (params->verbose) printf("init_connection\n"); 183 | 184 | /*******************************************************************/ 185 | /* Modbus-TCP */ 186 | /*******************************************************************/ 187 | if (params->host != NULL) 188 | { 189 | *mb = modbus_new_tcp_pi(params->host, params->mport); 190 | if (*mb == NULL) 191 | { 192 | fprintf( stderr,"Unable to allocate libmodbus context\n"); 193 | return RESULT_ERROR; 194 | } 195 | } 196 | 197 | /*******************************************************************/ 198 | /* Modbus-RTU */ 199 | /*******************************************************************/ 200 | #if LIBMODBUS_VERSION_MAJOR >= 3 201 | if (params->serial != NULL) 202 | { 203 | *mb = modbus_new_rtu(params->serial, params->serial_bps, params->serial_parity, params->serial_data_bits, params->serial_stop_bits); 204 | if (*mb != NULL) 205 | { 206 | if (modbus_rtu_get_serial_mode(*mb) != params->serial_mode) 207 | { 208 | rc = modbus_rtu_set_serial_mode(*mb, params->serial_mode); 209 | if (rc == -1) 210 | { 211 | fprintf(stderr,"Unable to set serial mode - %s (%d)\n", modbus_strerror(errno), errno); 212 | return RESULT_ERROR; 213 | } 214 | } 215 | else 216 | { 217 | if (params->verbose) printf("Serial port already in requested mode.\n"); 218 | } 219 | } 220 | else 221 | { 222 | fprintf(stderr, "Unable to allocate libmodbus context\n"); 223 | return RESULT_ERROR; 224 | } 225 | } 226 | #endif 227 | /*******************************************************************/ 228 | /* File input */ 229 | /*******************************************************************/ 230 | if (params->file != NULL) 231 | { 232 | *f = fopen( params->file, "rb"); 233 | if (*f == NULL ) 234 | { 235 | fprintf(stderr,"Unable to open binary dump file %s (%s)\n", \ 236 | params->file, strerror(errno)); 237 | return RESULT_ERROR; 238 | } 239 | if ( check_lockfile( fileno(*f) ) ) return RESULT_ERROR; 240 | } 241 | 242 | 243 | /*******************************************************************/ 244 | if (*mb != NULL) 245 | { 246 | if (params->verbose > 1) modbus_set_debug(*mb, 1); 247 | 248 | /* set short timeout */ 249 | response_timeout.tv_sec = 1; 250 | response_timeout.tv_usec = 0; 251 | modbus_set_response_timeout( *mb, &response_timeout ); 252 | 253 | modbus_set_slave(*mb,params->devnum); 254 | } 255 | 256 | /* Set exclusive lock for stdout. It's needed in dump mode to be 257 | sure that noone can access unfinished file. Because 258 | the dump file is created using stdout. */ 259 | rc = check_lockfile( STDOUT_FILENO ); 260 | 261 | if (params->verbose) printf("init_connection rc: %d\n", rc); 262 | return rc; 263 | } 264 | 265 | void sleep_between_tries(int try) 266 | { 267 | const int retry_max_timeout_us = 100*1000; /* us */ 268 | int retry_timeout_us; 269 | 270 | /* calculate retry timeout : random from 1.0 to 1.3 of base timeout */ 271 | retry_timeout_us = (1 + (rand() % 30)/100.0 )* ( retry_max_timeout_us*(try+1 ) ); 272 | 273 | usleep( retry_timeout_us ); 274 | } 275 | 276 | void deinit_connection(modbus_t** mb, FILE** f) 277 | { 278 | if (*mb != NULL) 279 | { 280 | modbus_close(*mb); 281 | modbus_free(*mb); 282 | *mb = NULL; 283 | } 284 | if (*f != NULL) 285 | { 286 | fclose(*f); 287 | *f = NULL; 288 | } 289 | } 290 | 291 | int open_modbus_connection(modbus_t* mb) 292 | { 293 | int rc = RESULT_OK; 294 | if (mb != NULL) 295 | { 296 | if (modbus_connect(mb) == -1) rc = RESULT_ERROR_CONNECT; 297 | } 298 | return rc; 299 | } 300 | 301 | 302 | int close_modbus_connection(modbus_t* mb) 303 | { 304 | if (mb != NULL) modbus_close(mb); 305 | } 306 | 307 | 308 | 309 | int check_lockfile(int fd) 310 | { 311 | int rc = RESULT_ERROR; 312 | int i; 313 | int quit; 314 | 315 | if (fd == -1) fprintf(stderr,"Can't get fd of opened file (%s)\n", strerror( errno ) ); 316 | else 317 | { 318 | for( quit=0; !quit; ) 319 | { 320 | i = flock( fd, LOCK_EX ); 321 | switch(i) 322 | { 323 | case 0: 324 | rc = RESULT_OK; 325 | quit = 1; 326 | break; 327 | case EINTR: 328 | break; 329 | default: 330 | fprintf(stderr,"flock() failed (%s)\n", strerror( errno ) ); 331 | quit = 1; 332 | break; 333 | } 334 | } 335 | } 336 | return rc; 337 | } 338 | 339 | 340 | 341 | 342 | 343 | int process(modbus_params_t* params ) 344 | { 345 | modbus_t *mb; 346 | FILE* f; 347 | int try_cnt; 348 | data_t data; 349 | int rc; 350 | 351 | if (params->verbose) printf("process\n"); 352 | if (rc = init_connection(params, &mb, &f)) return rc; 353 | 354 | 355 | init_data_t( &data, params->format, params->dump_size); 356 | for(try_cnt=0; try_cnttries; try_cnt++) 357 | { 358 | /* start new try */ 359 | rc = RESULT_OK; 360 | 361 | if ((rc = open_modbus_connection(mb))==RESULT_OK) 362 | { 363 | rc = read_data( mb, f, params, &data); 364 | if (rc == RESULT_OK) break; 365 | 366 | close_modbus_connection(mb); 367 | } 368 | sleep_between_tries( try_cnt ); 369 | } 370 | 371 | print_error( rc ); 372 | 373 | if (rc==RESULT_OK) 374 | { 375 | if (params->dump) printf_data_t( &data ); 376 | else rc = print_result( params, &data ); 377 | } 378 | 379 | deinit_connection( &mb, &f); 380 | if (params->verbose) printf("process rc: %d\n", rc); 381 | return rc; 382 | } 383 | 384 | 385 | 386 | 387 | int main(int argc, char **argv) 388 | 389 | { 390 | int rc; 391 | modbus_params_t params; 392 | 393 | srand( time(NULL) ); 394 | rc = parse_command_line(¶ms, argc, argv ); 395 | return ( rc != RESULT_OK ) ? rc : process( ¶ms ); 396 | } 397 | -------------------------------------------------------------------------------- /missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 7 | # 2008, 2009 Free Software Foundation, Inc. 8 | # Originally by Fran,cois Pinard , 1996. 9 | 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, see . 22 | 23 | # As a special exception to the GNU General Public License, if you 24 | # distribute this file as part of a program that contains a 25 | # configuration script generated by Autoconf, you may include it under 26 | # the same distribution terms that you use for the rest of that program. 27 | 28 | if test $# -eq 0; then 29 | echo 1>&2 "Try \`$0 --help' for more information" 30 | exit 1 31 | fi 32 | 33 | run=: 34 | sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' 35 | sed_minuso='s/.* -o \([^ ]*\).*/\1/p' 36 | 37 | # In the cases where this matters, `missing' is being run in the 38 | # srcdir already. 39 | if test -f configure.ac; then 40 | configure_ac=configure.ac 41 | else 42 | configure_ac=configure.in 43 | fi 44 | 45 | msg="missing on your system" 46 | 47 | case $1 in 48 | --run) 49 | # Try to run requested program, and just exit if it succeeds. 50 | run= 51 | shift 52 | "$@" && exit 0 53 | # Exit code 63 means version mismatch. This often happens 54 | # when the user try to use an ancient version of a tool on 55 | # a file that requires a minimum version. In this case we 56 | # we should proceed has if the program had been absent, or 57 | # if --run hadn't been passed. 58 | if test $? = 63; then 59 | run=: 60 | msg="probably too old" 61 | fi 62 | ;; 63 | 64 | -h|--h|--he|--hel|--help) 65 | echo "\ 66 | $0 [OPTION]... PROGRAM [ARGUMENT]... 67 | 68 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 69 | error status if there is no known handling for PROGRAM. 70 | 71 | Options: 72 | -h, --help display this help and exit 73 | -v, --version output version information and exit 74 | --run try to run the given command, and emulate it if it fails 75 | 76 | Supported PROGRAM values: 77 | aclocal touch file \`aclocal.m4' 78 | autoconf touch file \`configure' 79 | autoheader touch file \`config.h.in' 80 | autom4te touch the output file, or create a stub one 81 | automake touch all \`Makefile.in' files 82 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 83 | flex create \`lex.yy.c', if possible, from existing .c 84 | help2man touch the output file 85 | lex create \`lex.yy.c', if possible, from existing .c 86 | makeinfo touch the output file 87 | tar try tar, gnutar, gtar, then tar without non-portable flags 88 | yacc create \`y.tab.[ch]', if possible, from existing .[ch] 89 | 90 | Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and 91 | \`g' are ignored when checking the name. 92 | 93 | Send bug reports to ." 94 | exit $? 95 | ;; 96 | 97 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 98 | echo "missing $scriptversion (GNU Automake)" 99 | exit $? 100 | ;; 101 | 102 | -*) 103 | echo 1>&2 "$0: Unknown \`$1' option" 104 | echo 1>&2 "Try \`$0 --help' for more information" 105 | exit 1 106 | ;; 107 | 108 | esac 109 | 110 | # normalize program name to check for. 111 | program=`echo "$1" | sed ' 112 | s/^gnu-//; t 113 | s/^gnu//; t 114 | s/^g//; t'` 115 | 116 | # Now exit if we have it, but it failed. Also exit now if we 117 | # don't have it and --version was passed (most likely to detect 118 | # the program). This is about non-GNU programs, so use $1 not 119 | # $program. 120 | case $1 in 121 | lex*|yacc*) 122 | # Not GNU programs, they don't have --version. 123 | ;; 124 | 125 | tar*) 126 | if test -n "$run"; then 127 | echo 1>&2 "ERROR: \`tar' requires --run" 128 | exit 1 129 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 130 | exit 1 131 | fi 132 | ;; 133 | 134 | *) 135 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 136 | # We have it, but it failed. 137 | exit 1 138 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 139 | # Could not run --version or --help. This is probably someone 140 | # running `$TOOL --version' or `$TOOL --help' to check whether 141 | # $TOOL exists and not knowing $TOOL uses missing. 142 | exit 1 143 | fi 144 | ;; 145 | esac 146 | 147 | # If it does not exist, or fails to run (possibly an outdated version), 148 | # try to emulate it. 149 | case $program in 150 | aclocal*) 151 | echo 1>&2 "\ 152 | WARNING: \`$1' is $msg. You should only need it if 153 | you modified \`acinclude.m4' or \`${configure_ac}'. You might want 154 | to install the \`Automake' and \`Perl' packages. Grab them from 155 | any GNU archive site." 156 | touch aclocal.m4 157 | ;; 158 | 159 | autoconf*) 160 | echo 1>&2 "\ 161 | WARNING: \`$1' is $msg. You should only need it if 162 | you modified \`${configure_ac}'. You might want to install the 163 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 164 | archive site." 165 | touch configure 166 | ;; 167 | 168 | autoheader*) 169 | echo 1>&2 "\ 170 | WARNING: \`$1' is $msg. You should only need it if 171 | you modified \`acconfig.h' or \`${configure_ac}'. You might want 172 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 173 | from any GNU archive site." 174 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 175 | test -z "$files" && files="config.h" 176 | touch_files= 177 | for f in $files; do 178 | case $f in 179 | *:*) touch_files="$touch_files "`echo "$f" | 180 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 181 | *) touch_files="$touch_files $f.in";; 182 | esac 183 | done 184 | touch $touch_files 185 | ;; 186 | 187 | automake*) 188 | echo 1>&2 "\ 189 | WARNING: \`$1' is $msg. You should only need it if 190 | you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 191 | You might want to install the \`Automake' and \`Perl' packages. 192 | Grab them from any GNU archive site." 193 | find . -type f -name Makefile.am -print | 194 | sed 's/\.am$/.in/' | 195 | while read f; do touch "$f"; done 196 | ;; 197 | 198 | autom4te*) 199 | echo 1>&2 "\ 200 | WARNING: \`$1' is needed, but is $msg. 201 | You might have modified some files without having the 202 | proper tools for further handling them. 203 | You can get \`$1' as part of \`Autoconf' from any GNU 204 | archive site." 205 | 206 | file=`echo "$*" | sed -n "$sed_output"` 207 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 208 | if test -f "$file"; then 209 | touch $file 210 | else 211 | test -z "$file" || exec >$file 212 | echo "#! /bin/sh" 213 | echo "# Created by GNU Automake missing as a replacement of" 214 | echo "# $ $@" 215 | echo "exit 0" 216 | chmod +x $file 217 | exit 1 218 | fi 219 | ;; 220 | 221 | bison*|yacc*) 222 | echo 1>&2 "\ 223 | WARNING: \`$1' $msg. You should only need it if 224 | you modified a \`.y' file. You may need the \`Bison' package 225 | in order for those modifications to take effect. You can get 226 | \`Bison' from any GNU archive site." 227 | rm -f y.tab.c y.tab.h 228 | if test $# -ne 1; then 229 | eval LASTARG="\${$#}" 230 | case $LASTARG in 231 | *.y) 232 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 233 | if test -f "$SRCFILE"; then 234 | cp "$SRCFILE" y.tab.c 235 | fi 236 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 237 | if test -f "$SRCFILE"; then 238 | cp "$SRCFILE" y.tab.h 239 | fi 240 | ;; 241 | esac 242 | fi 243 | if test ! -f y.tab.h; then 244 | echo >y.tab.h 245 | fi 246 | if test ! -f y.tab.c; then 247 | echo 'main() { return 0; }' >y.tab.c 248 | fi 249 | ;; 250 | 251 | lex*|flex*) 252 | echo 1>&2 "\ 253 | WARNING: \`$1' is $msg. You should only need it if 254 | you modified a \`.l' file. You may need the \`Flex' package 255 | in order for those modifications to take effect. You can get 256 | \`Flex' from any GNU archive site." 257 | rm -f lex.yy.c 258 | if test $# -ne 1; then 259 | eval LASTARG="\${$#}" 260 | case $LASTARG in 261 | *.l) 262 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 263 | if test -f "$SRCFILE"; then 264 | cp "$SRCFILE" lex.yy.c 265 | fi 266 | ;; 267 | esac 268 | fi 269 | if test ! -f lex.yy.c; then 270 | echo 'main() { return 0; }' >lex.yy.c 271 | fi 272 | ;; 273 | 274 | help2man*) 275 | echo 1>&2 "\ 276 | WARNING: \`$1' is $msg. You should only need it if 277 | you modified a dependency of a manual page. You may need the 278 | \`Help2man' package in order for those modifications to take 279 | effect. You can get \`Help2man' from any GNU archive site." 280 | 281 | file=`echo "$*" | sed -n "$sed_output"` 282 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 283 | if test -f "$file"; then 284 | touch $file 285 | else 286 | test -z "$file" || exec >$file 287 | echo ".ab help2man is required to generate this page" 288 | exit $? 289 | fi 290 | ;; 291 | 292 | makeinfo*) 293 | echo 1>&2 "\ 294 | WARNING: \`$1' is $msg. You should only need it if 295 | you modified a \`.texi' or \`.texinfo' file, or any other file 296 | indirectly affecting the aspect of the manual. The spurious 297 | call might also be the consequence of using a buggy \`make' (AIX, 298 | DU, IRIX). You might want to install the \`Texinfo' package or 299 | the \`GNU make' package. Grab either from any GNU archive site." 300 | # The file to touch is that specified with -o ... 301 | file=`echo "$*" | sed -n "$sed_output"` 302 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 303 | if test -z "$file"; then 304 | # ... or it is the one specified with @setfilename ... 305 | infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 306 | file=`sed -n ' 307 | /^@setfilename/{ 308 | s/.* \([^ ]*\) *$/\1/ 309 | p 310 | q 311 | }' $infile` 312 | # ... or it is derived from the source name (dir/f.texi becomes f.info) 313 | test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 314 | fi 315 | # If the file does not exist, the user really needs makeinfo; 316 | # let's fail without touching anything. 317 | test -f $file || exit 1 318 | touch $file 319 | ;; 320 | 321 | tar*) 322 | shift 323 | 324 | # We have already tried tar in the generic part. 325 | # Look for gnutar/gtar before invocation to avoid ugly error 326 | # messages. 327 | if (gnutar --version > /dev/null 2>&1); then 328 | gnutar "$@" && exit 0 329 | fi 330 | if (gtar --version > /dev/null 2>&1); then 331 | gtar "$@" && exit 0 332 | fi 333 | firstarg="$1" 334 | if shift; then 335 | case $firstarg in 336 | *o*) 337 | firstarg=`echo "$firstarg" | sed s/o//` 338 | tar "$firstarg" "$@" && exit 0 339 | ;; 340 | esac 341 | case $firstarg in 342 | *h*) 343 | firstarg=`echo "$firstarg" | sed s/h//` 344 | tar "$firstarg" "$@" && exit 0 345 | ;; 346 | esac 347 | fi 348 | 349 | echo 1>&2 "\ 350 | WARNING: I can't seem to be able to run \`tar' with the given arguments. 351 | You may want to install GNU tar or Free paxutils, or check the 352 | command line arguments." 353 | exit 1 354 | ;; 355 | 356 | *) 357 | echo 1>&2 "\ 358 | WARNING: \`$1' is needed, and is $msg. 359 | You might have modified some files without having the 360 | proper tools for further handling them. Check the \`README' file, 361 | it often tells you about the needed prerequisites for installing 362 | this package. You may also peek at any GNU archive site, in case 363 | some other package would contain this missing \`$1' program." 364 | exit 1 365 | ;; 366 | esac 367 | 368 | exit 0 369 | 370 | # Local variables: 371 | # eval: (add-hook 'write-file-hooks 'time-stamp) 372 | # time-stamp-start: "scriptversion=" 373 | # time-stamp-format: "%:y-%02m-%02d.%02H" 374 | # time-stamp-time-zone: "UTC" 375 | # time-stamp-end: "; # UTC" 376 | # End: 377 | -------------------------------------------------------------------------------- /install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # install - install a program, script, or datafile 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # This originates from X11R5 (mit/util/scripts/install.sh), which was 7 | # later released in X11R6 (xc/config/util/install.sh) with the 8 | # following copyright and license. 9 | # 10 | # Copyright (C) 1994 X Consortium 11 | # 12 | # Permission is hereby granted, free of charge, to any person obtaining a copy 13 | # of this software and associated documentation files (the "Software"), to 14 | # deal in the Software without restriction, including without limitation the 15 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 16 | # sell copies of the Software, and to permit persons to whom the Software is 17 | # furnished to do so, subject to the following conditions: 18 | # 19 | # The above copyright notice and this permission notice shall be included in 20 | # all copies or substantial portions of the Software. 21 | # 22 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26 | # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- 27 | # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name of the X Consortium shall not 30 | # be used in advertising or otherwise to promote the sale, use or other deal- 31 | # ings in this Software without prior written authorization from the X Consor- 32 | # tium. 33 | # 34 | # 35 | # FSF changes to this file are in the public domain. 36 | # 37 | # Calling this script install-sh is preferred over install.sh, to prevent 38 | # `make' implicit rules from creating a file called install from it 39 | # when there is no Makefile. 40 | # 41 | # This script is compatible with the BSD install script, but was written 42 | # from scratch. 43 | 44 | nl=' 45 | ' 46 | IFS=" "" $nl" 47 | 48 | # set DOITPROG to echo to test this script 49 | 50 | # Don't use :- since 4.3BSD and earlier shells don't like it. 51 | doit=${DOITPROG-} 52 | if test -z "$doit"; then 53 | doit_exec=exec 54 | else 55 | doit_exec=$doit 56 | fi 57 | 58 | # Put in absolute file names if you don't have them in your path; 59 | # or use environment vars. 60 | 61 | chgrpprog=${CHGRPPROG-chgrp} 62 | chmodprog=${CHMODPROG-chmod} 63 | chownprog=${CHOWNPROG-chown} 64 | cmpprog=${CMPPROG-cmp} 65 | cpprog=${CPPROG-cp} 66 | mkdirprog=${MKDIRPROG-mkdir} 67 | mvprog=${MVPROG-mv} 68 | rmprog=${RMPROG-rm} 69 | stripprog=${STRIPPROG-strip} 70 | 71 | posix_glob='?' 72 | initialize_posix_glob=' 73 | test "$posix_glob" != "?" || { 74 | if (set -f) 2>/dev/null; then 75 | posix_glob= 76 | else 77 | posix_glob=: 78 | fi 79 | } 80 | ' 81 | 82 | posix_mkdir= 83 | 84 | # Desired mode of installed file. 85 | mode=0755 86 | 87 | chgrpcmd= 88 | chmodcmd=$chmodprog 89 | chowncmd= 90 | mvcmd=$mvprog 91 | rmcmd="$rmprog -f" 92 | stripcmd= 93 | 94 | src= 95 | dst= 96 | dir_arg= 97 | dst_arg= 98 | 99 | copy_on_change=false 100 | no_target_directory= 101 | 102 | usage="\ 103 | Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE 104 | or: $0 [OPTION]... SRCFILES... DIRECTORY 105 | or: $0 [OPTION]... -t DIRECTORY SRCFILES... 106 | or: $0 [OPTION]... -d DIRECTORIES... 107 | 108 | In the 1st form, copy SRCFILE to DSTFILE. 109 | In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. 110 | In the 4th, create DIRECTORIES. 111 | 112 | Options: 113 | --help display this help and exit. 114 | --version display version info and exit. 115 | 116 | -c (ignored) 117 | -C install only if different (preserve the last data modification time) 118 | -d create directories instead of installing files. 119 | -g GROUP $chgrpprog installed files to GROUP. 120 | -m MODE $chmodprog installed files to MODE. 121 | -o USER $chownprog installed files to USER. 122 | -s $stripprog installed files. 123 | -t DIRECTORY install into DIRECTORY. 124 | -T report an error if DSTFILE is a directory. 125 | 126 | Environment variables override the default commands: 127 | CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG 128 | RMPROG STRIPPROG 129 | " 130 | 131 | while test $# -ne 0; do 132 | case $1 in 133 | -c) ;; 134 | 135 | -C) copy_on_change=true;; 136 | 137 | -d) dir_arg=true;; 138 | 139 | -g) chgrpcmd="$chgrpprog $2" 140 | shift;; 141 | 142 | --help) echo "$usage"; exit $?;; 143 | 144 | -m) mode=$2 145 | case $mode in 146 | *' '* | *' '* | *' 147 | '* | *'*'* | *'?'* | *'['*) 148 | echo "$0: invalid mode: $mode" >&2 149 | exit 1;; 150 | esac 151 | shift;; 152 | 153 | -o) chowncmd="$chownprog $2" 154 | shift;; 155 | 156 | -s) stripcmd=$stripprog;; 157 | 158 | -t) dst_arg=$2 159 | shift;; 160 | 161 | -T) no_target_directory=true;; 162 | 163 | --version) echo "$0 $scriptversion"; exit $?;; 164 | 165 | --) shift 166 | break;; 167 | 168 | -*) echo "$0: invalid option: $1" >&2 169 | exit 1;; 170 | 171 | *) break;; 172 | esac 173 | shift 174 | done 175 | 176 | if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then 177 | # When -d is used, all remaining arguments are directories to create. 178 | # When -t is used, the destination is already specified. 179 | # Otherwise, the last argument is the destination. Remove it from $@. 180 | for arg 181 | do 182 | if test -n "$dst_arg"; then 183 | # $@ is not empty: it contains at least $arg. 184 | set fnord "$@" "$dst_arg" 185 | shift # fnord 186 | fi 187 | shift # arg 188 | dst_arg=$arg 189 | done 190 | fi 191 | 192 | if test $# -eq 0; then 193 | if test -z "$dir_arg"; then 194 | echo "$0: no input file specified." >&2 195 | exit 1 196 | fi 197 | # It's OK to call `install-sh -d' without argument. 198 | # This can happen when creating conditional directories. 199 | exit 0 200 | fi 201 | 202 | if test -z "$dir_arg"; then 203 | trap '(exit $?); exit' 1 2 13 15 204 | 205 | # Set umask so as not to create temps with too-generous modes. 206 | # However, 'strip' requires both read and write access to temps. 207 | case $mode in 208 | # Optimize common cases. 209 | *644) cp_umask=133;; 210 | *755) cp_umask=22;; 211 | 212 | *[0-7]) 213 | if test -z "$stripcmd"; then 214 | u_plus_rw= 215 | else 216 | u_plus_rw='% 200' 217 | fi 218 | cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; 219 | *) 220 | if test -z "$stripcmd"; then 221 | u_plus_rw= 222 | else 223 | u_plus_rw=,u+rw 224 | fi 225 | cp_umask=$mode$u_plus_rw;; 226 | esac 227 | fi 228 | 229 | for src 230 | do 231 | # Protect names starting with `-'. 232 | case $src in 233 | -*) src=./$src;; 234 | esac 235 | 236 | if test -n "$dir_arg"; then 237 | dst=$src 238 | dstdir=$dst 239 | test -d "$dstdir" 240 | dstdir_status=$? 241 | else 242 | 243 | # Waiting for this to be detected by the "$cpprog $src $dsttmp" command 244 | # might cause directories to be created, which would be especially bad 245 | # if $src (and thus $dsttmp) contains '*'. 246 | if test ! -f "$src" && test ! -d "$src"; then 247 | echo "$0: $src does not exist." >&2 248 | exit 1 249 | fi 250 | 251 | if test -z "$dst_arg"; then 252 | echo "$0: no destination specified." >&2 253 | exit 1 254 | fi 255 | 256 | dst=$dst_arg 257 | # Protect names starting with `-'. 258 | case $dst in 259 | -*) dst=./$dst;; 260 | esac 261 | 262 | # If destination is a directory, append the input filename; won't work 263 | # if double slashes aren't ignored. 264 | if test -d "$dst"; then 265 | if test -n "$no_target_directory"; then 266 | echo "$0: $dst_arg: Is a directory" >&2 267 | exit 1 268 | fi 269 | dstdir=$dst 270 | dst=$dstdir/`basename "$src"` 271 | dstdir_status=0 272 | else 273 | # Prefer dirname, but fall back on a substitute if dirname fails. 274 | dstdir=` 275 | (dirname "$dst") 2>/dev/null || 276 | expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 277 | X"$dst" : 'X\(//\)[^/]' \| \ 278 | X"$dst" : 'X\(//\)$' \| \ 279 | X"$dst" : 'X\(/\)' \| . 2>/dev/null || 280 | echo X"$dst" | 281 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ 282 | s//\1/ 283 | q 284 | } 285 | /^X\(\/\/\)[^/].*/{ 286 | s//\1/ 287 | q 288 | } 289 | /^X\(\/\/\)$/{ 290 | s//\1/ 291 | q 292 | } 293 | /^X\(\/\).*/{ 294 | s//\1/ 295 | q 296 | } 297 | s/.*/./; q' 298 | ` 299 | 300 | test -d "$dstdir" 301 | dstdir_status=$? 302 | fi 303 | fi 304 | 305 | obsolete_mkdir_used=false 306 | 307 | if test $dstdir_status != 0; then 308 | case $posix_mkdir in 309 | '') 310 | # Create intermediate dirs using mode 755 as modified by the umask. 311 | # This is like FreeBSD 'install' as of 1997-10-28. 312 | umask=`umask` 313 | case $stripcmd.$umask in 314 | # Optimize common cases. 315 | *[2367][2367]) mkdir_umask=$umask;; 316 | .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; 317 | 318 | *[0-7]) 319 | mkdir_umask=`expr $umask + 22 \ 320 | - $umask % 100 % 40 + $umask % 20 \ 321 | - $umask % 10 % 4 + $umask % 2 322 | `;; 323 | *) mkdir_umask=$umask,go-w;; 324 | esac 325 | 326 | # With -d, create the new directory with the user-specified mode. 327 | # Otherwise, rely on $mkdir_umask. 328 | if test -n "$dir_arg"; then 329 | mkdir_mode=-m$mode 330 | else 331 | mkdir_mode= 332 | fi 333 | 334 | posix_mkdir=false 335 | case $umask in 336 | *[123567][0-7][0-7]) 337 | # POSIX mkdir -p sets u+wx bits regardless of umask, which 338 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. 339 | ;; 340 | *) 341 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ 342 | trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 343 | 344 | if (umask $mkdir_umask && 345 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 346 | then 347 | if test -z "$dir_arg" || { 348 | # Check for POSIX incompatibilities with -m. 349 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or 350 | # other-writeable bit of parent directory when it shouldn't. 351 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. 352 | ls_ld_tmpdir=`ls -ld "$tmpdir"` 353 | case $ls_ld_tmpdir in 354 | d????-?r-*) different_mode=700;; 355 | d????-?--*) different_mode=755;; 356 | *) false;; 357 | esac && 358 | $mkdirprog -m$different_mode -p -- "$tmpdir" && { 359 | ls_ld_tmpdir_1=`ls -ld "$tmpdir"` 360 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" 361 | } 362 | } 363 | then posix_mkdir=: 364 | fi 365 | rmdir "$tmpdir/d" "$tmpdir" 366 | else 367 | # Remove any dirs left behind by ancient mkdir implementations. 368 | rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null 369 | fi 370 | trap '' 0;; 371 | esac;; 372 | esac 373 | 374 | if 375 | $posix_mkdir && ( 376 | umask $mkdir_umask && 377 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" 378 | ) 379 | then : 380 | else 381 | 382 | # The umask is ridiculous, or mkdir does not conform to POSIX, 383 | # or it failed possibly due to a race condition. Create the 384 | # directory the slow way, step by step, checking for races as we go. 385 | 386 | case $dstdir in 387 | /*) prefix='/';; 388 | -*) prefix='./';; 389 | *) prefix='';; 390 | esac 391 | 392 | eval "$initialize_posix_glob" 393 | 394 | oIFS=$IFS 395 | IFS=/ 396 | $posix_glob set -f 397 | set fnord $dstdir 398 | shift 399 | $posix_glob set +f 400 | IFS=$oIFS 401 | 402 | prefixes= 403 | 404 | for d 405 | do 406 | test -z "$d" && continue 407 | 408 | prefix=$prefix$d 409 | if test -d "$prefix"; then 410 | prefixes= 411 | else 412 | if $posix_mkdir; then 413 | (umask=$mkdir_umask && 414 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break 415 | # Don't fail if two instances are running concurrently. 416 | test -d "$prefix" || exit 1 417 | else 418 | case $prefix in 419 | *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; 420 | *) qprefix=$prefix;; 421 | esac 422 | prefixes="$prefixes '$qprefix'" 423 | fi 424 | fi 425 | prefix=$prefix/ 426 | done 427 | 428 | if test -n "$prefixes"; then 429 | # Don't fail if two instances are running concurrently. 430 | (umask $mkdir_umask && 431 | eval "\$doit_exec \$mkdirprog $prefixes") || 432 | test -d "$dstdir" || exit 1 433 | obsolete_mkdir_used=true 434 | fi 435 | fi 436 | fi 437 | 438 | if test -n "$dir_arg"; then 439 | { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && 440 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && 441 | { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || 442 | test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 443 | else 444 | 445 | # Make a couple of temp file names in the proper directory. 446 | dsttmp=$dstdir/_inst.$$_ 447 | rmtmp=$dstdir/_rm.$$_ 448 | 449 | # Trap to clean up those temp files at exit. 450 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 451 | 452 | # Copy the file name to the temp name. 453 | (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && 454 | 455 | # and set any options; do chmod last to preserve setuid bits. 456 | # 457 | # If any of these fail, we abort the whole thing. If we want to 458 | # ignore errors from any of these, just make sure not to ignore 459 | # errors from the above "$doit $cpprog $src $dsttmp" command. 460 | # 461 | { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && 462 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && 463 | { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && 464 | { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && 465 | 466 | # If -C, don't bother to copy if it wouldn't change the file. 467 | if $copy_on_change && 468 | old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && 469 | new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && 470 | 471 | eval "$initialize_posix_glob" && 472 | $posix_glob set -f && 473 | set X $old && old=:$2:$4:$5:$6 && 474 | set X $new && new=:$2:$4:$5:$6 && 475 | $posix_glob set +f && 476 | 477 | test "$old" = "$new" && 478 | $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 479 | then 480 | rm -f "$dsttmp" 481 | else 482 | # Rename the file to the real destination. 483 | $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || 484 | 485 | # The rename failed, perhaps because mv can't rename something else 486 | # to itself, or perhaps because mv is so ancient that it does not 487 | # support -f. 488 | { 489 | # Now remove or move aside any old file at destination location. 490 | # We try this two ways since rm can't unlink itself on some 491 | # systems and the destination file might be busy for other 492 | # reasons. In this case, the final cleanup might fail but the new 493 | # file should still install successfully. 494 | { 495 | test ! -f "$dst" || 496 | $doit $rmcmd -f "$dst" 2>/dev/null || 497 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && 498 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } 499 | } || 500 | { echo "$0: cannot unlink or rename $dst" >&2 501 | (exit 1); exit 1 502 | } 503 | } && 504 | 505 | # Now rename the file to the real destination. 506 | $doit $mvcmd "$dsttmp" "$dst" 507 | } 508 | fi || exit 1 509 | 510 | trap '' 0 511 | fi 512 | done 513 | 514 | # Local variables: 515 | # eval: (add-hook 'write-file-hooks 'time-stamp) 516 | # time-stamp-start: "scriptversion=" 517 | # time-stamp-format: "%:y-%02m-%02d.%02H" 518 | # time-stamp-time-zone: "UTC" 519 | # time-stamp-end: "; # UTC" 520 | # End: 521 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Installation Instructions 2 | ************************* 3 | 4 | Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 5 | 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 6 | 7 | Copying and distribution of this file, with or without modification, 8 | are permitted in any medium without royalty provided the copyright 9 | notice and this notice are preserved. This file is offered as-is, 10 | without warranty of any kind. 11 | 12 | Basic Installation 13 | ================== 14 | 15 | Briefly, the shell commands `./configure; make; make install' should 16 | configure, build, and install this package. The following 17 | more-detailed instructions are generic; see the `README' file for 18 | instructions specific to this package. Some packages provide this 19 | `INSTALL' file but do not implement all of the features documented 20 | below. The lack of an optional feature in a given package is not 21 | necessarily a bug. More recommendations for GNU packages can be found 22 | in *note Makefile Conventions: (standards)Makefile Conventions. 23 | 24 | The `configure' shell script attempts to guess correct values for 25 | various system-dependent variables used during compilation. It uses 26 | those values to create a `Makefile' in each directory of the package. 27 | It may also create one or more `.h' files containing system-dependent 28 | definitions. Finally, it creates a shell script `config.status' that 29 | you can run in the future to recreate the current configuration, and a 30 | file `config.log' containing compiler output (useful mainly for 31 | debugging `configure'). 32 | 33 | It can also use an optional file (typically called `config.cache' 34 | and enabled with `--cache-file=config.cache' or simply `-C') that saves 35 | the results of its tests to speed up reconfiguring. Caching is 36 | disabled by default to prevent problems with accidental use of stale 37 | cache files. 38 | 39 | If you need to do unusual things to compile the package, please try 40 | to figure out how `configure' could check whether to do them, and mail 41 | diffs or instructions to the address given in the `README' so they can 42 | be considered for the next release. If you are using the cache, and at 43 | some point `config.cache' contains results you don't want to keep, you 44 | may remove or edit it. 45 | 46 | The file `configure.ac' (or `configure.in') is used to create 47 | `configure' by a program called `autoconf'. You need `configure.ac' if 48 | you want to change it or regenerate `configure' using a newer version 49 | of `autoconf'. 50 | 51 | The simplest way to compile this package is: 52 | 53 | 1. `cd' to the directory containing the package's source code and type 54 | `./configure' to configure the package for your system. 55 | 56 | Running `configure' might take a while. While running, it prints 57 | some messages telling which features it is checking for. 58 | 59 | 2. Type `make' to compile the package. 60 | 61 | 3. Optionally, type `make check' to run any self-tests that come with 62 | the package, generally using the just-built uninstalled binaries. 63 | 64 | 4. Type `make install' to install the programs and any data files and 65 | documentation. When installing into a prefix owned by root, it is 66 | recommended that the package be configured and built as a regular 67 | user, and only the `make install' phase executed with root 68 | privileges. 69 | 70 | 5. Optionally, type `make installcheck' to repeat any self-tests, but 71 | this time using the binaries in their final installed location. 72 | This target does not install anything. Running this target as a 73 | regular user, particularly if the prior `make install' required 74 | root privileges, verifies that the installation completed 75 | correctly. 76 | 77 | 6. You can remove the program binaries and object files from the 78 | source code directory by typing `make clean'. To also remove the 79 | files that `configure' created (so you can compile the package for 80 | a different kind of computer), type `make distclean'. There is 81 | also a `make maintainer-clean' target, but that is intended mainly 82 | for the package's developers. If you use it, you may have to get 83 | all sorts of other programs in order to regenerate files that came 84 | with the distribution. 85 | 86 | 7. Often, you can also type `make uninstall' to remove the installed 87 | files again. In practice, not all packages have tested that 88 | uninstallation works correctly, even though it is required by the 89 | GNU Coding Standards. 90 | 91 | 8. Some packages, particularly those that use Automake, provide `make 92 | distcheck', which can by used by developers to test that all other 93 | targets like `make install' and `make uninstall' work correctly. 94 | This target is generally not run by end users. 95 | 96 | Compilers and Options 97 | ===================== 98 | 99 | Some systems require unusual options for compilation or linking that 100 | the `configure' script does not know about. Run `./configure --help' 101 | for details on some of the pertinent environment variables. 102 | 103 | You can give `configure' initial values for configuration parameters 104 | by setting variables in the command line or in the environment. Here 105 | is an example: 106 | 107 | ./configure CC=c99 CFLAGS=-g LIBS=-lposix 108 | 109 | *Note Defining Variables::, for more details. 110 | 111 | Compiling For Multiple Architectures 112 | ==================================== 113 | 114 | You can compile the package for more than one kind of computer at the 115 | same time, by placing the object files for each architecture in their 116 | own directory. To do this, you can use GNU `make'. `cd' to the 117 | directory where you want the object files and executables to go and run 118 | the `configure' script. `configure' automatically checks for the 119 | source code in the directory that `configure' is in and in `..'. This 120 | is known as a "VPATH" build. 121 | 122 | With a non-GNU `make', it is safer to compile the package for one 123 | architecture at a time in the source code directory. After you have 124 | installed the package for one architecture, use `make distclean' before 125 | reconfiguring for another architecture. 126 | 127 | On MacOS X 10.5 and later systems, you can create libraries and 128 | executables that work on multiple system types--known as "fat" or 129 | "universal" binaries--by specifying multiple `-arch' options to the 130 | compiler but only a single `-arch' option to the preprocessor. Like 131 | this: 132 | 133 | ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ 134 | CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ 135 | CPP="gcc -E" CXXCPP="g++ -E" 136 | 137 | This is not guaranteed to produce working output in all cases, you 138 | may have to build one architecture at a time and combine the results 139 | using the `lipo' tool if you have problems. 140 | 141 | Installation Names 142 | ================== 143 | 144 | By default, `make install' installs the package's commands under 145 | `/usr/local/bin', include files under `/usr/local/include', etc. You 146 | can specify an installation prefix other than `/usr/local' by giving 147 | `configure' the option `--prefix=PREFIX', where PREFIX must be an 148 | absolute file name. 149 | 150 | You can specify separate installation prefixes for 151 | architecture-specific files and architecture-independent files. If you 152 | pass the option `--exec-prefix=PREFIX' to `configure', the package uses 153 | PREFIX as the prefix for installing programs and libraries. 154 | Documentation and other data files still use the regular prefix. 155 | 156 | In addition, if you use an unusual directory layout you can give 157 | options like `--bindir=DIR' to specify different values for particular 158 | kinds of files. Run `configure --help' for a list of the directories 159 | you can set and what kinds of files go in them. In general, the 160 | default for these options is expressed in terms of `${prefix}', so that 161 | specifying just `--prefix' will affect all of the other directory 162 | specifications that were not explicitly provided. 163 | 164 | The most portable way to affect installation locations is to pass the 165 | correct locations to `configure'; however, many packages provide one or 166 | both of the following shortcuts of passing variable assignments to the 167 | `make install' command line to change installation locations without 168 | having to reconfigure or recompile. 169 | 170 | The first method involves providing an override variable for each 171 | affected directory. For example, `make install 172 | prefix=/alternate/directory' will choose an alternate location for all 173 | directory configuration variables that were expressed in terms of 174 | `${prefix}'. Any directories that were specified during `configure', 175 | but not in terms of `${prefix}', must each be overridden at install 176 | time for the entire installation to be relocated. The approach of 177 | makefile variable overrides for each directory variable is required by 178 | the GNU Coding Standards, and ideally causes no recompilation. 179 | However, some platforms have known limitations with the semantics of 180 | shared libraries that end up requiring recompilation when using this 181 | method, particularly noticeable in packages that use GNU Libtool. 182 | 183 | The second method involves providing the `DESTDIR' variable. For 184 | example, `make install DESTDIR=/alternate/directory' will prepend 185 | `/alternate/directory' before all installation names. The approach of 186 | `DESTDIR' overrides is not required by the GNU Coding Standards, and 187 | does not work on platforms that have drive letters. On the other hand, 188 | it does better at avoiding recompilation issues, and works well even 189 | when some directory options were not specified in terms of `${prefix}' 190 | at `configure' time. 191 | 192 | Optional Features 193 | ================= 194 | 195 | If the package supports it, you can cause programs to be installed 196 | with an extra prefix or suffix on their names by giving `configure' the 197 | option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. 198 | 199 | Some packages pay attention to `--enable-FEATURE' options to 200 | `configure', where FEATURE indicates an optional part of the package. 201 | They may also pay attention to `--with-PACKAGE' options, where PACKAGE 202 | is something like `gnu-as' or `x' (for the X Window System). The 203 | `README' should mention any `--enable-' and `--with-' options that the 204 | package recognizes. 205 | 206 | For packages that use the X Window System, `configure' can usually 207 | find the X include and library files automatically, but if it doesn't, 208 | you can use the `configure' options `--x-includes=DIR' and 209 | `--x-libraries=DIR' to specify their locations. 210 | 211 | Some packages offer the ability to configure how verbose the 212 | execution of `make' will be. For these packages, running `./configure 213 | --enable-silent-rules' sets the default to minimal output, which can be 214 | overridden with `make V=1'; while running `./configure 215 | --disable-silent-rules' sets the default to verbose, which can be 216 | overridden with `make V=0'. 217 | 218 | Particular systems 219 | ================== 220 | 221 | On HP-UX, the default C compiler is not ANSI C compatible. If GNU 222 | CC is not installed, it is recommended to use the following options in 223 | order to use an ANSI C compiler: 224 | 225 | ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" 226 | 227 | and if that doesn't work, install pre-built binaries of GCC for HP-UX. 228 | 229 | On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot 230 | parse its `' header file. The option `-nodtk' can be used as 231 | a workaround. If GNU CC is not installed, it is therefore recommended 232 | to try 233 | 234 | ./configure CC="cc" 235 | 236 | and if that doesn't work, try 237 | 238 | ./configure CC="cc -nodtk" 239 | 240 | On Solaris, don't put `/usr/ucb' early in your `PATH'. This 241 | directory contains several dysfunctional programs; working variants of 242 | these programs are available in `/usr/bin'. So, if you need `/usr/ucb' 243 | in your `PATH', put it _after_ `/usr/bin'. 244 | 245 | On Haiku, software installed for all users goes in `/boot/common', 246 | not `/usr/local'. It is recommended to use the following options: 247 | 248 | ./configure --prefix=/boot/common 249 | 250 | Specifying the System Type 251 | ========================== 252 | 253 | There may be some features `configure' cannot figure out 254 | automatically, but needs to determine by the type of machine the package 255 | will run on. Usually, assuming the package is built to be run on the 256 | _same_ architectures, `configure' can figure that out, but if it prints 257 | a message saying it cannot guess the machine type, give it the 258 | `--build=TYPE' option. TYPE can either be a short name for the system 259 | type, such as `sun4', or a canonical name which has the form: 260 | 261 | CPU-COMPANY-SYSTEM 262 | 263 | where SYSTEM can have one of these forms: 264 | 265 | OS 266 | KERNEL-OS 267 | 268 | See the file `config.sub' for the possible values of each field. If 269 | `config.sub' isn't included in this package, then this package doesn't 270 | need to know the machine type. 271 | 272 | If you are _building_ compiler tools for cross-compiling, you should 273 | use the option `--target=TYPE' to select the type of system they will 274 | produce code for. 275 | 276 | If you want to _use_ a cross compiler, that generates code for a 277 | platform different from the build platform, you should specify the 278 | "host" platform (i.e., that on which the generated programs will 279 | eventually be run) with `--host=TYPE'. 280 | 281 | Sharing Defaults 282 | ================ 283 | 284 | If you want to set default values for `configure' scripts to share, 285 | you can create a site shell script called `config.site' that gives 286 | default values for variables like `CC', `cache_file', and `prefix'. 287 | `configure' looks for `PREFIX/share/config.site' if it exists, then 288 | `PREFIX/etc/config.site' if it exists. Or, you can set the 289 | `CONFIG_SITE' environment variable to the location of the site script. 290 | A warning: not all `configure' scripts look for a site script. 291 | 292 | Defining Variables 293 | ================== 294 | 295 | Variables not defined in a site shell script can be set in the 296 | environment passed to `configure'. However, some packages may run 297 | configure again during the build, and the customized values of these 298 | variables may be lost. In order to avoid this problem, you should set 299 | them in the `configure' command line, using `VAR=value'. For example: 300 | 301 | ./configure CC=/usr/local2/bin/gcc 302 | 303 | causes the specified `gcc' to be used as the C compiler (unless it is 304 | overridden in the site shell script). 305 | 306 | Unfortunately, this technique does not work for `CONFIG_SHELL' due to 307 | an Autoconf bug. Until the bug is fixed you can use this workaround: 308 | 309 | CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash 310 | 311 | `configure' Invocation 312 | ====================== 313 | 314 | `configure' recognizes the following options to control how it 315 | operates. 316 | 317 | `--help' 318 | `-h' 319 | Print a summary of all of the options to `configure', and exit. 320 | 321 | `--help=short' 322 | `--help=recursive' 323 | Print a summary of the options unique to this package's 324 | `configure', and exit. The `short' variant lists options used 325 | only in the top level, while the `recursive' variant lists options 326 | also present in any nested packages. 327 | 328 | `--version' 329 | `-V' 330 | Print the version of Autoconf used to generate the `configure' 331 | script, and exit. 332 | 333 | `--cache-file=FILE' 334 | Enable the cache: use and save the results of the tests in FILE, 335 | traditionally `config.cache'. FILE defaults to `/dev/null' to 336 | disable caching. 337 | 338 | `--config-cache' 339 | `-C' 340 | Alias for `--cache-file=config.cache'. 341 | 342 | `--quiet' 343 | `--silent' 344 | `-q' 345 | Do not print messages saying which checks are being made. To 346 | suppress all normal output, redirect it to `/dev/null' (any error 347 | messages will still be shown). 348 | 349 | `--srcdir=DIR' 350 | Look for the package's source code in directory DIR. Usually 351 | `configure' can determine that directory automatically. 352 | 353 | `--prefix=DIR' 354 | Use DIR as the installation prefix. *note Installation Names:: 355 | for more details, including other options available for fine-tuning 356 | the installation locations. 357 | 358 | `--no-create' 359 | `-n' 360 | Run the configure checks, but stop before creating any output 361 | files. 362 | 363 | `configure' also accepts some other, not widely useful, options. Run 364 | `configure --help' for more details. 365 | 366 | -------------------------------------------------------------------------------- /tests/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, 6 | # Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | VPATH = @srcdir@ 18 | pkgdatadir = $(datadir)/@PACKAGE@ 19 | pkgincludedir = $(includedir)/@PACKAGE@ 20 | pkglibdir = $(libdir)/@PACKAGE@ 21 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 22 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 23 | install_sh_DATA = $(install_sh) -c -m 644 24 | install_sh_PROGRAM = $(install_sh) -c 25 | install_sh_SCRIPT = $(install_sh) -c 26 | INSTALL_HEADER = $(INSTALL_DATA) 27 | transform = $(program_transform_name) 28 | NORMAL_INSTALL = : 29 | PRE_INSTALL = : 30 | POST_INSTALL = : 31 | NORMAL_UNINSTALL = : 32 | PRE_UNINSTALL = : 33 | POST_UNINSTALL = : 34 | check_PROGRAMS = test_swap$(EXEEXT) test_inverse$(EXEEXT) 35 | subdir = tests 36 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 37 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 38 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 39 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 40 | $(ACLOCAL_M4) 41 | mkinstalldirs = $(install_sh) -d 42 | CONFIG_CLEAN_FILES = 43 | CONFIG_CLEAN_VPATH_FILES = 44 | am_test_inverse_OBJECTS = test_inverse.$(OBJEXT) variant.$(OBJEXT) 45 | test_inverse_OBJECTS = $(am_test_inverse_OBJECTS) 46 | test_inverse_LDADD = $(LDADD) 47 | am_test_swap_OBJECTS = test_swap.$(OBJEXT) variant.$(OBJEXT) 48 | test_swap_OBJECTS = $(am_test_swap_OBJECTS) 49 | test_swap_LDADD = $(LDADD) 50 | DEFAULT_INCLUDES = -I.@am__isrc@ 51 | depcomp = $(SHELL) $(top_srcdir)/depcomp 52 | am__depfiles_maybe = depfiles 53 | am__mv = mv -f 54 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 55 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 56 | CCLD = $(CC) 57 | LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ 58 | SOURCES = $(test_inverse_SOURCES) $(test_swap_SOURCES) 59 | DIST_SOURCES = $(test_inverse_SOURCES) $(test_swap_SOURCES) 60 | ETAGS = etags 61 | CTAGS = ctags 62 | am__tty_colors = \ 63 | red=; grn=; lgn=; blu=; std= 64 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 65 | ACLOCAL = @ACLOCAL@ 66 | AMTAR = @AMTAR@ 67 | AUTOCONF = @AUTOCONF@ 68 | AUTOHEADER = @AUTOHEADER@ 69 | AUTOMAKE = @AUTOMAKE@ 70 | AWK = @AWK@ 71 | CC = @CC@ 72 | CCDEPMODE = @CCDEPMODE@ 73 | CFLAGS = @CFLAGS@ 74 | CPP = @CPP@ 75 | CPPFLAGS = @CPPFLAGS@ 76 | CYGPATH_W = @CYGPATH_W@ 77 | DEFS = @DEFS@ 78 | DEPDIR = @DEPDIR@ 79 | ECHO_C = @ECHO_C@ 80 | ECHO_N = @ECHO_N@ 81 | ECHO_T = @ECHO_T@ 82 | EGREP = @EGREP@ 83 | EXEEXT = @EXEEXT@ 84 | GREP = @GREP@ 85 | INSTALL = @INSTALL@ 86 | INSTALL_DATA = @INSTALL_DATA@ 87 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 88 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 89 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 90 | LDFLAGS = @LDFLAGS@ 91 | LIBOBJS = @LIBOBJS@ 92 | LIBS = @LIBS@ 93 | LTLIBOBJS = @LTLIBOBJS@ 94 | MAKEINFO = @MAKEINFO@ 95 | MKDIR_P = @MKDIR_P@ 96 | OBJEXT = @OBJEXT@ 97 | PACKAGE = @PACKAGE@ 98 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 99 | PACKAGE_NAME = @PACKAGE_NAME@ 100 | PACKAGE_STRING = @PACKAGE_STRING@ 101 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 102 | PACKAGE_URL = @PACKAGE_URL@ 103 | PACKAGE_VERSION = @PACKAGE_VERSION@ 104 | PATH_SEPARATOR = @PATH_SEPARATOR@ 105 | SET_MAKE = @SET_MAKE@ 106 | SHELL = @SHELL@ 107 | STRIP = @STRIP@ 108 | VERSION = @VERSION@ 109 | abs_builddir = @abs_builddir@ 110 | abs_srcdir = @abs_srcdir@ 111 | abs_top_builddir = @abs_top_builddir@ 112 | abs_top_srcdir = @abs_top_srcdir@ 113 | ac_ct_CC = @ac_ct_CC@ 114 | am__include = @am__include@ 115 | am__leading_dot = @am__leading_dot@ 116 | am__quote = @am__quote@ 117 | am__tar = @am__tar@ 118 | am__untar = @am__untar@ 119 | bindir = @bindir@ 120 | build_alias = @build_alias@ 121 | builddir = @builddir@ 122 | datadir = @datadir@ 123 | datarootdir = @datarootdir@ 124 | docdir = @docdir@ 125 | dvidir = @dvidir@ 126 | exec_prefix = @exec_prefix@ 127 | host_alias = @host_alias@ 128 | htmldir = @htmldir@ 129 | includedir = @includedir@ 130 | infodir = @infodir@ 131 | install_sh = @install_sh@ 132 | libdir = @libdir@ 133 | libexecdir = @libexecdir@ 134 | localedir = @localedir@ 135 | localstatedir = @localstatedir@ 136 | mandir = @mandir@ 137 | mkdir_p = @mkdir_p@ 138 | oldincludedir = @oldincludedir@ 139 | pdfdir = @pdfdir@ 140 | prefix = @prefix@ 141 | program_transform_name = @program_transform_name@ 142 | psdir = @psdir@ 143 | sbindir = @sbindir@ 144 | sharedstatedir = @sharedstatedir@ 145 | srcdir = @srcdir@ 146 | sysconfdir = @sysconfdir@ 147 | target_alias = @target_alias@ 148 | top_build_prefix = @top_build_prefix@ 149 | top_builddir = @top_builddir@ 150 | top_srcdir = @top_srcdir@ 151 | test_swap_SOURCES = test_swap.c ../src/variant.h ../src/variant.c 152 | test_inverse_SOURCES = test_inverse.c ../src/variant.h ../src/variant.c 153 | TESTS = $(check_PROGRAMS) 154 | all: all-am 155 | 156 | .SUFFIXES: 157 | .SUFFIXES: .c .o .obj 158 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 159 | @for dep in $?; do \ 160 | case '$(am__configure_deps)' in \ 161 | *$$dep*) \ 162 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 163 | && { if test -f $@; then exit 0; else break; fi; }; \ 164 | exit 1;; \ 165 | esac; \ 166 | done; \ 167 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ 168 | $(am__cd) $(top_srcdir) && \ 169 | $(AUTOMAKE) --gnu tests/Makefile 170 | .PRECIOUS: Makefile 171 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 172 | @case '$?' in \ 173 | *config.status*) \ 174 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 175 | *) \ 176 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 177 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 178 | esac; 179 | 180 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 181 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 182 | 183 | $(top_srcdir)/configure: $(am__configure_deps) 184 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 185 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 186 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 187 | $(am__aclocal_m4_deps): 188 | 189 | clean-checkPROGRAMS: 190 | -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) 191 | test_inverse$(EXEEXT): $(test_inverse_OBJECTS) $(test_inverse_DEPENDENCIES) 192 | @rm -f test_inverse$(EXEEXT) 193 | $(LINK) $(test_inverse_OBJECTS) $(test_inverse_LDADD) $(LIBS) 194 | test_swap$(EXEEXT): $(test_swap_OBJECTS) $(test_swap_DEPENDENCIES) 195 | @rm -f test_swap$(EXEEXT) 196 | $(LINK) $(test_swap_OBJECTS) $(test_swap_LDADD) $(LIBS) 197 | 198 | mostlyclean-compile: 199 | -rm -f *.$(OBJEXT) 200 | 201 | distclean-compile: 202 | -rm -f *.tab.c 203 | 204 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_inverse.Po@am__quote@ 205 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_swap.Po@am__quote@ 206 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/variant.Po@am__quote@ 207 | 208 | .c.o: 209 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 210 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 211 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 212 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 213 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< 214 | 215 | .c.obj: 216 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` 217 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 218 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 219 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 220 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` 221 | 222 | variant.o: ../src/variant.c 223 | @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT variant.o -MD -MP -MF $(DEPDIR)/variant.Tpo -c -o variant.o `test -f '../src/variant.c' || echo '$(srcdir)/'`../src/variant.c 224 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/variant.Tpo $(DEPDIR)/variant.Po 225 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/variant.c' object='variant.o' libtool=no @AMDEPBACKSLASH@ 226 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 227 | @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o variant.o `test -f '../src/variant.c' || echo '$(srcdir)/'`../src/variant.c 228 | 229 | variant.obj: ../src/variant.c 230 | @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT variant.obj -MD -MP -MF $(DEPDIR)/variant.Tpo -c -o variant.obj `if test -f '../src/variant.c'; then $(CYGPATH_W) '../src/variant.c'; else $(CYGPATH_W) '$(srcdir)/../src/variant.c'; fi` 231 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/variant.Tpo $(DEPDIR)/variant.Po 232 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/variant.c' object='variant.obj' libtool=no @AMDEPBACKSLASH@ 233 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 234 | @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o variant.obj `if test -f '../src/variant.c'; then $(CYGPATH_W) '../src/variant.c'; else $(CYGPATH_W) '$(srcdir)/../src/variant.c'; fi` 235 | 236 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 237 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 238 | unique=`for i in $$list; do \ 239 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 240 | done | \ 241 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 242 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 243 | mkid -fID $$unique 244 | tags: TAGS 245 | 246 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 247 | $(TAGS_FILES) $(LISP) 248 | set x; \ 249 | here=`pwd`; \ 250 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 251 | unique=`for i in $$list; do \ 252 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 253 | done | \ 254 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 255 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 256 | shift; \ 257 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 258 | test -n "$$unique" || unique=$$empty_fix; \ 259 | if test $$# -gt 0; then \ 260 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 261 | "$$@" $$unique; \ 262 | else \ 263 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 264 | $$unique; \ 265 | fi; \ 266 | fi 267 | ctags: CTAGS 268 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 269 | $(TAGS_FILES) $(LISP) 270 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 271 | unique=`for i in $$list; do \ 272 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 273 | done | \ 274 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 275 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 276 | test -z "$(CTAGS_ARGS)$$unique" \ 277 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 278 | $$unique 279 | 280 | GTAGS: 281 | here=`$(am__cd) $(top_builddir) && pwd` \ 282 | && $(am__cd) $(top_srcdir) \ 283 | && gtags -i $(GTAGS_ARGS) "$$here" 284 | 285 | distclean-tags: 286 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 287 | 288 | check-TESTS: $(TESTS) 289 | @failed=0; all=0; xfail=0; xpass=0; skip=0; \ 290 | srcdir=$(srcdir); export srcdir; \ 291 | list=' $(TESTS) '; \ 292 | $(am__tty_colors); \ 293 | if test -n "$$list"; then \ 294 | for tst in $$list; do \ 295 | if test -f ./$$tst; then dir=./; \ 296 | elif test -f $$tst; then dir=; \ 297 | else dir="$(srcdir)/"; fi; \ 298 | if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ 299 | all=`expr $$all + 1`; \ 300 | case " $(XFAIL_TESTS) " in \ 301 | *[\ \ ]$$tst[\ \ ]*) \ 302 | xpass=`expr $$xpass + 1`; \ 303 | failed=`expr $$failed + 1`; \ 304 | col=$$red; res=XPASS; \ 305 | ;; \ 306 | *) \ 307 | col=$$grn; res=PASS; \ 308 | ;; \ 309 | esac; \ 310 | elif test $$? -ne 77; then \ 311 | all=`expr $$all + 1`; \ 312 | case " $(XFAIL_TESTS) " in \ 313 | *[\ \ ]$$tst[\ \ ]*) \ 314 | xfail=`expr $$xfail + 1`; \ 315 | col=$$lgn; res=XFAIL; \ 316 | ;; \ 317 | *) \ 318 | failed=`expr $$failed + 1`; \ 319 | col=$$red; res=FAIL; \ 320 | ;; \ 321 | esac; \ 322 | else \ 323 | skip=`expr $$skip + 1`; \ 324 | col=$$blu; res=SKIP; \ 325 | fi; \ 326 | echo "$${col}$$res$${std}: $$tst"; \ 327 | done; \ 328 | if test "$$all" -eq 1; then \ 329 | tests="test"; \ 330 | All=""; \ 331 | else \ 332 | tests="tests"; \ 333 | All="All "; \ 334 | fi; \ 335 | if test "$$failed" -eq 0; then \ 336 | if test "$$xfail" -eq 0; then \ 337 | banner="$$All$$all $$tests passed"; \ 338 | else \ 339 | if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ 340 | banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ 341 | fi; \ 342 | else \ 343 | if test "$$xpass" -eq 0; then \ 344 | banner="$$failed of $$all $$tests failed"; \ 345 | else \ 346 | if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ 347 | banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ 348 | fi; \ 349 | fi; \ 350 | dashes="$$banner"; \ 351 | skipped=""; \ 352 | if test "$$skip" -ne 0; then \ 353 | if test "$$skip" -eq 1; then \ 354 | skipped="($$skip test was not run)"; \ 355 | else \ 356 | skipped="($$skip tests were not run)"; \ 357 | fi; \ 358 | test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ 359 | dashes="$$skipped"; \ 360 | fi; \ 361 | report=""; \ 362 | if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ 363 | report="Please report to $(PACKAGE_BUGREPORT)"; \ 364 | test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ 365 | dashes="$$report"; \ 366 | fi; \ 367 | dashes=`echo "$$dashes" | sed s/./=/g`; \ 368 | if test "$$failed" -eq 0; then \ 369 | echo "$$grn$$dashes"; \ 370 | else \ 371 | echo "$$red$$dashes"; \ 372 | fi; \ 373 | echo "$$banner"; \ 374 | test -z "$$skipped" || echo "$$skipped"; \ 375 | test -z "$$report" || echo "$$report"; \ 376 | echo "$$dashes$$std"; \ 377 | test "$$failed" -eq 0; \ 378 | else :; fi 379 | 380 | distdir: $(DISTFILES) 381 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 382 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 383 | list='$(DISTFILES)'; \ 384 | dist_files=`for file in $$list; do echo $$file; done | \ 385 | sed -e "s|^$$srcdirstrip/||;t" \ 386 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 387 | case $$dist_files in \ 388 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 389 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 390 | sort -u` ;; \ 391 | esac; \ 392 | for file in $$dist_files; do \ 393 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 394 | if test -d $$d/$$file; then \ 395 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 396 | if test -d "$(distdir)/$$file"; then \ 397 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 398 | fi; \ 399 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 400 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 401 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 402 | fi; \ 403 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 404 | else \ 405 | test -f "$(distdir)/$$file" \ 406 | || cp -p $$d/$$file "$(distdir)/$$file" \ 407 | || exit 1; \ 408 | fi; \ 409 | done 410 | check-am: all-am 411 | $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) 412 | $(MAKE) $(AM_MAKEFLAGS) check-TESTS 413 | check: check-am 414 | all-am: Makefile 415 | installdirs: 416 | install: install-am 417 | install-exec: install-exec-am 418 | install-data: install-data-am 419 | uninstall: uninstall-am 420 | 421 | install-am: all-am 422 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 423 | 424 | installcheck: installcheck-am 425 | install-strip: 426 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 427 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 428 | `test -z '$(STRIP)' || \ 429 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 430 | mostlyclean-generic: 431 | 432 | clean-generic: 433 | 434 | distclean-generic: 435 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 436 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 437 | 438 | maintainer-clean-generic: 439 | @echo "This command is intended for maintainers to use" 440 | @echo "it deletes files that may require special tools to rebuild." 441 | clean: clean-am 442 | 443 | clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am 444 | 445 | distclean: distclean-am 446 | -rm -rf ./$(DEPDIR) 447 | -rm -f Makefile 448 | distclean-am: clean-am distclean-compile distclean-generic \ 449 | distclean-tags 450 | 451 | dvi: dvi-am 452 | 453 | dvi-am: 454 | 455 | html: html-am 456 | 457 | html-am: 458 | 459 | info: info-am 460 | 461 | info-am: 462 | 463 | install-data-am: 464 | 465 | install-dvi: install-dvi-am 466 | 467 | install-dvi-am: 468 | 469 | install-exec-am: 470 | 471 | install-html: install-html-am 472 | 473 | install-html-am: 474 | 475 | install-info: install-info-am 476 | 477 | install-info-am: 478 | 479 | install-man: 480 | 481 | install-pdf: install-pdf-am 482 | 483 | install-pdf-am: 484 | 485 | install-ps: install-ps-am 486 | 487 | install-ps-am: 488 | 489 | installcheck-am: 490 | 491 | maintainer-clean: maintainer-clean-am 492 | -rm -rf ./$(DEPDIR) 493 | -rm -f Makefile 494 | maintainer-clean-am: distclean-am maintainer-clean-generic 495 | 496 | mostlyclean: mostlyclean-am 497 | 498 | mostlyclean-am: mostlyclean-compile mostlyclean-generic 499 | 500 | pdf: pdf-am 501 | 502 | pdf-am: 503 | 504 | ps: ps-am 505 | 506 | ps-am: 507 | 508 | uninstall-am: 509 | 510 | .MAKE: check-am install-am install-strip 511 | 512 | .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ 513 | clean-checkPROGRAMS clean-generic ctags distclean \ 514 | distclean-compile distclean-generic distclean-tags distdir dvi \ 515 | dvi-am html html-am info info-am install install-am \ 516 | install-data install-data-am install-dvi install-dvi-am \ 517 | install-exec install-exec-am install-html install-html-am \ 518 | install-info install-info-am install-man install-pdf \ 519 | install-pdf-am install-ps install-ps-am install-strip \ 520 | installcheck installcheck-am installdirs maintainer-clean \ 521 | maintainer-clean-generic mostlyclean mostlyclean-compile \ 522 | mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ 523 | uninstall-am 524 | 525 | 526 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 527 | # Otherwise a system limit (for SysV at least) may be exceeded. 528 | .NOEXPORT: 529 | -------------------------------------------------------------------------------- /src/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, 6 | # Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | 18 | VPATH = @srcdir@ 19 | pkgdatadir = $(datadir)/@PACKAGE@ 20 | pkgincludedir = $(includedir)/@PACKAGE@ 21 | pkglibdir = $(libdir)/@PACKAGE@ 22 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 23 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 24 | install_sh_DATA = $(install_sh) -c -m 644 25 | install_sh_PROGRAM = $(install_sh) -c 26 | install_sh_SCRIPT = $(install_sh) -c 27 | INSTALL_HEADER = $(INSTALL_DATA) 28 | transform = $(program_transform_name) 29 | NORMAL_INSTALL = : 30 | PRE_INSTALL = : 31 | POST_INSTALL = : 32 | NORMAL_UNINSTALL = : 33 | PRE_UNINSTALL = : 34 | POST_UNINSTALL = : 35 | bin_PROGRAMS = check_modbus$(EXEEXT) 36 | subdir = src 37 | DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \ 38 | $(srcdir)/Makefile.in 39 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 40 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 41 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 42 | $(ACLOCAL_M4) 43 | mkinstalldirs = $(install_sh) -d 44 | CONFIG_CLEAN_FILES = 45 | CONFIG_CLEAN_VPATH_FILES = 46 | am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" 47 | PROGRAMS = $(bin_PROGRAMS) 48 | am_check_modbus_OBJECTS = command_line.$(OBJEXT) \ 49 | check_modbus.$(OBJEXT) variant.$(OBJEXT) 50 | check_modbus_OBJECTS = $(am_check_modbus_OBJECTS) 51 | check_modbus_LDADD = $(LDADD) 52 | DEFAULT_INCLUDES = -I.@am__isrc@ 53 | depcomp = $(SHELL) $(top_srcdir)/depcomp 54 | am__depfiles_maybe = depfiles 55 | am__mv = mv -f 56 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 57 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 58 | CCLD = $(CC) 59 | LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ 60 | SOURCES = $(check_modbus_SOURCES) 61 | DIST_SOURCES = $(check_modbus_SOURCES) 62 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 63 | am__vpath_adj = case $$p in \ 64 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 65 | *) f=$$p;; \ 66 | esac; 67 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; 68 | am__install_max = 40 69 | am__nobase_strip_setup = \ 70 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` 71 | am__nobase_strip = \ 72 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" 73 | am__nobase_list = $(am__nobase_strip_setup); \ 74 | for p in $$list; do echo "$$p $$p"; done | \ 75 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ 76 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ 77 | if (++n[$$2] == $(am__install_max)) \ 78 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ 79 | END { for (dir in files) print dir, files[dir] }' 80 | am__base_list = \ 81 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 82 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 83 | man1dir = $(mandir)/man1 84 | NROFF = nroff 85 | MANS = $(dist_man_MANS) 86 | ETAGS = etags 87 | CTAGS = ctags 88 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 89 | ACLOCAL = @ACLOCAL@ 90 | AMTAR = @AMTAR@ 91 | AUTOCONF = @AUTOCONF@ 92 | AUTOHEADER = @AUTOHEADER@ 93 | AUTOMAKE = @AUTOMAKE@ 94 | AWK = @AWK@ 95 | CC = @CC@ 96 | CCDEPMODE = @CCDEPMODE@ 97 | CFLAGS = @CFLAGS@ 98 | CPP = @CPP@ 99 | CPPFLAGS = @CPPFLAGS@ 100 | CYGPATH_W = @CYGPATH_W@ 101 | DEFS = @DEFS@ 102 | DEPDIR = @DEPDIR@ 103 | ECHO_C = @ECHO_C@ 104 | ECHO_N = @ECHO_N@ 105 | ECHO_T = @ECHO_T@ 106 | EGREP = @EGREP@ 107 | EXEEXT = @EXEEXT@ 108 | GREP = @GREP@ 109 | INSTALL = @INSTALL@ 110 | INSTALL_DATA = @INSTALL_DATA@ 111 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 112 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 113 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 114 | LDFLAGS = @LDFLAGS@ 115 | LIBOBJS = @LIBOBJS@ 116 | LIBS = @LIBS@ 117 | LTLIBOBJS = @LTLIBOBJS@ 118 | MAKEINFO = @MAKEINFO@ 119 | MKDIR_P = @MKDIR_P@ 120 | OBJEXT = @OBJEXT@ 121 | PACKAGE = @PACKAGE@ 122 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 123 | PACKAGE_NAME = @PACKAGE_NAME@ 124 | PACKAGE_STRING = @PACKAGE_STRING@ 125 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 126 | PACKAGE_URL = @PACKAGE_URL@ 127 | PACKAGE_VERSION = @PACKAGE_VERSION@ 128 | PATH_SEPARATOR = @PATH_SEPARATOR@ 129 | SET_MAKE = @SET_MAKE@ 130 | SHELL = @SHELL@ 131 | STRIP = @STRIP@ 132 | VERSION = @VERSION@ 133 | abs_builddir = @abs_builddir@ 134 | abs_srcdir = @abs_srcdir@ 135 | abs_top_builddir = @abs_top_builddir@ 136 | abs_top_srcdir = @abs_top_srcdir@ 137 | ac_ct_CC = @ac_ct_CC@ 138 | am__include = @am__include@ 139 | am__leading_dot = @am__leading_dot@ 140 | am__quote = @am__quote@ 141 | am__tar = @am__tar@ 142 | am__untar = @am__untar@ 143 | bindir = @bindir@ 144 | build_alias = @build_alias@ 145 | builddir = @builddir@ 146 | datadir = @datadir@ 147 | datarootdir = @datarootdir@ 148 | docdir = @docdir@ 149 | dvidir = @dvidir@ 150 | exec_prefix = @exec_prefix@ 151 | host_alias = @host_alias@ 152 | htmldir = @htmldir@ 153 | includedir = @includedir@ 154 | infodir = @infodir@ 155 | install_sh = @install_sh@ 156 | libdir = @libdir@ 157 | libexecdir = @libexecdir@ 158 | localedir = @localedir@ 159 | localstatedir = @localstatedir@ 160 | mandir = @mandir@ 161 | mkdir_p = @mkdir_p@ 162 | oldincludedir = @oldincludedir@ 163 | pdfdir = @pdfdir@ 164 | prefix = @prefix@ 165 | program_transform_name = @program_transform_name@ 166 | psdir = @psdir@ 167 | sbindir = @sbindir@ 168 | sharedstatedir = @sharedstatedir@ 169 | srcdir = @srcdir@ 170 | sysconfdir = @sysconfdir@ 171 | target_alias = @target_alias@ 172 | top_build_prefix = @top_build_prefix@ 173 | top_builddir = @top_builddir@ 174 | top_srcdir = @top_srcdir@ 175 | 176 | # man1_MANS=check_modbus.1 177 | dist_man_MANS = check_modbus.1 178 | check_modbus_SOURCES = compile_date_time.h command_line.c command_line.h check_modbus.c variant.h variant.c check_modbus.h global_macro.h 179 | all: all-am 180 | 181 | .SUFFIXES: 182 | .SUFFIXES: .c .o .obj 183 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 184 | @for dep in $?; do \ 185 | case '$(am__configure_deps)' in \ 186 | *$$dep*) \ 187 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 188 | && { if test -f $@; then exit 0; else break; fi; }; \ 189 | exit 1;; \ 190 | esac; \ 191 | done; \ 192 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ 193 | $(am__cd) $(top_srcdir) && \ 194 | $(AUTOMAKE) --gnu src/Makefile 195 | .PRECIOUS: Makefile 196 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 197 | @case '$?' in \ 198 | *config.status*) \ 199 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 200 | *) \ 201 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 202 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 203 | esac; 204 | 205 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 206 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 207 | 208 | $(top_srcdir)/configure: $(am__configure_deps) 209 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 210 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 211 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 212 | $(am__aclocal_m4_deps): 213 | install-binPROGRAMS: $(bin_PROGRAMS) 214 | @$(NORMAL_INSTALL) 215 | test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" 216 | @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 217 | for p in $$list; do echo "$$p $$p"; done | \ 218 | sed 's/$(EXEEXT)$$//' | \ 219 | while read p p1; do if test -f $$p; \ 220 | then echo "$$p"; echo "$$p"; else :; fi; \ 221 | done | \ 222 | sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ 223 | -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 224 | sed 'N;N;N;s,\n, ,g' | \ 225 | $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ 226 | { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ 227 | if ($$2 == $$4) files[d] = files[d] " " $$1; \ 228 | else { print "f", $$3 "/" $$4, $$1; } } \ 229 | END { for (d in files) print "f", d, files[d] }' | \ 230 | while read type dir files; do \ 231 | if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ 232 | test -z "$$files" || { \ 233 | echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ 234 | $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ 235 | } \ 236 | ; done 237 | 238 | uninstall-binPROGRAMS: 239 | @$(NORMAL_UNINSTALL) 240 | @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 241 | files=`for p in $$list; do echo "$$p"; done | \ 242 | sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ 243 | -e 's/$$/$(EXEEXT)/' `; \ 244 | test -n "$$list" || exit 0; \ 245 | echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ 246 | cd "$(DESTDIR)$(bindir)" && rm -f $$files 247 | 248 | clean-binPROGRAMS: 249 | -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) 250 | check_modbus$(EXEEXT): $(check_modbus_OBJECTS) $(check_modbus_DEPENDENCIES) 251 | @rm -f check_modbus$(EXEEXT) 252 | $(LINK) $(check_modbus_OBJECTS) $(check_modbus_LDADD) $(LIBS) 253 | 254 | mostlyclean-compile: 255 | -rm -f *.$(OBJEXT) 256 | 257 | distclean-compile: 258 | -rm -f *.tab.c 259 | 260 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_modbus.Po@am__quote@ 261 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/command_line.Po@am__quote@ 262 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/variant.Po@am__quote@ 263 | 264 | .c.o: 265 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 266 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 267 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 268 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 269 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< 270 | 271 | .c.obj: 272 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` 273 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 274 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 275 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 276 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` 277 | install-man1: $(dist_man_MANS) 278 | @$(NORMAL_INSTALL) 279 | test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" 280 | @list=''; test -n "$(man1dir)" || exit 0; \ 281 | { for i in $$list; do echo "$$i"; done; \ 282 | l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ 283 | sed -n '/\.1[a-z]*$$/p'; \ 284 | } | while read p; do \ 285 | if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ 286 | echo "$$d$$p"; echo "$$p"; \ 287 | done | \ 288 | sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ 289 | -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ 290 | sed 'N;N;s,\n, ,g' | { \ 291 | list=; while read file base inst; do \ 292 | if test "$$base" = "$$inst"; then list="$$list $$file"; else \ 293 | echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ 294 | $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ 295 | fi; \ 296 | done; \ 297 | for i in $$list; do echo "$$i"; done | $(am__base_list) | \ 298 | while read files; do \ 299 | test -z "$$files" || { \ 300 | echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ 301 | $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ 302 | done; } 303 | 304 | uninstall-man1: 305 | @$(NORMAL_UNINSTALL) 306 | @list=''; test -n "$(man1dir)" || exit 0; \ 307 | files=`{ for i in $$list; do echo "$$i"; done; \ 308 | l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ 309 | sed -n '/\.1[a-z]*$$/p'; \ 310 | } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ 311 | -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ 312 | test -z "$$files" || { \ 313 | echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ 314 | cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } 315 | 316 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 317 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 318 | unique=`for i in $$list; do \ 319 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 320 | done | \ 321 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 322 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 323 | mkid -fID $$unique 324 | tags: TAGS 325 | 326 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 327 | $(TAGS_FILES) $(LISP) 328 | set x; \ 329 | here=`pwd`; \ 330 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 331 | unique=`for i in $$list; do \ 332 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 333 | done | \ 334 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 335 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 336 | shift; \ 337 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 338 | test -n "$$unique" || unique=$$empty_fix; \ 339 | if test $$# -gt 0; then \ 340 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 341 | "$$@" $$unique; \ 342 | else \ 343 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 344 | $$unique; \ 345 | fi; \ 346 | fi 347 | ctags: CTAGS 348 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 349 | $(TAGS_FILES) $(LISP) 350 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 351 | unique=`for i in $$list; do \ 352 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 353 | done | \ 354 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 355 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 356 | test -z "$(CTAGS_ARGS)$$unique" \ 357 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 358 | $$unique 359 | 360 | GTAGS: 361 | here=`$(am__cd) $(top_builddir) && pwd` \ 362 | && $(am__cd) $(top_srcdir) \ 363 | && gtags -i $(GTAGS_ARGS) "$$here" 364 | 365 | distclean-tags: 366 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 367 | 368 | distdir: $(DISTFILES) 369 | @list='$(MANS)'; if test -n "$$list"; then \ 370 | list=`for p in $$list; do \ 371 | if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ 372 | if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ 373 | if test -n "$$list" && \ 374 | grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ 375 | echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ 376 | grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ 377 | echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ 378 | echo " typically \`make maintainer-clean' will remove them" >&2; \ 379 | exit 1; \ 380 | else :; fi; \ 381 | else :; fi 382 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 383 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 384 | list='$(DISTFILES)'; \ 385 | dist_files=`for file in $$list; do echo $$file; done | \ 386 | sed -e "s|^$$srcdirstrip/||;t" \ 387 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 388 | case $$dist_files in \ 389 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 390 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 391 | sort -u` ;; \ 392 | esac; \ 393 | for file in $$dist_files; do \ 394 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 395 | if test -d $$d/$$file; then \ 396 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 397 | if test -d "$(distdir)/$$file"; then \ 398 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 399 | fi; \ 400 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 401 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 402 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 403 | fi; \ 404 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 405 | else \ 406 | test -f "$(distdir)/$$file" \ 407 | || cp -p $$d/$$file "$(distdir)/$$file" \ 408 | || exit 1; \ 409 | fi; \ 410 | done 411 | check-am: all-am 412 | check: check-am 413 | all-am: Makefile $(PROGRAMS) $(MANS) 414 | installdirs: 415 | for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ 416 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 417 | done 418 | install: install-am 419 | install-exec: install-exec-am 420 | install-data: install-data-am 421 | uninstall: uninstall-am 422 | 423 | install-am: all-am 424 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 425 | 426 | installcheck: installcheck-am 427 | install-strip: 428 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 429 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 430 | `test -z '$(STRIP)' || \ 431 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 432 | mostlyclean-generic: 433 | 434 | clean-generic: 435 | 436 | distclean-generic: 437 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 438 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 439 | 440 | maintainer-clean-generic: 441 | @echo "This command is intended for maintainers to use" 442 | @echo "it deletes files that may require special tools to rebuild." 443 | clean: clean-am 444 | 445 | clean-am: clean-binPROGRAMS clean-generic mostlyclean-am 446 | 447 | distclean: distclean-am 448 | -rm -rf ./$(DEPDIR) 449 | -rm -f Makefile 450 | distclean-am: clean-am distclean-compile distclean-generic \ 451 | distclean-tags 452 | 453 | dvi: dvi-am 454 | 455 | dvi-am: 456 | 457 | html: html-am 458 | 459 | html-am: 460 | 461 | info: info-am 462 | 463 | info-am: 464 | 465 | install-data-am: install-man 466 | 467 | install-dvi: install-dvi-am 468 | 469 | install-dvi-am: 470 | 471 | install-exec-am: install-binPROGRAMS 472 | 473 | install-html: install-html-am 474 | 475 | install-html-am: 476 | 477 | install-info: install-info-am 478 | 479 | install-info-am: 480 | 481 | install-man: install-man1 482 | 483 | install-pdf: install-pdf-am 484 | 485 | install-pdf-am: 486 | 487 | install-ps: install-ps-am 488 | 489 | install-ps-am: 490 | 491 | installcheck-am: 492 | 493 | maintainer-clean: maintainer-clean-am 494 | -rm -rf ./$(DEPDIR) 495 | -rm -f Makefile 496 | maintainer-clean-am: distclean-am maintainer-clean-generic 497 | 498 | mostlyclean: mostlyclean-am 499 | 500 | mostlyclean-am: mostlyclean-compile mostlyclean-generic 501 | 502 | pdf: pdf-am 503 | 504 | pdf-am: 505 | 506 | ps: ps-am 507 | 508 | ps-am: 509 | 510 | uninstall-am: uninstall-binPROGRAMS uninstall-man 511 | 512 | uninstall-man: uninstall-man1 513 | 514 | .MAKE: install-am install-strip 515 | 516 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ 517 | clean-generic ctags distclean distclean-compile \ 518 | distclean-generic distclean-tags distdir dvi dvi-am html \ 519 | html-am info info-am install install-am install-binPROGRAMS \ 520 | install-data install-data-am install-dvi install-dvi-am \ 521 | install-exec install-exec-am install-html install-html-am \ 522 | install-info install-info-am install-man install-man1 \ 523 | install-pdf install-pdf-am install-ps install-ps-am \ 524 | install-strip installcheck installcheck-am installdirs \ 525 | maintainer-clean maintainer-clean-generic mostlyclean \ 526 | mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ 527 | tags uninstall uninstall-am uninstall-binPROGRAMS \ 528 | uninstall-man uninstall-man1 529 | 530 | 531 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 532 | # Otherwise a system limit (for SysV at least) may be exceeded. 533 | .NOEXPORT: 534 | -------------------------------------------------------------------------------- /depcomp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # depcomp - compile a program generating dependencies as side-effects 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free 7 | # Software Foundation, Inc. 8 | 9 | # This program is free software; you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 2, or (at your option) 12 | # any later version. 13 | 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | # Originally written by Alexandre Oliva . 28 | 29 | case $1 in 30 | '') 31 | echo "$0: No command. Try \`$0 --help' for more information." 1>&2 32 | exit 1; 33 | ;; 34 | -h | --h*) 35 | cat <<\EOF 36 | Usage: depcomp [--help] [--version] PROGRAM [ARGS] 37 | 38 | Run PROGRAMS ARGS to compile a file, generating dependencies 39 | as side-effects. 40 | 41 | Environment variables: 42 | depmode Dependency tracking mode. 43 | source Source file read by `PROGRAMS ARGS'. 44 | object Object file output by `PROGRAMS ARGS'. 45 | DEPDIR directory where to store dependencies. 46 | depfile Dependency file to output. 47 | tmpdepfile Temporary file to use when outputing dependencies. 48 | libtool Whether libtool is used (yes/no). 49 | 50 | Report bugs to . 51 | EOF 52 | exit $? 53 | ;; 54 | -v | --v*) 55 | echo "depcomp $scriptversion" 56 | exit $? 57 | ;; 58 | esac 59 | 60 | if test -z "$depmode" || test -z "$source" || test -z "$object"; then 61 | echo "depcomp: Variables source, object and depmode must be set" 1>&2 62 | exit 1 63 | fi 64 | 65 | # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. 66 | depfile=${depfile-`echo "$object" | 67 | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} 68 | tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} 69 | 70 | rm -f "$tmpdepfile" 71 | 72 | # Some modes work just like other modes, but use different flags. We 73 | # parameterize here, but still list the modes in the big case below, 74 | # to make depend.m4 easier to write. Note that we *cannot* use a case 75 | # here, because this file can only contain one case statement. 76 | if test "$depmode" = hp; then 77 | # HP compiler uses -M and no extra arg. 78 | gccflag=-M 79 | depmode=gcc 80 | fi 81 | 82 | if test "$depmode" = dashXmstdout; then 83 | # This is just like dashmstdout with a different argument. 84 | dashmflag=-xM 85 | depmode=dashmstdout 86 | fi 87 | 88 | cygpath_u="cygpath -u -f -" 89 | if test "$depmode" = msvcmsys; then 90 | # This is just like msvisualcpp but w/o cygpath translation. 91 | # Just convert the backslash-escaped backslashes to single forward 92 | # slashes to satisfy depend.m4 93 | cygpath_u="sed s,\\\\\\\\,/,g" 94 | depmode=msvisualcpp 95 | fi 96 | 97 | case "$depmode" in 98 | gcc3) 99 | ## gcc 3 implements dependency tracking that does exactly what 100 | ## we want. Yay! Note: for some reason libtool 1.4 doesn't like 101 | ## it if -MD -MP comes after the -MF stuff. Hmm. 102 | ## Unfortunately, FreeBSD c89 acceptance of flags depends upon 103 | ## the command line argument order; so add the flags where they 104 | ## appear in depend2.am. Note that the slowdown incurred here 105 | ## affects only configure: in makefiles, %FASTDEP% shortcuts this. 106 | for arg 107 | do 108 | case $arg in 109 | -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; 110 | *) set fnord "$@" "$arg" ;; 111 | esac 112 | shift # fnord 113 | shift # $arg 114 | done 115 | "$@" 116 | stat=$? 117 | if test $stat -eq 0; then : 118 | else 119 | rm -f "$tmpdepfile" 120 | exit $stat 121 | fi 122 | mv "$tmpdepfile" "$depfile" 123 | ;; 124 | 125 | gcc) 126 | ## There are various ways to get dependency output from gcc. Here's 127 | ## why we pick this rather obscure method: 128 | ## - Don't want to use -MD because we'd like the dependencies to end 129 | ## up in a subdir. Having to rename by hand is ugly. 130 | ## (We might end up doing this anyway to support other compilers.) 131 | ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like 132 | ## -MM, not -M (despite what the docs say). 133 | ## - Using -M directly means running the compiler twice (even worse 134 | ## than renaming). 135 | if test -z "$gccflag"; then 136 | gccflag=-MD, 137 | fi 138 | "$@" -Wp,"$gccflag$tmpdepfile" 139 | stat=$? 140 | if test $stat -eq 0; then : 141 | else 142 | rm -f "$tmpdepfile" 143 | exit $stat 144 | fi 145 | rm -f "$depfile" 146 | echo "$object : \\" > "$depfile" 147 | alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 148 | ## The second -e expression handles DOS-style file names with drive letters. 149 | sed -e 's/^[^:]*: / /' \ 150 | -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" 151 | ## This next piece of magic avoids the `deleted header file' problem. 152 | ## The problem is that when a header file which appears in a .P file 153 | ## is deleted, the dependency causes make to die (because there is 154 | ## typically no way to rebuild the header). We avoid this by adding 155 | ## dummy dependencies for each header file. Too bad gcc doesn't do 156 | ## this for us directly. 157 | tr ' ' ' 158 | ' < "$tmpdepfile" | 159 | ## Some versions of gcc put a space before the `:'. On the theory 160 | ## that the space means something, we add a space to the output as 161 | ## well. 162 | ## Some versions of the HPUX 10.20 sed can't process this invocation 163 | ## correctly. Breaking it into two sed invocations is a workaround. 164 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 165 | rm -f "$tmpdepfile" 166 | ;; 167 | 168 | hp) 169 | # This case exists only to let depend.m4 do its work. It works by 170 | # looking at the text of this script. This case will never be run, 171 | # since it is checked for above. 172 | exit 1 173 | ;; 174 | 175 | sgi) 176 | if test "$libtool" = yes; then 177 | "$@" "-Wp,-MDupdate,$tmpdepfile" 178 | else 179 | "$@" -MDupdate "$tmpdepfile" 180 | fi 181 | stat=$? 182 | if test $stat -eq 0; then : 183 | else 184 | rm -f "$tmpdepfile" 185 | exit $stat 186 | fi 187 | rm -f "$depfile" 188 | 189 | if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files 190 | echo "$object : \\" > "$depfile" 191 | 192 | # Clip off the initial element (the dependent). Don't try to be 193 | # clever and replace this with sed code, as IRIX sed won't handle 194 | # lines with more than a fixed number of characters (4096 in 195 | # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; 196 | # the IRIX cc adds comments like `#:fec' to the end of the 197 | # dependency line. 198 | tr ' ' ' 199 | ' < "$tmpdepfile" \ 200 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ 201 | tr ' 202 | ' ' ' >> "$depfile" 203 | echo >> "$depfile" 204 | 205 | # The second pass generates a dummy entry for each header file. 206 | tr ' ' ' 207 | ' < "$tmpdepfile" \ 208 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ 209 | >> "$depfile" 210 | else 211 | # The sourcefile does not contain any dependencies, so just 212 | # store a dummy comment line, to avoid errors with the Makefile 213 | # "include basename.Plo" scheme. 214 | echo "#dummy" > "$depfile" 215 | fi 216 | rm -f "$tmpdepfile" 217 | ;; 218 | 219 | aix) 220 | # The C for AIX Compiler uses -M and outputs the dependencies 221 | # in a .u file. In older versions, this file always lives in the 222 | # current directory. Also, the AIX compiler puts `$object:' at the 223 | # start of each line; $object doesn't have directory information. 224 | # Version 6 uses the directory in both cases. 225 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 226 | test "x$dir" = "x$object" && dir= 227 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 228 | if test "$libtool" = yes; then 229 | tmpdepfile1=$dir$base.u 230 | tmpdepfile2=$base.u 231 | tmpdepfile3=$dir.libs/$base.u 232 | "$@" -Wc,-M 233 | else 234 | tmpdepfile1=$dir$base.u 235 | tmpdepfile2=$dir$base.u 236 | tmpdepfile3=$dir$base.u 237 | "$@" -M 238 | fi 239 | stat=$? 240 | 241 | if test $stat -eq 0; then : 242 | else 243 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 244 | exit $stat 245 | fi 246 | 247 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 248 | do 249 | test -f "$tmpdepfile" && break 250 | done 251 | if test -f "$tmpdepfile"; then 252 | # Each line is of the form `foo.o: dependent.h'. 253 | # Do two passes, one to just change these to 254 | # `$object: dependent.h' and one to simply `dependent.h:'. 255 | sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 256 | # That's a tab and a space in the []. 257 | sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 258 | else 259 | # The sourcefile does not contain any dependencies, so just 260 | # store a dummy comment line, to avoid errors with the Makefile 261 | # "include basename.Plo" scheme. 262 | echo "#dummy" > "$depfile" 263 | fi 264 | rm -f "$tmpdepfile" 265 | ;; 266 | 267 | icc) 268 | # Intel's C compiler understands `-MD -MF file'. However on 269 | # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c 270 | # ICC 7.0 will fill foo.d with something like 271 | # foo.o: sub/foo.c 272 | # foo.o: sub/foo.h 273 | # which is wrong. We want: 274 | # sub/foo.o: sub/foo.c 275 | # sub/foo.o: sub/foo.h 276 | # sub/foo.c: 277 | # sub/foo.h: 278 | # ICC 7.1 will output 279 | # foo.o: sub/foo.c sub/foo.h 280 | # and will wrap long lines using \ : 281 | # foo.o: sub/foo.c ... \ 282 | # sub/foo.h ... \ 283 | # ... 284 | 285 | "$@" -MD -MF "$tmpdepfile" 286 | stat=$? 287 | if test $stat -eq 0; then : 288 | else 289 | rm -f "$tmpdepfile" 290 | exit $stat 291 | fi 292 | rm -f "$depfile" 293 | # Each line is of the form `foo.o: dependent.h', 294 | # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. 295 | # Do two passes, one to just change these to 296 | # `$object: dependent.h' and one to simply `dependent.h:'. 297 | sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" 298 | # Some versions of the HPUX 10.20 sed can't process this invocation 299 | # correctly. Breaking it into two sed invocations is a workaround. 300 | sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | 301 | sed -e 's/$/ :/' >> "$depfile" 302 | rm -f "$tmpdepfile" 303 | ;; 304 | 305 | hp2) 306 | # The "hp" stanza above does not work with aCC (C++) and HP's ia64 307 | # compilers, which have integrated preprocessors. The correct option 308 | # to use with these is +Maked; it writes dependencies to a file named 309 | # 'foo.d', which lands next to the object file, wherever that 310 | # happens to be. 311 | # Much of this is similar to the tru64 case; see comments there. 312 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 313 | test "x$dir" = "x$object" && dir= 314 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 315 | if test "$libtool" = yes; then 316 | tmpdepfile1=$dir$base.d 317 | tmpdepfile2=$dir.libs/$base.d 318 | "$@" -Wc,+Maked 319 | else 320 | tmpdepfile1=$dir$base.d 321 | tmpdepfile2=$dir$base.d 322 | "$@" +Maked 323 | fi 324 | stat=$? 325 | if test $stat -eq 0; then : 326 | else 327 | rm -f "$tmpdepfile1" "$tmpdepfile2" 328 | exit $stat 329 | fi 330 | 331 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" 332 | do 333 | test -f "$tmpdepfile" && break 334 | done 335 | if test -f "$tmpdepfile"; then 336 | sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" 337 | # Add `dependent.h:' lines. 338 | sed -ne '2,${ 339 | s/^ *// 340 | s/ \\*$// 341 | s/$/:/ 342 | p 343 | }' "$tmpdepfile" >> "$depfile" 344 | else 345 | echo "#dummy" > "$depfile" 346 | fi 347 | rm -f "$tmpdepfile" "$tmpdepfile2" 348 | ;; 349 | 350 | tru64) 351 | # The Tru64 compiler uses -MD to generate dependencies as a side 352 | # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. 353 | # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 354 | # dependencies in `foo.d' instead, so we check for that too. 355 | # Subdirectories are respected. 356 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 357 | test "x$dir" = "x$object" && dir= 358 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 359 | 360 | if test "$libtool" = yes; then 361 | # With Tru64 cc, shared objects can also be used to make a 362 | # static library. This mechanism is used in libtool 1.4 series to 363 | # handle both shared and static libraries in a single compilation. 364 | # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. 365 | # 366 | # With libtool 1.5 this exception was removed, and libtool now 367 | # generates 2 separate objects for the 2 libraries. These two 368 | # compilations output dependencies in $dir.libs/$base.o.d and 369 | # in $dir$base.o.d. We have to check for both files, because 370 | # one of the two compilations can be disabled. We should prefer 371 | # $dir$base.o.d over $dir.libs/$base.o.d because the latter is 372 | # automatically cleaned when .libs/ is deleted, while ignoring 373 | # the former would cause a distcleancheck panic. 374 | tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 375 | tmpdepfile2=$dir$base.o.d # libtool 1.5 376 | tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 377 | tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 378 | "$@" -Wc,-MD 379 | else 380 | tmpdepfile1=$dir$base.o.d 381 | tmpdepfile2=$dir$base.d 382 | tmpdepfile3=$dir$base.d 383 | tmpdepfile4=$dir$base.d 384 | "$@" -MD 385 | fi 386 | 387 | stat=$? 388 | if test $stat -eq 0; then : 389 | else 390 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 391 | exit $stat 392 | fi 393 | 394 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 395 | do 396 | test -f "$tmpdepfile" && break 397 | done 398 | if test -f "$tmpdepfile"; then 399 | sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 400 | # That's a tab and a space in the []. 401 | sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 402 | else 403 | echo "#dummy" > "$depfile" 404 | fi 405 | rm -f "$tmpdepfile" 406 | ;; 407 | 408 | #nosideeffect) 409 | # This comment above is used by automake to tell side-effect 410 | # dependency tracking mechanisms from slower ones. 411 | 412 | dashmstdout) 413 | # Important note: in order to support this mode, a compiler *must* 414 | # always write the preprocessed file to stdout, regardless of -o. 415 | "$@" || exit $? 416 | 417 | # Remove the call to Libtool. 418 | if test "$libtool" = yes; then 419 | while test "X$1" != 'X--mode=compile'; do 420 | shift 421 | done 422 | shift 423 | fi 424 | 425 | # Remove `-o $object'. 426 | IFS=" " 427 | for arg 428 | do 429 | case $arg in 430 | -o) 431 | shift 432 | ;; 433 | $object) 434 | shift 435 | ;; 436 | *) 437 | set fnord "$@" "$arg" 438 | shift # fnord 439 | shift # $arg 440 | ;; 441 | esac 442 | done 443 | 444 | test -z "$dashmflag" && dashmflag=-M 445 | # Require at least two characters before searching for `:' 446 | # in the target name. This is to cope with DOS-style filenames: 447 | # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. 448 | "$@" $dashmflag | 449 | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" 450 | rm -f "$depfile" 451 | cat < "$tmpdepfile" > "$depfile" 452 | tr ' ' ' 453 | ' < "$tmpdepfile" | \ 454 | ## Some versions of the HPUX 10.20 sed can't process this invocation 455 | ## correctly. Breaking it into two sed invocations is a workaround. 456 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 457 | rm -f "$tmpdepfile" 458 | ;; 459 | 460 | dashXmstdout) 461 | # This case only exists to satisfy depend.m4. It is never actually 462 | # run, as this mode is specially recognized in the preamble. 463 | exit 1 464 | ;; 465 | 466 | makedepend) 467 | "$@" || exit $? 468 | # Remove any Libtool call 469 | if test "$libtool" = yes; then 470 | while test "X$1" != 'X--mode=compile'; do 471 | shift 472 | done 473 | shift 474 | fi 475 | # X makedepend 476 | shift 477 | cleared=no eat=no 478 | for arg 479 | do 480 | case $cleared in 481 | no) 482 | set ""; shift 483 | cleared=yes ;; 484 | esac 485 | if test $eat = yes; then 486 | eat=no 487 | continue 488 | fi 489 | case "$arg" in 490 | -D*|-I*) 491 | set fnord "$@" "$arg"; shift ;; 492 | # Strip any option that makedepend may not understand. Remove 493 | # the object too, otherwise makedepend will parse it as a source file. 494 | -arch) 495 | eat=yes ;; 496 | -*|$object) 497 | ;; 498 | *) 499 | set fnord "$@" "$arg"; shift ;; 500 | esac 501 | done 502 | obj_suffix=`echo "$object" | sed 's/^.*\././'` 503 | touch "$tmpdepfile" 504 | ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" 505 | rm -f "$depfile" 506 | cat < "$tmpdepfile" > "$depfile" 507 | sed '1,2d' "$tmpdepfile" | tr ' ' ' 508 | ' | \ 509 | ## Some versions of the HPUX 10.20 sed can't process this invocation 510 | ## correctly. Breaking it into two sed invocations is a workaround. 511 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 512 | rm -f "$tmpdepfile" "$tmpdepfile".bak 513 | ;; 514 | 515 | cpp) 516 | # Important note: in order to support this mode, a compiler *must* 517 | # always write the preprocessed file to stdout. 518 | "$@" || exit $? 519 | 520 | # Remove the call to Libtool. 521 | if test "$libtool" = yes; then 522 | while test "X$1" != 'X--mode=compile'; do 523 | shift 524 | done 525 | shift 526 | fi 527 | 528 | # Remove `-o $object'. 529 | IFS=" " 530 | for arg 531 | do 532 | case $arg in 533 | -o) 534 | shift 535 | ;; 536 | $object) 537 | shift 538 | ;; 539 | *) 540 | set fnord "$@" "$arg" 541 | shift # fnord 542 | shift # $arg 543 | ;; 544 | esac 545 | done 546 | 547 | "$@" -E | 548 | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 549 | -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | 550 | sed '$ s: \\$::' > "$tmpdepfile" 551 | rm -f "$depfile" 552 | echo "$object : \\" > "$depfile" 553 | cat < "$tmpdepfile" >> "$depfile" 554 | sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" 555 | rm -f "$tmpdepfile" 556 | ;; 557 | 558 | msvisualcpp) 559 | # Important note: in order to support this mode, a compiler *must* 560 | # always write the preprocessed file to stdout. 561 | "$@" || exit $? 562 | 563 | # Remove the call to Libtool. 564 | if test "$libtool" = yes; then 565 | while test "X$1" != 'X--mode=compile'; do 566 | shift 567 | done 568 | shift 569 | fi 570 | 571 | IFS=" " 572 | for arg 573 | do 574 | case "$arg" in 575 | -o) 576 | shift 577 | ;; 578 | $object) 579 | shift 580 | ;; 581 | "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") 582 | set fnord "$@" 583 | shift 584 | shift 585 | ;; 586 | *) 587 | set fnord "$@" "$arg" 588 | shift 589 | shift 590 | ;; 591 | esac 592 | done 593 | "$@" -E 2>/dev/null | 594 | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" 595 | rm -f "$depfile" 596 | echo "$object : \\" > "$depfile" 597 | sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" 598 | echo " " >> "$depfile" 599 | sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" 600 | rm -f "$tmpdepfile" 601 | ;; 602 | 603 | msvcmsys) 604 | # This case exists only to let depend.m4 do its work. It works by 605 | # looking at the text of this script. This case will never be run, 606 | # since it is checked for above. 607 | exit 1 608 | ;; 609 | 610 | none) 611 | exec "$@" 612 | ;; 613 | 614 | *) 615 | echo "Unknown depmode $depmode" 1>&2 616 | exit 1 617 | ;; 618 | esac 619 | 620 | exit 0 621 | 622 | # Local Variables: 623 | # mode: shell-script 624 | # sh-indentation: 2 625 | # eval: (add-hook 'write-file-hooks 'time-stamp) 626 | # time-stamp-start: "scriptversion=" 627 | # time-stamp-format: "%:y-%02m-%02d.%02H" 628 | # time-stamp-time-zone: "UTC" 629 | # time-stamp-end: "; # UTC" 630 | # End: 631 | -------------------------------------------------------------------------------- /src/command_line.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "compile_date_time.h" 7 | #include "global_macro.h" 8 | #include "check_modbus.h" 9 | 10 | 11 | void print_help(void) 12 | { 13 | printf("Check ModBus version %s\n", PACKAGE_VERSION ); 14 | printf("Build date: %02d.%02d.%04d\n",COMPILE_DAY,COMPILE_MONTH,COMPILE_YEAR); 15 | printf("\n"); 16 | printf("-v --verbose Print additional (debug) information (settings, modbus debug etc).\n"); 17 | printf(" Specify multiple times to increase verbosity level.\n" ); 18 | printf("-h --help Print this help\n" ); 19 | printf("-H --ip= IP address or hostname\n"); 20 | printf("-p --port= [ TCP Port number. Default %s ]\n", XSTR(MODBUS_TCP_DEFAULT_PORT)); 21 | 22 | #if LIBMODBUS_VERSION_MAJOR >= 3 23 | printf("-S --serial= Serial port to use\n"); 24 | printf("-b --serial_bps= [ Serial port speed. Default 9600 ]\n"); 25 | printf(" --serial_mode= [ RS mode of serial port. Default 0 ]\n"); 26 | printf(" 0 - RS232\n"); 27 | printf(" 1 - RS485\n"); 28 | printf(" --serial_parity= [ Serial port parity settings. Default none ]\n"); 29 | printf(" Allowed values: none/N, even/E, odd/O\n"); 30 | printf(" --serial_data_bits= [ Serial port number of data bits. Default 8 ]\n"); 31 | printf(" Allowed values: 5, 6, 7, 8\n"); 32 | printf(" --serial_stop_bits= [ Serial port number of stop bits. Default 1 ]\n"); 33 | printf(" Allowed values: 1, 2\n"); 34 | #endif 35 | 36 | printf("--file= use binary dump file as input source \n"); 37 | 38 | printf("-d --device= [ Device modbus number. Default 1 ]\n"); 39 | printf("-a --address= [ Register/bit address reference. Default 1 ]\n"); 40 | printf("-t --try= [ Number of tries. Default 1 ]\n"); 41 | printf("-F --format= [ Data format. Default 1 ]\n"); 42 | printf(" 1 - int16_t \n"); 43 | printf(" 2 - uint16_t \n"); 44 | printf(" 3 - int32_t \n"); 45 | printf(" 4 - uint32_t \n"); 46 | printf(" 5 - int64_t \n"); 47 | printf(" 6 - uint64_t \n"); 48 | printf(" 7 - float \n"); 49 | printf(" 8 - double \n"); 50 | printf("-s --swapbytes [ Swap bytes in each incomming word ]\n"); 51 | printf("-i --inverse [ Use inversed words order ]\n"); 52 | printf("-f --function= Number of functions\n"); 53 | printf(" 1 - Read coils\n"); 54 | printf(" 2 - Read input discretes\n"); 55 | printf(" 3 - Read multiple registers\n"); 56 | printf(" 4 - Read input registers\n"); 57 | printf("-w --warning= [ Warning range ]\n"); 58 | printf("-c --critical= [ Critical range ]\n"); 59 | printf("-n --null [ If the query will get zero, return the critical signal ]\n"); 60 | printf("-N --not_null [ If the query will get no zero, return the critical signal ]\n"); 61 | printf("\n"); 62 | printf("-m --perf_min= [ Minimum value for performance data]\n"); 63 | printf("-M --perf_max= [ Maximum value for performance data]\n"); 64 | printf("-P --perf_data [ Enable to show performance data. By default performance data is disabled]\n"); 65 | printf("-L --perf_label= [ Label for performance data]\n"); 66 | printf("\n"); 67 | printf("--dump [ Dump register and bits values instead of analize their values ]\n"); 68 | printf("--dump_size= [ Number of registers/bits in output dump ]\n"); 69 | printf("--dump_format= [ Format of dump output. Default 1]\n"); 70 | printf(" 1 - binary\n"); 71 | printf(" 2 - hex\n"); 72 | printf(" 3 - decimal\n"); 73 | printf("\n"); 74 | printf(" Examples:\n"); 75 | printf(" ./check_modbus --ip=192.168.1.123 -d 1 -a 13 -f 4 -w 123.4 -c 234.5\n"); 76 | printf(" ./check_modbus --ip=192.168.1.123 -d 1 -a 15 -f 4 -w 2345 -c 1234\n"); 77 | printf(" ./check_modbus --ip=plc01 --try=5 -d 2 -a 20 -f 2 -n\n"); 78 | printf(" ./check_modbus --ip=plc01 --try=5 -d 2 -a 1 -f 4 --dump --dump_format 1 --dump_size 20\n" ); 79 | printf(" ./check_modbus --file=file.dump -F 7 -f 4 -a 20 -w 100\n"); 80 | 81 | #if LIBMODBUS_VERSION_MAJOR >= 3 82 | printf(" ./check_modbus --serial=/dev/ttyS0 -d 2 -a 7 -f 4 -n\n"); 83 | #endif 84 | 85 | printf("\n"); 86 | } 87 | 88 | void print_settings(modbus_params_t* params) 89 | { 90 | printf("---------------------------------------------\n"); 91 | printf("Settings:\n"); 92 | 93 | if (params->host != NULL) 94 | { 95 | printf("ip: %s\n", params->host ); 96 | printf("port: %s\n", params->mport ); 97 | } 98 | #if LIBMODBUS_VERSION_MAJOR >= 3 99 | else if (params->serial != NULL) 100 | { 101 | printf("serial: %s\n", params->serial ); 102 | printf("serial_mode: %s\n", (params->serial_mode == MODBUS_RTU_RS232) ? "MODBUS_RTU_RS232" : "MODBUS_RTU_RS485" ); 103 | printf("serial_bps: %d\n", params->serial_bps ); 104 | printf("serial_parity: %c (N: none, E: even, O: odd)\n", params->serial_parity ); 105 | printf("serial_data_bits: %d\n", params->serial_data_bits ); 106 | printf("serial_stop_bits: %d\n", params->serial_stop_bits ); 107 | } 108 | #endif 109 | else if (params->file != NULL ) 110 | printf("file: %s\n", params->file ); 111 | 112 | printf("\n"); 113 | 114 | printf("verbosity: %d\n", params->verbose ); 115 | 116 | printf("device: %d\n", params->devnum ); 117 | printf("address: %d\n", params->sad ); 118 | printf("function: %d\n", params->nf ); 119 | printf("tries: %d\n", params->tries ); 120 | printf("\n"); 121 | printf("inverse: %d\n", params->inverse_words); 122 | printf("format: %d\n", params->format ); 123 | printf("swap bytes: %d\n", params->swap_bytes ); 124 | printf("\n"); 125 | printf("warning: %lf\n", params->warn_range ); 126 | printf("critical: %lf\n", params->crit_range ); 127 | printf("null: %d\n", params->nc ); 128 | printf("not null: %d\n", params->nnc ); 129 | printf("\n"); 130 | printf("perf_data: %d\n", params->perf_data ); 131 | 132 | 133 | printf("perf_label: %s\n", params->perf_label ? params->perf_label : "NULL" ); 134 | 135 | printf("perf_min: %lf\n", params->perf_min ); 136 | printf("perf_max: %lf\n", params->perf_max ); 137 | 138 | printf("\n"); 139 | printf("dump: %d\n", params->dump ); 140 | printf("dump_format: %d\n", params->dump_format); 141 | printf("dump_size: %d\n", params->dump_size ); 142 | printf("---------------------------------------------\n"); 143 | } 144 | 145 | 146 | void load_defaults(modbus_params_t* params) 147 | { 148 | static char mport_default[] = XSTR(MODBUS_TCP_DEFAULT_PORT); 149 | 150 | params->mport = mport_default; 151 | 152 | #if LIBMODBUS_VERSION_MAJOR >= 3 153 | static char serial_parity_default = SERIAL_PARITY_DEFAULT; 154 | 155 | params->serial = NULL; 156 | params->serial_mode = MODBUS_RTU_RS232; 157 | params->serial_bps = 9600; 158 | params->serial_parity = serial_parity_default; 159 | params->serial_data_bits = 8; 160 | params->serial_stop_bits = 1; 161 | #endif 162 | params->file = NULL; 163 | 164 | params->sad = 0; 165 | params->devnum = 1; 166 | params->host = NULL; 167 | params->nf = 0; 168 | params->nc = 0; 169 | params->nnc = 0; 170 | params->tries = 1; 171 | params->format = 1; 172 | params->inverse_words = 0; 173 | params->swap_bytes = 0; 174 | 175 | params->warn_range = 0; 176 | params->crit_range = 0; 177 | params->verbose = 0; 178 | 179 | params->perf_min_en = 0; 180 | params->perf_max_en = 0; 181 | params->perf_data = 0; 182 | params->perf_label = NULL; 183 | params->perf_min = 0; 184 | params->perf_max = 0; 185 | 186 | params->dump = 0; 187 | params->dump_format = 0; 188 | params->dump_size = 0; 189 | } 190 | 191 | 192 | int check_swap_inverse( modbus_params_t* params) 193 | { 194 | int rc = 0; 195 | if ( ((params->nf == 1) || (params->nf == 2)) && /* bit operations */ 196 | ((params->swap_bytes ) || (params->inverse_words)) ) 197 | rc = 1; 198 | if (rc) 199 | { 200 | fprintf( stderr, "Swap bytes and inverse words functionality not acceptable "); 201 | fprintf( stderr, "for modbus functions 1 and 2 operated with bits.\n"); 202 | } 203 | return rc; 204 | } 205 | 206 | int check_dump_param( modbus_params_t* params) 207 | { 208 | int rc = 0; 209 | int ft = params->dump_format; 210 | 211 | rc = (ft>DUMP_FMT_MIN_SUPPORTED) && (ftdump ; 212 | return rc; 213 | } 214 | 215 | int check_function_num(modbus_params_t* params) 216 | { 217 | int rc; 218 | rc = (params->nf>MBF_MIN_SUPPORTED) && (params->nfnf ); 220 | return rc; 221 | } 222 | 223 | 224 | int check_source( modbus_params_t* params) 225 | { 226 | int cnt; 227 | 228 | cnt = params->host ? 1 : 0; 229 | #if LIBMODBUS_VERSION_MAJOR >= 3 230 | cnt = params->serial ? cnt++ : cnt; 231 | #endif 232 | cnt = params->file ? cnt++ : cnt; 233 | 234 | if (cnt>1) 235 | { 236 | fprintf( stderr, "Several modbus input interfaces were declared\n"); 237 | return 1; 238 | } 239 | return 0; 240 | } 241 | 242 | 243 | int check_format_type(modbus_params_t* params) 244 | { 245 | int rc; 246 | int ft; 247 | int max_format,min_format; 248 | 249 | min_format = params->dump ? FORMAT_DUMP_MIN : FORMAT_MIN_SUPPORTED; 250 | max_format = params->dump ? FORMAT_DUMP_MAX : FORMAT_MAX_SUPPORTED; 251 | ft = params->format; 252 | 253 | rc = (ft>min_format) && (ftformat ); 257 | if (params->dump) 258 | fprintf( stderr, "-F (--format) parameter can not be used in dump mode \n"); 259 | } 260 | return rc; 261 | } 262 | 263 | 264 | #if LIBMODBUS_VERSION_MAJOR >= 3 265 | int check_serial_parity(char parity) 266 | { 267 | return ((parity == 'N') || (parity == 'E') || (parity == 'O')) ? 0 : 1; 268 | } 269 | #endif 270 | 271 | 272 | 273 | 274 | int check_command_line(modbus_params_t* params, int argc, char** argv) 275 | { 276 | #if LIBMODBUS_VERSION_MAJOR >= 3 277 | if (params->host == NULL && params->serial == NULL && params->file == NULL) 278 | { 279 | fprintf( \ 280 | stderr, \ 281 | "Not provided or unable to parse host address/serial port name/filename: %s\n", \ 282 | argv[0] \ 283 | ); 284 | return RESULT_WRONG_ARG; 285 | }; 286 | #else 287 | if (params->host == NULL && params->file == NULL ) 288 | { 289 | fprintf( \ 290 | stderr, \ 291 | "Not provided or unable to parse host address or filename: %s\n", \ 292 | argv[0] \ 293 | ); 294 | return RESULT_WRONG_ARG; 295 | }; 296 | #endif 297 | 298 | #if LIBMODBUS_VERSION_MAJOR >= 3 299 | if (params->serial != NULL) 300 | { 301 | if (params->serial_mode != MODBUS_RTU_RS232 && params->serial_mode != MODBUS_RTU_RS485) 302 | { 303 | fprintf( stderr, "%s: Invalid value of serial port mode parameter!\n", argv[0]); 304 | return RESULT_WRONG_ARG; 305 | } 306 | if (check_serial_parity(params->serial_parity)) 307 | { 308 | fprintf( stderr, "%s: Invalid value of serial port parity mode parameter!\n", argv[0]); 309 | return RESULT_WRONG_ARG; 310 | } 311 | if (params->serial_data_bits < 5 || params->serial_data_bits > 8) 312 | { 313 | fprintf(stderr, "%s: Invalid value of serial port mode data length parameter!\n", argv[0]); 314 | return RESULT_WRONG_ARG; 315 | } 316 | if (params->serial_stop_bits < 1 || params->serial_stop_bits > 2) 317 | { 318 | fprintf(stderr, "%s: Invalid value of serial port stop bits parameter!\n", argv[0]); 319 | return RESULT_WRONG_ARG; 320 | } 321 | } 322 | #endif 323 | if (params->perf_data && (params->perf_label==NULL)) 324 | { 325 | fprintf( stderr, "Label parameter is required, when performance data is enabled\n"); 326 | return RESULT_WRONG_ARG; 327 | } 328 | 329 | if (params->dump_size>127) 330 | { 331 | fprintf( stderr, "The maximal number of registers in one dump is 127\n"); 332 | return RESULT_WRONG_ARG; 333 | } 334 | 335 | 336 | if (check_swap_inverse( params )) return RESULT_WRONG_ARG; 337 | if (check_function_num( params )) return RESULT_WRONG_ARG; 338 | if (check_format_type( params ) ) return RESULT_WRONG_ARG; 339 | if (check_source( params ) ) return RESULT_WRONG_ARG; 340 | if (check_dump_param( params )) return RESULT_WRONG_ARG; 341 | 342 | if (params->verbose) print_settings( params ); 343 | 344 | return RESULT_OK; 345 | } 346 | 347 | 348 | 349 | 350 | 351 | int parse_command_line(modbus_params_t* params, int argc, char **argv) 352 | { 353 | int rs; 354 | int option_index; 355 | 356 | /* no short option char wasted for rarely used options */ 357 | enum 358 | { 359 | OPT_LONG_OPTIONS_ONLY=0x100, 360 | #if LIBMODBUS_VERSION_MAJOR >= 3 361 | OPT_SERIAL_MODE, 362 | OPT_SERIAL_PARITY, 363 | OPT_SERIAL_DATA_BITS, 364 | OPT_SERIAL_STOP_BITS, 365 | #endif 366 | OPT_FILE, 367 | OPT_DUMP, 368 | OPT_DUMP_FORMAT, 369 | OPT_DUMP_SIZE 370 | }; 371 | 372 | #if LIBMODBUS_VERSION_MAJOR >= 3 373 | const char* short_options = "hH:p:S:b:d:a:f:w:c:nNt:F:isvPm:M:L:"; 374 | #else 375 | const char* short_options = "hH:p:d:a:f:w:c:nNt:F:isvPm:M:L:"; 376 | #endif 377 | const struct option long_options[] = { 378 | {"help" ,no_argument ,NULL, 'h' }, 379 | {"ip" ,required_argument ,NULL, 'H' }, 380 | {"port" ,required_argument ,NULL, 'p' }, 381 | #if LIBMODBUS_VERSION_MAJOR >= 3 382 | {"serial" ,required_argument ,NULL, 'S' }, 383 | {"serial_mode" ,required_argument ,NULL, OPT_SERIAL_MODE }, 384 | {"serial_bps" ,required_argument ,NULL, 'b' }, 385 | {"serial_parity",required_argument ,NULL, OPT_SERIAL_PARITY }, 386 | {"serial_data_bits" ,required_argument ,NULL, OPT_SERIAL_DATA_BITS }, 387 | {"serial_stop_bits" ,required_argument ,NULL, OPT_SERIAL_STOP_BITS }, 388 | #endif 389 | {"file" ,required_argument ,NULL, OPT_FILE }, 390 | {"device" ,required_argument ,NULL, 'd' }, 391 | {"address" ,required_argument ,NULL, 'a' }, 392 | {"try" ,required_argument ,NULL, 't' }, 393 | {"function" ,required_argument ,NULL, 'f' }, 394 | {"format" ,required_argument ,NULL, 'F' }, 395 | {"function" ,required_argument ,NULL, 'f' }, 396 | {"critical" ,required_argument ,NULL, 'c' }, 397 | {"null" ,no_argument ,NULL, 'n' }, 398 | {"not_null" ,no_argument ,NULL, 'N' }, 399 | {"swapbytes" ,no_argument ,NULL, 's' }, 400 | {"inverse" ,no_argument ,NULL, 'i' }, 401 | {"verbose" ,no_argument ,NULL, 'v' }, 402 | {"perf_data" ,no_argument ,NULL, 'P' }, 403 | {"perf_min" ,required_argument ,NULL, 'm' }, 404 | {"perf_max" ,required_argument ,NULL, 'M' }, 405 | {"perf_label" ,required_argument ,NULL, 'L' }, 406 | {"dump" ,no_argument ,NULL, OPT_DUMP }, 407 | {"dump_size" ,required_argument ,NULL, OPT_DUMP_SIZE }, 408 | {"dump_format" ,required_argument ,NULL, OPT_DUMP_FORMAT }, 409 | {NULL ,0 ,NULL, 0 } 410 | }; 411 | 412 | //************************************************************ 413 | if (argc < 2) 414 | { 415 | fprintf( stderr, "%s: Could not parse arguments\n", argv[0]); 416 | print_help(); 417 | return RESULT_WRONG_ARG; 418 | }; 419 | 420 | load_defaults( params ); 421 | while (1) 422 | { 423 | rs=getopt_long(argc,argv,short_options,long_options,&option_index); 424 | if (rs == -1) break; 425 | 426 | 427 | switch(rs) 428 | { 429 | case 'v': 430 | params->verbose++; 431 | break; 432 | case 'h': 433 | print_help(); 434 | return RESULT_PRINT_HELP; 435 | 436 | // MODBUS TCP 437 | case 'H': 438 | params->host = optarg; 439 | break; 440 | case 'p': 441 | params->mport = optarg; 442 | break; 443 | 444 | #if LIBMODBUS_VERSION_MAJOR >= 3 445 | // MODBUS RTU 446 | case 'S': 447 | params->serial = optarg; 448 | break; 449 | case OPT_SERIAL_MODE: 450 | params->serial_mode = atoi(optarg); 451 | break; 452 | case 'b': 453 | params->serial_bps = atoi(optarg); 454 | break; 455 | case OPT_SERIAL_PARITY: 456 | if (optarg > 0) 457 | { 458 | params->serial_parity = toupper( *optarg ); 459 | } 460 | else 461 | { 462 | params->serial_parity = '\0'; 463 | } 464 | break; 465 | case OPT_SERIAL_DATA_BITS: 466 | params->serial_data_bits = atoi(optarg); 467 | break; 468 | case OPT_SERIAL_STOP_BITS: 469 | params->serial_stop_bits = atoi(optarg); 470 | break; 471 | #endif 472 | case OPT_FILE: 473 | params->file = optarg; 474 | break; 475 | case 'd': 476 | params->devnum = atoi(optarg); 477 | break; 478 | case 'a': 479 | params->sad = atoi(optarg); 480 | params->sad --; /* register/bit address starts from 0 */ 481 | break; 482 | case 'f': 483 | params->nf = atoi(optarg); 484 | break; 485 | case 'F': 486 | params->format = atoi(optarg); 487 | break; 488 | case 'w': 489 | params->warn_range = atof(optarg); 490 | break; 491 | case 'c': 492 | params->crit_range = atof(optarg); 493 | break; 494 | case 'n': 495 | params->nc = 1; 496 | break; 497 | case 'i': 498 | params->inverse_words = 1; 499 | break; 500 | case 's': 501 | params->swap_bytes = 1; 502 | break; 503 | case 't': 504 | params->tries = atoi(optarg); 505 | break; 506 | case 'N': 507 | params->nnc = 1; 508 | break; 509 | case 'm': 510 | params->perf_min = atof(optarg); 511 | params->perf_min_en = 1; 512 | break; 513 | case 'M': 514 | params->perf_max = atof(optarg); 515 | params->perf_max_en = 1; 516 | break; 517 | case 'L': 518 | params->perf_label = optarg; 519 | break; 520 | case 'P': 521 | params->perf_data = 1; 522 | break; 523 | case OPT_DUMP: 524 | params->dump = 1; 525 | break; 526 | case OPT_DUMP_SIZE: 527 | params->dump_size = atoi(optarg); 528 | break; 529 | case OPT_DUMP_FORMAT: 530 | params->dump_format = atoi(optarg); 531 | switch(params->dump_format) 532 | { 533 | case DUMP_FMT_BIN: 534 | params->format = FORMAT_DUMP_BIN; 535 | break; 536 | case DUMP_FMT_HEX: 537 | params->format = FORMAT_DUMP_HEX; 538 | break; 539 | case DUMP_FMT_DEC: 540 | params->format = FORMAT_DUMP_DEC; 541 | break; 542 | } 543 | break; 544 | 545 | case '?': 546 | default: 547 | print_help(); 548 | return RESULT_PRINT_HELP; 549 | }; 550 | }; /* while(1) */ 551 | 552 | return check_command_line( params, argc, argv ); 553 | } 554 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, 6 | # Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | VPATH = @srcdir@ 18 | pkgdatadir = $(datadir)/@PACKAGE@ 19 | pkgincludedir = $(includedir)/@PACKAGE@ 20 | pkglibdir = $(libdir)/@PACKAGE@ 21 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 22 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 23 | install_sh_DATA = $(install_sh) -c -m 644 24 | install_sh_PROGRAM = $(install_sh) -c 25 | install_sh_SCRIPT = $(install_sh) -c 26 | INSTALL_HEADER = $(INSTALL_DATA) 27 | transform = $(program_transform_name) 28 | NORMAL_INSTALL = : 29 | PRE_INSTALL = : 30 | POST_INSTALL = : 31 | NORMAL_UNINSTALL = : 32 | PRE_UNINSTALL = : 33 | POST_UNINSTALL = : 34 | subdir = . 35 | DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ 36 | $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ 37 | ChangeLog INSTALL NEWS depcomp install-sh missing 38 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 39 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 40 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 41 | $(ACLOCAL_M4) 42 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ 43 | configure.lineno config.status.lineno 44 | mkinstalldirs = $(install_sh) -d 45 | CONFIG_CLEAN_FILES = 46 | CONFIG_CLEAN_VPATH_FILES = 47 | SOURCES = 48 | DIST_SOURCES = 49 | RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ 50 | html-recursive info-recursive install-data-recursive \ 51 | install-dvi-recursive install-exec-recursive \ 52 | install-html-recursive install-info-recursive \ 53 | install-pdf-recursive install-ps-recursive install-recursive \ 54 | installcheck-recursive installdirs-recursive pdf-recursive \ 55 | ps-recursive uninstall-recursive 56 | RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ 57 | distclean-recursive maintainer-clean-recursive 58 | AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ 59 | $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ 60 | distdir dist dist-all distcheck 61 | ETAGS = etags 62 | CTAGS = ctags 63 | DIST_SUBDIRS = $(SUBDIRS) 64 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 65 | distdir = $(PACKAGE)-$(VERSION) 66 | top_distdir = $(distdir) 67 | am__remove_distdir = \ 68 | { test ! -d "$(distdir)" \ 69 | || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ 70 | && rm -fr "$(distdir)"; }; } 71 | am__relativize = \ 72 | dir0=`pwd`; \ 73 | sed_first='s,^\([^/]*\)/.*$$,\1,'; \ 74 | sed_rest='s,^[^/]*/*,,'; \ 75 | sed_last='s,^.*/\([^/]*\)$$,\1,'; \ 76 | sed_butlast='s,/*[^/]*$$,,'; \ 77 | while test -n "$$dir1"; do \ 78 | first=`echo "$$dir1" | sed -e "$$sed_first"`; \ 79 | if test "$$first" != "."; then \ 80 | if test "$$first" = ".."; then \ 81 | dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ 82 | dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ 83 | else \ 84 | first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ 85 | if test "$$first2" = "$$first"; then \ 86 | dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ 87 | else \ 88 | dir2="../$$dir2"; \ 89 | fi; \ 90 | dir0="$$dir0"/"$$first"; \ 91 | fi; \ 92 | fi; \ 93 | dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ 94 | done; \ 95 | reldir="$$dir2" 96 | DIST_ARCHIVES = $(distdir).tar.gz 97 | GZIP_ENV = --best 98 | distuninstallcheck_listfiles = find . -type f -print 99 | distcleancheck_listfiles = find . -type f -print 100 | ACLOCAL = @ACLOCAL@ 101 | AMTAR = @AMTAR@ 102 | AUTOCONF = @AUTOCONF@ 103 | AUTOHEADER = @AUTOHEADER@ 104 | AUTOMAKE = @AUTOMAKE@ 105 | AWK = @AWK@ 106 | CC = @CC@ 107 | CCDEPMODE = @CCDEPMODE@ 108 | CFLAGS = @CFLAGS@ 109 | CPP = @CPP@ 110 | CPPFLAGS = @CPPFLAGS@ 111 | CYGPATH_W = @CYGPATH_W@ 112 | DEFS = @DEFS@ 113 | DEPDIR = @DEPDIR@ 114 | ECHO_C = @ECHO_C@ 115 | ECHO_N = @ECHO_N@ 116 | ECHO_T = @ECHO_T@ 117 | EGREP = @EGREP@ 118 | EXEEXT = @EXEEXT@ 119 | GREP = @GREP@ 120 | INSTALL = @INSTALL@ 121 | INSTALL_DATA = @INSTALL_DATA@ 122 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 123 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 124 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 125 | LDFLAGS = @LDFLAGS@ 126 | LIBOBJS = @LIBOBJS@ 127 | LIBS = @LIBS@ 128 | LTLIBOBJS = @LTLIBOBJS@ 129 | MAKEINFO = @MAKEINFO@ 130 | MKDIR_P = @MKDIR_P@ 131 | OBJEXT = @OBJEXT@ 132 | PACKAGE = @PACKAGE@ 133 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 134 | PACKAGE_NAME = @PACKAGE_NAME@ 135 | PACKAGE_STRING = @PACKAGE_STRING@ 136 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 137 | PACKAGE_URL = @PACKAGE_URL@ 138 | PACKAGE_VERSION = @PACKAGE_VERSION@ 139 | PATH_SEPARATOR = @PATH_SEPARATOR@ 140 | SET_MAKE = @SET_MAKE@ 141 | SHELL = @SHELL@ 142 | STRIP = @STRIP@ 143 | VERSION = @VERSION@ 144 | abs_builddir = @abs_builddir@ 145 | abs_srcdir = @abs_srcdir@ 146 | abs_top_builddir = @abs_top_builddir@ 147 | abs_top_srcdir = @abs_top_srcdir@ 148 | ac_ct_CC = @ac_ct_CC@ 149 | am__include = @am__include@ 150 | am__leading_dot = @am__leading_dot@ 151 | am__quote = @am__quote@ 152 | am__tar = @am__tar@ 153 | am__untar = @am__untar@ 154 | bindir = @bindir@ 155 | build_alias = @build_alias@ 156 | builddir = @builddir@ 157 | datadir = @datadir@ 158 | datarootdir = @datarootdir@ 159 | docdir = @docdir@ 160 | dvidir = @dvidir@ 161 | exec_prefix = @exec_prefix@ 162 | host_alias = @host_alias@ 163 | htmldir = @htmldir@ 164 | includedir = @includedir@ 165 | infodir = @infodir@ 166 | install_sh = @install_sh@ 167 | libdir = @libdir@ 168 | libexecdir = @libexecdir@ 169 | localedir = @localedir@ 170 | localstatedir = @localstatedir@ 171 | mandir = @mandir@ 172 | mkdir_p = @mkdir_p@ 173 | oldincludedir = @oldincludedir@ 174 | pdfdir = @pdfdir@ 175 | prefix = @prefix@ 176 | program_transform_name = @program_transform_name@ 177 | psdir = @psdir@ 178 | sbindir = @sbindir@ 179 | sharedstatedir = @sharedstatedir@ 180 | srcdir = @srcdir@ 181 | sysconfdir = @sysconfdir@ 182 | target_alias = @target_alias@ 183 | top_build_prefix = @top_build_prefix@ 184 | top_builddir = @top_builddir@ 185 | top_srcdir = @top_srcdir@ 186 | SUBDIRS = src tests 187 | all: all-recursive 188 | 189 | .SUFFIXES: 190 | am--refresh: 191 | @: 192 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 193 | @for dep in $?; do \ 194 | case '$(am__configure_deps)' in \ 195 | *$$dep*) \ 196 | echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ 197 | $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ 198 | && exit 0; \ 199 | exit 1;; \ 200 | esac; \ 201 | done; \ 202 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ 203 | $(am__cd) $(top_srcdir) && \ 204 | $(AUTOMAKE) --gnu Makefile 205 | .PRECIOUS: Makefile 206 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 207 | @case '$?' in \ 208 | *config.status*) \ 209 | echo ' $(SHELL) ./config.status'; \ 210 | $(SHELL) ./config.status;; \ 211 | *) \ 212 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ 213 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ 214 | esac; 215 | 216 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 217 | $(SHELL) ./config.status --recheck 218 | 219 | $(top_srcdir)/configure: $(am__configure_deps) 220 | $(am__cd) $(srcdir) && $(AUTOCONF) 221 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 222 | $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 223 | $(am__aclocal_m4_deps): 224 | 225 | # This directory's subdirectories are mostly independent; you can cd 226 | # into them and run `make' without going through this Makefile. 227 | # To change the values of `make' variables: instead of editing Makefiles, 228 | # (1) if the variable is set in `config.status', edit `config.status' 229 | # (which will cause the Makefiles to be regenerated when you run `make'); 230 | # (2) otherwise, pass the desired values on the `make' command line. 231 | $(RECURSIVE_TARGETS): 232 | @fail= failcom='exit 1'; \ 233 | for f in x $$MAKEFLAGS; do \ 234 | case $$f in \ 235 | *=* | --[!k]*);; \ 236 | *k*) failcom='fail=yes';; \ 237 | esac; \ 238 | done; \ 239 | dot_seen=no; \ 240 | target=`echo $@ | sed s/-recursive//`; \ 241 | list='$(SUBDIRS)'; for subdir in $$list; do \ 242 | echo "Making $$target in $$subdir"; \ 243 | if test "$$subdir" = "."; then \ 244 | dot_seen=yes; \ 245 | local_target="$$target-am"; \ 246 | else \ 247 | local_target="$$target"; \ 248 | fi; \ 249 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 250 | || eval $$failcom; \ 251 | done; \ 252 | if test "$$dot_seen" = "no"; then \ 253 | $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ 254 | fi; test -z "$$fail" 255 | 256 | $(RECURSIVE_CLEAN_TARGETS): 257 | @fail= failcom='exit 1'; \ 258 | for f in x $$MAKEFLAGS; do \ 259 | case $$f in \ 260 | *=* | --[!k]*);; \ 261 | *k*) failcom='fail=yes';; \ 262 | esac; \ 263 | done; \ 264 | dot_seen=no; \ 265 | case "$@" in \ 266 | distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ 267 | *) list='$(SUBDIRS)' ;; \ 268 | esac; \ 269 | rev=''; for subdir in $$list; do \ 270 | if test "$$subdir" = "."; then :; else \ 271 | rev="$$subdir $$rev"; \ 272 | fi; \ 273 | done; \ 274 | rev="$$rev ."; \ 275 | target=`echo $@ | sed s/-recursive//`; \ 276 | for subdir in $$rev; do \ 277 | echo "Making $$target in $$subdir"; \ 278 | if test "$$subdir" = "."; then \ 279 | local_target="$$target-am"; \ 280 | else \ 281 | local_target="$$target"; \ 282 | fi; \ 283 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 284 | || eval $$failcom; \ 285 | done && test -z "$$fail" 286 | tags-recursive: 287 | list='$(SUBDIRS)'; for subdir in $$list; do \ 288 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ 289 | done 290 | ctags-recursive: 291 | list='$(SUBDIRS)'; for subdir in $$list; do \ 292 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ 293 | done 294 | 295 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 296 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 297 | unique=`for i in $$list; do \ 298 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 299 | done | \ 300 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 301 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 302 | mkid -fID $$unique 303 | tags: TAGS 304 | 305 | TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 306 | $(TAGS_FILES) $(LISP) 307 | set x; \ 308 | here=`pwd`; \ 309 | if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ 310 | include_option=--etags-include; \ 311 | empty_fix=.; \ 312 | else \ 313 | include_option=--include; \ 314 | empty_fix=; \ 315 | fi; \ 316 | list='$(SUBDIRS)'; for subdir in $$list; do \ 317 | if test "$$subdir" = .; then :; else \ 318 | test ! -f $$subdir/TAGS || \ 319 | set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ 320 | fi; \ 321 | done; \ 322 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 323 | unique=`for i in $$list; do \ 324 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 325 | done | \ 326 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 327 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 328 | shift; \ 329 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 330 | test -n "$$unique" || unique=$$empty_fix; \ 331 | if test $$# -gt 0; then \ 332 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 333 | "$$@" $$unique; \ 334 | else \ 335 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 336 | $$unique; \ 337 | fi; \ 338 | fi 339 | ctags: CTAGS 340 | CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 341 | $(TAGS_FILES) $(LISP) 342 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 343 | unique=`for i in $$list; do \ 344 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 345 | done | \ 346 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 347 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 348 | test -z "$(CTAGS_ARGS)$$unique" \ 349 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 350 | $$unique 351 | 352 | GTAGS: 353 | here=`$(am__cd) $(top_builddir) && pwd` \ 354 | && $(am__cd) $(top_srcdir) \ 355 | && gtags -i $(GTAGS_ARGS) "$$here" 356 | 357 | distclean-tags: 358 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 359 | 360 | distdir: $(DISTFILES) 361 | $(am__remove_distdir) 362 | test -d "$(distdir)" || mkdir "$(distdir)" 363 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 364 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 365 | list='$(DISTFILES)'; \ 366 | dist_files=`for file in $$list; do echo $$file; done | \ 367 | sed -e "s|^$$srcdirstrip/||;t" \ 368 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 369 | case $$dist_files in \ 370 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 371 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 372 | sort -u` ;; \ 373 | esac; \ 374 | for file in $$dist_files; do \ 375 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 376 | if test -d $$d/$$file; then \ 377 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 378 | if test -d "$(distdir)/$$file"; then \ 379 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 380 | fi; \ 381 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 382 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 383 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 384 | fi; \ 385 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 386 | else \ 387 | test -f "$(distdir)/$$file" \ 388 | || cp -p $$d/$$file "$(distdir)/$$file" \ 389 | || exit 1; \ 390 | fi; \ 391 | done 392 | @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 393 | if test "$$subdir" = .; then :; else \ 394 | test -d "$(distdir)/$$subdir" \ 395 | || $(MKDIR_P) "$(distdir)/$$subdir" \ 396 | || exit 1; \ 397 | fi; \ 398 | done 399 | @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 400 | if test "$$subdir" = .; then :; else \ 401 | dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ 402 | $(am__relativize); \ 403 | new_distdir=$$reldir; \ 404 | dir1=$$subdir; dir2="$(top_distdir)"; \ 405 | $(am__relativize); \ 406 | new_top_distdir=$$reldir; \ 407 | echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ 408 | echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ 409 | ($(am__cd) $$subdir && \ 410 | $(MAKE) $(AM_MAKEFLAGS) \ 411 | top_distdir="$$new_top_distdir" \ 412 | distdir="$$new_distdir" \ 413 | am__remove_distdir=: \ 414 | am__skip_length_check=: \ 415 | am__skip_mode_fix=: \ 416 | distdir) \ 417 | || exit 1; \ 418 | fi; \ 419 | done 420 | -test -n "$(am__skip_mode_fix)" \ 421 | || find "$(distdir)" -type d ! -perm -755 \ 422 | -exec chmod u+rwx,go+rx {} \; -o \ 423 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ 424 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ 425 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ 426 | || chmod -R a+r "$(distdir)" 427 | dist-gzip: distdir 428 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 429 | $(am__remove_distdir) 430 | 431 | dist-bzip2: distdir 432 | tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 433 | $(am__remove_distdir) 434 | 435 | dist-lzma: distdir 436 | tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma 437 | $(am__remove_distdir) 438 | 439 | dist-xz: distdir 440 | tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz 441 | $(am__remove_distdir) 442 | 443 | dist-tarZ: distdir 444 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z 445 | $(am__remove_distdir) 446 | 447 | dist-shar: distdir 448 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz 449 | $(am__remove_distdir) 450 | 451 | dist-zip: distdir 452 | -rm -f $(distdir).zip 453 | zip -rq $(distdir).zip $(distdir) 454 | $(am__remove_distdir) 455 | 456 | dist dist-all: distdir 457 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 458 | $(am__remove_distdir) 459 | 460 | # This target untars the dist file and tries a VPATH configuration. Then 461 | # it guarantees that the distribution is self-contained by making another 462 | # tarfile. 463 | distcheck: dist 464 | case '$(DIST_ARCHIVES)' in \ 465 | *.tar.gz*) \ 466 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ 467 | *.tar.bz2*) \ 468 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ 469 | *.tar.lzma*) \ 470 | lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ 471 | *.tar.xz*) \ 472 | xz -dc $(distdir).tar.xz | $(am__untar) ;;\ 473 | *.tar.Z*) \ 474 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ 475 | *.shar.gz*) \ 476 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ 477 | *.zip*) \ 478 | unzip $(distdir).zip ;;\ 479 | esac 480 | chmod -R a-w $(distdir); chmod u+w $(distdir) 481 | mkdir $(distdir)/_build 482 | mkdir $(distdir)/_inst 483 | chmod a-w $(distdir) 484 | test -d $(distdir)/_build || exit 0; \ 485 | dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ 486 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ 487 | && am__cwd=`pwd` \ 488 | && $(am__cd) $(distdir)/_build \ 489 | && ../configure --srcdir=.. --prefix="$$dc_install_base" \ 490 | $(DISTCHECK_CONFIGURE_FLAGS) \ 491 | && $(MAKE) $(AM_MAKEFLAGS) \ 492 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ 493 | && $(MAKE) $(AM_MAKEFLAGS) check \ 494 | && $(MAKE) $(AM_MAKEFLAGS) install \ 495 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ 496 | && $(MAKE) $(AM_MAKEFLAGS) uninstall \ 497 | && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ 498 | distuninstallcheck \ 499 | && chmod -R a-w "$$dc_install_base" \ 500 | && ({ \ 501 | (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ 502 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ 503 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ 504 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ 505 | distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ 506 | } || { rm -rf "$$dc_destdir"; exit 1; }) \ 507 | && rm -rf "$$dc_destdir" \ 508 | && $(MAKE) $(AM_MAKEFLAGS) dist \ 509 | && rm -rf $(DIST_ARCHIVES) \ 510 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ 511 | && cd "$$am__cwd" \ 512 | || exit 1 513 | $(am__remove_distdir) 514 | @(echo "$(distdir) archives ready for distribution: "; \ 515 | list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ 516 | sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' 517 | distuninstallcheck: 518 | @$(am__cd) '$(distuninstallcheck_dir)' \ 519 | && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ 520 | || { echo "ERROR: files left after uninstall:" ; \ 521 | if test -n "$(DESTDIR)"; then \ 522 | echo " (check DESTDIR support)"; \ 523 | fi ; \ 524 | $(distuninstallcheck_listfiles) ; \ 525 | exit 1; } >&2 526 | distcleancheck: distclean 527 | @if test '$(srcdir)' = . ; then \ 528 | echo "ERROR: distcleancheck can only run from a VPATH build" ; \ 529 | exit 1 ; \ 530 | fi 531 | @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ 532 | || { echo "ERROR: files left in build directory after distclean:" ; \ 533 | $(distcleancheck_listfiles) ; \ 534 | exit 1; } >&2 535 | check-am: all-am 536 | check: check-recursive 537 | all-am: Makefile 538 | installdirs: installdirs-recursive 539 | installdirs-am: 540 | install: install-recursive 541 | install-exec: install-exec-recursive 542 | install-data: install-data-recursive 543 | uninstall: uninstall-recursive 544 | 545 | install-am: all-am 546 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 547 | 548 | installcheck: installcheck-recursive 549 | install-strip: 550 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 551 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 552 | `test -z '$(STRIP)' || \ 553 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 554 | mostlyclean-generic: 555 | 556 | clean-generic: 557 | 558 | distclean-generic: 559 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 560 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 561 | 562 | maintainer-clean-generic: 563 | @echo "This command is intended for maintainers to use" 564 | @echo "it deletes files that may require special tools to rebuild." 565 | clean: clean-recursive 566 | 567 | clean-am: clean-generic mostlyclean-am 568 | 569 | distclean: distclean-recursive 570 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 571 | -rm -f Makefile 572 | distclean-am: clean-am distclean-generic distclean-tags 573 | 574 | dvi: dvi-recursive 575 | 576 | dvi-am: 577 | 578 | html: html-recursive 579 | 580 | html-am: 581 | 582 | info: info-recursive 583 | 584 | info-am: 585 | 586 | install-data-am: 587 | 588 | install-dvi: install-dvi-recursive 589 | 590 | install-dvi-am: 591 | 592 | install-exec-am: 593 | 594 | install-html: install-html-recursive 595 | 596 | install-html-am: 597 | 598 | install-info: install-info-recursive 599 | 600 | install-info-am: 601 | 602 | install-man: 603 | 604 | install-pdf: install-pdf-recursive 605 | 606 | install-pdf-am: 607 | 608 | install-ps: install-ps-recursive 609 | 610 | install-ps-am: 611 | 612 | installcheck-am: 613 | 614 | maintainer-clean: maintainer-clean-recursive 615 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 616 | -rm -rf $(top_srcdir)/autom4te.cache 617 | -rm -f Makefile 618 | maintainer-clean-am: distclean-am maintainer-clean-generic 619 | 620 | mostlyclean: mostlyclean-recursive 621 | 622 | mostlyclean-am: mostlyclean-generic 623 | 624 | pdf: pdf-recursive 625 | 626 | pdf-am: 627 | 628 | ps: ps-recursive 629 | 630 | ps-am: 631 | 632 | uninstall-am: 633 | 634 | .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ 635 | install-am install-strip tags-recursive 636 | 637 | .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ 638 | all all-am am--refresh check check-am clean clean-generic \ 639 | ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ 640 | dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ 641 | distclean distclean-generic distclean-tags distcleancheck \ 642 | distdir distuninstallcheck dvi dvi-am html html-am info \ 643 | info-am install install-am install-data install-data-am \ 644 | install-dvi install-dvi-am install-exec install-exec-am \ 645 | install-html install-html-am install-info install-info-am \ 646 | install-man install-pdf install-pdf-am install-ps \ 647 | install-ps-am install-strip installcheck installcheck-am \ 648 | installdirs installdirs-am maintainer-clean \ 649 | maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ 650 | pdf-am ps ps-am tags tags-recursive uninstall uninstall-am 651 | 652 | 653 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 654 | # Otherwise a system limit (for SysV at least) may be exceeded. 655 | .NOEXPORT: 656 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------