Merge lp:~noskcaj/ubuntu/vivid/sagan/liblognorm-transition into lp:ubuntu/vivid/sagan

Proposed by Jackson Doak
Status: Needs review
Proposed branch: lp:~noskcaj/ubuntu/vivid/sagan/liblognorm-transition
Merge into: lp:ubuntu/vivid/sagan
Diff against target: 39802 lines (+21113/-12473)
125 files modified
.pc/01-do-not-include-lognorm-private-header.patch/src/sagan-config.c (+0/-532)
.pc/01-do-not-include-lognorm-private-header.patch/src/sagan-signal.c (+0/-160)
.pc/01-do-not-include-lognorm-private-header.patch/src/sagan.c (+0/-1322)
.pc/applied-patches (+0/-1)
AUTHORS (+0/-1)
FAQ (+1/-4)
INSTALL (+12/-7)
Makefile (+805/-0)
Makefile.am (+2/-2)
Makefile.in (+252/-164)
NEWS (+1/-2)
README (+9/-6)
aclocal.m4 (+703/-254)
autogen.sh (+5/-0)
config.guess (+206/-161)
config.h (+335/-0)
config.h.in (+53/-12)
config.status (+1290/-0)
config.sub (+157/-121)
configure (+2040/-899)
configure.ac (+300/-0)
configure.in (+0/-325)
debian/changelog (+8/-0)
debian/control (+3/-1)
debian/patches/01-do-not-include-lognorm-private-header.patch (+0/-36)
debian/patches/series (+0/-1)
depcomp (+347/-186)
doc/sagan_freebsd.howto.md (+393/-0)
etc/sagan.8 (+4/-1)
etc/sagan.conf (+252/-63)
extra/README (+2/-1)
extra/barnyard2/barnyard2.cli.conf (+6/-0)
extra/barnyard2/barnyard2.snorby.conf (+15/-0)
extra/pulledpork/fetchcarl.sh (+187/-0)
extra/pulledpork/pulledpork.sagan.conf (+19/-0)
extra/rc.d-freebsd/sagan (+39/-0)
extra/rsyslog/sagan.conf (+6/-0)
install-sh (+21/-14)
missing (+159/-320)
src/Makefile (+0/-673)
src/Makefile.am (+20/-5)
src/Makefile.in (+844/-254)
src/output-plugins/sagan-alert.c (+30/-18)
src/output-plugins/sagan-alert.h (+26/-0)
src/output-plugins/sagan-esmtp.c (+210/-157)
src/output-plugins/sagan-esmtp.h (+8/-0)
src/output-plugins/sagan-external.c (+114/-90)
src/output-plugins/sagan-external.h (+25/-0)
src/output-plugins/sagan-prelude.c (+0/-456)
src/output-plugins/sagan-prelude.h (+0/-39)
src/output-plugins/sagan-snort.c (+0/-597)
src/output-plugins/sagan-snort.h (+0/-57)
src/output-plugins/sagan-snortsam.c (+644/-579)
src/output-plugins/sagan-snortsam.h (+199/-202)
src/output-plugins/sagan-twofish.c (+574/-513)
src/output-plugins/sagan-twofish.h (+54/-51)
src/output-plugins/sagan-unified2.c (+439/-424)
src/output-plugins/sagan-unified2.h (+3/-3)
src/parsers/parse-ip.c (+106/-56)
src/parsers/parse-port.c (+140/-115)
src/parsers/parse-proto.c (+93/-0)
src/parsers/parsers.h (+30/-0)
src/processors/sagan-blacklist.c (+327/-0)
src/processors/sagan-blacklist.h (+42/-0)
src/processors/sagan-engine.c (+952/-0)
src/processors/sagan-engine.h (+31/-0)
src/processors/sagan-perfmon.c (+254/-0)
src/processors/sagan-perfmon.h (+24/-0)
src/processors/sagan-search.c (+281/-0)
src/processors/sagan-search.h (+44/-0)
src/processors/sagan-track-clients.c (+209/-0)
src/processors/sagan-track-clients.h (+49/-0)
src/processors/sagan-websense.c (+14/-0)
src/sagan-alert-time.c (+195/-0)
src/sagan-alert-time.h (+27/-0)
src/sagan-classifications.c (+74/-62)
src/sagan-classifications.h (+38/-0)
src/sagan-config.c (+845/-442)
src/sagan-config.h (+192/-0)
src/sagan-credits.c (+72/-0)
src/sagan-credits.h (+26/-0)
src/sagan-defs.h (+56/-17)
src/sagan-flowbit.c (+681/-0)
src/sagan-flowbit.h (+50/-0)
src/sagan-gen-msg.c (+116/-0)
src/sagan-gen-msg.h (+37/-0)
src/sagan-geoip.c (+136/-0)
src/sagan-geoip.h (+35/-0)
src/sagan-ignore-list.c (+84/-0)
src/sagan-ignore-list.h (+34/-0)
src/sagan-key.c (+21/-14)
src/sagan-key.h (+25/-0)
src/sagan-liblognorm.c (+193/-0)
src/sagan-liblognorm.h (+60/-0)
src/sagan-lockfile.c (+80/-58)
src/sagan-lockfile.h (+27/-0)
src/sagan-meta-content.c (+147/-0)
src/sagan-meta-content.h (+26/-0)
src/sagan-output.c (+65/-51)
src/sagan-output.h (+26/-0)
src/sagan-plog.c (+160/-144)
src/sagan-plog.h (+36/-0)
src/sagan-processor.c (+148/-16)
src/sagan-processor.h (+26/-0)
src/sagan-protocol-map.c (+115/-0)
src/sagan-protocol-map.h (+48/-0)
src/sagan-references.c (+129/-99)
src/sagan-references.h (+37/-0)
src/sagan-rules.c (+1113/-535)
src/sagan-rules.h (+129/-0)
src/sagan-send-alert.c (+91/-0)
src/sagan-send-alert.h (+26/-0)
src/sagan-signal.c (+191/-100)
src/sagan-signal.h (+39/-0)
src/sagan-stats.c (+159/-50)
src/sagan-stats.h (+25/-0)
src/sagan-strlcat.c (+27/-25)
src/sagan-strlcpy.c (+26/-23)
src/sagan-usage.c (+60/-61)
src/sagan-usage.h (+25/-0)
src/sagan-util.c (+516/-273)
src/sagan.c (+988/-1241)
src/sagan.h (+211/-376)
src/version.h (+1/-1)
stamp-h1 (+1/-0)
To merge this branch: bzr merge lp:~noskcaj/ubuntu/vivid/sagan/liblognorm-transition
Reviewer Review Type Date Requested Status
Iain Lane Needs Fixing
Review via email: mp+242573@code.launchpad.net

Description of the change

New upstream RC release. Allows the package to build, so this is preferable to our current version.

To post a comment you must log in.
Revision history for this message
Iain Lane (laney) wrote :

I don't think this works very well, can you fix? Might be an update to sagan-rules.

laney@raleigh> sagan
[E] [sagan.c, line 392] Cannot open /var/log/sagan/sagan.log!
laney@raleigh> sudo sagan
[*] Loading classifications.conf file. [/etc/sagan-rules/classification.config]
[*] 46 classifications loaded
[*] Loading references.conf file. [/etc/sagan-rules/reference.config]
[*] 6 references loaded.
[*] Loading gen-msg.map file. [/etc/sagan-rules/gen-msg.map]
[E] [sagan-gen-msg.c, line 62] Cannot open generator file (/etc/sagan-rules/gen-msg.map)

review: Needs Fixing

Unmerged revisions

12. By Jackson Doak

Add build-dep on libee-dev.

11. By Jackson Doak

* New upstream release.
* Drop patch, no longer needed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed directory '.pc/01-do-not-include-lognorm-private-header.patch'
=== removed directory '.pc/01-do-not-include-lognorm-private-header.patch/src'
=== removed file '.pc/01-do-not-include-lognorm-private-header.patch/src/sagan-config.c'
--- .pc/01-do-not-include-lognorm-private-header.patch/src/sagan-config.c 2012-04-16 22:33:24 +0000
+++ .pc/01-do-not-include-lognorm-private-header.patch/src/sagan-config.c 1970-01-01 00:00:00 +0000
@@ -1,532 +0,0 @@
1/*
2** Copyright (C) 2009-2012 Quadrant Information Security <quadrantsec.com>
3** Copyright (C) 2009-2012 Champ Clark III <cclark@quadrantsec.com>
4**
5** This program is free software; you can redistribute it and/or modify
6** it under the terms of the GNU General Public License Version 2 as
7** published by the Free Software Foundation. You may not use, modify or
8** distribute this program under any other version of the GNU General
9** Public License.
10**
11** This program is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14** GNU General Public License for more details.
15**
16** You should have received a copy of the GNU General Public License
17** along with this program; if not, write to the Free Software
18** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19*/
20
21/* sagan-config.c
22 *
23 * Loads the sagan.conf file into memory
24 *
25 */
26
27#ifdef HAVE_CONFIG_H
28#include "config.h" /* From autoconf */
29#endif
30
31#include <stdio.h>
32#include <stdlib.h>
33#include <sys/types.h>
34#include <unistd.h>
35#include <pthread.h>
36#include <ctype.h>
37#include <errno.h>
38#include <fcntl.h>
39#include <sys/stat.h>
40#include <string.h>
41#include <getopt.h>
42#include <time.h>
43#include <signal.h>
44#include <netinet/in.h>
45#include <arpa/inet.h>
46#include <math.h>
47
48#ifdef HAVE_LIBLOGNORM
49#include <liblognorm.h>
50#include <ptree.h>
51#include <lognorm.h>
52#endif
53
54#include "version.h"
55
56#include "sagan.h"
57
58#ifdef HAVE_LIBDNET
59#include "output-plugins/sagan-unified2.h"
60#endif
61
62
63#ifdef HAVE_LIBLOGNORM
64struct liblognorm_struct *liblognormstruct;
65int liblognorm_count;
66#endif
67
68struct _Rule_Struct *rulestruct;
69struct _SaganCounters *counters;
70
71void load_config( _SaganDebug *debug, _SaganConfig *config ) {
72
73FILE *sagancfg;
74
75char normfile[MAXPATH];
76
77char *filename;
78char ruleset[MAXPATH];
79
80char tmpbuf[CONFBUF];
81char tmpstring[CONFBUF];
82
83char *sagan_option=NULL;
84char *sagan_var=NULL;
85char *ptmp=NULL;
86
87char *tok=NULL;
88
89int i,check;
90
91/* Set some system defaults */
92
93snprintf(config->sagan_alert_filepath, sizeof(config->sagan_alert_filepath), "%s", ALERTLOG);
94snprintf(config->sagan_lockfile, sizeof(config->sagan_lockfile), "%s", LOCKFILE);
95snprintf(config->sagan_log_path, sizeof(config->sagan_log_path), "%s", SAGANLOGPATH);
96config->sagan_proto = 17; /* Default to UDP */
97config->max_output_threads = MAX_OUTPUT_THREADS;
98config->max_processor_threads = MAX_PROCESSOR_THREADS;
99
100/* Start loading configuration */
101
102rulestruct = (_Rule_Struct *) realloc(rulestruct, (counters->rulecount+1) * sizeof(_Rule_Struct));
103
104/* Gather information for the master configuration file */
105
106
107if ((sagancfg = fopen(config->sagan_config, "r")) == NULL) {
108 fprintf(stderr, "[%s, line %d] Cannot open configuration file (%s)\n", __FILE__, __LINE__, config->sagan_config);
109 exit(1);
110 }
111
112while(fgets(tmpbuf, sizeof(tmpbuf), sagancfg) != NULL) {
113 if (tmpbuf[0] == '#') continue;
114 if (tmpbuf[0] == ';') continue;
115 if (tmpbuf[0] == 10 ) continue;
116 if (tmpbuf[0] == 32 ) continue;
117
118 sagan_option = strtok_r(tmpbuf, " ", &tok);
119
120 if (!strcmp(remrt(sagan_option), "max_output_threads")) {
121 sagan_var = strtok_r(NULL, " ", &tok);
122 config->max_output_threads = atol(sagan_var);
123 }
124
125 if (!strcmp(remrt(sagan_option), "max_processor_threads")) {
126 sagan_var = strtok_r(NULL, " ", &tok);
127 config->max_processor_threads = atol(sagan_var);
128 }
129
130 if (!strcmp(remrt(sagan_option), "disable_dns_warnings")) {
131 sagan_log(config, 0, "Supressing DNS warnings");
132 config->disable_dns_warnings = 1;
133 }
134
135 if (!strcmp(remrt(sagan_option), "syslog_src_lookup")) {
136 sagan_log(config, 0, "DNS lookup of source address supplied by syslog daemon");
137 config->syslog_src_lookup = 1;
138 }
139
140
141 if (!strcmp(sagan_option, "sagan_host")) {
142 snprintf(config->sagan_host, sizeof(config->sagan_host)-1, "%s", strtok_r(NULL, " " , &tok));
143 config->sagan_host[strlen(config->sagan_host)-1] = '\0';
144 }
145
146 if (!strcmp(sagan_option, "sagan_port")) {
147 sagan_var = strtok_r(NULL, " ", &tok);
148 config->sagan_port = atoi(sagan_var);
149 }
150
151#ifndef HAVE_LIBESMTP
152if (!strcmp(sagan_option, "send-to") || !strcmp(sagan_option, "min_email_priority"))
153 sagan_log(config,1, "\"libesmtp\" support not found. Re-compile with ESMTP support or disable in the sagan.conf.");
154#endif
155
156#ifdef HAVE_LIBESMTP
157
158 if (!strcmp(sagan_option, "send-to")) {
159 sagan_var = strtok_r(NULL, " ", &tok);
160 snprintf(config->sagan_esmtp_to, sizeof(config->sagan_esmtp_to), "%s", sagan_var);
161 remrt(config->sagan_esmtp_to);
162 config->sagan_esmtp_flag=1;
163 config->sagan_sendto_flag=1;
164 }
165
166 if (!strcmp(sagan_option, "min_email_priority")) {
167 sagan_var = strtok_r(NULL, " ", &tok);
168 config->min_email_priority = atoi(sagan_var);
169 }
170
171#endif
172
173#ifndef HAVE_LIBPCAP
174if (!strcmp(sagan_option, "plog_interface") || !strcmp(sagan_option, "plog_logdev") || !strcmp(sagan_option, "plog_port"))
175 sagan_log(config,1, "\"libpcap\" support not found. Re-compile with PCAP support or disable in the sagan.conf.");
176#endif
177
178#ifdef HAVE_LIBPCAP
179
180 if (!strcmp(sagan_option, "plog_interface")) {
181 snprintf(config->plog_interface, sizeof(config->plog_interface)-1, "%s", strtok_r(NULL, " ", &tok));
182 config->plog_interface[strlen(config->plog_interface)-1] = '\0';
183 config->plog_flag=1;
184 }
185
186 if (!strcmp(sagan_option, "plog_logdev")) {
187 snprintf(config->plog_logdev, sizeof(config->plog_logdev)-1, "%s", strtok_r(NULL, " ", &tok));
188 config->plog_logdev[strlen(config->plog_logdev)-1] = '\0';
189 config->plog_flag=1;
190 }
191
192 if (!strcmp(sagan_option, "plog_port")) {
193 sagan_var = strtok_r(NULL, " ", &tok);
194 config->plog_port = atoi(sagan_var);
195 config->plog_flag = 1;
196 }
197
198#endif
199
200#if defined(HAVE_LIBMYSQLCLIENT_R) || defined(HAVE_LIBPQ)
201
202 if (!strcmp(sagan_option, "sagan_proto")) {
203 sagan_var = strtok_r(NULL, " ", &tok);
204 config->sagan_proto = atoi(sagan_var);
205 }
206
207 if (!strcmp(sagan_option, "sagan_hostname")) {
208 snprintf(config->sagan_hostname, sizeof(config->sagan_hostname)-1, "%s", strtok_r(NULL, " ", &tok));
209 config->sagan_hostname[strlen(config->sagan_hostname)-1] = '\0';
210 }
211
212 if (!strcmp(sagan_option, "sagan_interface")) {
213 snprintf(config->sagan_interface, sizeof(config->sagan_interface)-1, "%s", strtok_r(NULL, " ", &tok));
214 config->sagan_interface[strlen(config->sagan_interface)-1] = '\0';
215 }
216
217 if (!strcmp(sagan_option, "sagan_filter")) {
218 snprintf(config->sagan_filter, sizeof(config->sagan_filter)-1, "%s", strtok_r(NULL, " ", &tok));
219 config->sagan_filter[strlen(config->sagan_filter)-1] = '\0';
220 }
221
222 if (!strcmp(sagan_option, "sagan_detail")) {
223 sagan_var = strtok_r(NULL, " ", &tok);
224 config->sagan_detail = atoi(sagan_var);
225 }
226
227#endif
228
229#ifndef HAVE_LIBLOGNORM
230if (!strcmp(sagan_option, "normalize:")) {
231 sagan_log(config, 0, "WARNING: Sagan was not compiled with \"liblognorm\" support!");
232 sagan_log(config, 0, "WARNING: Sagan will continue, but _without_ liblognorm!");
233 }
234#endif
235
236#ifdef HAVE_LIBLOGNORM
237
238/*
239 We load the location for liblognorm's 'rule base/samples'. We don't want to
240 load them quiet yet. We only want to load samples we need, so we do the
241 actual ln_loadSamples() after the configuration file and all rules have
242 been analyzed */
243
244if (!strcmp(sagan_option, "normalize:")) {
245 liblognormstruct = (liblognorm_struct *) realloc(liblognormstruct, (liblognorm_count+1) * sizeof(liblognorm_struct));
246
247 sagan_var = strtok_r(NULL, ",", &tok);
248 remspaces(sagan_var);
249 snprintf(liblognormstruct[liblognorm_count].type, sizeof(liblognormstruct[liblognorm_count].type), "%s", sagan_var);
250
251 snprintf(tmpstring, sizeof(tmpstring), "%s", strtok_r(NULL, ",", &tok));
252 remspaces(tmpstring);
253 tmpstring[strlen(tmpstring)-1] = '\0';
254 strlcpy(normfile, sagan_replace_str(tmpstring, "$RULE_PATH", config->sagan_rule_path), sizeof(normfile));
255 snprintf(liblognormstruct[liblognorm_count].filepath, sizeof(liblognormstruct[liblognorm_count].filepath), "%s", normfile);
256
257 liblognorm_count++;
258}
259
260#endif
261
262if (!strcmp(sagan_option, "output")) {
263 sagan_var = strtok_r(NULL," ", &tok);
264
265 if (!strcmp(sagan_var, "external:")) {
266 snprintf(config->sagan_extern, sizeof(config->sagan_extern), "%s", strtok_r(NULL, " ", &tok));
267 if (strstr(strtok_r(NULL, " ", &tok), "parsable")) config->sagan_exttype=1;
268 config->sagan_ext_flag=1;
269 }
270
271
272#ifdef WITH_SNORTSAM
273if (!strcmp(sagan_var, "alert_fwsam:")) {
274 snprintf(config->sagan_fwsam_info, sizeof(config->sagan_fwsam_info), "%s", remrt(strtok_r(NULL, " ", &tok)));
275 config->sagan_fwsam_flag=1;
276 }
277#endif
278
279#ifndef HAVE_LIBDNET
280if (!strcmp(sagan_var, "unified2:")) {
281 sagan_log(config, 0,"\"libdnet\" support not found. This is needed for unified2.");
282 sagan_log(config, 1, "Re-compile with libdnet support or disable in the sagan.conf.");
283 }
284#endif
285
286#ifdef HAVE_LIBDNET
287
288if (!strcmp(sagan_var, "unified2:")) {
289
290 config->sagan_unified2_flag = 1;
291
292 ptmp = sagan_var;
293 remrt(ptmp);
294
295 while (ptmp != NULL ) {
296
297 if (!strcmp(ptmp, "filename")) {
298 ptmp = strtok_r(NULL, ",", &tok);
299 snprintf(config->unified2_filepath, sizeof(config->unified2_filepath), "%s/%s", config->sagan_log_path, ptmp);
300 }
301
302 if (!strcmp(ptmp, "limit")) {
303 ptmp = strtok_r(NULL, " ", &tok);
304 config->unified2_limit = atoi(ptmp) * 1024 * 1024;
305 }
306
307 if (!strcmp(ptmp, "nostamp")) config->unified2_nostamp = 1;
308
309 ptmp = strtok_r(NULL, " ", &tok);
310
311 }
312}
313
314#endif
315
316#ifndef HAVE_LIBPRELUDE
317 if (!strcmp(sagan_var, "prelude:"))
318 sagan_log(config,1, " libprelude support not found. Re-compile with Prelude support or disable in the sagan.conf.");
319#endif
320
321#ifdef HAVE_LIBPRELUDE
322
323 if (!strcmp(sagan_var, "prelude:")) {
324 config->output_thread_flag = 1;
325 ptmp = sagan_var;
326
327 while (ptmp != NULL ) {
328
329 if (!strcmp(ptmp, "profile")) {
330 ptmp = strtok_r(NULL, " ", &tok);
331 snprintf(config->sagan_prelude_profile, sizeof(config->sagan_prelude_profile), "%s", ptmp);
332 remrt(config->sagan_prelude_profile);
333 config->sagan_prelude_flag=1;
334 }
335
336 ptmp = strtok_r(NULL, "=", &tok);
337 }
338 }
339#endif
340
341
342#ifdef HAVE_LIBESMTP
343
344 if (!strcmp(sagan_var, "email:")) {
345 config->output_thread_flag = 1;
346 ptmp = sagan_var;
347
348 while (ptmp != NULL ) {
349
350 if (!strcmp(ptmp, "from")) {
351 ptmp = strtok_r(NULL, " ", &tok);
352 snprintf(config->sagan_esmtp_from, sizeof(config->sagan_esmtp_from), "%s", ptmp);
353 remrt(config->sagan_esmtp_from);
354 }
355
356 if (!strcmp(ptmp, "smtpserver")) {
357 ptmp = strtok_r(NULL, " ", &tok);
358 snprintf(config->sagan_esmtp_server, sizeof(config->sagan_esmtp_server), "%s", ptmp);
359 remrt(config->sagan_esmtp_server);
360 }
361
362 ptmp = strtok_r(NULL, "=", &tok);
363 }
364
365 }
366#endif
367
368
369#if defined(HAVE_LIBMYSQLCLIENT_R) || defined(HAVE_LIBPQ)
370
371 /* output type (database, etc) */
372
373 if (!strcmp(sagan_var, "database:")) {
374 config->output_thread_flag = 1;
375 sagan_var = strtok_r(NULL, ",", &tok);
376
377 /* Type (only "log" is used right now */
378
379 if (!strcmp(sagan_var, "log")) {
380 sagan_var = strtok_r(NULL, ",", &tok);
381 }
382
383 /* MySQL/PostgreSQL/Oracle/etc */
384
385 remspaces(sagan_var);
386
387
388 if (!strcmp(sagan_var, "mysql" )) {
389#ifndef HAVE_LIBMYSQLCLIENT_R
390 sagan_log(config, 1,"MySQL support not found. Re-compile with MySQL support or disable in the sagan.conf.");
391#endif
392 config->dbtype=1;
393 }
394
395 if (!strcmp(sagan_var, "postgresql" )) {
396#ifndef HAVE_LIBPQ
397 sagan_log(config, 1,"PostgreSQL support not found. Re-compile with PostgreSQL support or disable in the sagan.conf.");
398#endif
399 config->dbtype=2;
400 }
401
402
403 sagan_var = strtok_r(NULL, ",", &tok);
404 remrt(sagan_var); /* rm NL */
405
406 strlcpy(tmpbuf, sagan_var, sizeof(tmpbuf));
407
408 ptmp = strtok_r(tmpbuf, "=", &tok);
409
410 while (ptmp != NULL) {
411 remspaces(ptmp);
412
413 if (!strcmp(ptmp, "user")) {
414 ptmp = strtok_r(NULL, " ", &tok);
415 snprintf(config->dbuser, sizeof(config->dbuser), "%s", ptmp);
416 }
417
418 if (!strcmp(ptmp , "password")) {
419 ptmp = strtok_r(NULL, " ", &tok);
420 snprintf(config->dbpassword, sizeof(config->dbpassword), "%s", ptmp);
421 }
422
423 if (!strcmp(ptmp, "dbname")) {
424 ptmp = strtok_r(NULL, " ", &tok);
425 snprintf(config->dbname, sizeof(config->dbname), "%s", ptmp);
426 }
427
428 if (!strcmp(ptmp, "host")) {
429 ptmp = strtok_r(NULL, " ", &tok);
430 snprintf(config->dbhost, sizeof(config->dbhost), "%s", ptmp);
431 }
432
433 if (!strcmp(ptmp, "port")) {
434 config->dbport = atoi(ptmp);
435 }
436
437 ptmp = strtok_r(NULL, "=", &tok);
438
439
440 }
441
442 }
443#endif
444 }
445
446 /* "var" */
447
448 if (!strcmp(sagan_option, "var")) {
449 sagan_var = strtok_r(NULL, " ", &tok);
450
451 if (!strcmp(sagan_var, "FIFO" )) {
452 snprintf(config->sagan_fifo, sizeof(config->sagan_fifo), "%s", strtok_r(NULL, " ", &tok));
453 config->sagan_fifo[strlen(config->sagan_fifo)-1] = '\0';
454 }
455
456 if (!strcmp(sagan_var, "RULE_PATH" )) {
457 snprintf(config->sagan_rule_path, sizeof(config->sagan_rule_path), "%s", strtok_r(NULL, " ", &tok));
458 config->sagan_rule_path[strlen(config->sagan_rule_path)-1] = '\0';
459 }
460
461 if (!strcmp(sagan_var, "LOCKFILE" )) {
462 snprintf(config->sagan_lockfile, sizeof(config->sagan_lockfile), "%s", strtok_r(NULL, " ", &tok));
463 config->sagan_lockfile[strlen(config->sagan_lockfile)-1] = '\0';
464 }
465
466 if (!strcmp(sagan_var, "ALERTLOG" )) {
467 snprintf(config->sagan_alert_filepath, sizeof(config->sagan_alert_filepath), "%s", strtok_r(NULL, " ", &tok));
468 config->sagan_alert_filepath[strlen(config->sagan_alert_filepath)-1] = '\0';
469 }
470
471 if (!strcmp(sagan_var, "SAGANLOGPATH" )) {
472 snprintf(config->sagan_log_path, sizeof(config->sagan_log_path), "%s", strtok_r(NULL, " ", &tok));
473 config->sagan_log_path[strlen(config->sagan_log_path)-1] = '\0';
474 }
475 }
476
477/* "include */
478
479 if (!strcmp(sagan_option, "include" )) {
480
481 snprintf(tmpstring, sizeof(tmpstring), "%s", strtok_r(NULL, " ", &tok));
482
483 tmpstring[strlen(tmpstring)-1] = '\0';
484
485 strlcpy(ruleset, sagan_replace_str(tmpstring, "$RULE_PATH", config->sagan_rule_path), sizeof(ruleset));
486
487 filename=sagan_getfilename(ruleset); /* Get the file name to figure out "what" we're loading */
488
489 if (!strcmp(filename, "classification.config"))
490 {
491 load_classifications(debug, config, ruleset);
492 }
493
494 if (!strcmp(filename, "reference.config"))
495 {
496 load_reference(debug, config, ruleset);
497 }
498
499 /* It's not a classifcations file or reference, so it must be a ruleset */
500
501 if (strcmp(filename, "reference.config") && strcmp(filename, "classification.config")) {
502
503 load_rules(debug, config, ruleset);
504 }
505 }
506}
507
508fclose(sagancfg);
509
510/* Check rules for duplicate sid. We can't have that! */
511
512for (i = 0; i < counters->rulecount; i++) {
513 for ( check = i+1; check < counters->rulecount; check ++) {
514 if (!strcmp (rulestruct[check].s_sid, rulestruct[i].s_sid ))
515 sagan_log(config, 1, "[%s, line %d] Detected duplicate signature id [sid] number %s. Please correct this.", __FILE__, __LINE__, rulestruct[check].s_sid, rulestruct[i].s_sid);
516 }
517 }
518
519/* If we have the "send-to" option, verify the configuration has the proper smtpserver, etc. */
520
521#ifdef HAVE_LIBESMTP
522
523if (config->sagan_esmtp_flag && !strcmp(config->sagan_esmtp_server, "")) sagan_log(config, 1, "[%s, line %d] Configuration SMTP 'smtpserver' field is missing! |%s|", __FILE__, __LINE__, config->sagan_esmtp_server);
524if (config->sagan_esmtp_flag && !strcmp(config->sagan_esmtp_from, "" )) sagan_log(config, 1, "[%s, line %d] Configuration SMTP 'from' field is missing!", __FILE__, __LINE__);
525
526#endif
527
528if (!strcmp(config->sagan_fifo, "")) sagan_log(config, 1, "No FIFO option found which is required! Aborting!");
529if (!strcmp(config->sagan_host, "" )) sagan_log(config, 1, "The 'sagan_host' option was not found and is required.");
530if ( config->sagan_port == 0 ) sagan_log(config, 1, "The 'sagan_port' option was not set and is required.");
531
532}
5330
=== removed file '.pc/01-do-not-include-lognorm-private-header.patch/src/sagan-signal.c'
--- .pc/01-do-not-include-lognorm-private-header.patch/src/sagan-signal.c 2012-04-16 22:33:24 +0000
+++ .pc/01-do-not-include-lognorm-private-header.patch/src/sagan-signal.c 1970-01-01 00:00:00 +0000
@@ -1,160 +0,0 @@
1/*
2** Copyright (C) 2009-2012 Quadrant Information Security <quadrantsec.com>
3** Copyright (C) 2009-2012 Champ Clark III <cclark@quadrantsec.com>
4**
5** This program is free software; you can redistribute it and/or modify
6** it under the terms of the GNU General Public License Version 2 as
7** published by the Free Software Foundation. You may not use, modify or
8** distribute this program under any other version of the GNU General
9** Public License.
10**
11** This program is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14** GNU General Public License for more details.
15**
16** You should have received a copy of the GNU General Public License
17** along with this program; if not, write to the Free Software
18** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19*/
20
21/* sagan-signal.c
22 *
23 * This runs as a thread for signal processing.
24 *
25 */
26
27#ifdef HAVE_CONFIG_H
28#include "config.h" /* From autoconf */
29#endif
30
31#include <stdio.h>
32#include <stdlib.h>
33#include <signal.h>
34#include <pthread.h>
35#include <stdint.h>
36
37#include "version.h"
38
39#include "sagan.h"
40
41#ifdef HAVE_LIBLOGNORM
42#include <liblognorm.h>
43#include <ptree.h>
44#include <lognorm.h>
45static ln_ctx ctx;
46int liblognorm_count;
47#endif
48
49#ifdef HAVE_LIBPRELUDE
50#include <libprelude/prelude.h>
51sbool sagan_prelude_flag;
52prelude_client_t *preludeclient;
53#endif
54
55#ifdef HAVE_LIBDNET
56#include "output-plugins/sagan-unified2.h"
57sbool sagan_unified2_flag;
58#endif
59
60#if defined(HAVE_LIBMYSQLCLIENT_R) || defined(HAVE_LIBPQ)
61#include "output-plugins/sagan-snort.h"
62#endif
63
64
65struct _SaganCounters *counters;
66
67struct rule_struct *rulestruct;
68struct class_struct *classstruct;
69struct ref_struct *refstruct;
70
71pthread_mutex_t sig_mutex = PTHREAD_MUTEX_INITIALIZER;
72
73void sig_handler( _SaganSigArgs *args ) {
74
75 sigset_t signal_set;
76 int sig;
77
78 for(;;) {
79 /* wait for any and all signals */
80 sigfillset( &signal_set );
81 sigwait( &signal_set, &sig );
82
83
84 switch( sig )
85 {
86 /* exit */
87 case SIGQUIT:
88 case SIGINT:
89 case SIGTERM:
90 case SIGSEGV:
91 case SIGABRT:
92
93 sagan_log(args->config, 0, "\n\n[Received signal %d. Sagan version %s shutting down]-------\n", sig, VERSION);
94 sagan_statistics(args->config);
95
96#if defined(HAVE_LIBMYSQLCLIENT_R) || defined(HAVE_LIBPQ)
97
98 /* last_cid != cid (has there been any alerts? */
99
100 if ( args->config->dbtype != 0 && counters->last_cid != counters-> cid ) record_last_cid(args->debug, args->config, counters);
101#endif
102
103#ifdef HAVE_LIBPRELUDE
104
105/* This comment is from the Snort source code. "Sensor reporting to Prelude
106 shall never go offline, which is why we use the
107 PRELUDE_CLIENT_EXIT_STATUS_FAILURE. */
108
109if ( sagan_prelude_flag != 0 ) {
110prelude_client_destroy(preludeclient, PRELUDE_CLIENT_EXIT_STATUS_FAILURE);
111prelude_deinit();
112}
113
114#endif
115
116#ifdef HAVE_LIBDNET
117if ( sagan_unified2_flag ) Unified2CleanExit(args->config);
118#endif
119
120 fflush(args->config->sagan_alert_stream);
121 fclose(args->config->sagan_alert_stream); /* Close Sagan alert file */
122
123 fflush(args->config->sagan_log_stream); /* Close the sagan.log */
124 fclose(args->config->sagan_log_stream);
125
126 removelockfile(args->config);
127 exit(0);
128 break;
129
130 case SIGHUP:
131 pthread_mutex_lock(&sig_mutex);
132 sagan_log(args->config, 0, "[Reloading Sagan version %s.]-------", VERSION);
133
134 /* Reset counters */
135 counters->refcount=0; counters->classcount=0; counters->rulecount=0; counters->ruletotal=0;
136
137 /* Re-load everything */
138
139 load_config(args->debug, args->config);
140
141 pthread_mutex_unlock(&sig_mutex);
142
143 sagan_log(args->config, 0, "Configuration reloaded.");
144 break;
145
146 /* Signals to ignore */
147 case 17: /* Child process has exited. */
148 case 28: /* Terminal 'resize'/alarm. */
149 break;
150
151 case SIGUSR1:
152 sagan_statistics(args->config);
153 break;
154
155 default:
156 sagan_log(args->config, 0, "[Received signal %d. Sagan doesn't know how to deal with]", sig);
157 }
158 }
159}
160
1610
=== removed file '.pc/01-do-not-include-lognorm-private-header.patch/src/sagan.c'
--- .pc/01-do-not-include-lognorm-private-header.patch/src/sagan.c 2012-04-16 22:33:24 +0000
+++ .pc/01-do-not-include-lognorm-private-header.patch/src/sagan.c 1970-01-01 00:00:00 +0000
@@ -1,1322 +0,0 @@
1/*
2** Copyright (C) 2009-2012 Quadrant Information Security <quadrantsec.com>
3** Copyright (C) 2009-2012 Champ Clark III <cclark@quadrantsec.com>
4**
5** This program is free software; you can redistribute it and/or modify
6** it under the terms of the GNU General Public License Version 2 as
7** published by the Free Software Foundation. You may not use, modify or
8** distribute this program under any other version of the GNU General
9** Public License.
10**
11** This program is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14** GNU General Public License for more details.
15**
16** You should have received a copy of the GNU General Public License
17** along with this program; if not, write to the Free Software
18** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19*/
20
21/* sagan.c
22 *
23 * This is the main "thread" and engine that looks for events & patterns
24 * based on 'snort like' rule sets.
25 *
26 */
27
28#ifdef HAVE_CONFIG_H
29#include "config.h" /* From autoconf */
30#endif
31
32#include <stdio.h>
33#include <stdlib.h>
34#include <sys/types.h>
35#include <unistd.h>
36#include <pthread.h>
37#include <ctype.h>
38#include <errno.h>
39#include <fcntl.h>
40#include <sys/stat.h>
41#include <string.h>
42#include <getopt.h>
43#include <time.h>
44#include <signal.h>
45#include <pcre.h>
46#include <limits.h>
47#include <stdint.h>
48#include <inttypes.h>
49#include <arpa/inet.h>
50#include <netinet/in.h>
51#include <sys/socket.h>
52
53#include "sagan.h"
54
55#include "version.h"
56
57
58#ifdef HAVE_LIBLOGNORM
59#include <liblognorm.h>
60#include <ptree.h>
61#include <lognorm.h>
62#endif
63
64#ifdef HAVE_LIBDNET
65#include "output-plugins/sagan-unified2.h"
66#endif
67
68#define OVECCOUNT 30
69
70struct _SaganCounters *counters;
71struct _Rule_Struct *rulestruct;
72struct class_struct *classstruct;
73
74sbool daemonize=0;
75
76/****************************************************************************/
77/* Liblognorm Globals */
78/****************************************************************************/
79
80#ifdef HAVE_LIBLOGNORM
81struct stat fileinfo;
82struct liblognorm_struct *liblognormstruct;
83struct liblognorm_toload_struct *liblognormtoloadstruct;
84int liblognorm_count;
85
86static ln_ctx ctx;
87static ee_ctx eectx;
88
89es_str_t *str;
90es_str_t *propName = NULL;
91
92struct ee_event *lnevent = NULL;;
93struct ee_field *field = NULL;
94char *cstr;
95#endif
96
97/* ########################################################################
98 * Start of main() thread
99 * ######################################################################## */
100
101int main(int argc, char **argv) {
102
103const struct option long_options[] = {
104 { "help", no_argument, NULL, 'h' },
105 { "debug", required_argument, NULL, 'd' },
106 { "daemon", no_argument, NULL, 'D' },
107 { "user", required_argument, NULL, 'U' },
108 { "chroot", required_argument, NULL, 'c' },
109 { "config", required_argument, NULL, 'f' },
110 { "log", required_argument, NULL, 'l' },
111 {0, 0, 0, 0}
112
113};
114
115static const char *short_options =
116"l:f:u:d:c:pDh";
117
118int option_index = 0;
119
120/* Passing Sagan events to output plugins */
121
122struct _Sagan_Event *SaganEvent = NULL;
123SaganEvent = malloc(MAX_THREADS * sizeof(struct _Sagan_Event));
124
125/***************************************************************************/
126/* pthread for the output plugins */
127/***************************************************************************/
128
129pthread_t output_id[MAX_THREADS];
130pthread_attr_t thread_output_attr;
131pthread_attr_init(&thread_output_attr);
132pthread_attr_setdetachstate(&thread_output_attr, PTHREAD_CREATE_DETACHED);
133
134/****************************************************************************/
135/* pthread for the processor plugins */
136/****************************************************************************/
137
138pthread_t processor_id[MAX_THREADS];
139pthread_attr_t thread_processor_attr;
140pthread_attr_init(&thread_processor_attr);
141pthread_attr_setdetachstate(&thread_processor_attr, PTHREAD_CREATE_DETACHED);
142
143
144/****************************************************************************/
145/* libpcap/PLOG (syslog sniffer) local variables */
146/****************************************************************************/
147
148#ifdef HAVE_LIBPCAP
149pthread_t pcap_thread;
150pthread_attr_t thread_pcap_attr;
151pthread_attr_init(&thread_pcap_attr);
152pthread_attr_setdetachstate(&thread_pcap_attr, PTHREAD_CREATE_DETACHED);
153#endif
154
155/****************************************************************************/
156/* Various local variables */
157/****************************************************************************/
158
159#if defined(HAVE_LIBMYSQLCLIENT_R) || defined(HAVE_LIBPQ)
160char *sqlout=NULL;
161char *sql=NULL;
162char sqltmp[MAXSQL];
163#endif
164
165/* Block all signals, we create a signal handling thread */
166
167sigset_t signal_set;
168pthread_t sig_thread;
169sigfillset( &signal_set );
170pthread_sigmask( SIG_BLOCK, &signal_set, NULL );
171
172/* Key board handler (displays stats, etc */
173
174pthread_t key_thread;
175pthread_attr_t key_thread_attr;
176pthread_attr_init(&key_thread_attr);
177pthread_attr_setdetachstate(&key_thread_attr, PTHREAD_CREATE_DETACHED);
178
179struct sockaddr_in sa;
180char src_dns_lookup[20];
181int dns_flag=0;
182
183sbool fifoerr=0;
184
185int threadid=0;
186
187char *ip_src = NULL;
188char *ip_dst = NULL;
189
190char ip_srctmp[MAX_MSGSLOT][MAXIP];
191char ip_dsttmp[MAX_MSGSLOT][MAXIP];
192
193char *username = NULL;
194char *uid = NULL;
195char s_msg[1024];
196char s_msgtmp[MAX_MSGSLOT][1024];
197
198int src_port;
199int dst_port;
200
201int src_porttmp[MAX_MSGSLOT];
202int dst_porttmp[MAX_MSGSLOT];
203
204int after_count_by_src=0;
205int after_count_by_dst=0;
206sbool after_flag=0;
207sbool after_log_flag=0;
208
209int thresh_count_by_src=0;
210int thresh_count_by_dst=0;
211sbool thresh_flag=0;
212sbool thresh_log_flag=0;
213char timet[20];
214
215struct thresh_by_src *threshbysrc = NULL;
216struct thresh_by_dst *threshbydst = NULL;
217
218struct after_by_src *afterbysrc = NULL;
219struct after_by_dst *afterbydst = NULL;
220
221uint64_t thresh_oldtime_src;
222uint64_t after_oldtime_src;
223
224char fip[MAXIP];
225
226char *syslog_host=NULL;
227char syslog_hosttmp[MAX_MSGSLOT][MAXHOST];
228
229char *syslog_facility=NULL;
230char syslog_facilitytmp[MAX_MSGSLOT][MAXFACILITY];
231
232char *syslog_priority=NULL;
233
234char *syslog_level=NULL;
235char syslog_leveltmp[MAX_MSGSLOT][MAXLEVEL];
236
237char *syslog_tag=NULL;
238char syslog_tagtmp[MAX_MSGSLOT][MAXTAG];
239
240char *syslog_date=NULL;
241char syslog_datetmp[MAX_MSGSLOT][MAXDATE];
242
243char *syslog_time=NULL;
244char syslog_timetmp[MAX_MSGSLOT][MAXTIME];
245
246char *syslog_program=NULL;
247char syslog_programtmp[MAX_MSGSLOT][MAXPROGRAM];
248
249char *syslog_msg=NULL;
250char syslog_msg_origtmp[MAX_SYSLOGMSG];
251
252int rc=0;
253
254int ovector[OVECCOUNT];
255
256char syslogstring[MAX_SYSLOGMSG];
257char sysmsg[MAX_MSGSLOT][MAX_SYSLOGMSG];
258int msgslot=0;
259char syslogtmp[2];
260char c;
261
262char *ptmp;
263char *tok;
264char *tok2;
265
266/* For the ruleset */
267
268char *content;
269char *program;
270char *facility;
271char *syspri;
272char *level;
273char *tag;
274char tmpbuf[128];
275memset(tmpbuf,0,128);
276char ipbuf_src[128];
277char ipbuf_dst[128];
278
279char *syslog_msg_case;
280char *s_content_case;
281
282char *runas=RUNAS;
283
284int i;
285int fd=0;
286int b;
287int z;
288int match=0;
289int pcrematch=0;
290
291time_t t;
292struct tm *now, *run;
293
294/* Allocate and clear memory for global structs */
295
296struct _SaganDebug *debug;
297debug = malloc(sizeof(_SaganDebug));
298memset(debug, 0, sizeof(_SaganDebug));
299
300struct _SaganConfig *config;
301config = malloc(sizeof(_SaganConfig));
302memset(config, 0, sizeof(_SaganConfig));
303
304struct _SaganSigArgs *sigargs;
305sigargs = malloc(sizeof(_SaganSigArgs));
306memset(sigargs, 0, sizeof(_SaganSigArgs));
307
308struct _SaganDNSCache *dnscache;
309dnscache = malloc(sizeof(_SaganDNSCache));
310memset(dnscache, 0, sizeof(_SaganDNSCache));
311
312counters = malloc(sizeof(_SaganCounters));
313memset(counters, 0, sizeof(_SaganCounters));
314
315t = time(NULL);
316run=localtime(&t);
317strftime(config->sagan_startutime, sizeof(config->sagan_startutime), "%s", run);
318
319
320snprintf(config->sagan_config, sizeof(config->sagan_config), "%s", CONFIG_FILE_PATH);
321
322/* We set the config->sagan_log_filepath to the system default. It'll be fopen'ed
323 shortly - 06/03/2011 - Champ Clark III */
324
325snprintf(config->sagan_log_filepath, sizeof(config->sagan_log_filepath), "%s", SAGANLOG);
326
327/* Get command line arg's */
328while ((c = getopt_long(argc, argv, short_options, long_options, &option_index)) != -1) {
329
330 switch(c) {
331
332 if (c == -1) break;
333
334 case 'h':
335 sagan_usage();
336 exit(0);
337 break;
338
339 case 'd':
340
341 if (strstr(optarg, "syslog")) debug->debugsyslog=1;
342 if (strstr(optarg, "load")) debug->debugload=1;
343 if (strstr(optarg, "fwsam")) debug->debugfwsam=1;
344
345#ifdef HAVE_LIBLOGNORM
346 if (strstr(optarg, "normalize" )) debug->debugnormalize=1;
347#endif
348
349#if defined(HAVE_LIBMYSQLCLIENT_R) || defined(HAVE_LIBPQ)
350 if (strstr(optarg, "sql")) debug->debugsql=1;
351#endif
352
353#ifdef HAVE_LIBESMTP
354 if (strstr(optarg, "smtp")) debug->debugesmtp=1;
355#endif
356
357#ifdef HAVE_LIBPCAP
358 if (strstr(optarg, "plog")) debug->debugplog=1;
359#endif
360
361 break;
362
363 case 'D':
364 daemonize=1;
365 break;
366
367 case 'u':
368 runas=optarg;
369 break;
370
371 case 'c':
372 sagan_chroot(runas,optarg);
373 break;
374
375 case 'f':
376 strncpy(config->sagan_config,optarg,sizeof(config->sagan_config) - 1); // strlcpy
377 config->sagan_config[sizeof(config->sagan_config)-1] = '\0';
378 break;
379
380 case 'l':
381 strncpy(config->sagan_log_filepath,optarg,sizeof(config->sagan_log_filepath) - 1);
382 config->sagan_log_filepath[sizeof(config->sagan_log_filepath)-1] = '\0';
383 break;
384
385
386 default:
387 fprintf(stderr, "Invalid argument! See below for command line switches.\n");
388 sagan_usage();
389 exit(0);
390 break;
391 }
392}
393
394/* Open the sagan.log file. Moved from sagan-config.c as it became to complex
395 06/03/2011 - Champ Clark */
396
397if ((config->sagan_log_stream = fopen(config->sagan_log_filepath, "a")) == NULL) {
398 fprintf(stderr, "[E] [%s, line %d] Cannot open %s!\n", __FILE__, __LINE__, config->sagan_log_filepath);
399 exit(1);
400 }
401
402
403load_config( debug, config );
404
405/* Load/init liblognorm definitions. I tried to move this into a subroutine,
406 * but that ended up causing segfaults on ln_normalize() or causing
407 * liblognorm not to function correctly (not parsing fields). Make reloading
408 * a SIGHUP a issue as well.
409 * 12/17/2010 - Champ
410 */
411
412#ifdef HAVE_LIBLOGNORM
413if((ctx = ln_initCtx()) == NULL) sagan_log(config, 1, "[%s, line %d] Cannot initialize liblognorm context.", __FILE__, __LINE__);
414if((eectx = ee_initCtx()) == NULL) sagan_log(config, 1, "[%s, line %d] Cannot initialize libee context.", __FILE__, __LINE__);
415
416ln_setEECtx(ctx, eectx);
417
418for (i=0; i < counters->liblognormtoload_count; i++) {
419sagan_log(config, 0, "Loading %s for normalization.", liblognormtoloadstruct[i].filepath);
420if (stat(liblognormtoloadstruct[i].filepath, &fileinfo)) sagan_log(config, 1, "%s was not fonnd.", liblognormtoloadstruct[i].filepath);
421ln_loadSamples(ctx, liblognormtoloadstruct[i].filepath);
422}
423#endif
424
425sagan_log(config, 0, "Configuration file %s loaded and %d rules loaded.", config->sagan_config, counters->rulecount);
426sagan_log(config, 0, "Sagan version %s is firing up!", VERSION);
427
428/* We go ahead and assign values to SaganSigArgs (struct sig_thread_args). This
429 * struct is always used by the sig_handler thread, and sometimes used by the
430 * plog_handler (below). So we assign values now */
431
432sigargs->daemonize = daemonize;
433sigargs->debug = debug;
434sigargs->config = config;
435
436#ifdef HAVE_LIBPCAP
437
438/* Spawn a thread to 'sniff' syslog traffic (sagan-plog.c). This redirects syslog
439 traffic to the /dev/log socket. This needs "root" access, so we drop priv's
440 after this thread is started */
441
442if ( config->plog_flag ) {
443
444if ( pthread_create( &pcap_thread, NULL, (void *)plog_handler, sigargs )) {
445
446 removelockfile(config);
447 sagan_log(config, 1, "[%s, line %d] Error creating libpcap handler thread.", __FILE__, __LINE__);
448 }
449
450sleep(1); /* Sleep to avoid race between main() and plog thread
451 plog thread needs "root" rights before sagan_droppriv().
452 In some cases main() run sagan_droppriv() before thread
453 can complete - Champ Clark - 07/20/2011 */
454
455}
456#endif
457
458sagan_droppriv(config, runas); /* Become the Sagan user */
459sagan_log(config, 0, "---------------------------------------------------------------------------");
460
461/* Open sagan alert file */
462
463if (( config->sagan_alert_stream = fopen(config->sagan_alert_filepath, "a" )) == NULL ) {
464removelockfile(config);
465sagan_log(config, 1, "[%s, line %d] Can't open %s!", __FILE__, __LINE__, config->sagan_alert_filepath);
466}
467
468sagan_log(config, 0, "Max Output Threads : %" PRIu64 "", config->max_output_threads);
469sagan_log(config, 0, "Max Processor Threads: %" PRIu64 "", config->max_processor_threads);
470
471sagan_log(config, 0, "");
472
473#if defined(HAVE_LIBMYSQLCLIENT_R) || defined(HAVE_LIBPQ)
474if ( config->dbtype ) {
475
476config->endian = checkendian();
477
478db_connect(config);
479
480get_sensor_id( debug, config );
481sagan_log(config, 0, "Sensor ID : %d", config->sensor_id);
482counters->cid = get_cid( debug, config ) + 1;
483
484snprintf(sqltmp, sizeof(sqltmp), "SELECT MAX(cid) FROM event WHERE sid=%d", config->sensor_id);
485sql=sqltmp;
486sqlout = db_query(debug, config, sql);
487
488sagan_log(config, 0, "Next CID : %" PRIu64 "", counters->cid);
489
490/* Check the event table and compare sensor.last_cid with event_cid. If there's a
491 * mismatch, we correct it - Champ Clark 03/30/2012 */
492
493if ( atol(sqlout) != counters->cid ) {
494 sagan_log(config, 2, "Inconsistent cid information for sid=%d. Recovering by rolling forward to cid=%d", config->sensor_id, atol(sqlout) );
495 counters->cid = atol(sqlout);
496 record_last_cid(debug, config, counters);
497 }
498
499counters->last_cid = counters->cid; /* Use to determine if a change has happened in sagan_siganl.c */
500}
501
502#endif
503
504#ifdef HAVE_LIBPRELUDE
505
506if ( config->sagan_prelude_flag ) {
507
508sagan_log(config, 0, "Prelude profile: %s", config->sagan_prelude_profile);
509sagan_log(config, 0, ""); /* libprelude dumps some information. This is to make it pretty */
510
511PreludeInit(config);
512}
513
514#endif
515
516#ifdef HAVE_LIBDNET
517
518if ( config->sagan_unified2_flag ) {
519
520sagan_log(config, 0, "");
521sagan_log(config, 0, "Unified2 file: %s", config->unified2_filepath);
522sagan_log(config, 0, "Unified2 limit: %dM", config->unified2_limit / 1024 / 1024 );
523Unified2InitFile( config );
524
525}
526
527#endif
528
529
530sagan_log(config, 0, "");
531
532sagan_log(config, 0, "");
533sagan_log(config, 0, " ,-._,-. -*> Sagan! <*-");
534sagan_log(config, 0, " \\/)\"(\\/ Version %s", VERSION);
535sagan_log(config, 0, " (_o_) Champ Clark III & The Quadrant InfoSec Team [quadrantsec.com]");
536sagan_log(config, 0, " / \\/) Copyright (C) 2009-2012 Quadrant Information Security, et al.");
537sagan_log(config, 0, " (|| ||) Using PCRE version: %s", pcre_version());
538sagan_log(config, 0, " oo-oo Sagan is processing events.....");
539sagan_log(config, 0, "");
540
541/* Become a daemon if requested */
542
543if ( daemonize )
544{
545sagan_log(config, 0, "Becoming a daemon!");
546
547pid_t pid = 0;
548setsid();
549pid = fork();
550if (pid == 0) {} else { exit(0); }
551}
552
553/* Create the signal handlers thread _after_ the fork() so it can properly
554 * handly signals - Champ Clark III - 06/13/2011 */
555
556if ( pthread_create( &sig_thread, NULL, (void *)sig_handler, sigargs )) {
557 removelockfile(config);
558 sagan_log(config, 1, "[%s, line %d] Error creating signal handler thread.", __FILE__, __LINE__);
559 }
560
561
562/* We don't want the key_handler() if we're in daemon mode! */
563
564if (!daemonize) {
565
566if (pthread_create( &key_thread, NULL, (void *)key_handler, config )) { ;
567 removelockfile(config);
568 sagan_log(config, 1, "[%s, line %d] Error creating key_handler thread.", __FILE__, __LINE__);
569 }
570
571}
572
573/* We do this after forking so init scripts can complete */
574
575/* Check lock file _after_ thread. If you don't it'll retreive the wrong pid
576 * and incorrectly believe there is a stale lock file if --daemon */
577
578checklockfile(config);
579
580sagan_log(config, 0, "Attempting to open syslog FIFO (%s).", config->sagan_fifo);
581
582if ( fd == 0 ) fd = open(config->sagan_fifo, O_RDONLY);
583
584sagan_log(config, 0, "Successfully opened FIFO (%s).", config->sagan_fifo);
585
586while(1) {
587
588 if(fd < 0) {
589 removelockfile(config);
590 sagan_log(config, 1, "[%s, line %d] Error opening in FIFO! %s (Errno: %d)", __FILE__, __LINE__, config->sagan_fifo, errno);
591 }
592
593 i = read(fd, &c, 1);
594
595 if(i < 0) {
596 removelockfile(config);
597 sagan_log(config, 1, "[%s, line %d] Error reading FIFO! %s (Errno: %d)", __FILE__, __LINE__, config->sagan_fifo, errno);
598 }
599
600 /* Error on reading (FIFO writer left) and we have no
601 * previous error state. */
602
603 if (i == 0 && fifoerr == 0 ) {
604 sagan_log(config, 0, "FIFO closed (writer exited). Will start processing when writer resumes.");
605 fifoerr=1;
606 }
607
608 /* If previous state was error, now we see data,
609 * then the write is back online. */
610
611 if ( fifoerr == 1 && i == 1 ) {
612 sagan_log(config, 0,"FIFO writer detected, resuming...");
613 fifoerr=0; /* Rest error state */
614 }
615
616 /* FIFO will return null and eat CPU. We sleep to avoid
617 * this until the FIFO writer comes back online */
618
619 if ( fifoerr == 1 ) sleep(1);
620
621 snprintf(syslogtmp, sizeof(syslogtmp), "%c", c);
622 strncat(syslogstring, syslogtmp, 1);
623
624 if ( c == '\n' || c == '\r' )
625 {
626
627 counters->sagantotal++;
628 syslog_host = strtok_r(syslogstring, "|", &tok);
629
630 /* If we're using DNS (and we shouldn't be!), we start DNS checks and lookups
631 * here. We cache both good and bad lookups to not over load our DNS server(s).
632 * The only way DNS cache can be cleared is to restart Sagan */
633
634 if (config->syslog_src_lookup ) {
635 if ( inet_pton(AF_INET, syslog_host, &(sa.sin_addr)) == 0 ) { /* Is inbound a valid IP? */
636 dns_flag=0;
637
638 for(i=0; i <= counters->dns_cache_count ; i++) { /* Check cache first */
639 if (!strcmp( dnscache[i].hostname, syslog_host)) {
640 syslog_host = dnscache[i].src_ip;
641 dns_flag=1;
642 }
643 }
644
645 /* If entry was not found in cache, look it up */
646
647 if ( dns_flag == 0 ) {
648
649 /* Do a DNS lookup */
650 snprintf(src_dns_lookup, sizeof(src_dns_lookup), "%s", dns_lookup(config, syslog_host));
651
652 /* Invalid lookups get the config->sagan_host value */
653
654 if (!strcmp(src_dns_lookup, "0" )) {
655 snprintf(src_dns_lookup, sizeof(src_dns_lookup), "%s", config->sagan_host);
656 counters->dns_miss_count++;
657 }
658
659
660 /* Add entry to DNS Cache */
661
662 dnscache = (_SaganDNSCache *) realloc(dnscache, (counters->dns_cache_count+1) * sizeof(_SaganDNSCache));
663 snprintf(dnscache[counters->dns_cache_count].hostname, sizeof(dnscache[counters->dns_cache_count].hostname), "%s", syslog_host);
664 snprintf(dnscache[counters->dns_cache_count].src_ip, sizeof(dnscache[counters->dns_cache_count].src_ip), "%s", src_dns_lookup);
665 counters->dns_cache_count++;
666 syslog_host = src_dns_lookup;
667
668 }
669 }
670
671 } else {
672
673 /* We check to see if values from our FIFO are valid. If we aren't doing DNS related
674 * stuff (above), we start basic check with the syslog_host */
675
676 if (syslog_host == NULL || inet_pton(AF_INET, syslog_host, &(sa.sin_addr)) == 0 ) {
677 syslog_host = config->sagan_host;
678 if ( !fifoerr ) sagan_log(config, 0, "Sagan received a malformed 'host' (replaced with %s)", config->sagan_host);
679 }
680 }
681
682 /* We know check the rest of the values */
683
684 syslog_facility=strtok_r(NULL, "|", &tok);
685 if ( syslog_facility == NULL ) {
686 syslog_facility = "SAGAN: FACILITY ERROR";
687 if ( !fifoerr ) sagan_log(config, 0, "Sagan received a malformed 'facility'");
688 }
689
690 syslog_priority=strtok_r(NULL, "|", &tok);
691 if ( syslog_priority == NULL ) {
692 syslog_priority = "SAGAN: PRIORITY ERROR";
693 if ( !fifoerr ) sagan_log(config, 0, "Sagan received a malformed 'priority'");
694 }
695
696 syslog_level=strtok_r(NULL, "|", &tok);
697 if ( syslog_level == NULL ) {
698 syslog_level = "SAGAN: LEVEL ERROR";
699 if ( !fifoerr ) sagan_log(config, 0, "Sagan received a malformed 'priority'");
700 }
701
702 syslog_tag=strtok_r(NULL, "|", &tok);
703 if ( syslog_tag == NULL ) {
704 syslog_tag = "SAGAN: TAG ERROR";
705 if ( !fifoerr ) sagan_log(config, 0, "Sagan received a malformed 'tag'");
706 }
707
708 syslog_date=strtok_r(NULL, "|", &tok);
709 if ( syslog_date == NULL ) {
710 syslog_date = "SAGAN: DATE ERROR";
711 if ( !fifoerr ) sagan_log(config, 0, "Sagan received a malformed 'date'");
712 }
713
714 syslog_time=strtok_r(NULL, "|", &tok);
715 if ( syslog_time == NULL ) {
716 syslog_time = "SAGAN: TIME ERROR";
717 if ( !fifoerr ) sagan_log(config, 0, "Sagan received a malformed 'time'");
718 }
719
720 syslog_program=strtok_r(NULL, "|", &tok);
721 if ( syslog_program == NULL ) {
722 syslog_program = "SAGAN: PROGRAM ERROR";
723 if ( !fifoerr ) sagan_log(config, 0, "Sagan received a malformed 'program'");
724 } else {
725 syslog_msg=syslog_program + strlen(syslog_program) + 1;
726 }
727
728 if ( syslog_msg == NULL ) {
729 syslog_msg = "SAGAN: MESSAGE ERROR";
730 if ( !fifoerr ) sagan_log(config, 0, "Sagan received a malformed 'message'\n");
731
732 /* If the message is lost, all is lost. Typically, you don't lose part of the message,
733 * it's more likely to lose all - Champ Clark III 11/17/2011 */
734
735 counters->sagan_log_drop++;
736
737 }
738
739
740 /* Strip any \n or \r from the syslog_msg */
741
742 if ( strcspn ( syslog_msg, "\n" ) < strlen(syslog_msg) )
743 syslog_msg[strcspn ( syslog_msg, "\n" )] = '\0';
744
745
746if (debug->debugsyslog) sagan_log(config, 0, "%s|%s|%s|%s|%s|%s|%s|%s|%s", syslog_host, syslog_facility, syslog_priority, syslog_level, syslog_tag, syslog_date, syslog_time, syslog_program, syslog_msg);
747
748
749 /* Search for matches */
750
751 /* First we search for 'program' and such. This way, we don't waste CPU
752 * time with pcre/content. */
753
754 for(b=0; b < counters->rulecount; b++) {
755
756 match = 0; program=""; facility=""; syspri=""; level=""; tag=""; content="";
757
758 if ( strcmp(rulestruct[b].s_program, "" )) {
759 snprintf(tmpbuf, sizeof(tmpbuf), "%s", rulestruct[b].s_program);
760 ptmp = strtok_r(tmpbuf, "|", &tok2);
761 match=1;
762 while ( ptmp != NULL ) {
763 if (!strcmp(ptmp, syslog_program)) match=0;
764 ptmp = strtok_r(NULL, "|", &tok2);
765 }
766 }
767
768 if ( strcmp(rulestruct[b].s_facility, "" )) {
769 snprintf(tmpbuf, sizeof(tmpbuf), "%s", rulestruct[b].s_facility);
770 ptmp = strtok_r(tmpbuf, "|", &tok2);
771 match=1;
772 while ( ptmp != NULL ) {
773 if (!strcmp(ptmp, syslog_facility)) match=0;
774 ptmp = strtok_r(NULL, "|", &tok2);
775 }
776 }
777
778 if ( strcmp(rulestruct[b].s_syspri, "" )) {
779 snprintf(tmpbuf, sizeof(tmpbuf), "%s", rulestruct[b].s_syspri);
780 ptmp = strtok_r(tmpbuf, "|", &tok2);
781 match=1;
782 while ( ptmp != NULL ) {
783 if (!strcmp(ptmp, syslog_priority)) match=0;
784 ptmp = strtok_r(NULL, "|", &tok2);
785 }
786 }
787
788 if ( strcmp(rulestruct[b].s_level, "" )) {
789 snprintf(tmpbuf, sizeof(tmpbuf), "%s", rulestruct[b].s_level);
790 ptmp = strtok_r(tmpbuf, "|", &tok2);
791 match=1;
792 while ( ptmp != NULL ) {
793 if (!strcmp(ptmp, syslog_level)) match=0;
794 ptmp = strtok_r(NULL, "|", &tok2);
795 }
796 }
797
798 if ( strcmp(rulestruct[b].s_tag, "" )) {
799 snprintf(tmpbuf, sizeof(tmpbuf), "%s", rulestruct[b].s_tag);
800 ptmp = strtok_r(tmpbuf, "|", &tok2);
801 match=1;
802 while ( ptmp != NULL ) {
803 if (!strcmp(ptmp, syslog_tag)) match=0;
804 ptmp = strtok_r(NULL, "|", &tok2);
805 }
806 }
807
808 /* If there has been a match above, or NULL on all, then we continue with
809 * PCRE/content search */
810
811 /* Search via strstr (content:) */
812
813 if ( match == 0 ) {
814
815 if ( rulestruct[b].content_count != 0 ) {
816
817 for(z=0; z<rulestruct[b].content_count; z++) {
818
819 /* If case insensitive */
820 if ( rulestruct[b].s_nocase == 1 ) {
821 snprintf(syslog_msg_origtmp, sizeof(syslog_msg_origtmp), "%s", syslog_msg);
822 syslog_msg_case=syslog_msg_origtmp;
823 s_content_case=rulestruct[b].s_content[z];
824 toupperc(syslog_msg_case);
825 toupperc(s_content_case);
826 if (strstr(syslog_msg_case, s_content_case )) pcrematch++;
827 } else {
828
829 /* If case sensitive */
830 if (strstr(syslog_msg, rulestruct[b].s_content[z] )) pcrematch++;
831 }
832 }
833 }
834
835
836 /* Search via PCRE */
837
838 if ( rulestruct[b].pcre_count != 0 ) {
839
840 for(z=0; z<rulestruct[b].pcre_count; z++) {
841
842 rc = pcre_exec( rulestruct[b].re_pcre[z], rulestruct[b].pcre_extra[z], syslog_msg, (int)strlen(syslog_msg), 0, 0, ovector, OVECCOUNT);
843
844 } /* End of pcre if */
845
846 if ( rc == 1 ) {
847 pcrematch++;
848 }
849 }
850
851 } /* End of content: & pcre */
852
853 /* if you got match */
854
855 if ( pcrematch == rulestruct[b].pcre_count + rulestruct[b].content_count )
856 {
857
858 if ( match == 0 ) {
859
860 counters->saganfound++;
861
862 ip_src=NULL;
863 ip_dst=NULL;
864 dst_port=0;
865 src_port=0;
866
867 username=NULL;
868 uid=NULL;
869
870#ifdef HAVE_LIBLOGNORM
871 if ( rulestruct[b].normalize == 1 && counters->liblognormtoload_count != 0 )
872 {
873 str = es_newStrFromCStr(syslog_msg, strlen(syslog_msg ));
874 ln_normalize(ctx, str, &lnevent);
875 if(lnevent != NULL) {
876 es_emptyStr(str);
877 ee_fmtEventToRFC5424(lnevent, &str);
878 cstr = es_str2cstr(str, NULL);
879
880 if ( debug->debugnormalize ) sagan_log(config, 0, "Normalize output: %s", cstr);
881
882 propName = es_newStrFromBuf("src-ip", 6);
883 if((field = ee_getEventField(lnevent, propName)) != NULL) {
884 str = ee_getFieldValueAsStr(field, 0);
885 ip_src = es_str2cstr(str, NULL);
886 }
887
888 propName = es_newStrFromBuf("dst-ip", 6);
889 if((field = ee_getEventField(lnevent, propName)) != NULL) {
890 str = ee_getFieldValueAsStr(field, 0);
891 ip_dst = es_str2cstr(str, NULL);
892 }
893
894 propName = es_newStrFromBuf("src-port", 8);
895 if((field = ee_getEventField(lnevent, propName)) != NULL) {
896 str = ee_getFieldValueAsStr(field, 0);
897 cstr = es_str2cstr(str, NULL);
898 src_port = atoi(cstr);
899 }
900
901 propName = es_newStrFromBuf("dst-port", 8);
902 if((field = ee_getEventField(lnevent, propName)) != NULL) {
903 str = ee_getFieldValueAsStr(field, 0);
904 cstr = es_str2cstr(str, NULL);
905 dst_port = atoi(cstr);
906 }
907
908 propName = es_newStrFromBuf("username", 8);
909 if((field = ee_getEventField(lnevent, propName)) != NULL) {
910 str = ee_getFieldValueAsStr(field, 0);
911 username = es_str2cstr(str, NULL);
912 }
913
914 propName = es_newStrFromBuf("uid", 3);
915 if((field = ee_getEventField(lnevent, propName)) != NULL) {
916 str = ee_getFieldValueAsStr(field, 0);
917 uid = es_str2cstr(str, NULL);
918 }
919
920 propName = es_newStrFromBuf("src-host", 8);
921 if((field = ee_getEventField(lnevent, propName)) != NULL) {
922 str = ee_getFieldValueAsStr(field, 0);
923 snprintf(ipbuf_src, sizeof(ipbuf_src), "%s", dns_lookup(config, es_str2cstr(str, NULL)));
924 ip_src=ipbuf_src;
925 }
926
927 propName = es_newStrFromBuf("dst-host", 8);
928 if((field = ee_getEventField(lnevent, propName)) != NULL) {
929 str = ee_getFieldValueAsStr(field, 0);
930 snprintf(ipbuf_dst, sizeof(ipbuf_dst), "%s", dns_lookup(config, es_str2cstr(str, NULL)));
931 ip_dst=ipbuf_dst;
932
933 }
934
935 free(cstr);
936 ee_deleteEvent(lnevent);
937 lnevent = NULL;
938 }
939
940}
941#endif
942
943/* Normalization always over rides parse_ip/parse_port */
944
945if ( rulestruct[b].normalize == 0 ) {
946
947 /* parse_ip && parse_port - Simple means of parsing */
948
949 if ( rulestruct[b].s_find_ip == 1 ) {
950
951 snprintf(fip, sizeof(fip), "%s", parse_ip_simple(syslog_msg));
952
953 if (strcmp(fip,"0")) {
954 ip_src = fip; ip_dst = syslog_host;
955 } else {
956 ip_src = syslog_host; ip_dst = config->sagan_host;
957 }
958 } else {
959 ip_src = syslog_host; ip_dst = config->sagan_host;
960 }
961
962if ( rulestruct[b].s_find_port == 1 ) {
963 src_port = parse_port_simple(config, syslog_msg);
964 } else {
965 src_port = config->sagan_port;
966 }
967}
968
969if ( ip_src == NULL ) ip_src=syslog_host;
970if ( ip_dst == NULL ) ip_dst=syslog_host;
971
972if ( src_port == 0 ) src_port=config->sagan_port;
973if ( dst_port == 0 ) dst_port=rulestruct[b].dst_port;
974
975snprintf(s_msg, sizeof(s_msg), "%s", rulestruct[b].s_msg);
976
977if (username != NULL ) {
978 snprintf(tmpbuf, sizeof(tmpbuf), " [%s]", username);
979 strlcat(s_msg, tmpbuf, sizeof(s_msg));
980 }
981
982if (uid != NULL ) {
983 snprintf(tmpbuf, sizeof(tmpbuf), " [uid: %s]", uid);
984 strlcat(s_msg, tmpbuf, sizeof(s_msg));
985 }
986
987/* We don't want 127.0.0.1, so remap it to something more useful */
988
989if (!strcmp(ip_src, "127.0.0.1" )) ip_src=config->sagan_host;
990if (!strcmp(ip_dst, "127.0.0.1" )) ip_dst=config->sagan_host;
991
992/*********************************************************/
993/* After - Similar to thresholding, but the opposite */
994/* direction - ie - alert _after_ X number of events */
995/*********************************************************/
996
997if ( rulestruct[b].after_src_or_dst != 0 ) {
998
999 after_log_flag=1;
1000
1001 t = time(NULL);
1002 now=localtime(&t);
1003 strftime(timet, sizeof(timet), "%s", now);
1004
1005 /* After by source IP address */
1006
1007 if ( rulestruct[b].after_src_or_dst == 1 ) {
1008 after_flag = 0;
1009
1010 for (i = 0; i < after_count_by_src; i++ ) {
1011 if (!strcmp( afterbysrc[i].ipsrc, ip_src ) && !strcmp(afterbysrc[i].sid, rulestruct[b].s_sid )) {
1012 after_flag=1;
1013 afterbysrc[i].count++;
1014 after_oldtime_src = atol(timet) - afterbysrc[i].utime;
1015 afterbysrc[i].utime = atol(timet);
1016 if ( after_oldtime_src > rulestruct[b].after_seconds ) {
1017 afterbysrc[i].count=1;
1018 afterbysrc[i].utime = atol(timet);
1019 after_log_flag=1;
1020 }
1021
1022 if ( rulestruct[b].after_count < afterbysrc[i].count )
1023 {
1024 after_log_flag = 0;
1025 sagan_log(config, 0, "After SID %s by source IP address. [%s]", afterbysrc[i].sid, ip_src);
1026 counters->after_total++;
1027 }
1028
1029 }
1030 }
1031 }
1032
1033
1034 /* If not found, add it to the array */
1035
1036 if ( after_flag == 0 ) {
1037 afterbysrc = (after_by_src *) realloc(afterbysrc, (after_count_by_src+1) * sizeof(after_by_src));
1038 snprintf(afterbysrc[after_count_by_src].ipsrc, sizeof(afterbysrc[after_count_by_src].ipsrc), "%s", ip_src);
1039 snprintf(afterbysrc[after_count_by_src].sid, sizeof(afterbysrc[after_count_by_src].sid), "%s", rulestruct[b].s_sid );
1040 afterbysrc[after_count_by_src].count = 1;
1041 afterbysrc[after_count_by_src].utime = atol(timet);
1042 after_count_by_src++;
1043 }
1044
1045 /* After by destination IP address */
1046
1047 if ( rulestruct[b].after_src_or_dst == 2 ) {
1048
1049 after_flag = 0;
1050
1051 /* Check array for matching src / sid */
1052
1053 for (i = 0; i < after_count_by_dst; i++ ) {
1054 if (!strcmp( afterbydst[i].ipdst, ip_dst ) && !strcmp(afterbydst[i].sid, rulestruct[b].s_sid )) {
1055 after_flag=1;
1056 afterbydst[i].count++;
1057 after_oldtime_src = atol(timet) - afterbydst[i].utime;
1058 afterbydst[i].utime = atol(timet);
1059 if ( after_oldtime_src > rulestruct[b].after_seconds ) {
1060 afterbydst[i].count=1;
1061 afterbydst[i].utime = atol(timet);
1062 after_log_flag=1;
1063 }
1064
1065 if ( rulestruct[b].after_count < afterbydst[i].count ) {
1066 after_log_flag = 0;
1067 sagan_log(config, 0, "After SID %s by destination IP address. [%s]", afterbysrc[i].sid, ip_dst);
1068 counters->after_total++;
1069 }
1070 }
1071 }
1072
1073 /* If not found, add it to the array */
1074
1075 if ( after_flag == 0 ) {
1076 afterbydst = (after_by_dst *) realloc(afterbydst, (after_count_by_dst+1) * sizeof(after_by_dst));
1077 snprintf(afterbydst[after_count_by_dst].ipdst, sizeof(afterbydst[after_count_by_dst].ipdst), "%s", ip_dst);
1078 snprintf(afterbydst[after_count_by_dst].sid, sizeof(afterbydst[after_count_by_dst].sid), "%s", rulestruct[b].s_sid );
1079 afterbydst[after_count_by_dst].count = 1;
1080 afterbydst[after_count_by_dst].utime = atol(timet);
1081 after_count_by_dst++;
1082 }
1083 }
1084
1085} /* End of After */
1086
1087
1088thresh_log_flag = 0;
1089
1090/*********************************************************/
1091/* Thresh holding */
1092/*********************************************************/
1093
1094if ( rulestruct[b].threshold_type != 0 && after_log_flag == 0) {
1095
1096 t = time(NULL);
1097 now=localtime(&t);
1098 strftime(timet, sizeof(timet), "%s", now);
1099
1100 /* Thresholding by source IP address */
1101
1102 if ( rulestruct[b].threshold_src_or_dst == 1 ) {
1103 thresh_flag = 0;
1104
1105 /* Check array for matching src / sid */
1106
1107 for (i = 0; i < thresh_count_by_src; i++ ) {
1108 if (!strcmp( threshbysrc[i].ipsrc, ip_src ) && !strcmp(threshbysrc[i].sid, rulestruct[b].s_sid )) {
1109 thresh_flag=1;
1110 threshbysrc[i].count++;
1111 thresh_oldtime_src = atol(timet) - threshbysrc[i].utime;
1112 threshbysrc[i].utime = atol(timet);
1113 if ( thresh_oldtime_src > rulestruct[b].threshold_seconds ) {
1114 threshbysrc[i].count=1;
1115 threshbysrc[i].utime = atol(timet);
1116 thresh_log_flag=0;
1117 }
1118
1119 if ( rulestruct[b].threshold_count < threshbysrc[i].count )
1120 {
1121 thresh_log_flag = 1;
1122 sagan_log(config, 0, "Threshold SID %s by source IP address. [%s]", threshbysrc[i].sid, ip_src);
1123 counters->threshold_total++;
1124 }
1125
1126 }
1127 }
1128
1129 /* If not found, add it to the array */
1130
1131 if ( thresh_flag == 0 ) {
1132 threshbysrc = (thresh_by_src *) realloc(threshbysrc, (thresh_count_by_src+1) * sizeof(thresh_by_src));
1133 snprintf(threshbysrc[thresh_count_by_src].ipsrc, sizeof(threshbysrc[thresh_count_by_src].ipsrc), "%s", ip_src);
1134 snprintf(threshbysrc[thresh_count_by_src].sid, sizeof(threshbysrc[thresh_count_by_src].sid), "%s", rulestruct[b].s_sid );
1135 threshbysrc[thresh_count_by_src].count = 1;
1136 threshbysrc[thresh_count_by_src].utime = atol(timet);
1137 thresh_count_by_src++;
1138 }
1139 }
1140
1141 /* Thresholding by destination IP address */
1142
1143 if ( rulestruct[b].threshold_src_or_dst == 2 ) {
1144 thresh_flag = 0;
1145
1146 /* Check array for matching src / sid */
1147
1148 for (i = 0; i < thresh_count_by_dst; i++ ) {
1149 if (!strcmp( threshbydst[i].ipdst, ip_dst ) && !strcmp(threshbydst[i].sid, rulestruct[b].s_sid )) {
1150 thresh_flag=1;
1151 threshbydst[i].count++;
1152 thresh_oldtime_src = atol(timet) - threshbydst[i].utime;
1153 threshbydst[i].utime = atol(timet);
1154 if ( thresh_oldtime_src > rulestruct[b].threshold_seconds ) {
1155 threshbydst[i].count=1;
1156 threshbydst[i].utime = atol(timet);
1157 thresh_log_flag=0;
1158 }
1159
1160 if ( rulestruct[b].threshold_count < threshbydst[i].count ) {
1161 thresh_log_flag = 1;
1162 sagan_log(config, 0, "Threshold SID %s by destination IP address. [%s]", threshbysrc[i].sid, ip_dst);
1163 counters->threshold_total++;
1164 }
1165 }
1166 }
1167
1168 /* If not found, add it to the array */
1169
1170 if ( thresh_flag == 0 ) {
1171 threshbydst = (thresh_by_dst *) realloc(threshbydst, (thresh_count_by_dst+1) * sizeof(thresh_by_dst));
1172 snprintf(threshbydst[thresh_count_by_dst].ipdst, sizeof(threshbydst[thresh_count_by_dst].ipdst), "%s", ip_dst);
1173 snprintf(threshbydst[thresh_count_by_dst].sid, sizeof(threshbydst[thresh_count_by_dst].sid), "%s", rulestruct[b].s_sid );
1174 threshbydst[thresh_count_by_dst].count = 1;
1175 threshbydst[thresh_count_by_dst].utime = atol(timet);
1176 thresh_count_by_dst++;
1177 }
1178 }
1179} /* End of thresholding */
1180
1181
1182/****************************************************************************/
1183/* Populate the SaganEvent array with the information needed. This info */
1184/* will be passed to the threads. No need to populate it _if_ we're in a */
1185/* threshold state. */
1186/****************************************************************************/
1187
1188/* Check for thesholding & "after" */
1189
1190if ( thresh_log_flag == 0 && after_log_flag == 0 ) {
1191
1192threadid++;
1193if ( threadid >= MAX_THREADS ) threadid=0;
1194
1195msgslot++;
1196if ( msgslot >= MAX_MSGSLOT ) msgslot=0;
1197
1198/* We can't use the pointers from our syslog data. If two (or more) event's
1199 * fire at the same time, the two alerts will have corrupted information
1200 * (due to threading). So we populate the SaganEvent[threadid] with the
1201 * var[msgslot] information. - Champ Clark 02/02/2011
1202 */
1203
1204snprintf(sysmsg[msgslot], sizeof(sysmsg[msgslot]), "%s", syslog_msg);
1205snprintf(syslog_timetmp[msgslot], sizeof(syslog_timetmp[msgslot]), "%s", syslog_time);
1206snprintf(syslog_datetmp[msgslot], sizeof(syslog_datetmp[msgslot]), "%s", syslog_date);
1207snprintf(syslog_leveltmp[msgslot], sizeof(syslog_leveltmp[msgslot]), "%s", syslog_level);
1208snprintf(syslog_tagtmp[msgslot], sizeof(syslog_tagtmp[msgslot]), "%s", syslog_tag);
1209snprintf(syslog_facilitytmp[msgslot], sizeof(syslog_facilitytmp[msgslot]), "%s", syslog_facility);
1210snprintf(syslog_programtmp[msgslot], sizeof(syslog_programtmp[msgslot]), "%s", syslog_program);
1211snprintf(ip_srctmp[msgslot], sizeof(ip_srctmp[msgslot]), "%s", ip_src);
1212snprintf(ip_dsttmp[msgslot], sizeof(ip_dsttmp[msgslot]), "%s", ip_dst);
1213snprintf(syslog_hosttmp[msgslot], sizeof(syslog_hosttmp[msgslot]), "%s", syslog_host);
1214snprintf(s_msgtmp[msgslot], sizeof(s_msgtmp[msgslot]), "%s", s_msg);
1215src_porttmp[msgslot] = src_port;
1216dst_porttmp[msgslot] = dst_port;
1217
1218SaganEvent[threadid].ip_src = ip_srctmp[msgslot];
1219SaganEvent[threadid].ip_dst = ip_dsttmp[msgslot];
1220SaganEvent[threadid].dst_port = dst_porttmp[msgslot];
1221SaganEvent[threadid].src_port = src_porttmp[msgslot];
1222SaganEvent[threadid].found = b;
1223SaganEvent[threadid].program = syslog_programtmp[msgslot];
1224SaganEvent[threadid].message = sysmsg[msgslot];
1225SaganEvent[threadid].time = syslog_timetmp[msgslot];
1226SaganEvent[threadid].date = syslog_datetmp[msgslot];
1227SaganEvent[threadid].f_msg = s_msgtmp[msgslot];
1228SaganEvent[threadid].facility = syslog_facilitytmp[msgslot];
1229SaganEvent[threadid].priority = syslog_leveltmp[msgslot];
1230SaganEvent[threadid].tag = syslog_tagtmp[msgslot];
1231SaganEvent[threadid].host = syslog_hosttmp[msgslot];
1232SaganEvent[threadid].event_time_sec = time(NULL);
1233
1234SaganEvent[threadid].debug = debug;
1235SaganEvent[threadid].config = config;
1236
1237}
1238
1239/***************************************************************************/
1240/* Output plugins that cannot be threaded and require little I/O (almost */
1241/* no I/O blocking) - IE - unified2/ASCII alerts */
1242/***************************************************************************/
1243
1244/* If thresholding isn't happening, send to output plugins */
1245
1246if ( thresh_log_flag == 0 && after_log_flag == 0 ) {
1247
1248sagan_alert( &SaganEvent[threadid] ); /*
1249
1250/* Log to unified2 output (if enabled and have libdnet). */
1251
1252#ifdef HAVE_LIBDNET
1253if ( config->sagan_unified2_flag ) {
1254if ( thresh_log_flag == 0 && after_log_flag == 0 ) Sagan_Unified2( &SaganEvent[threadid] );
1255if ( thresh_log_flag == 0 && after_log_flag == 0 ) Sagan_Unified2LogPacketAlert( &SaganEvent[threadid] );
1256}
1257#endif
1258
1259/****************************************************************************/
1260/* Output Plugin Threads - This is for output plugins like SQL/etc that */
1261/* might cause some I/O blocking */
1262/****************************************************************************/
1263
1264if ( config->output_thread_flag ) {
1265
1266if ( counters->thread_output_counter < config->max_output_threads ) {
1267
1268 counters->thread_output_counter++;
1269
1270if ( pthread_create ( &output_id[threadid], &thread_output_attr, (void *)sagan_output, &SaganEvent[threadid] ) ) {
1271 removelockfile(config);
1272 sagan_log(config, 1, "[%s, line %d] Error creating output-plugin thread", __FILE__, __LINE__);
1273 }
1274} else {
1275 counters->sagan_output_drop++;
1276 sagan_log(config, 0, "[%s, line %d] sagan_output(): Out of threads\n", __FILE__, __LINE__);
1277 }
1278}
1279
1280
1281/****************************************************************************/
1282/* Log Processors that might take valuable CPU time (Geo IP, etc) */
1283/* Not sure if this section will remain here or not. We might end up with */
1284/* "processors" and "preprocessors" - Champ Clark III 04/04/2012 */
1285/****************************************************************************/
1286
1287if ( config->processor_thread_flag ) {
1288
1289if ( counters->thread_processor_counter < config->max_processor_threads ) {
1290
1291 counters->thread_processor_counter++;
1292
1293if ( pthread_create ( &processor_id[threadid], &thread_processor_attr, (void *)sagan_processor, &SaganEvent[threadid] ) ) {
1294 removelockfile(config);
1295 sagan_log(config, 1, "[%s, line %d] Error creating processor-plugin thread", __FILE__, __LINE__);
1296 }
1297} else {
1298 counters->sagan_processor_drop++;
1299 sagan_log(config, 0, "[%s, line %d] sagan_processor(): Out of threads\n", __FILE__, __LINE__);
1300}
1301}
1302
1303
1304
1305 } /* End of threshold */
1306 } /* End of match */
1307} /* End of pcre match */
1308
1309match=0; /* Reset match! */
1310pcrematch=0;
1311rc=0;
1312} /* End for for loop */
1313
1314syslogstring[0]='\0'; /* Reset values */
1315syslogtmp[0]='\0';
1316}
1317
1318} /* End of while(1) */
1319
1320} /* End of main */
1321
1322
13230
=== removed file '.pc/applied-patches'
--- .pc/applied-patches 2011-12-17 16:04:27 +0000
+++ .pc/applied-patches 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
101-do-not-include-lognorm-private-header.patch
20
=== modified file 'AUTHORS'
--- AUTHORS 2011-12-17 16:04:27 +0000
+++ AUTHORS 2014-11-22 20:03:11 +0000
@@ -1,4 +1,3 @@
1
2Primary code development was done by Champ Clark III (champ@quadrantsec.com).1Primary code development was done by Champ Clark III (champ@quadrantsec.com).
32
4Many people have contributed to the project. I'm hoping in the future3Many people have contributed to the project. I'm hoping in the future
54
=== modified file 'FAQ'
--- FAQ 2011-12-17 16:04:27 +0000
+++ FAQ 2014-11-22 20:03:11 +0000
@@ -1,4 +1,1 @@
1For the Sagan FAQ, please see:1See http://sagan.quadrantsec.com
2
3https://wiki.quadrantsec.com/bin/view/Main/SaganFAQ
4
52
=== modified file 'INSTALL'
--- INSTALL 2012-04-16 22:33:24 +0000
+++ INSTALL 2014-11-22 20:03:11 +0000
@@ -1,8 +1,8 @@
1Installation Instructions1Installation Instructions
2*************************2*************************
33
4Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,4Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
52006, 2007, 2008, 2009 Free Software Foundation, Inc.5Inc.
66
7 Copying and distribution of this file, with or without modification,7 Copying and distribution of this file, with or without modification,
8are permitted in any medium without royalty provided the copyright8are permitted in any medium without royalty provided the copyright
@@ -12,8 +12,8 @@
12Basic Installation12Basic Installation
13==================13==================
1414
15 Briefly, the shell commands `./configure; make; make install' should15 Briefly, the shell command `./configure && make && make install'
16configure, build, and install this package. The following16should configure, build, and install this package. The following
17more-detailed instructions are generic; see the `README' file for17more-detailed instructions are generic; see the `README' file for
18instructions specific to this package. Some packages provide this18instructions specific to this package. Some packages provide this
19`INSTALL' file but do not implement all of the features documented19`INSTALL' file but do not implement all of the features documented
@@ -226,6 +226,11 @@
226226
227and if that doesn't work, install pre-built binaries of GCC for HP-UX.227and if that doesn't work, install pre-built binaries of GCC for HP-UX.
228228
229 HP-UX `make' updates targets which have the same time stamps as
230their prerequisites, which makes it generally unusable when shipped
231generated files such as `configure' are involved. Use GNU `make'
232instead.
233
229 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot234 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
230parse its `<wchar.h>' header file. The option `-nodtk' can be used as235parse its `<wchar.h>' header file. The option `-nodtk' can be used as
231a workaround. If GNU CC is not installed, it is therefore recommended236a workaround. If GNU CC is not installed, it is therefore recommended
@@ -304,9 +309,10 @@
304overridden in the site shell script).309overridden in the site shell script).
305310
306Unfortunately, this technique does not work for `CONFIG_SHELL' due to311Unfortunately, this technique does not work for `CONFIG_SHELL' due to
307an Autoconf bug. Until the bug is fixed you can use this workaround:312an Autoconf limitation. Until the limitation is lifted, you can use
313this workaround:
308314
309 CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash315 CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
310316
311`configure' Invocation317`configure' Invocation
312======================318======================
@@ -362,4 +368,3 @@
362368
363`configure' also accepts some other, not widely useful, options. Run369`configure' also accepts some other, not widely useful, options. Run
364`configure --help' for more details.370`configure --help' for more details.
365
366371
=== added file 'Makefile'
--- Makefile 1970-01-01 00:00:00 +0000
+++ Makefile 2014-11-22 20:03:11 +0000
@@ -0,0 +1,805 @@
1# Makefile.in generated by automake 1.14.1 from Makefile.am.
2# Makefile. Generated from Makefile.in by configure.
3
4# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
6# This Makefile.in is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13# PARTICULAR PURPOSE.
14
15
16
17am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
18am__make_running_with_option = \
19 case $${target_option-} in \
20 ?) ;; \
21 *) echo "am__make_running_with_option: internal error: invalid" \
22 "target option '$${target_option-}' specified" >&2; \
23 exit 1;; \
24 esac; \
25 has_opt=no; \
26 sane_makeflags=$$MAKEFLAGS; \
27 if $(am__is_gnu_make); then \
28 sane_makeflags=$$MFLAGS; \
29 else \
30 case $$MAKEFLAGS in \
31 *\\[\ \ ]*) \
32 bs=\\; \
33 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
34 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
35 esac; \
36 fi; \
37 skip_next=no; \
38 strip_trailopt () \
39 { \
40 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
41 }; \
42 for flg in $$sane_makeflags; do \
43 test $$skip_next = yes && { skip_next=no; continue; }; \
44 case $$flg in \
45 *=*|--*) continue;; \
46 -*I) strip_trailopt 'I'; skip_next=yes;; \
47 -*I?*) strip_trailopt 'I';; \
48 -*O) strip_trailopt 'O'; skip_next=yes;; \
49 -*O?*) strip_trailopt 'O';; \
50 -*l) strip_trailopt 'l'; skip_next=yes;; \
51 -*l?*) strip_trailopt 'l';; \
52 -[dEDm]) skip_next=yes;; \
53 -[JT]) skip_next=yes;; \
54 esac; \
55 case $$flg in \
56 *$$target_option*) has_opt=yes; break;; \
57 esac; \
58 done; \
59 test $$has_opt = yes
60am__make_dryrun = (target_option=n; $(am__make_running_with_option))
61am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
62pkgdatadir = $(datadir)/sagan
63pkgincludedir = $(includedir)/sagan
64pkglibdir = $(libdir)/sagan
65pkglibexecdir = $(libexecdir)/sagan
66am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
67install_sh_DATA = $(install_sh) -c -m 644
68install_sh_PROGRAM = $(install_sh) -c
69install_sh_SCRIPT = $(install_sh) -c
70INSTALL_HEADER = $(INSTALL_DATA)
71transform = $(program_transform_name)
72NORMAL_INSTALL = :
73PRE_INSTALL = :
74POST_INSTALL = :
75NORMAL_UNINSTALL = :
76PRE_UNINSTALL = :
77POST_UNINSTALL = :
78build_triplet = x86_64-unknown-linux-gnu
79host_triplet = x86_64-unknown-linux-gnu
80target_triplet = x86_64-unknown-linux-gnu
81subdir = .
82DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
83 $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
84 $(top_srcdir)/configure $(am__configure_deps) \
85 $(srcdir)/config.h.in COPYING TODO compile config.guess \
86 config.sub depcomp install-sh missing
87ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
88am__aclocal_m4_deps = $(top_srcdir)/configure.ac
89am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
90 $(ACLOCAL_M4)
91am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
92 configure.lineno config.status.lineno
93mkinstalldirs = $(install_sh) -d
94CONFIG_HEADER = config.h
95CONFIG_CLEAN_FILES =
96CONFIG_CLEAN_VPATH_FILES =
97AM_V_P = $(am__v_P_$(V))
98am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
99am__v_P_0 = false
100am__v_P_1 = :
101AM_V_GEN = $(am__v_GEN_$(V))
102am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
103am__v_GEN_0 = @echo " GEN " $@;
104am__v_GEN_1 =
105AM_V_at = $(am__v_at_$(V))
106am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
107am__v_at_0 = @
108am__v_at_1 =
109SOURCES =
110DIST_SOURCES =
111RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
112 ctags-recursive dvi-recursive html-recursive info-recursive \
113 install-data-recursive install-dvi-recursive \
114 install-exec-recursive install-html-recursive \
115 install-info-recursive install-pdf-recursive \
116 install-ps-recursive install-recursive installcheck-recursive \
117 installdirs-recursive pdf-recursive ps-recursive \
118 tags-recursive uninstall-recursive
119am__can_run_installinfo = \
120 case $$AM_UPDATE_INFO_DIR in \
121 n|no|NO) false;; \
122 *) (install-info --version) >/dev/null 2>&1;; \
123 esac
124RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
125 distclean-recursive maintainer-clean-recursive
126am__recursive_targets = \
127 $(RECURSIVE_TARGETS) \
128 $(RECURSIVE_CLEAN_TARGETS) \
129 $(am__extra_recursive_targets)
130AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
131 cscope distdir dist dist-all distcheck
132am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
133 $(LISP)config.h.in
134# Read a list of newline-separated strings from the standard input,
135# and print each of them once, without duplicates. Input order is
136# *not* preserved.
137am__uniquify_input = $(AWK) '\
138 BEGIN { nonempty = 0; } \
139 { items[$$0] = 1; nonempty = 1; } \
140 END { if (nonempty) { for (i in items) print i; }; } \
141'
142# Make sure the list of sources is unique. This is necessary because,
143# e.g., the same source file might be shared among _SOURCES variables
144# for different programs/libraries.
145am__define_uniq_tagged_files = \
146 list='$(am__tagged_files)'; \
147 unique=`for i in $$list; do \
148 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
149 done | $(am__uniquify_input)`
150ETAGS = etags
151CTAGS = ctags
152CSCOPE = cscope
153DIST_SUBDIRS = $(SUBDIRS)
154DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
155distdir = $(PACKAGE)-$(VERSION)
156top_distdir = $(distdir)
157am__remove_distdir = \
158 if test -d "$(distdir)"; then \
159 find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
160 && rm -rf "$(distdir)" \
161 || { sleep 5 && rm -rf "$(distdir)"; }; \
162 else :; fi
163am__post_remove_distdir = $(am__remove_distdir)
164am__relativize = \
165 dir0=`pwd`; \
166 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
167 sed_rest='s,^[^/]*/*,,'; \
168 sed_last='s,^.*/\([^/]*\)$$,\1,'; \
169 sed_butlast='s,/*[^/]*$$,,'; \
170 while test -n "$$dir1"; do \
171 first=`echo "$$dir1" | sed -e "$$sed_first"`; \
172 if test "$$first" != "."; then \
173 if test "$$first" = ".."; then \
174 dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
175 dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
176 else \
177 first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
178 if test "$$first2" = "$$first"; then \
179 dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
180 else \
181 dir2="../$$dir2"; \
182 fi; \
183 dir0="$$dir0"/"$$first"; \
184 fi; \
185 fi; \
186 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
187 done; \
188 reldir="$$dir2"
189DIST_ARCHIVES = $(distdir).tar.gz
190GZIP_ENV = --best
191DIST_TARGETS = dist-gzip
192distuninstallcheck_listfiles = find . -type f -print
193am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
194 | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
195distcleancheck_listfiles = find . -type f -print
196ACLOCAL = ${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing aclocal-1.14
197AMTAR = $${TAR-tar}
198AM_DEFAULT_VERBOSITY = 1
199AUTOCONF = ${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing autoconf
200AUTOHEADER = ${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing autoheader
201AUTOMAKE = ${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing automake-1.14
202AWK = gawk
203CC = gcc
204CCDEPMODE = depmode=gcc3
205CFLAGS = -g -O2
206CPP = gcc -E
207CPPFLAGS =
208CYGPATH_W = echo
209DEFS = -DHAVE_CONFIG_H
210DEPDIR = .deps
211ECHO_C =
212ECHO_N = -n
213ECHO_T =
214EGREP = /bin/grep -E
215ENDIAN = little
216EXEEXT =
217GREP = /bin/grep
218INSTALL = /usr/bin/install -c
219INSTALL_DATA = ${INSTALL} -m 644
220INSTALL_PROGRAM = ${INSTALL}
221INSTALL_SCRIPT = ${INSTALL}
222INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
223JSON_C_CFLAGS = -I/usr/include/json
224JSON_C_LIBS = -ljson
225LDFLAGS =
226LIBESTR_CFLAGS =
227LIBESTR_LIBS = -L/usr/lib -lestr
228LIBLOGNORM_CFLAGS =
229LIBLOGNORM_LIBS = -L/usr/lib -llognorm -lestr
230LIBOBJS =
231LIBS = -ldnet -llognorm -lestr -lm -lpthread -lpcre
232LTLIBOBJS =
233MAINT = #
234MAKEINFO = ${SHELL} /home/champ/code/release-1.0.0RC4/sagan/missing makeinfo
235MKDIR_P = /bin/mkdir -p
236OBJEXT = o
237PACKAGE = sagan
238PACKAGE_BUGREPORT =
239PACKAGE_NAME =
240PACKAGE_STRING =
241PACKAGE_TARNAME =
242PACKAGE_URL =
243PACKAGE_VERSION =
244PATH_SEPARATOR = :
245PKG_CONFIG = /usr/bin/pkg-config
246PKG_CONFIG_LIBDIR =
247PKG_CONFIG_PATH =
248SET_MAKE =
249SHELL = /bin/sh
250STRIP =
251VERSION = 1.0.0-RC4
252abs_builddir = /home/champ/code/release-1.0.0RC4/sagan
253abs_srcdir = /home/champ/code/release-1.0.0RC4/sagan
254abs_top_builddir = /home/champ/code/release-1.0.0RC4/sagan
255abs_top_srcdir = /home/champ/code/release-1.0.0RC4/sagan
256ac_ct_CC = gcc
257am__include = include
258am__leading_dot = .
259am__quote =
260am__tar = $${TAR-tar} chof - "$$tardir"
261am__untar = $${TAR-tar} xf -
262bindir = ${exec_prefix}/bin
263build = x86_64-unknown-linux-gnu
264build_alias =
265build_cpu = x86_64
266build_os = linux-gnu
267build_vendor = unknown
268builddir = .
269datadir = ${datarootdir}
270datarootdir = ${prefix}/share
271docdir = ${datarootdir}/doc/${PACKAGE}
272dvidir = ${docdir}
273exec_prefix = ${prefix}
274host = x86_64-unknown-linux-gnu
275host_alias =
276host_cpu = x86_64
277host_os = linux-gnu
278host_vendor = unknown
279htmldir = ${docdir}
280includedir = ${prefix}/include
281infodir = ${datarootdir}/info
282install_sh = ${SHELL} /home/champ/code/release-1.0.0RC4/sagan/install-sh
283libdir = ${exec_prefix}/lib
284libexecdir = ${exec_prefix}/libexec
285localedir = ${datarootdir}/locale
286localstatedir = ${prefix}/var
287mandir = ${datarootdir}/man
288mkdir_p = $(MKDIR_P)
289oldincludedir = /usr/include
290pdfdir = ${docdir}
291prefix = /usr/local
292program_transform_name = s,x,x,
293psdir = ${docdir}
294sbindir = ${exec_prefix}/sbin
295sharedstatedir = ${prefix}/com
296srcdir = .
297sysconfdir = ${prefix}/etc
298target = x86_64-unknown-linux-gnu
299target_alias =
300target_cpu = x86_64
301target_os = linux-gnu
302target_vendor = unknown
303top_build_prefix =
304top_builddir = .
305top_srcdir = .
306AUTOMAKE_OPIONS = foreign no-dependencies
307SUBDIRS = src
308INCLUDES = @INCLUDES@
309all: config.h
310 $(MAKE) $(AM_MAKEFLAGS) all-recursive
311
312.SUFFIXES:
313am--refresh: Makefile
314 @:
315$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps)
316 @for dep in $?; do \
317 case '$(am__configure_deps)' in \
318 *$$dep*) \
319 echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
320 $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
321 && exit 0; \
322 exit 1;; \
323 esac; \
324 done; \
325 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
326 $(am__cd) $(top_srcdir) && \
327 $(AUTOMAKE) --gnu Makefile
328.PRECIOUS: Makefile
329Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
330 @case '$?' in \
331 *config.status*) \
332 echo ' $(SHELL) ./config.status'; \
333 $(SHELL) ./config.status;; \
334 *) \
335 echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
336 cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
337 esac;
338
339$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
340 $(SHELL) ./config.status --recheck
341
342$(top_srcdir)/configure: # $(am__configure_deps)
343 $(am__cd) $(srcdir) && $(AUTOCONF)
344$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
345 $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
346$(am__aclocal_m4_deps):
347
348config.h: stamp-h1
349 @test -f $@ || rm -f stamp-h1
350 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
351
352stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
353 @rm -f stamp-h1
354 cd $(top_builddir) && $(SHELL) ./config.status config.h
355$(srcdir)/config.h.in: # $(am__configure_deps)
356 ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
357 rm -f stamp-h1
358 touch $@
359
360distclean-hdr:
361 -rm -f config.h stamp-h1
362
363# This directory's subdirectories are mostly independent; you can cd
364# into them and run 'make' without going through this Makefile.
365# To change the values of 'make' variables: instead of editing Makefiles,
366# (1) if the variable is set in 'config.status', edit 'config.status'
367# (which will cause the Makefiles to be regenerated when you run 'make');
368# (2) otherwise, pass the desired values on the 'make' command line.
369$(am__recursive_targets):
370 @fail=; \
371 if $(am__make_keepgoing); then \
372 failcom='fail=yes'; \
373 else \
374 failcom='exit 1'; \
375 fi; \
376 dot_seen=no; \
377 target=`echo $@ | sed s/-recursive//`; \
378 case "$@" in \
379 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
380 *) list='$(SUBDIRS)' ;; \
381 esac; \
382 for subdir in $$list; do \
383 echo "Making $$target in $$subdir"; \
384 if test "$$subdir" = "."; then \
385 dot_seen=yes; \
386 local_target="$$target-am"; \
387 else \
388 local_target="$$target"; \
389 fi; \
390 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
391 || eval $$failcom; \
392 done; \
393 if test "$$dot_seen" = "no"; then \
394 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
395 fi; test -z "$$fail"
396
397ID: $(am__tagged_files)
398 $(am__define_uniq_tagged_files); mkid -fID $$unique
399tags: tags-recursive
400TAGS: tags
401
402tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
403 set x; \
404 here=`pwd`; \
405 if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
406 include_option=--etags-include; \
407 empty_fix=.; \
408 else \
409 include_option=--include; \
410 empty_fix=; \
411 fi; \
412 list='$(SUBDIRS)'; for subdir in $$list; do \
413 if test "$$subdir" = .; then :; else \
414 test ! -f $$subdir/TAGS || \
415 set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
416 fi; \
417 done; \
418 $(am__define_uniq_tagged_files); \
419 shift; \
420 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
421 test -n "$$unique" || unique=$$empty_fix; \
422 if test $$# -gt 0; then \
423 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
424 "$$@" $$unique; \
425 else \
426 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
427 $$unique; \
428 fi; \
429 fi
430ctags: ctags-recursive
431
432CTAGS: ctags
433ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
434 $(am__define_uniq_tagged_files); \
435 test -z "$(CTAGS_ARGS)$$unique" \
436 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
437 $$unique
438
439GTAGS:
440 here=`$(am__cd) $(top_builddir) && pwd` \
441 && $(am__cd) $(top_srcdir) \
442 && gtags -i $(GTAGS_ARGS) "$$here"
443cscope: cscope.files
444 test ! -s cscope.files \
445 || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
446clean-cscope:
447 -rm -f cscope.files
448cscope.files: clean-cscope cscopelist
449cscopelist: cscopelist-recursive
450
451cscopelist-am: $(am__tagged_files)
452 list='$(am__tagged_files)'; \
453 case "$(srcdir)" in \
454 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
455 *) sdir=$(subdir)/$(srcdir) ;; \
456 esac; \
457 for i in $$list; do \
458 if test -f "$$i"; then \
459 echo "$(subdir)/$$i"; \
460 else \
461 echo "$$sdir/$$i"; \
462 fi; \
463 done >> $(top_builddir)/cscope.files
464
465distclean-tags:
466 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
467 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
468
469distdir: $(DISTFILES)
470 $(am__remove_distdir)
471 test -d "$(distdir)" || mkdir "$(distdir)"
472 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
473 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
474 list='$(DISTFILES)'; \
475 dist_files=`for file in $$list; do echo $$file; done | \
476 sed -e "s|^$$srcdirstrip/||;t" \
477 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
478 case $$dist_files in \
479 */*) $(MKDIR_P) `echo "$$dist_files" | \
480 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
481 sort -u` ;; \
482 esac; \
483 for file in $$dist_files; do \
484 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
485 if test -d $$d/$$file; then \
486 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
487 if test -d "$(distdir)/$$file"; then \
488 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
489 fi; \
490 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
491 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
492 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
493 fi; \
494 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
495 else \
496 test -f "$(distdir)/$$file" \
497 || cp -p $$d/$$file "$(distdir)/$$file" \
498 || exit 1; \
499 fi; \
500 done
501 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
502 if test "$$subdir" = .; then :; else \
503 $(am__make_dryrun) \
504 || test -d "$(distdir)/$$subdir" \
505 || $(MKDIR_P) "$(distdir)/$$subdir" \
506 || exit 1; \
507 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
508 $(am__relativize); \
509 new_distdir=$$reldir; \
510 dir1=$$subdir; dir2="$(top_distdir)"; \
511 $(am__relativize); \
512 new_top_distdir=$$reldir; \
513 echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
514 echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
515 ($(am__cd) $$subdir && \
516 $(MAKE) $(AM_MAKEFLAGS) \
517 top_distdir="$$new_top_distdir" \
518 distdir="$$new_distdir" \
519 am__remove_distdir=: \
520 am__skip_length_check=: \
521 am__skip_mode_fix=: \
522 distdir) \
523 || exit 1; \
524 fi; \
525 done
526 -test -n "$(am__skip_mode_fix)" \
527 || find "$(distdir)" -type d ! -perm -755 \
528 -exec chmod u+rwx,go+rx {} \; -o \
529 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
530 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
531 ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
532 || chmod -R a+r "$(distdir)"
533dist-gzip: distdir
534 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
535 $(am__post_remove_distdir)
536
537dist-bzip2: distdir
538 tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
539 $(am__post_remove_distdir)
540
541dist-lzip: distdir
542 tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
543 $(am__post_remove_distdir)
544
545dist-xz: distdir
546 tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
547 $(am__post_remove_distdir)
548
549dist-tarZ: distdir
550 @echo WARNING: "Support for shar distribution archives is" \
551 "deprecated." >&2
552 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
553 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
554 $(am__post_remove_distdir)
555
556dist-shar: distdir
557 @echo WARNING: "Support for distribution archives compressed with" \
558 "legacy program 'compress' is deprecated." >&2
559 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
560 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
561 $(am__post_remove_distdir)
562
563dist-zip: distdir
564 -rm -f $(distdir).zip
565 zip -rq $(distdir).zip $(distdir)
566 $(am__post_remove_distdir)
567
568dist dist-all:
569 $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
570 $(am__post_remove_distdir)
571
572# This target untars the dist file and tries a VPATH configuration. Then
573# it guarantees that the distribution is self-contained by making another
574# tarfile.
575distcheck: dist
576 case '$(DIST_ARCHIVES)' in \
577 *.tar.gz*) \
578 GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
579 *.tar.bz2*) \
580 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
581 *.tar.lz*) \
582 lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
583 *.tar.xz*) \
584 xz -dc $(distdir).tar.xz | $(am__untar) ;;\
585 *.tar.Z*) \
586 uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
587 *.shar.gz*) \
588 GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
589 *.zip*) \
590 unzip $(distdir).zip ;;\
591 esac
592 chmod -R a-w $(distdir)
593 chmod u+w $(distdir)
594 mkdir $(distdir)/_build $(distdir)/_inst
595 chmod a-w $(distdir)
596 test -d $(distdir)/_build || exit 0; \
597 dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
598 && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
599 && am__cwd=`pwd` \
600 && $(am__cd) $(distdir)/_build \
601 && ../configure \
602 $(AM_DISTCHECK_CONFIGURE_FLAGS) \
603 $(DISTCHECK_CONFIGURE_FLAGS) \
604 --srcdir=.. --prefix="$$dc_install_base" \
605 && $(MAKE) $(AM_MAKEFLAGS) \
606 && $(MAKE) $(AM_MAKEFLAGS) dvi \
607 && $(MAKE) $(AM_MAKEFLAGS) check \
608 && $(MAKE) $(AM_MAKEFLAGS) install \
609 && $(MAKE) $(AM_MAKEFLAGS) installcheck \
610 && $(MAKE) $(AM_MAKEFLAGS) uninstall \
611 && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
612 distuninstallcheck \
613 && chmod -R a-w "$$dc_install_base" \
614 && ({ \
615 (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
616 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
617 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
618 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
619 distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
620 } || { rm -rf "$$dc_destdir"; exit 1; }) \
621 && rm -rf "$$dc_destdir" \
622 && $(MAKE) $(AM_MAKEFLAGS) dist \
623 && rm -rf $(DIST_ARCHIVES) \
624 && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
625 && cd "$$am__cwd" \
626 || exit 1
627 $(am__post_remove_distdir)
628 @(echo "$(distdir) archives ready for distribution: "; \
629 list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
630 sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
631distuninstallcheck:
632 @test -n '$(distuninstallcheck_dir)' || { \
633 echo 'ERROR: trying to run $@ with an empty' \
634 '$$(distuninstallcheck_dir)' >&2; \
635 exit 1; \
636 }; \
637 $(am__cd) '$(distuninstallcheck_dir)' || { \
638 echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
639 exit 1; \
640 }; \
641 test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
642 || { echo "ERROR: files left after uninstall:" ; \
643 if test -n "$(DESTDIR)"; then \
644 echo " (check DESTDIR support)"; \
645 fi ; \
646 $(distuninstallcheck_listfiles) ; \
647 exit 1; } >&2
648distcleancheck: distclean
649 @if test '$(srcdir)' = . ; then \
650 echo "ERROR: distcleancheck can only run from a VPATH build" ; \
651 exit 1 ; \
652 fi
653 @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
654 || { echo "ERROR: files left in build directory after distclean:" ; \
655 $(distcleancheck_listfiles) ; \
656 exit 1; } >&2
657check-am: all-am
658check: check-recursive
659all-am: Makefile config.h
660installdirs: installdirs-recursive
661installdirs-am:
662install: install-recursive
663install-exec: install-exec-recursive
664install-data: install-data-recursive
665uninstall: uninstall-recursive
666
667install-am: all-am
668 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
669
670installcheck: installcheck-recursive
671install-strip:
672 if test -z '$(STRIP)'; then \
673 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
674 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
675 install; \
676 else \
677 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
678 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
679 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
680 fi
681mostlyclean-generic:
682
683clean-generic:
684
685distclean-generic:
686 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
687 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
688
689maintainer-clean-generic:
690 @echo "This command is intended for maintainers to use"
691 @echo "it deletes files that may require special tools to rebuild."
692clean: clean-recursive
693
694clean-am: clean-generic mostlyclean-am
695
696distclean: distclean-recursive
697 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
698 -rm -f Makefile
699distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
700
701dvi: dvi-recursive
702
703dvi-am:
704
705html: html-recursive
706
707html-am:
708
709info: info-recursive
710
711info-am:
712
713install-data-am: install-data-local
714
715install-dvi: install-dvi-recursive
716
717install-dvi-am:
718
719install-exec-am:
720
721install-html: install-html-recursive
722
723install-html-am:
724
725install-info: install-info-recursive
726
727install-info-am:
728
729install-man:
730
731install-pdf: install-pdf-recursive
732
733install-pdf-am:
734
735install-ps: install-ps-recursive
736
737install-ps-am:
738
739installcheck-am:
740
741maintainer-clean: maintainer-clean-recursive
742 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
743 -rm -rf $(top_srcdir)/autom4te.cache
744 -rm -f Makefile
745maintainer-clean-am: distclean-am maintainer-clean-generic
746
747mostlyclean: mostlyclean-recursive
748
749mostlyclean-am: mostlyclean-generic
750
751pdf: pdf-recursive
752
753pdf-am:
754
755ps: ps-recursive
756
757ps-am:
758
759uninstall-am:
760
761.MAKE: $(am__recursive_targets) all install-am install-strip
762
763.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
764 am--refresh check check-am clean clean-cscope clean-generic \
765 cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
766 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
767 distcheck distclean distclean-generic distclean-hdr \
768 distclean-tags distcleancheck distdir distuninstallcheck dvi \
769 dvi-am html html-am info info-am install install-am \
770 install-data install-data-am install-data-local install-dvi \
771 install-dvi-am install-exec install-exec-am install-html \
772 install-html-am install-info install-info-am install-man \
773 install-pdf install-pdf-am install-ps install-ps-am \
774 install-strip installcheck installcheck-am installdirs \
775 installdirs-am maintainer-clean maintainer-clean-generic \
776 mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
777 tags-am uninstall uninstall-am
778
779
780# Install BFD include file, and others that it needs.
781#install-data-local:
782# @$(NORMAL_INSTALL)
783# $(mkinstalldirs) $(sysconfdir)
784# $(INSTALL_DATA)sagan.conf $(sysconfdir)/sagan.conf
785
786install-data-local:
787 test -z "$(DESTDIR)$(sysconfdir)" || /bin/mkdir -p "$(DESTDIR)$(sysconfdir)"
788 test -f "$(DESTDIR)$(sysconfdir)/sagan.conf" || $(INSTALL_DATA) etc/sagan.conf "$(DESTDIR)$(sysconfdir)/sagan.conf"
789 test -z "$(DESTDIR)$(sbindir)" || /bin/mkdir -p "$(DESTDIR)$(sbindir)"
790 $(INSTALL) -d "$(DESTDIR)$(mandir)/man8"
791 $(INSTALL) -m 644 etc/sagan.8 "$(DESTDIR)$(mandir)/man8"
792 $(INSTALL) -m 755 src/sagan "$(DESTDIR)$(sbindir)/sagan"
793 $(INSTALL) -d "$(DESTDIR)/var/log/sagan"
794 $(INSTALL) -d "$(DESTDIR)/var/run/sagan"
795 @echo ""
796 @echo "------------------------------------------------------------------------------"
797 @echo "Sagan has been installed! You still need to do a few more things before your"
798 @echo "up and running. For more information, see:"
799 @echo "https://wiki.quadrantsec.com/twiki/bin/view/Main/SaganInstall"
800 @echo "------------------------------------------------------------------------------"
801 @echo ""
802
803# Tell versions [3.59,3.63) of GNU make to not export all variables.
804# Otherwise a system limit (for SysV at least) may be exceeded.
805.NOEXPORT:
0806
=== modified file 'Makefile.am'
--- Makefile.am 2011-12-17 16:04:27 +0000
+++ Makefile.am 2014-11-22 20:03:11 +0000
@@ -21,8 +21,8 @@
21 @echo ""21 @echo ""
22 @echo "------------------------------------------------------------------------------"22 @echo "------------------------------------------------------------------------------"
23 @echo "Sagan has been installed! You still need to do a few more things before your"23 @echo "Sagan has been installed! You still need to do a few more things before your"
24 @echo "up and running. See https://wiki.quadrantsec.com/bin/view/Main/SaganHOWTO for"24 @echo "up and running. For more information, see:"
25 @echo "more information."25 @echo "https://wiki.quadrantsec.com/twiki/bin/view/Main/SaganInstall"
26 @echo "------------------------------------------------------------------------------"26 @echo "------------------------------------------------------------------------------"
27 @echo ""27 @echo ""
2828
2929
=== modified file 'Makefile.in'
--- Makefile.in 2011-12-17 16:04:27 +0000
+++ Makefile.in 2014-11-22 20:03:11 +0000
@@ -1,9 +1,8 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.1# Makefile.in generated by automake 1.14.1 from Makefile.am.
2# @configure_input@2# @configure_input@
33
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,4# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,5
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation6# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,7# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.8# with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,51 @@
1514
16@SET_MAKE@15@SET_MAKE@
17VPATH = @srcdir@16VPATH = @srcdir@
17am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
18am__make_running_with_option = \
19 case $${target_option-} in \
20 ?) ;; \
21 *) echo "am__make_running_with_option: internal error: invalid" \
22 "target option '$${target_option-}' specified" >&2; \
23 exit 1;; \
24 esac; \
25 has_opt=no; \
26 sane_makeflags=$$MAKEFLAGS; \
27 if $(am__is_gnu_make); then \
28 sane_makeflags=$$MFLAGS; \
29 else \
30 case $$MAKEFLAGS in \
31 *\\[\ \ ]*) \
32 bs=\\; \
33 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
34 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
35 esac; \
36 fi; \
37 skip_next=no; \
38 strip_trailopt () \
39 { \
40 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
41 }; \
42 for flg in $$sane_makeflags; do \
43 test $$skip_next = yes && { skip_next=no; continue; }; \
44 case $$flg in \
45 *=*|--*) continue;; \
46 -*I) strip_trailopt 'I'; skip_next=yes;; \
47 -*I?*) strip_trailopt 'I';; \
48 -*O) strip_trailopt 'O'; skip_next=yes;; \
49 -*O?*) strip_trailopt 'O';; \
50 -*l) strip_trailopt 'l'; skip_next=yes;; \
51 -*l?*) strip_trailopt 'l';; \
52 -[dEDm]) skip_next=yes;; \
53 -[JT]) skip_next=yes;; \
54 esac; \
55 case $$flg in \
56 *$$target_option*) has_opt=yes; break;; \
57 esac; \
58 done; \
59 test $$has_opt = yes
60am__make_dryrun = (target_option=n; $(am__make_running_with_option))
61am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
18pkgdatadir = $(datadir)/@PACKAGE@62pkgdatadir = $(datadir)/@PACKAGE@
19pkgincludedir = $(includedir)/@PACKAGE@63pkgincludedir = $(includedir)/@PACKAGE@
20pkglibdir = $(libdir)/@PACKAGE@64pkglibdir = $(libdir)/@PACKAGE@
@@ -35,12 +79,13 @@
35host_triplet = @host@79host_triplet = @host@
36target_triplet = @target@80target_triplet = @target@
37subdir = .81subdir = .
38DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \82DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
39 $(srcdir)/Makefile.in $(srcdir)/config.h.in \83 $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
40 $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \84 $(top_srcdir)/configure $(am__configure_deps) \
41 TODO config.guess config.sub depcomp install-sh missing85 $(srcdir)/config.h.in COPYING TODO compile config.guess \
86 config.sub depcomp install-sh missing
42ACLOCAL_M4 = $(top_srcdir)/aclocal.m487ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
43am__aclocal_m4_deps = $(top_srcdir)/configure.in88am__aclocal_m4_deps = $(top_srcdir)/configure.ac
44am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \89am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
45 $(ACLOCAL_M4)90 $(ACLOCAL_M4)
46am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \91am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -49,30 +94,73 @@
49CONFIG_HEADER = config.h94CONFIG_HEADER = config.h
50CONFIG_CLEAN_FILES =95CONFIG_CLEAN_FILES =
51CONFIG_CLEAN_VPATH_FILES =96CONFIG_CLEAN_VPATH_FILES =
97AM_V_P = $(am__v_P_@AM_V@)
98am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
99am__v_P_0 = false
100am__v_P_1 = :
101AM_V_GEN = $(am__v_GEN_@AM_V@)
102am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
103am__v_GEN_0 = @echo " GEN " $@;
104am__v_GEN_1 =
105AM_V_at = $(am__v_at_@AM_V@)
106am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
107am__v_at_0 = @
108am__v_at_1 =
52SOURCES =109SOURCES =
53DIST_SOURCES =110DIST_SOURCES =
54RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \111RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
55 html-recursive info-recursive install-data-recursive \112 ctags-recursive dvi-recursive html-recursive info-recursive \
56 install-dvi-recursive install-exec-recursive \113 install-data-recursive install-dvi-recursive \
57 install-html-recursive install-info-recursive \114 install-exec-recursive install-html-recursive \
58 install-pdf-recursive install-ps-recursive install-recursive \115 install-info-recursive install-pdf-recursive \
59 installcheck-recursive installdirs-recursive pdf-recursive \116 install-ps-recursive install-recursive installcheck-recursive \
60 ps-recursive uninstall-recursive117 installdirs-recursive pdf-recursive ps-recursive \
118 tags-recursive uninstall-recursive
119am__can_run_installinfo = \
120 case $$AM_UPDATE_INFO_DIR in \
121 n|no|NO) false;; \
122 *) (install-info --version) >/dev/null 2>&1;; \
123 esac
61RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \124RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
62 distclean-recursive maintainer-clean-recursive125 distclean-recursive maintainer-clean-recursive
63AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \126am__recursive_targets = \
64 $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \127 $(RECURSIVE_TARGETS) \
65 distdir dist dist-all distcheck128 $(RECURSIVE_CLEAN_TARGETS) \
129 $(am__extra_recursive_targets)
130AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
131 cscope distdir dist dist-all distcheck
132am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
133 $(LISP)config.h.in
134# Read a list of newline-separated strings from the standard input,
135# and print each of them once, without duplicates. Input order is
136# *not* preserved.
137am__uniquify_input = $(AWK) '\
138 BEGIN { nonempty = 0; } \
139 { items[$$0] = 1; nonempty = 1; } \
140 END { if (nonempty) { for (i in items) print i; }; } \
141'
142# Make sure the list of sources is unique. This is necessary because,
143# e.g., the same source file might be shared among _SOURCES variables
144# for different programs/libraries.
145am__define_uniq_tagged_files = \
146 list='$(am__tagged_files)'; \
147 unique=`for i in $$list; do \
148 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
149 done | $(am__uniquify_input)`
66ETAGS = etags150ETAGS = etags
67CTAGS = ctags151CTAGS = ctags
152CSCOPE = cscope
68DIST_SUBDIRS = $(SUBDIRS)153DIST_SUBDIRS = $(SUBDIRS)
69DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)154DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
70distdir = $(PACKAGE)-$(VERSION)155distdir = $(PACKAGE)-$(VERSION)
71top_distdir = $(distdir)156top_distdir = $(distdir)
72am__remove_distdir = \157am__remove_distdir = \
73 { test ! -d "$(distdir)" \158 if test -d "$(distdir)"; then \
74 || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \159 find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
75 && rm -fr "$(distdir)"; }; }160 && rm -rf "$(distdir)" \
161 || { sleep 5 && rm -rf "$(distdir)"; }; \
162 else :; fi
163am__post_remove_distdir = $(am__remove_distdir)
76am__relativize = \164am__relativize = \
77 dir0=`pwd`; \165 dir0=`pwd`; \
78 sed_first='s,^\([^/]*\)/.*$$,\1,'; \166 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@@ -100,10 +188,14 @@
100 reldir="$$dir2"188 reldir="$$dir2"
101DIST_ARCHIVES = $(distdir).tar.gz189DIST_ARCHIVES = $(distdir).tar.gz
102GZIP_ENV = --best190GZIP_ENV = --best
191DIST_TARGETS = dist-gzip
103distuninstallcheck_listfiles = find . -type f -print192distuninstallcheck_listfiles = find . -type f -print
193am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
194 | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
104distcleancheck_listfiles = find . -type f -print195distcleancheck_listfiles = find . -type f -print
105ACLOCAL = @ACLOCAL@196ACLOCAL = @ACLOCAL@
106AMTAR = @AMTAR@197AMTAR = @AMTAR@
198AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
107AUTOCONF = @AUTOCONF@199AUTOCONF = @AUTOCONF@
108AUTOHEADER = @AUTOHEADER@200AUTOHEADER = @AUTOHEADER@
109AUTOMAKE = @AUTOMAKE@201AUTOMAKE = @AUTOMAKE@
@@ -128,10 +220,17 @@
128INSTALL_PROGRAM = @INSTALL_PROGRAM@220INSTALL_PROGRAM = @INSTALL_PROGRAM@
129INSTALL_SCRIPT = @INSTALL_SCRIPT@221INSTALL_SCRIPT = @INSTALL_SCRIPT@
130INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@222INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
223JSON_C_CFLAGS = @JSON_C_CFLAGS@
224JSON_C_LIBS = @JSON_C_LIBS@
131LDFLAGS = @LDFLAGS@225LDFLAGS = @LDFLAGS@
226LIBESTR_CFLAGS = @LIBESTR_CFLAGS@
227LIBESTR_LIBS = @LIBESTR_LIBS@
228LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@
229LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@
132LIBOBJS = @LIBOBJS@230LIBOBJS = @LIBOBJS@
133LIBS = @LIBS@231LIBS = @LIBS@
134LTLIBOBJS = @LTLIBOBJS@232LTLIBOBJS = @LTLIBOBJS@
233MAINT = @MAINT@
135MAKEINFO = @MAKEINFO@234MAKEINFO = @MAKEINFO@
136MKDIR_P = @MKDIR_P@235MKDIR_P = @MKDIR_P@
137OBJEXT = @OBJEXT@236OBJEXT = @OBJEXT@
@@ -143,6 +242,9 @@
143PACKAGE_URL = @PACKAGE_URL@242PACKAGE_URL = @PACKAGE_URL@
144PACKAGE_VERSION = @PACKAGE_VERSION@243PACKAGE_VERSION = @PACKAGE_VERSION@
145PATH_SEPARATOR = @PATH_SEPARATOR@244PATH_SEPARATOR = @PATH_SEPARATOR@
245PKG_CONFIG = @PKG_CONFIG@
246PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
247PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
146SET_MAKE = @SET_MAKE@248SET_MAKE = @SET_MAKE@
147SHELL = @SHELL@249SHELL = @SHELL@
148STRIP = @STRIP@250STRIP = @STRIP@
@@ -208,9 +310,9 @@
208 $(MAKE) $(AM_MAKEFLAGS) all-recursive310 $(MAKE) $(AM_MAKEFLAGS) all-recursive
209311
210.SUFFIXES:312.SUFFIXES:
211am--refresh:313am--refresh: Makefile
212 @:314 @:
213$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)315$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
214 @for dep in $?; do \316 @for dep in $?; do \
215 case '$(am__configure_deps)' in \317 case '$(am__configure_deps)' in \
216 *$$dep*) \318 *$$dep*) \
@@ -237,22 +339,20 @@
237$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)339$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
238 $(SHELL) ./config.status --recheck340 $(SHELL) ./config.status --recheck
239341
240$(top_srcdir)/configure: $(am__configure_deps)342$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
241 $(am__cd) $(srcdir) && $(AUTOCONF)343 $(am__cd) $(srcdir) && $(AUTOCONF)
242$(ACLOCAL_M4): $(am__aclocal_m4_deps)344$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
243 $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)345 $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
244$(am__aclocal_m4_deps):346$(am__aclocal_m4_deps):
245347
246config.h: stamp-h1348config.h: stamp-h1
247 @if test ! -f $@; then \349 @test -f $@ || rm -f stamp-h1
248 rm -f stamp-h1; \350 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
249 $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
250 else :; fi
251351
252stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status352stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
253 @rm -f stamp-h1353 @rm -f stamp-h1
254 cd $(top_builddir) && $(SHELL) ./config.status config.h354 cd $(top_builddir) && $(SHELL) ./config.status config.h
255$(srcdir)/config.h.in: $(am__configure_deps) 355$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
256 ($(am__cd) $(top_srcdir) && $(AUTOHEADER))356 ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
257 rm -f stamp-h1357 rm -f stamp-h1
258 touch $@358 touch $@
@@ -261,22 +361,25 @@
261 -rm -f config.h stamp-h1361 -rm -f config.h stamp-h1
262362
263# This directory's subdirectories are mostly independent; you can cd363# This directory's subdirectories are mostly independent; you can cd
264# into them and run `make' without going through this Makefile.364# into them and run 'make' without going through this Makefile.
265# To change the values of `make' variables: instead of editing Makefiles,365# To change the values of 'make' variables: instead of editing Makefiles,
266# (1) if the variable is set in `config.status', edit `config.status'366# (1) if the variable is set in 'config.status', edit 'config.status'
267# (which will cause the Makefiles to be regenerated when you run `make');367# (which will cause the Makefiles to be regenerated when you run 'make');
268# (2) otherwise, pass the desired values on the `make' command line.368# (2) otherwise, pass the desired values on the 'make' command line.
269$(RECURSIVE_TARGETS):369$(am__recursive_targets):
270 @fail= failcom='exit 1'; \370 @fail=; \
271 for f in x $$MAKEFLAGS; do \371 if $(am__make_keepgoing); then \
272 case $$f in \372 failcom='fail=yes'; \
273 *=* | --[!k]*);; \373 else \
274 *k*) failcom='fail=yes';; \374 failcom='exit 1'; \
275 esac; \375 fi; \
276 done; \
277 dot_seen=no; \376 dot_seen=no; \
278 target=`echo $@ | sed s/-recursive//`; \377 target=`echo $@ | sed s/-recursive//`; \
279 list='$(SUBDIRS)'; for subdir in $$list; do \378 case "$@" in \
379 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
380 *) list='$(SUBDIRS)' ;; \
381 esac; \
382 for subdir in $$list; do \
280 echo "Making $$target in $$subdir"; \383 echo "Making $$target in $$subdir"; \
281 if test "$$subdir" = "."; then \384 if test "$$subdir" = "."; then \
282 dot_seen=yes; \385 dot_seen=yes; \
@@ -291,57 +394,12 @@
291 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \394 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
292 fi; test -z "$$fail"395 fi; test -z "$$fail"
293396
294$(RECURSIVE_CLEAN_TARGETS):397ID: $(am__tagged_files)
295 @fail= failcom='exit 1'; \398 $(am__define_uniq_tagged_files); mkid -fID $$unique
296 for f in x $$MAKEFLAGS; do \399tags: tags-recursive
297 case $$f in \400TAGS: tags
298 *=* | --[!k]*);; \401
299 *k*) failcom='fail=yes';; \402tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
300 esac; \
301 done; \
302 dot_seen=no; \
303 case "$@" in \
304 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
305 *) list='$(SUBDIRS)' ;; \
306 esac; \
307 rev=''; for subdir in $$list; do \
308 if test "$$subdir" = "."; then :; else \
309 rev="$$subdir $$rev"; \
310 fi; \
311 done; \
312 rev="$$rev ."; \
313 target=`echo $@ | sed s/-recursive//`; \
314 for subdir in $$rev; do \
315 echo "Making $$target in $$subdir"; \
316 if test "$$subdir" = "."; then \
317 local_target="$$target-am"; \
318 else \
319 local_target="$$target"; \
320 fi; \
321 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
322 || eval $$failcom; \
323 done && test -z "$$fail"
324tags-recursive:
325 list='$(SUBDIRS)'; for subdir in $$list; do \
326 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
327 done
328ctags-recursive:
329 list='$(SUBDIRS)'; for subdir in $$list; do \
330 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
331 done
332
333ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
334 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
335 unique=`for i in $$list; do \
336 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
337 done | \
338 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
339 END { if (nonempty) { for (i in files) print i; }; }'`; \
340 mkid -fID $$unique
341tags: TAGS
342
343TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
344 $(TAGS_FILES) $(LISP)
345 set x; \403 set x; \
346 here=`pwd`; \404 here=`pwd`; \
347 if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \405 if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -357,12 +415,7 @@
357 set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \415 set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
358 fi; \416 fi; \
359 done; \417 done; \
360 list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \418 $(am__define_uniq_tagged_files); \
361 unique=`for i in $$list; do \
362 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
363 done | \
364 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
365 END { if (nonempty) { for (i in files) print i; }; }'`; \
366 shift; \419 shift; \
367 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \420 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
368 test -n "$$unique" || unique=$$empty_fix; \421 test -n "$$unique" || unique=$$empty_fix; \
@@ -374,15 +427,11 @@
374 $$unique; \427 $$unique; \
375 fi; \428 fi; \
376 fi429 fi
377ctags: CTAGS430ctags: ctags-recursive
378CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \431
379 $(TAGS_FILES) $(LISP)432CTAGS: ctags
380 list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \433ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
381 unique=`for i in $$list; do \434 $(am__define_uniq_tagged_files); \
382 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
383 done | \
384 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
385 END { if (nonempty) { for (i in files) print i; }; }'`; \
386 test -z "$(CTAGS_ARGS)$$unique" \435 test -z "$(CTAGS_ARGS)$$unique" \
387 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \436 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
388 $$unique437 $$unique
@@ -391,9 +440,31 @@
391 here=`$(am__cd) $(top_builddir) && pwd` \440 here=`$(am__cd) $(top_builddir) && pwd` \
392 && $(am__cd) $(top_srcdir) \441 && $(am__cd) $(top_srcdir) \
393 && gtags -i $(GTAGS_ARGS) "$$here"442 && gtags -i $(GTAGS_ARGS) "$$here"
443cscope: cscope.files
444 test ! -s cscope.files \
445 || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
446clean-cscope:
447 -rm -f cscope.files
448cscope.files: clean-cscope cscopelist
449cscopelist: cscopelist-recursive
450
451cscopelist-am: $(am__tagged_files)
452 list='$(am__tagged_files)'; \
453 case "$(srcdir)" in \
454 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
455 *) sdir=$(subdir)/$(srcdir) ;; \
456 esac; \
457 for i in $$list; do \
458 if test -f "$$i"; then \
459 echo "$(subdir)/$$i"; \
460 else \
461 echo "$$sdir/$$i"; \
462 fi; \
463 done >> $(top_builddir)/cscope.files
394464
395distclean-tags:465distclean-tags:
396 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags466 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
467 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
397468
398distdir: $(DISTFILES)469distdir: $(DISTFILES)
399 $(am__remove_distdir)470 $(am__remove_distdir)
@@ -429,13 +500,10 @@
429 done500 done
430 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \501 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
431 if test "$$subdir" = .; then :; else \502 if test "$$subdir" = .; then :; else \
432 test -d "$(distdir)/$$subdir" \503 $(am__make_dryrun) \
433 || $(MKDIR_P) "$(distdir)/$$subdir" \504 || test -d "$(distdir)/$$subdir" \
434 || exit 1; \505 || $(MKDIR_P) "$(distdir)/$$subdir" \
435 fi; \506 || exit 1; \
436 done
437 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
438 if test "$$subdir" = .; then :; else \
439 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \507 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
440 $(am__relativize); \508 $(am__relativize); \
441 new_distdir=$$reldir; \509 new_distdir=$$reldir; \
@@ -464,36 +532,42 @@
464 || chmod -R a+r "$(distdir)"532 || chmod -R a+r "$(distdir)"
465dist-gzip: distdir533dist-gzip: distdir
466 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz534 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
467 $(am__remove_distdir)535 $(am__post_remove_distdir)
468536
469dist-bzip2: distdir537dist-bzip2: distdir
470 tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2538 tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
471 $(am__remove_distdir)539 $(am__post_remove_distdir)
472540
473dist-lzma: distdir541dist-lzip: distdir
474 tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma542 tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
475 $(am__remove_distdir)543 $(am__post_remove_distdir)
476544
477dist-xz: distdir545dist-xz: distdir
478 tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz546 tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
479 $(am__remove_distdir)547 $(am__post_remove_distdir)
480548
481dist-tarZ: distdir549dist-tarZ: distdir
550 @echo WARNING: "Support for shar distribution archives is" \
551 "deprecated." >&2
552 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
482 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z553 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
483 $(am__remove_distdir)554 $(am__post_remove_distdir)
484555
485dist-shar: distdir556dist-shar: distdir
557 @echo WARNING: "Support for distribution archives compressed with" \
558 "legacy program 'compress' is deprecated." >&2
559 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
486 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz560 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
487 $(am__remove_distdir)561 $(am__post_remove_distdir)
488562
489dist-zip: distdir563dist-zip: distdir
490 -rm -f $(distdir).zip564 -rm -f $(distdir).zip
491 zip -rq $(distdir).zip $(distdir)565 zip -rq $(distdir).zip $(distdir)
492 $(am__remove_distdir)566 $(am__post_remove_distdir)
493567
494dist dist-all: distdir568dist dist-all:
495 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz569 $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
496 $(am__remove_distdir)570 $(am__post_remove_distdir)
497571
498# This target untars the dist file and tries a VPATH configuration. Then572# This target untars the dist file and tries a VPATH configuration. Then
499# it guarantees that the distribution is self-contained by making another573# it guarantees that the distribution is self-contained by making another
@@ -504,8 +578,8 @@
504 GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\578 GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
505 *.tar.bz2*) \579 *.tar.bz2*) \
506 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\580 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
507 *.tar.lzma*) \581 *.tar.lz*) \
508 lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\582 lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
509 *.tar.xz*) \583 *.tar.xz*) \
510 xz -dc $(distdir).tar.xz | $(am__untar) ;;\584 xz -dc $(distdir).tar.xz | $(am__untar) ;;\
511 *.tar.Z*) \585 *.tar.Z*) \
@@ -515,17 +589,19 @@
515 *.zip*) \589 *.zip*) \
516 unzip $(distdir).zip ;;\590 unzip $(distdir).zip ;;\
517 esac591 esac
518 chmod -R a-w $(distdir); chmod a+w $(distdir)592 chmod -R a-w $(distdir)
519 mkdir $(distdir)/_build593 chmod u+w $(distdir)
520 mkdir $(distdir)/_inst594 mkdir $(distdir)/_build $(distdir)/_inst
521 chmod a-w $(distdir)595 chmod a-w $(distdir)
522 test -d $(distdir)/_build || exit 0; \596 test -d $(distdir)/_build || exit 0; \
523 dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \597 dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
524 && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \598 && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
525 && am__cwd=`pwd` \599 && am__cwd=`pwd` \
526 && $(am__cd) $(distdir)/_build \600 && $(am__cd) $(distdir)/_build \
527 && ../configure --srcdir=.. --prefix="$$dc_install_base" \601 && ../configure \
602 $(AM_DISTCHECK_CONFIGURE_FLAGS) \
528 $(DISTCHECK_CONFIGURE_FLAGS) \603 $(DISTCHECK_CONFIGURE_FLAGS) \
604 --srcdir=.. --prefix="$$dc_install_base" \
529 && $(MAKE) $(AM_MAKEFLAGS) \605 && $(MAKE) $(AM_MAKEFLAGS) \
530 && $(MAKE) $(AM_MAKEFLAGS) dvi \606 && $(MAKE) $(AM_MAKEFLAGS) dvi \
531 && $(MAKE) $(AM_MAKEFLAGS) check \607 && $(MAKE) $(AM_MAKEFLAGS) check \
@@ -548,13 +624,21 @@
548 && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \624 && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
549 && cd "$$am__cwd" \625 && cd "$$am__cwd" \
550 || exit 1626 || exit 1
551 $(am__remove_distdir)627 $(am__post_remove_distdir)
552 @(echo "$(distdir) archives ready for distribution: "; \628 @(echo "$(distdir) archives ready for distribution: "; \
553 list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \629 list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
554 sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'630 sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
555distuninstallcheck:631distuninstallcheck:
556 @$(am__cd) '$(distuninstallcheck_dir)' \632 @test -n '$(distuninstallcheck_dir)' || { \
557 && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \633 echo 'ERROR: trying to run $@ with an empty' \
634 '$$(distuninstallcheck_dir)' >&2; \
635 exit 1; \
636 }; \
637 $(am__cd) '$(distuninstallcheck_dir)' || { \
638 echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
639 exit 1; \
640 }; \
641 test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
558 || { echo "ERROR: files left after uninstall:" ; \642 || { echo "ERROR: files left after uninstall:" ; \
559 if test -n "$(DESTDIR)"; then \643 if test -n "$(DESTDIR)"; then \
560 echo " (check DESTDIR support)"; \644 echo " (check DESTDIR support)"; \
@@ -585,10 +669,15 @@
585669
586installcheck: installcheck-recursive670installcheck: installcheck-recursive
587install-strip:671install-strip:
588 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \672 if test -z '$(STRIP)'; then \
589 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \673 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
590 `test -z '$(STRIP)' || \674 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
591 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install675 install; \
676 else \
677 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
678 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
679 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
680 fi
592mostlyclean-generic:681mostlyclean-generic:
593682
594clean-generic:683clean-generic:
@@ -669,24 +758,23 @@
669758
670uninstall-am:759uninstall-am:
671760
672.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \761.MAKE: $(am__recursive_targets) all install-am install-strip
673 ctags-recursive install-am install-strip tags-recursive
674762
675.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \763.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
676 all all-am am--refresh check check-am clean clean-generic \764 am--refresh check check-am clean clean-cscope clean-generic \
677 ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \765 cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
678 dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \766 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
679 distclean distclean-generic distclean-hdr distclean-tags \767 distcheck distclean distclean-generic distclean-hdr \
680 distcleancheck distdir distuninstallcheck dvi dvi-am html \768 distclean-tags distcleancheck distdir distuninstallcheck dvi \
681 html-am info info-am install install-am install-data \769 dvi-am html html-am info info-am install install-am \
682 install-data-am install-data-local install-dvi install-dvi-am \770 install-data install-data-am install-data-local install-dvi \
683 install-exec install-exec-am install-html install-html-am \771 install-dvi-am install-exec install-exec-am install-html \
684 install-info install-info-am install-man install-pdf \772 install-html-am install-info install-info-am install-man \
685 install-pdf-am install-ps install-ps-am install-strip \773 install-pdf install-pdf-am install-ps install-ps-am \
686 installcheck installcheck-am installdirs installdirs-am \774 install-strip installcheck installcheck-am installdirs \
687 maintainer-clean maintainer-clean-generic mostlyclean \775 installdirs-am maintainer-clean maintainer-clean-generic \
688 mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \776 mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
689 uninstall uninstall-am777 tags-am uninstall uninstall-am
690778
691779
692# Install BFD include file, and others that it needs.780# Install BFD include file, and others that it needs.
@@ -707,8 +795,8 @@
707 @echo ""795 @echo ""
708 @echo "------------------------------------------------------------------------------"796 @echo "------------------------------------------------------------------------------"
709 @echo "Sagan has been installed! You still need to do a few more things before your"797 @echo "Sagan has been installed! You still need to do a few more things before your"
710 @echo "up and running. See https://wiki.quadrantsec.com/bin/view/Main/SaganHOWTO for"798 @echo "up and running. For more information, see:"
711 @echo "more information."799 @echo "https://wiki.quadrantsec.com/twiki/bin/view/Main/SaganInstall"
712 @echo "------------------------------------------------------------------------------"800 @echo "------------------------------------------------------------------------------"
713 @echo ""801 @echo ""
714802
715803
=== modified file 'NEWS'
--- NEWS 2011-12-17 16:04:27 +0000
+++ NEWS 2014-11-22 20:03:11 +0000
@@ -1,2 +1,1 @@
11See http://sagan.quadrantsec.com
2For News, see http://sagan.quadrantsec.com
32
=== modified file 'README'
--- README 2012-04-16 22:33:24 +0000
+++ README 2014-11-22 20:03:11 +0000
@@ -11,17 +11,20 @@
11compatibility with rule management software (oinkmaster/pulledpork/etc)11compatibility with rule management software (oinkmaster/pulledpork/etc)
12and allows Sagan to correlate log events with your Snort IDS/IPS 12and allows Sagan to correlate log events with your Snort IDS/IPS
13system. Since Sagan can write to Snort IDS/IPS databases via 13system. Since Sagan can write to Snort IDS/IPS databases via
14unified2/barnyard2 or direct SQL access, it is compatible with all 14unified2/barnyard2, it is compatible with all Snort "consoles".
15Snort "consoles". For example, Sagan is compatible with Snorby 15For example, Sagan is compatible with Snorby [http://www.snorby.org],
16[http://www.snorby.org], Sguil [http://sguil.sourceforge.net], BASE, 16Sguil [http://sguil.sourceforge.net], BASE, and the Prelude IDS
17 and the Prelude IDS framework! (to name a few).17framework! (to name a few).
1818
19Sagan supports many different output formats, log normalization 19Sagan supports many different output formats, log normalization
20(via liblognorm), script execution on event and automatic firewall20(via liblognorm), GeoIP detection, script execution on event and
21support via "Snortsam" (see http://www.snortsam.net). 21automatic firewall support via "Snortsam"
22(see http://www.snortsam.net).
2223
23For more information, please visit the Sagan web site: 24For more information, please visit the Sagan web site:
24http://sagan.quadrantsec.com. 25http://sagan.quadrantsec.com.
2526
27If you're looking for Sagan rules on Github, they are located at:
2628
29https://github.com/beave/sagan-rules
2730
2831
=== modified file 'aclocal.m4'
--- aclocal.m4 2011-03-17 15:18:58 +0000
+++ aclocal.m4 2014-11-22 20:03:11 +0000
@@ -1,7 +1,7 @@
1# generated automatically by aclocal 1.11.1 -*- Autoconf -*-1# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
22
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,3# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.4
5# This file is free software; the Free Software Foundation5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.7# with or without modifications, as long as this notice is preserved.
@@ -11,15 +11,231 @@
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.12# PARTICULAR PURPOSE.
1313
14m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
14m4_ifndef([AC_AUTOCONF_VERSION],15m4_ifndef([AC_AUTOCONF_VERSION],
15 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl16 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,17m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
17[m4_warning([this file was generated for autoconf 2.65.18[m4_warning([this file was generated for autoconf 2.69.
18You have another version of autoconf. It may work, but is not guaranteed to.19You have another version of autoconf. It may work, but is not guaranteed to.
19If you have problems, you may need to regenerate the build system entirely.20If you have problems, you may need to regenerate the build system entirely.
20To do so, use the procedure documented by the package, typically `autoreconf'.])])21To do so, use the procedure documented by the package, typically 'autoreconf'.])])
2122
22# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.23# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
24# serial 1 (pkg-config-0.24)
25#
26# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
27#
28# This program is free software; you can redistribute it and/or modify
29# it under the terms of the GNU General Public License as published by
30# the Free Software Foundation; either version 2 of the License, or
31# (at your option) any later version.
32#
33# This program is distributed in the hope that it will be useful, but
34# WITHOUT ANY WARRANTY; without even the implied warranty of
35# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36# General Public License for more details.
37#
38# You should have received a copy of the GNU General Public License
39# along with this program; if not, write to the Free Software
40# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
41#
42# As a special exception to the GNU General Public License, if you
43# distribute this file as part of a program that contains a
44# configuration script generated by Autoconf, you may include it under
45# the same distribution terms that you use for the rest of that program.
46
47# PKG_PROG_PKG_CONFIG([MIN-VERSION])
48# ----------------------------------
49AC_DEFUN([PKG_PROG_PKG_CONFIG],
50[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
51m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
52m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
53AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
54AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
55AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
56
57if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
58 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
59fi
60if test -n "$PKG_CONFIG"; then
61 _pkg_min_version=m4_default([$1], [0.9.0])
62 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
63 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
64 AC_MSG_RESULT([yes])
65 else
66 AC_MSG_RESULT([no])
67 PKG_CONFIG=""
68 fi
69fi[]dnl
70])# PKG_PROG_PKG_CONFIG
71
72# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
73#
74# Check to see whether a particular set of modules exists. Similar
75# to PKG_CHECK_MODULES(), but does not set variables or print errors.
76#
77# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
78# only at the first occurence in configure.ac, so if the first place
79# it's called might be skipped (such as if it is within an "if", you
80# have to call PKG_CHECK_EXISTS manually
81# --------------------------------------------------------------
82AC_DEFUN([PKG_CHECK_EXISTS],
83[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
84if test -n "$PKG_CONFIG" && \
85 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
86 m4_default([$2], [:])
87m4_ifvaln([$3], [else
88 $3])dnl
89fi])
90
91# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
92# ---------------------------------------------
93m4_define([_PKG_CONFIG],
94[if test -n "$$1"; then
95 pkg_cv_[]$1="$$1"
96 elif test -n "$PKG_CONFIG"; then
97 PKG_CHECK_EXISTS([$3],
98 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
99 test "x$?" != "x0" && pkg_failed=yes ],
100 [pkg_failed=yes])
101 else
102 pkg_failed=untried
103fi[]dnl
104])# _PKG_CONFIG
105
106# _PKG_SHORT_ERRORS_SUPPORTED
107# -----------------------------
108AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
109[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
110if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
111 _pkg_short_errors_supported=yes
112else
113 _pkg_short_errors_supported=no
114fi[]dnl
115])# _PKG_SHORT_ERRORS_SUPPORTED
116
117
118# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
119# [ACTION-IF-NOT-FOUND])
120#
121#
122# Note that if there is a possibility the first call to
123# PKG_CHECK_MODULES might not happen, you should be sure to include an
124# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
125#
126#
127# --------------------------------------------------------------
128AC_DEFUN([PKG_CHECK_MODULES],
129[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
130AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
131AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
132
133pkg_failed=no
134AC_MSG_CHECKING([for $1])
135
136_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
137_PKG_CONFIG([$1][_LIBS], [libs], [$2])
138
139m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
140and $1[]_LIBS to avoid the need to call pkg-config.
141See the pkg-config man page for more details.])
142
143if test $pkg_failed = yes; then
144 AC_MSG_RESULT([no])
145 _PKG_SHORT_ERRORS_SUPPORTED
146 if test $_pkg_short_errors_supported = yes; then
147 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
148 else
149 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
150 fi
151 # Put the nasty error message in config.log where it belongs
152 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
153
154 m4_default([$4], [AC_MSG_ERROR(
155[Package requirements ($2) were not met:
156
157$$1_PKG_ERRORS
158
159Consider adjusting the PKG_CONFIG_PATH environment variable if you
160installed software in a non-standard prefix.
161
162_PKG_TEXT])[]dnl
163 ])
164elif test $pkg_failed = untried; then
165 AC_MSG_RESULT([no])
166 m4_default([$4], [AC_MSG_FAILURE(
167[The pkg-config script could not be found or is too old. Make sure it
168is in your PATH or set the PKG_CONFIG environment variable to the full
169path to pkg-config.
170
171_PKG_TEXT
172
173To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
174 ])
175else
176 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
177 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
178 AC_MSG_RESULT([yes])
179 $3
180fi[]dnl
181])# PKG_CHECK_MODULES
182
183
184# PKG_INSTALLDIR(DIRECTORY)
185# -------------------------
186# Substitutes the variable pkgconfigdir as the location where a module
187# should install pkg-config .pc files. By default the directory is
188# $libdir/pkgconfig, but the default can be changed by passing
189# DIRECTORY. The user can override through the --with-pkgconfigdir
190# parameter.
191AC_DEFUN([PKG_INSTALLDIR],
192[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
193m4_pushdef([pkg_description],
194 [pkg-config installation directory @<:@]pkg_default[@:>@])
195AC_ARG_WITH([pkgconfigdir],
196 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
197 [with_pkgconfigdir=]pkg_default)
198AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
199m4_popdef([pkg_default])
200m4_popdef([pkg_description])
201]) dnl PKG_INSTALLDIR
202
203
204# PKG_NOARCH_INSTALLDIR(DIRECTORY)
205# -------------------------
206# Substitutes the variable noarch_pkgconfigdir as the location where a
207# module should install arch-independent pkg-config .pc files. By
208# default the directory is $datadir/pkgconfig, but the default can be
209# changed by passing DIRECTORY. The user can override through the
210# --with-noarch-pkgconfigdir parameter.
211AC_DEFUN([PKG_NOARCH_INSTALLDIR],
212[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
213m4_pushdef([pkg_description],
214 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
215AC_ARG_WITH([noarch-pkgconfigdir],
216 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
217 [with_noarch_pkgconfigdir=]pkg_default)
218AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
219m4_popdef([pkg_default])
220m4_popdef([pkg_description])
221]) dnl PKG_NOARCH_INSTALLDIR
222
223
224# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
225# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
226# -------------------------------------------
227# Retrieves the value of the pkg-config variable for the given module.
228AC_DEFUN([PKG_CHECK_VAR],
229[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
230AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
231
232_PKG_CONFIG([$1], [variable="][$3]["], [$2])
233AS_VAR_COPY([$1], [pkg_cv_][$1])
234
235AS_VAR_IF([$1], [""], [$5], [$4])dnl
236])# PKG_CHECK_VAR
237
238# Copyright (C) 2002-2013 Free Software Foundation, Inc.
23#239#
24# This file is free software; the Free Software Foundation240# This file is free software; the Free Software Foundation
25# gives unlimited permission to copy and/or distribute it,241# gives unlimited permission to copy and/or distribute it,
@@ -31,10 +247,10 @@
31# generated from the m4 files accompanying Automake X.Y.247# generated from the m4 files accompanying Automake X.Y.
32# (This private macro should not be called outside this file.)248# (This private macro should not be called outside this file.)
33AC_DEFUN([AM_AUTOMAKE_VERSION],249AC_DEFUN([AM_AUTOMAKE_VERSION],
34[am__api_version='1.11'250[am__api_version='1.14'
35dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to251dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36dnl require some minimum version. Point them to the right macro.252dnl require some minimum version. Point them to the right macro.
37m4_if([$1], [1.11.1], [],253m4_if([$1], [1.14.1], [],
38 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl254 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39])255])
40256
@@ -50,22 +266,22 @@
50# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.266# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.267# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],268AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53[AM_AUTOMAKE_VERSION([1.11.1])dnl269[AM_AUTOMAKE_VERSION([1.14.1])dnl
54m4_ifndef([AC_AUTOCONF_VERSION],270m4_ifndef([AC_AUTOCONF_VERSION],
55 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl271 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])272_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57273
58# AM_AUX_DIR_EXPAND -*- Autoconf -*-274# AM_AUX_DIR_EXPAND -*- Autoconf -*-
59275
60# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.276# Copyright (C) 2001-2013 Free Software Foundation, Inc.
61#277#
62# This file is free software; the Free Software Foundation278# This file is free software; the Free Software Foundation
63# gives unlimited permission to copy and/or distribute it,279# gives unlimited permission to copy and/or distribute it,
64# with or without modifications, as long as this notice is preserved.280# with or without modifications, as long as this notice is preserved.
65281
66# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets282# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to283# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
68# `$srcdir', `$srcdir/..', or `$srcdir/../..'.284# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
69#285#
70# Of course, Automake must honor this variable whenever it calls a286# Of course, Automake must honor this variable whenever it calls a
71# tool from the auxiliary directory. The problem is that $srcdir (and287# tool from the auxiliary directory. The problem is that $srcdir (and
@@ -84,7 +300,7 @@
84#300#
85# The reason of the latter failure is that $top_srcdir and $ac_aux_dir301# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86# are both prefixed by $srcdir. In an in-source build this is usually302# are both prefixed by $srcdir. In an in-source build this is usually
87# harmless because $srcdir is `.', but things will broke when you303# harmless because $srcdir is '.', but things will broke when you
88# start a VPATH build or use an absolute $srcdir.304# start a VPATH build or use an absolute $srcdir.
89#305#
90# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,306# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
@@ -110,22 +326,19 @@
110326
111# AM_CONDITIONAL -*- Autoconf -*-327# AM_CONDITIONAL -*- Autoconf -*-
112328
113# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008329# Copyright (C) 1997-2013 Free Software Foundation, Inc.
114# Free Software Foundation, Inc.
115#330#
116# This file is free software; the Free Software Foundation331# This file is free software; the Free Software Foundation
117# gives unlimited permission to copy and/or distribute it,332# gives unlimited permission to copy and/or distribute it,
118# with or without modifications, as long as this notice is preserved.333# with or without modifications, as long as this notice is preserved.
119334
120# serial 9
121
122# AM_CONDITIONAL(NAME, SHELL-CONDITION)335# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123# -------------------------------------336# -------------------------------------
124# Define a conditional.337# Define a conditional.
125AC_DEFUN([AM_CONDITIONAL],338AC_DEFUN([AM_CONDITIONAL],
126[AC_PREREQ(2.52)dnl339[AC_PREREQ([2.52])dnl
127 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],340 m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
128 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl341 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129AC_SUBST([$1_TRUE])dnl342AC_SUBST([$1_TRUE])dnl
130AC_SUBST([$1_FALSE])dnl343AC_SUBST([$1_FALSE])dnl
131_AM_SUBST_NOTMAKE([$1_TRUE])dnl344_AM_SUBST_NOTMAKE([$1_TRUE])dnl
@@ -144,16 +357,14 @@
144Usually this means the macro was only invoked conditionally.]])357Usually this means the macro was only invoked conditionally.]])
145fi])])358fi])])
146359
147# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009360# Copyright (C) 1999-2013 Free Software Foundation, Inc.
148# Free Software Foundation, Inc.
149#361#
150# This file is free software; the Free Software Foundation362# This file is free software; the Free Software Foundation
151# gives unlimited permission to copy and/or distribute it,363# gives unlimited permission to copy and/or distribute it,
152# with or without modifications, as long as this notice is preserved.364# with or without modifications, as long as this notice is preserved.
153365
154# serial 10
155366
156# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be367# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
157# written in clear, in which case automake, when reading aclocal.m4,368# written in clear, in which case automake, when reading aclocal.m4,
158# will think it sees a *use*, and therefore will trigger all it's369# will think it sees a *use*, and therefore will trigger all it's
159# C support machinery. Also note that it means that autoscan, seeing370# C support machinery. Also note that it means that autoscan, seeing
@@ -163,7 +374,7 @@
163# _AM_DEPENDENCIES(NAME)374# _AM_DEPENDENCIES(NAME)
164# ----------------------375# ----------------------
165# See how the compiler implements dependency checking.376# See how the compiler implements dependency checking.
166# NAME is "CC", "CXX", "GCJ", or "OBJC".377# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
167# We try a few techniques and use that to set a single cache variable.378# We try a few techniques and use that to set a single cache variable.
168#379#
169# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was380# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
@@ -176,12 +387,13 @@
176AC_REQUIRE([AM_MAKE_INCLUDE])dnl387AC_REQUIRE([AM_MAKE_INCLUDE])dnl
177AC_REQUIRE([AM_DEP_TRACK])dnl388AC_REQUIRE([AM_DEP_TRACK])dnl
178389
179ifelse([$1], CC, [depcc="$CC" am_compiler_list=],390m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
180 [$1], CXX, [depcc="$CXX" am_compiler_list=],391 [$1], [CXX], [depcc="$CXX" am_compiler_list=],
181 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],392 [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182 [$1], UPC, [depcc="$UPC" am_compiler_list=],393 [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
183 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],394 [$1], [UPC], [depcc="$UPC" am_compiler_list=],
184 [depcc="$$1" am_compiler_list=])395 [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
396 [depcc="$$1" am_compiler_list=])
185397
186AC_CACHE_CHECK([dependency style of $depcc],398AC_CACHE_CHECK([dependency style of $depcc],
187 [am_cv_$1_dependencies_compiler_type],399 [am_cv_$1_dependencies_compiler_type],
@@ -189,8 +401,9 @@
189 # We make a subdir and do the tests there. Otherwise we can end up401 # We make a subdir and do the tests there. Otherwise we can end up
190 # making bogus files that we don't know about and never remove. For402 # making bogus files that we don't know about and never remove. For
191 # instance it was reported that on HP-UX the gcc test will end up403 # instance it was reported that on HP-UX the gcc test will end up
192 # making a dummy file named `D' -- because `-MD' means `put the output404 # making a dummy file named 'D' -- because '-MD' means "put the output
193 # in D'.405 # in D".
406 rm -rf conftest.dir
194 mkdir conftest.dir407 mkdir conftest.dir
195 # Copy depcomp to subdir because otherwise we won't find it if we're408 # Copy depcomp to subdir because otherwise we won't find it if we're
196 # using a relative directory.409 # using a relative directory.
@@ -229,16 +442,16 @@
229 : > sub/conftest.c442 : > sub/conftest.c
230 for i in 1 2 3 4 5 6; do443 for i in 1 2 3 4 5 6; do
231 echo '#include "conftst'$i'.h"' >> sub/conftest.c444 echo '#include "conftst'$i'.h"' >> sub/conftest.c
232 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with445 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
233 # Solaris 8's {/usr,}/bin/sh.446 # Solaris 10 /bin/sh.
234 touch sub/conftst$i.h447 echo '/* dummy */' > sub/conftst$i.h
235 done448 done
236 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf449 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237450
238 # We check with `-c' and `-o' for the sake of the "dashmstdout"451 # We check with '-c' and '-o' for the sake of the "dashmstdout"
239 # mode. It turns out that the SunPro C++ compiler does not properly452 # mode. It turns out that the SunPro C++ compiler does not properly
240 # handle `-M -o', and we need to detect this. Also, some Intel453 # handle '-M -o', and we need to detect this. Also, some Intel
241 # versions had trouble with output in subdirs454 # versions had trouble with output in subdirs.
242 am__obj=sub/conftest.${OBJEXT-o}455 am__obj=sub/conftest.${OBJEXT-o}
243 am__minus_obj="-o $am__obj"456 am__minus_obj="-o $am__obj"
244 case $depmode in457 case $depmode in
@@ -247,16 +460,16 @@
247 test "$am__universal" = false || continue460 test "$am__universal" = false || continue
248 ;;461 ;;
249 nosideeffect)462 nosideeffect)
250 # after this tag, mechanisms are not by side-effect, so they'll463 # After this tag, mechanisms are not by side-effect, so they'll
251 # only be used when explicitly requested464 # only be used when explicitly requested.
252 if test "x$enable_dependency_tracking" = xyes; then465 if test "x$enable_dependency_tracking" = xyes; then
253 continue466 continue
254 else467 else
255 break468 break
256 fi469 fi
257 ;;470 ;;
258 msvisualcpp | msvcmsys)471 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
259 # This compiler won't grok `-c -o', but also, the minuso test has472 # This compiler won't grok '-c -o', but also, the minuso test has
260 # not run yet. These depmodes are late enough in the game, and473 # not run yet. These depmodes are late enough in the game, and
261 # so weak that their functioning should not be impacted.474 # so weak that their functioning should not be impacted.
262 am__obj=conftest.${OBJEXT-o}475 am__obj=conftest.${OBJEXT-o}
@@ -304,7 +517,7 @@
304# AM_SET_DEPDIR517# AM_SET_DEPDIR
305# -------------518# -------------
306# Choose a directory name for dependency files.519# Choose a directory name for dependency files.
307# This macro is AC_REQUIREd in _AM_DEPENDENCIES520# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
308AC_DEFUN([AM_SET_DEPDIR],521AC_DEFUN([AM_SET_DEPDIR],
309[AC_REQUIRE([AM_SET_LEADING_DOT])dnl522[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl523AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
@@ -314,34 +527,39 @@
314# AM_DEP_TRACK527# AM_DEP_TRACK
315# ------------528# ------------
316AC_DEFUN([AM_DEP_TRACK],529AC_DEFUN([AM_DEP_TRACK],
317[AC_ARG_ENABLE(dependency-tracking,530[AC_ARG_ENABLE([dependency-tracking], [dnl
318[ --disable-dependency-tracking speeds up one-time build531AS_HELP_STRING(
319 --enable-dependency-tracking do not reject slow dependency extractors])532 [--enable-dependency-tracking],
533 [do not reject slow dependency extractors])
534AS_HELP_STRING(
535 [--disable-dependency-tracking],
536 [speeds up one-time build])])
320if test "x$enable_dependency_tracking" != xno; then537if test "x$enable_dependency_tracking" != xno; then
321 am_depcomp="$ac_aux_dir/depcomp"538 am_depcomp="$ac_aux_dir/depcomp"
322 AMDEPBACKSLASH='\'539 AMDEPBACKSLASH='\'
540 am__nodep='_no'
323fi541fi
324AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])542AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325AC_SUBST([AMDEPBACKSLASH])dnl543AC_SUBST([AMDEPBACKSLASH])dnl
326_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl544_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
545AC_SUBST([am__nodep])dnl
546_AM_SUBST_NOTMAKE([am__nodep])dnl
327])547])
328548
329# Generate code to set up dependency tracking. -*- Autoconf -*-549# Generate code to set up dependency tracking. -*- Autoconf -*-
330550
331# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008551# Copyright (C) 1999-2013 Free Software Foundation, Inc.
332# Free Software Foundation, Inc.
333#552#
334# This file is free software; the Free Software Foundation553# This file is free software; the Free Software Foundation
335# gives unlimited permission to copy and/or distribute it,554# gives unlimited permission to copy and/or distribute it,
336# with or without modifications, as long as this notice is preserved.555# with or without modifications, as long as this notice is preserved.
337556
338#serial 5
339557
340# _AM_OUTPUT_DEPENDENCY_COMMANDS558# _AM_OUTPUT_DEPENDENCY_COMMANDS
341# ------------------------------559# ------------------------------
342AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],560AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343[{561[{
344 # Autoconf 2.62 quotes --file arguments for eval, but not when files562 # Older Autoconf quotes --file arguments for eval, but not when files
345 # are listed without --file. Let's play safe and only enable the eval563 # are listed without --file. Let's play safe and only enable the eval
346 # if we detect the quoting.564 # if we detect the quoting.
347 case $CONFIG_FILES in565 case $CONFIG_FILES in
@@ -354,7 +572,7 @@
354 # Strip MF so we end up with the name of the file.572 # Strip MF so we end up with the name of the file.
355 mf=`echo "$mf" | sed -e 's/:.*$//'`573 mf=`echo "$mf" | sed -e 's/:.*$//'`
356 # Check whether this is an Automake generated Makefile or not.574 # Check whether this is an Automake generated Makefile or not.
357 # We used to match only the files named `Makefile.in', but575 # We used to match only the files named 'Makefile.in', but
358 # some people rename them; so instead we look at the file content.576 # some people rename them; so instead we look at the file content.
359 # Grep'ing the first line is not enough: some people post-process577 # Grep'ing the first line is not enough: some people post-process
360 # each Makefile.in and add a new line on top of each file to say so.578 # each Makefile.in and add a new line on top of each file to say so.
@@ -366,21 +584,19 @@
366 continue584 continue
367 fi585 fi
368 # Extract the definition of DEPDIR, am__include, and am__quote586 # Extract the definition of DEPDIR, am__include, and am__quote
369 # from the Makefile without running `make'.587 # from the Makefile without running 'make'.
370 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`588 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371 test -z "$DEPDIR" && continue589 test -z "$DEPDIR" && continue
372 am__include=`sed -n 's/^am__include = //p' < "$mf"`590 am__include=`sed -n 's/^am__include = //p' < "$mf"`
373 test -z "am__include" && continue591 test -z "$am__include" && continue
374 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`592 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375 # When using ansi2knr, U may be empty or an underscore; expand it
376 U=`sed -n 's/^U = //p' < "$mf"`
377 # Find all dependency output files, they are included files with593 # Find all dependency output files, they are included files with
378 # $(DEPDIR) in their names. We invoke sed twice because it is the594 # $(DEPDIR) in their names. We invoke sed twice because it is the
379 # simplest approach to changing $(DEPDIR) to its actual value in the595 # simplest approach to changing $(DEPDIR) to its actual value in the
380 # expansion.596 # expansion.
381 for file in `sed -n "597 for file in `sed -n "
382 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \598 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do599 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
384 # Make sure the directory exists.600 # Make sure the directory exists.
385 test -f "$dirpart/$file" && continue601 test -f "$dirpart/$file" && continue
386 fdir=`AS_DIRNAME(["$file"])`602 fdir=`AS_DIRNAME(["$file"])`
@@ -398,7 +614,7 @@
398# This macro should only be invoked once -- use via AC_REQUIRE.614# This macro should only be invoked once -- use via AC_REQUIRE.
399#615#
400# This code is only required when automatic dependency tracking616# This code is only required when automatic dependency tracking
401# is enabled. FIXME. This creates each `.P' file that we will617# is enabled. FIXME. This creates each '.P' file that we will
402# need in order to bootstrap the dependency handling code.618# need in order to bootstrap the dependency handling code.
403AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],619AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404[AC_CONFIG_COMMANDS([depfiles],620[AC_CONFIG_COMMANDS([depfiles],
@@ -408,18 +624,21 @@
408624
409# Do all the work for Automake. -*- Autoconf -*-625# Do all the work for Automake. -*- Autoconf -*-
410626
411# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,627# Copyright (C) 1996-2013 Free Software Foundation, Inc.
412# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
413#628#
414# This file is free software; the Free Software Foundation629# This file is free software; the Free Software Foundation
415# gives unlimited permission to copy and/or distribute it,630# gives unlimited permission to copy and/or distribute it,
416# with or without modifications, as long as this notice is preserved.631# with or without modifications, as long as this notice is preserved.
417632
418# serial 16
419
420# This macro actually does too much. Some checks are only needed if633# This macro actually does too much. Some checks are only needed if
421# your package does certain things. But this isn't really a big deal.634# your package does certain things. But this isn't really a big deal.
422635
636dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
637m4_define([AC_PROG_CC],
638m4_defn([AC_PROG_CC])
639[_AM_PROG_CC_C_O
640])
641
423# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])642# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
424# AM_INIT_AUTOMAKE([OPTIONS])643# AM_INIT_AUTOMAKE([OPTIONS])
425# -----------------------------------------------644# -----------------------------------------------
@@ -432,7 +651,7 @@
432# arguments mandatory, and then we can depend on a new Autoconf651# arguments mandatory, and then we can depend on a new Autoconf
433# release and drop the old call support.652# release and drop the old call support.
434AC_DEFUN([AM_INIT_AUTOMAKE],653AC_DEFUN([AM_INIT_AUTOMAKE],
435[AC_PREREQ([2.62])dnl654[AC_PREREQ([2.65])dnl
436dnl Autoconf wants to disallow AM_ names. We explicitly allow655dnl Autoconf wants to disallow AM_ names. We explicitly allow
437dnl the ones we care about.656dnl the ones we care about.
438m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl657m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -461,31 +680,40 @@
461# Define the identity of the package.680# Define the identity of the package.
462dnl Distinguish between old-style and new-style calls.681dnl Distinguish between old-style and new-style calls.
463m4_ifval([$2],682m4_ifval([$2],
464[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl683[AC_DIAGNOSE([obsolete],
684 [$0: two- and three-arguments forms are deprecated.])
685m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465 AC_SUBST([PACKAGE], [$1])dnl686 AC_SUBST([PACKAGE], [$1])dnl
466 AC_SUBST([VERSION], [$2])],687 AC_SUBST([VERSION], [$2])],
467[_AM_SET_OPTIONS([$1])dnl688[_AM_SET_OPTIONS([$1])dnl
468dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.689dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,690m4_if(
691 m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
692 [ok:ok],,
470 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl693 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
471 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl694 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
472 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl695 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473696
474_AM_IF_OPTION([no-define],,697_AM_IF_OPTION([no-define],,
475[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])698[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
476 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl699 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
477700
478# Some tools Automake needs.701# Some tools Automake needs.
479AC_REQUIRE([AM_SANITY_CHECK])dnl702AC_REQUIRE([AM_SANITY_CHECK])dnl
480AC_REQUIRE([AC_ARG_PROGRAM])dnl703AC_REQUIRE([AC_ARG_PROGRAM])dnl
481AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})704AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
482AM_MISSING_PROG(AUTOCONF, autoconf)705AM_MISSING_PROG([AUTOCONF], [autoconf])
483AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})706AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
484AM_MISSING_PROG(AUTOHEADER, autoheader)707AM_MISSING_PROG([AUTOHEADER], [autoheader])
485AM_MISSING_PROG(MAKEINFO, makeinfo)708AM_MISSING_PROG([MAKEINFO], [makeinfo])
486AC_REQUIRE([AM_PROG_INSTALL_SH])dnl709AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
487AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl710AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
488AC_REQUIRE([AM_PROG_MKDIR_P])dnl711AC_REQUIRE([AC_PROG_MKDIR_P])dnl
712# For better backward compatibility. To be removed once Automake 1.9.x
713# dies out for good. For more background, see:
714# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
715# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
716AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
489# We need awk for the "check" target. The system "awk" is bad on717# We need awk for the "check" target. The system "awk" is bad on
490# some platforms.718# some platforms.
491AC_REQUIRE([AC_PROG_AWK])dnl719AC_REQUIRE([AC_PROG_AWK])dnl
@@ -496,34 +724,78 @@
496 [_AM_PROG_TAR([v7])])])724 [_AM_PROG_TAR([v7])])])
497_AM_IF_OPTION([no-dependencies],,725_AM_IF_OPTION([no-dependencies],,
498[AC_PROVIDE_IFELSE([AC_PROG_CC],726[AC_PROVIDE_IFELSE([AC_PROG_CC],
499 [_AM_DEPENDENCIES(CC)],727 [_AM_DEPENDENCIES([CC])],
500 [define([AC_PROG_CC],728 [m4_define([AC_PROG_CC],
501 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl729 m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
502AC_PROVIDE_IFELSE([AC_PROG_CXX],730AC_PROVIDE_IFELSE([AC_PROG_CXX],
503 [_AM_DEPENDENCIES(CXX)],731 [_AM_DEPENDENCIES([CXX])],
504 [define([AC_PROG_CXX],732 [m4_define([AC_PROG_CXX],
505 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl733 m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
506AC_PROVIDE_IFELSE([AC_PROG_OBJC],734AC_PROVIDE_IFELSE([AC_PROG_OBJC],
507 [_AM_DEPENDENCIES(OBJC)],735 [_AM_DEPENDENCIES([OBJC])],
508 [define([AC_PROG_OBJC],736 [m4_define([AC_PROG_OBJC],
509 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl737 m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
738AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
739 [_AM_DEPENDENCIES([OBJCXX])],
740 [m4_define([AC_PROG_OBJCXX],
741 m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
510])742])
511_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl743AC_REQUIRE([AM_SILENT_RULES])dnl
512dnl The `parallel-tests' driver may need to know about EXEEXT, so add the744dnl The testsuite driver may need to know about EXEEXT, so add the
513dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro745dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
514dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.746dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
515AC_CONFIG_COMMANDS_PRE(dnl747AC_CONFIG_COMMANDS_PRE(dnl
516[m4_provide_if([_AM_COMPILER_EXEEXT],748[m4_provide_if([_AM_COMPILER_EXEEXT],
517 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl749 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
518])750
519751# POSIX will say in a future version that running "rm -f" with no argument
520dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not752# is OK; and we want to be able to make that assumption in our Makefile
753# recipes. So use an aggressive probe to check that the usage we want is
754# actually supported "in the wild" to an acceptable degree.
755# See automake bug#10828.
756# To make any issue more visible, cause the running configure to be aborted
757# by default if the 'rm' program in use doesn't match our expectations; the
758# user can still override this though.
759if rm -f && rm -fr && rm -rf; then : OK; else
760 cat >&2 <<'END'
761Oops!
762
763Your 'rm' program seems unable to run without file operands specified
764on the command line, even when the '-f' option is present. This is contrary
765to the behaviour of most rm programs out there, and not conforming with
766the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
767
768Please tell bug-automake@gnu.org about your system, including the value
769of your $PATH and any error possibly output before this message. This
770can help us improve future automake versions.
771
772END
773 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
774 echo 'Configuration will proceed anyway, since you have set the' >&2
775 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
776 echo >&2
777 else
778 cat >&2 <<'END'
779Aborting the configuration process, to ensure you take notice of the issue.
780
781You can download and install GNU coreutils to get an 'rm' implementation
782that behaves properly: <http://www.gnu.org/software/coreutils/>.
783
784If you want to complete the configuration process using your problematic
785'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
786to "yes", and re-run configure.
787
788END
789 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
790 fi
791fi])
792
793dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
521dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further794dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
522dnl mangled by Autoconf and run in a shell conditional statement.795dnl mangled by Autoconf and run in a shell conditional statement.
523m4_define([_AC_COMPILER_EXEEXT],796m4_define([_AC_COMPILER_EXEEXT],
524m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])797m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525798
526
527# When config.status generates a header, we must update the stamp-h file.799# When config.status generates a header, we must update the stamp-h file.
528# This file resides in the same directory as the config header800# This file resides in the same directory as the config header
529# that is generated. The stamp files are numbered to have different names.801# that is generated. The stamp files are numbered to have different names.
@@ -545,7 +817,7 @@
545done817done
546echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])818echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547819
548# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.820# Copyright (C) 2001-2013 Free Software Foundation, Inc.
549#821#
550# This file is free software; the Free Software Foundation822# This file is free software; the Free Software Foundation
551# gives unlimited permission to copy and/or distribute it,823# gives unlimited permission to copy and/or distribute it,
@@ -564,16 +836,14 @@
564 install_sh="\${SHELL} $am_aux_dir/install-sh"836 install_sh="\${SHELL} $am_aux_dir/install-sh"
565 esac837 esac
566fi838fi
567AC_SUBST(install_sh)])839AC_SUBST([install_sh])])
568840
569# Copyright (C) 2003, 2005 Free Software Foundation, Inc.841# Copyright (C) 2003-2013 Free Software Foundation, Inc.
570#842#
571# This file is free software; the Free Software Foundation843# This file is free software; the Free Software Foundation
572# gives unlimited permission to copy and/or distribute it,844# gives unlimited permission to copy and/or distribute it,
573# with or without modifications, as long as this notice is preserved.845# with or without modifications, as long as this notice is preserved.
574846
575# serial 2
576
577# Check whether the underlying file-system supports filenames847# Check whether the underlying file-system supports filenames
578# with a leading dot. For instance MS-DOS doesn't.848# with a leading dot. For instance MS-DOS doesn't.
579AC_DEFUN([AM_SET_LEADING_DOT],849AC_DEFUN([AM_SET_LEADING_DOT],
@@ -587,16 +857,50 @@
587rmdir .tst 2>/dev/null857rmdir .tst 2>/dev/null
588AC_SUBST([am__leading_dot])])858AC_SUBST([am__leading_dot])])
589859
860# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
861# From Jim Meyering
862
863# Copyright (C) 1996-2013 Free Software Foundation, Inc.
864#
865# This file is free software; the Free Software Foundation
866# gives unlimited permission to copy and/or distribute it,
867# with or without modifications, as long as this notice is preserved.
868
869# AM_MAINTAINER_MODE([DEFAULT-MODE])
870# ----------------------------------
871# Control maintainer-specific portions of Makefiles.
872# Default is to disable them, unless 'enable' is passed literally.
873# For symmetry, 'disable' may be passed as well. Anyway, the user
874# can override the default with the --enable/--disable switch.
875AC_DEFUN([AM_MAINTAINER_MODE],
876[m4_case(m4_default([$1], [disable]),
877 [enable], [m4_define([am_maintainer_other], [disable])],
878 [disable], [m4_define([am_maintainer_other], [enable])],
879 [m4_define([am_maintainer_other], [enable])
880 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
881AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
882 dnl maintainer-mode's default is 'disable' unless 'enable' is passed
883 AC_ARG_ENABLE([maintainer-mode],
884 [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
885 am_maintainer_other[ make rules and dependencies not useful
886 (and sometimes confusing) to the casual installer])],
887 [USE_MAINTAINER_MODE=$enableval],
888 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
889 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
890 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
891 MAINT=$MAINTAINER_MODE_TRUE
892 AC_SUBST([MAINT])dnl
893]
894)
895
590# Check to see how 'make' treats includes. -*- Autoconf -*-896# Check to see how 'make' treats includes. -*- Autoconf -*-
591897
592# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.898# Copyright (C) 2001-2013 Free Software Foundation, Inc.
593#899#
594# This file is free software; the Free Software Foundation900# This file is free software; the Free Software Foundation
595# gives unlimited permission to copy and/or distribute it,901# gives unlimited permission to copy and/or distribute it,
596# with or without modifications, as long as this notice is preserved.902# with or without modifications, as long as this notice is preserved.
597903
598# serial 4
599
600# AM_MAKE_INCLUDE()904# AM_MAKE_INCLUDE()
601# -----------------905# -----------------
602# Check to see how make treats includes.906# Check to see how make treats includes.
@@ -614,7 +918,7 @@
614_am_result=none918_am_result=none
615# First try GNU make style include.919# First try GNU make style include.
616echo "include confinc" > confmf920echo "include confinc" > confmf
617# Ignore all kinds of additional output from `make'.921# Ignore all kinds of additional output from 'make'.
618case `$am_make -s -f confmf 2> /dev/null` in #(922case `$am_make -s -f confmf 2> /dev/null` in #(
619*the\ am__doit\ target*)923*the\ am__doit\ target*)
620 am__include=include924 am__include=include
@@ -641,15 +945,12 @@
641945
642# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-946# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
643947
644# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008948# Copyright (C) 1997-2013 Free Software Foundation, Inc.
645# Free Software Foundation, Inc.
646#949#
647# This file is free software; the Free Software Foundation950# This file is free software; the Free Software Foundation
648# gives unlimited permission to copy and/or distribute it,951# gives unlimited permission to copy and/or distribute it,
649# with or without modifications, as long as this notice is preserved.952# with or without modifications, as long as this notice is preserved.
650953
651# serial 6
652
653# AM_MISSING_PROG(NAME, PROGRAM)954# AM_MISSING_PROG(NAME, PROGRAM)
654# ------------------------------955# ------------------------------
655AC_DEFUN([AM_MISSING_PROG],956AC_DEFUN([AM_MISSING_PROG],
@@ -657,11 +958,10 @@
657$1=${$1-"${am_missing_run}$2"}958$1=${$1-"${am_missing_run}$2"}
658AC_SUBST($1)])959AC_SUBST($1)])
659960
660
661# AM_MISSING_HAS_RUN961# AM_MISSING_HAS_RUN
662# ------------------962# ------------------
663# Define MISSING if not defined so far and test if it supports --run.963# Define MISSING if not defined so far and test if it is modern enough.
664# If it does, set am_missing_run to use it, otherwise, to nothing.964# If it is, set am_missing_run to use it, otherwise, to nothing.
665AC_DEFUN([AM_MISSING_HAS_RUN],965AC_DEFUN([AM_MISSING_HAS_RUN],
666[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl966[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
667AC_REQUIRE_AUX_FILE([missing])dnl967AC_REQUIRE_AUX_FILE([missing])dnl
@@ -674,63 +974,35 @@
674 esac974 esac
675fi975fi
676# Use eval to expand $SHELL976# Use eval to expand $SHELL
677if eval "$MISSING --run true"; then977if eval "$MISSING --is-lightweight"; then
678 am_missing_run="$MISSING --run "978 am_missing_run="$MISSING "
679else979else
680 am_missing_run=980 am_missing_run=
681 AC_MSG_WARN([`missing' script is too old or missing])981 AC_MSG_WARN(['missing' script is too old or missing])
682fi982fi
683])983])
684984
685# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
686#
687# This file is free software; the Free Software Foundation
688# gives unlimited permission to copy and/or distribute it,
689# with or without modifications, as long as this notice is preserved.
690
691# AM_PROG_MKDIR_P
692# ---------------
693# Check for `mkdir -p'.
694AC_DEFUN([AM_PROG_MKDIR_P],
695[AC_PREREQ([2.60])dnl
696AC_REQUIRE([AC_PROG_MKDIR_P])dnl
697dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
698dnl while keeping a definition of mkdir_p for backward compatibility.
699dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
700dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
701dnl Makefile.ins that do not define MKDIR_P, so we do our own
702dnl adjustment using top_builddir (which is defined more often than
703dnl MKDIR_P).
704AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
705case $mkdir_p in
706 [[\\/$]]* | ?:[[\\/]]*) ;;
707 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
708esac
709])
710
711# Helper functions for option handling. -*- Autoconf -*-985# Helper functions for option handling. -*- Autoconf -*-
712986
713# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.987# Copyright (C) 2001-2013 Free Software Foundation, Inc.
714#988#
715# This file is free software; the Free Software Foundation989# This file is free software; the Free Software Foundation
716# gives unlimited permission to copy and/or distribute it,990# gives unlimited permission to copy and/or distribute it,
717# with or without modifications, as long as this notice is preserved.991# with or without modifications, as long as this notice is preserved.
718992
719# serial 4
720
721# _AM_MANGLE_OPTION(NAME)993# _AM_MANGLE_OPTION(NAME)
722# -----------------------994# -----------------------
723AC_DEFUN([_AM_MANGLE_OPTION],995AC_DEFUN([_AM_MANGLE_OPTION],
724[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])996[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
725997
726# _AM_SET_OPTION(NAME)998# _AM_SET_OPTION(NAME)
727# ------------------------------999# --------------------
728# Set option NAME. Presently that only means defining a flag for this option.1000# Set option NAME. Presently that only means defining a flag for this option.
729AC_DEFUN([_AM_SET_OPTION],1001AC_DEFUN([_AM_SET_OPTION],
730[m4_define(_AM_MANGLE_OPTION([$1]), 1)])1002[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
7311003
732# _AM_SET_OPTIONS(OPTIONS)1004# _AM_SET_OPTIONS(OPTIONS)
733# ----------------------------------1005# ------------------------
734# OPTIONS is a space-separated list of Automake options.1006# OPTIONS is a space-separated list of Automake options.
735AC_DEFUN([_AM_SET_OPTIONS],1007AC_DEFUN([_AM_SET_OPTIONS],
736[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])1008[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
@@ -741,24 +1013,82 @@
741AC_DEFUN([_AM_IF_OPTION],1013AC_DEFUN([_AM_IF_OPTION],
742[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])1014[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7431015
1016# Copyright (C) 1999-2013 Free Software Foundation, Inc.
1017#
1018# This file is free software; the Free Software Foundation
1019# gives unlimited permission to copy and/or distribute it,
1020# with or without modifications, as long as this notice is preserved.
1021
1022# _AM_PROG_CC_C_O
1023# ---------------
1024# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
1025# to automatically call this.
1026AC_DEFUN([_AM_PROG_CC_C_O],
1027[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1028AC_REQUIRE_AUX_FILE([compile])dnl
1029AC_LANG_PUSH([C])dnl
1030AC_CACHE_CHECK(
1031 [whether $CC understands -c and -o together],
1032 [am_cv_prog_cc_c_o],
1033 [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
1034 # Make sure it works both with $CC and with simple cc.
1035 # Following AC_PROG_CC_C_O, we do the test twice because some
1036 # compilers refuse to overwrite an existing .o file with -o,
1037 # though they will create one.
1038 am_cv_prog_cc_c_o=yes
1039 for am_i in 1 2; do
1040 if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
1041 && test -f conftest2.$ac_objext; then
1042 : OK
1043 else
1044 am_cv_prog_cc_c_o=no
1045 break
1046 fi
1047 done
1048 rm -f core conftest*
1049 unset am_i])
1050if test "$am_cv_prog_cc_c_o" != yes; then
1051 # Losing compiler, so override with the script.
1052 # FIXME: It is wrong to rewrite CC.
1053 # But if we don't then we get into trouble of one sort or another.
1054 # A longer-term fix would be to have automake use am__CC in this case,
1055 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
1056 CC="$am_aux_dir/compile $CC"
1057fi
1058AC_LANG_POP([C])])
1059
1060# For backward compatibility.
1061AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
1062
1063# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1064#
1065# This file is free software; the Free Software Foundation
1066# gives unlimited permission to copy and/or distribute it,
1067# with or without modifications, as long as this notice is preserved.
1068
1069# AM_RUN_LOG(COMMAND)
1070# -------------------
1071# Run COMMAND, save the exit status in ac_status, and log it.
1072# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
1073AC_DEFUN([AM_RUN_LOG],
1074[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
1075 ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
1076 ac_status=$?
1077 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1078 (exit $ac_status); }])
1079
744# Check to make sure that the build environment is sane. -*- Autoconf -*-1080# Check to make sure that the build environment is sane. -*- Autoconf -*-
7451081
746# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 20081082# Copyright (C) 1996-2013 Free Software Foundation, Inc.
747# Free Software Foundation, Inc.
748#1083#
749# This file is free software; the Free Software Foundation1084# This file is free software; the Free Software Foundation
750# gives unlimited permission to copy and/or distribute it,1085# gives unlimited permission to copy and/or distribute it,
751# with or without modifications, as long as this notice is preserved.1086# with or without modifications, as long as this notice is preserved.
7521087
753# serial 5
754
755# AM_SANITY_CHECK1088# AM_SANITY_CHECK
756# ---------------1089# ---------------
757AC_DEFUN([AM_SANITY_CHECK],1090AC_DEFUN([AM_SANITY_CHECK],
758[AC_MSG_CHECKING([whether build environment is sane])1091[AC_MSG_CHECKING([whether build environment is sane])
759# Just in case
760sleep 1
761echo timestamp > conftest.file
762# Reject unsafe characters in $srcdir or the absolute working directory1092# Reject unsafe characters in $srcdir or the absolute working directory
763# name. Accept space and tab only in the latter.1093# name. Accept space and tab only in the latter.
764am_lf='1094am_lf='
@@ -769,32 +1099,40 @@
769esac1099esac
770case $srcdir in1100case $srcdir in
771 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)1101 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
772 AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;1102 AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
773esac1103esac
7741104
775# Do `set' in a subshell so we don't clobber the current shell's1105# Do 'set' in a subshell so we don't clobber the current shell's
776# arguments. Must try -L first in case configure is actually a1106# arguments. Must try -L first in case configure is actually a
777# symlink; some systems play weird games with the mod time of symlinks1107# symlink; some systems play weird games with the mod time of symlinks
778# (eg FreeBSD returns the mod time of the symlink's containing1108# (eg FreeBSD returns the mod time of the symlink's containing
779# directory).1109# directory).
780if (1110if (
781 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`1111 am_has_slept=no
782 if test "$[*]" = "X"; then1112 for am_try in 1 2; do
783 # -L didn't work.1113 echo "timestamp, slept: $am_has_slept" > conftest.file
784 set X `ls -t "$srcdir/configure" conftest.file`1114 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
785 fi1115 if test "$[*]" = "X"; then
786 rm -f conftest.file1116 # -L didn't work.
787 if test "$[*]" != "X $srcdir/configure conftest.file" \1117 set X `ls -t "$srcdir/configure" conftest.file`
788 && test "$[*]" != "X conftest.file $srcdir/configure"; then1118 fi
7891119 if test "$[*]" != "X $srcdir/configure conftest.file" \
790 # If neither matched, then we have a broken ls. This can happen1120 && test "$[*]" != "X conftest.file $srcdir/configure"; then
791 # if, for instance, CONFIG_SHELL is bash and it inherits a1121
792 # broken ls alias from the environment. This has actually1122 # If neither matched, then we have a broken ls. This can happen
793 # happened. Such a system could not be considered "sane".1123 # if, for instance, CONFIG_SHELL is bash and it inherits a
794 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken1124 # broken ls alias from the environment. This has actually
795alias in your environment])1125 # happened. Such a system could not be considered "sane".
796 fi1126 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
7971127 alias in your environment])
1128 fi
1129 if test "$[2]" = conftest.file || test $am_try -eq 2; then
1130 break
1131 fi
1132 # Just in case.
1133 sleep 1
1134 am_has_slept=yes
1135 done
798 test "$[2]" = conftest.file1136 test "$[2]" = conftest.file
799 )1137 )
800then1138then
@@ -804,9 +1142,85 @@
804 AC_MSG_ERROR([newly created file is older than distributed files!1142 AC_MSG_ERROR([newly created file is older than distributed files!
805Check your system clock])1143Check your system clock])
806fi1144fi
807AC_MSG_RESULT(yes)])1145AC_MSG_RESULT([yes])
8081146# If we didn't sleep, we still need to ensure time stamps of config.status and
809# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.1147# generated files are strictly newer.
1148am_sleep_pid=
1149if grep 'slept: no' conftest.file >/dev/null 2>&1; then
1150 ( sleep 1 ) &
1151 am_sleep_pid=$!
1152fi
1153AC_CONFIG_COMMANDS_PRE(
1154 [AC_MSG_CHECKING([that generated files are newer than configure])
1155 if test -n "$am_sleep_pid"; then
1156 # Hide warnings about reused PIDs.
1157 wait $am_sleep_pid 2>/dev/null
1158 fi
1159 AC_MSG_RESULT([done])])
1160rm -f conftest.file
1161])
1162
1163# Copyright (C) 2009-2013 Free Software Foundation, Inc.
1164#
1165# This file is free software; the Free Software Foundation
1166# gives unlimited permission to copy and/or distribute it,
1167# with or without modifications, as long as this notice is preserved.
1168
1169# AM_SILENT_RULES([DEFAULT])
1170# --------------------------
1171# Enable less verbose build rules; with the default set to DEFAULT
1172# ("yes" being less verbose, "no" or empty being verbose).
1173AC_DEFUN([AM_SILENT_RULES],
1174[AC_ARG_ENABLE([silent-rules], [dnl
1175AS_HELP_STRING(
1176 [--enable-silent-rules],
1177 [less verbose build output (undo: "make V=1")])
1178AS_HELP_STRING(
1179 [--disable-silent-rules],
1180 [verbose build output (undo: "make V=0")])dnl
1181])
1182case $enable_silent_rules in @%:@ (((
1183 yes) AM_DEFAULT_VERBOSITY=0;;
1184 no) AM_DEFAULT_VERBOSITY=1;;
1185 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1186esac
1187dnl
1188dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
1189dnl do not support nested variable expansions.
1190dnl See automake bug#9928 and bug#10237.
1191am_make=${MAKE-make}
1192AC_CACHE_CHECK([whether $am_make supports nested variables],
1193 [am_cv_make_support_nested_variables],
1194 [if AS_ECHO([['TRUE=$(BAR$(V))
1195BAR0=false
1196BAR1=true
1197V=1
1198am__doit:
1199 @$(TRUE)
1200.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
1201 am_cv_make_support_nested_variables=yes
1202else
1203 am_cv_make_support_nested_variables=no
1204fi])
1205if test $am_cv_make_support_nested_variables = yes; then
1206 dnl Using '$V' instead of '$(V)' breaks IRIX make.
1207 AM_V='$(V)'
1208 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
1209else
1210 AM_V=$AM_DEFAULT_VERBOSITY
1211 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
1212fi
1213AC_SUBST([AM_V])dnl
1214AM_SUBST_NOTMAKE([AM_V])dnl
1215AC_SUBST([AM_DEFAULT_V])dnl
1216AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1217AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1218AM_BACKSLASH='\'
1219AC_SUBST([AM_BACKSLASH])dnl
1220_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1221])
1222
1223# Copyright (C) 2001-2013 Free Software Foundation, Inc.
810#1224#
811# This file is free software; the Free Software Foundation1225# This file is free software; the Free Software Foundation
812# gives unlimited permission to copy and/or distribute it,1226# gives unlimited permission to copy and/or distribute it,
@@ -814,34 +1228,32 @@
8141228
815# AM_PROG_INSTALL_STRIP1229# AM_PROG_INSTALL_STRIP
816# ---------------------1230# ---------------------
817# One issue with vendor `install' (even GNU) is that you can't1231# One issue with vendor 'install' (even GNU) is that you can't
818# specify the program used to strip binaries. This is especially1232# specify the program used to strip binaries. This is especially
819# annoying in cross-compiling environments, where the build's strip1233# annoying in cross-compiling environments, where the build's strip
820# is unlikely to handle the host's binaries.1234# is unlikely to handle the host's binaries.
821# Fortunately install-sh will honor a STRIPPROG variable, so we1235# Fortunately install-sh will honor a STRIPPROG variable, so we
822# always use install-sh in `make install-strip', and initialize1236# always use install-sh in "make install-strip", and initialize
823# STRIPPROG with the value of the STRIP variable (set by the user).1237# STRIPPROG with the value of the STRIP variable (set by the user).
824AC_DEFUN([AM_PROG_INSTALL_STRIP],1238AC_DEFUN([AM_PROG_INSTALL_STRIP],
825[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl1239[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
826# Installed binaries are usually stripped using `strip' when the user1240# Installed binaries are usually stripped using 'strip' when the user
827# run `make install-strip'. However `strip' might not be the right1241# run "make install-strip". However 'strip' might not be the right
828# tool to use in cross-compilation environments, therefore Automake1242# tool to use in cross-compilation environments, therefore Automake
829# will honor the `STRIP' environment variable to overrule this program.1243# will honor the 'STRIP' environment variable to overrule this program.
830dnl Don't test for $cross_compiling = yes, because it might be `maybe'.1244dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
831if test "$cross_compiling" != no; then1245if test "$cross_compiling" != no; then
832 AC_CHECK_TOOL([STRIP], [strip], :)1246 AC_CHECK_TOOL([STRIP], [strip], :)
833fi1247fi
834INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"1248INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
835AC_SUBST([INSTALL_STRIP_PROGRAM])])1249AC_SUBST([INSTALL_STRIP_PROGRAM])])
8361250
837# Copyright (C) 2006, 2008 Free Software Foundation, Inc.1251# Copyright (C) 2006-2013 Free Software Foundation, Inc.
838#1252#
839# This file is free software; the Free Software Foundation1253# This file is free software; the Free Software Foundation
840# gives unlimited permission to copy and/or distribute it,1254# gives unlimited permission to copy and/or distribute it,
841# with or without modifications, as long as this notice is preserved.1255# with or without modifications, as long as this notice is preserved.
8421256
843# serial 2
844
845# _AM_SUBST_NOTMAKE(VARIABLE)1257# _AM_SUBST_NOTMAKE(VARIABLE)
846# ---------------------------1258# ---------------------------
847# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.1259# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
@@ -849,24 +1261,22 @@
849AC_DEFUN([_AM_SUBST_NOTMAKE])1261AC_DEFUN([_AM_SUBST_NOTMAKE])
8501262
851# AM_SUBST_NOTMAKE(VARIABLE)1263# AM_SUBST_NOTMAKE(VARIABLE)
852# ---------------------------1264# --------------------------
853# Public sister of _AM_SUBST_NOTMAKE.1265# Public sister of _AM_SUBST_NOTMAKE.
854AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])1266AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
8551267
856# Check how to create a tarball. -*- Autoconf -*-1268# Check how to create a tarball. -*- Autoconf -*-
8571269
858# Copyright (C) 2004, 2005 Free Software Foundation, Inc.1270# Copyright (C) 2004-2013 Free Software Foundation, Inc.
859#1271#
860# This file is free software; the Free Software Foundation1272# This file is free software; the Free Software Foundation
861# gives unlimited permission to copy and/or distribute it,1273# gives unlimited permission to copy and/or distribute it,
862# with or without modifications, as long as this notice is preserved.1274# with or without modifications, as long as this notice is preserved.
8631275
864# serial 2
865
866# _AM_PROG_TAR(FORMAT)1276# _AM_PROG_TAR(FORMAT)
867# --------------------1277# --------------------
868# Check how to create a tarball in format FORMAT.1278# Check how to create a tarball in format FORMAT.
869# FORMAT should be one of `v7', `ustar', or `pax'.1279# FORMAT should be one of 'v7', 'ustar', or 'pax'.
870#1280#
871# Substitute a variable $(am__tar) that is a command1281# Substitute a variable $(am__tar) that is a command
872# writing to stdout a FORMAT-tarball containing the directory1282# writing to stdout a FORMAT-tarball containing the directory
@@ -876,75 +1286,114 @@
876# Substitute a variable $(am__untar) that extract such1286# Substitute a variable $(am__untar) that extract such
877# a tarball read from stdin.1287# a tarball read from stdin.
878# $(am__untar) < result.tar1288# $(am__untar) < result.tar
1289#
879AC_DEFUN([_AM_PROG_TAR],1290AC_DEFUN([_AM_PROG_TAR],
880[# Always define AMTAR for backward compatibility.1291[# Always define AMTAR for backward compatibility. Yes, it's still used
881AM_MISSING_PROG([AMTAR], [tar])1292# in the wild :-( We should find a proper way to deprecate it ...
1293AC_SUBST([AMTAR], ['$${TAR-tar}'])
1294
1295# We'll loop over all known methods to create a tar archive until one works.
1296_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1297
882m4_if([$1], [v7],1298m4_if([$1], [v7],
883 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],1299 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
884 [m4_case([$1], [ustar],, [pax],,1300
885 [m4_fatal([Unknown tar format])])1301 [m4_case([$1],
886AC_MSG_CHECKING([how to create a $1 tar archive])1302 [ustar],
887# Loop over all known methods to create a tar archive until one works.1303 [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
888_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'1304 # There is notably a 21 bits limit for the UID and the GID. In fact,
889_am_tools=${am_cv_prog_tar_$1-$_am_tools}1305 # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
890# Do not fold the above two line into one, because Tru64 sh and1306 # and bug#13588).
891# Solaris sh will not grok spaces in the rhs of `-'.1307 am_max_uid=2097151 # 2^21 - 1
892for _am_tool in $_am_tools1308 am_max_gid=$am_max_uid
893do1309 # The $UID and $GID variables are not portable, so we need to resort
894 case $_am_tool in1310 # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
895 gnutar)1311 # below are definitely unexpected, so allow the users to see them
896 for _am_tar in tar gnutar gtar;1312 # (that is, avoid stderr redirection).
897 do1313 am_uid=`id -u || echo unknown`
898 AM_RUN_LOG([$_am_tar --version]) && break1314 am_gid=`id -g || echo unknown`
899 done1315 AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
900 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'1316 if test $am_uid -le $am_max_uid; then
901 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'1317 AC_MSG_RESULT([yes])
902 am__untar="$_am_tar -xf -"1318 else
903 ;;1319 AC_MSG_RESULT([no])
904 plaintar)1320 _am_tools=none
905 # Must skip GNU tar: if it does not support --format= it doesn't create1321 fi
906 # ustar tarball either.1322 AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
907 (tar --version) >/dev/null 2>&1 && continue1323 if test $am_gid -le $am_max_gid; then
908 am__tar='tar chf - "$$tardir"'1324 AC_MSG_RESULT([yes])
909 am__tar_='tar chf - "$tardir"'1325 else
910 am__untar='tar xf -'1326 AC_MSG_RESULT([no])
911 ;;1327 _am_tools=none
912 pax)1328 fi],
913 am__tar='pax -L -x $1 -w "$$tardir"'1329
914 am__tar_='pax -L -x $1 -w "$tardir"'1330 [pax],
915 am__untar='pax -r'1331 [],
916 ;;1332
917 cpio)1333 [m4_fatal([Unknown tar format])])
918 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'1334
919 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'1335 AC_MSG_CHECKING([how to create a $1 tar archive])
920 am__untar='cpio -i -H $1 -d'1336
921 ;;1337 # Go ahead even if we have the value already cached. We do so because we
922 none)1338 # need to set the values for the 'am__tar' and 'am__untar' variables.
923 am__tar=false1339 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
924 am__tar_=false1340
925 am__untar=false1341 for _am_tool in $_am_tools; do
926 ;;1342 case $_am_tool in
927 esac1343 gnutar)
9281344 for _am_tar in tar gnutar gtar; do
929 # If the value was cached, stop now. We just wanted to have am__tar1345 AM_RUN_LOG([$_am_tar --version]) && break
930 # and am__untar set.1346 done
931 test -n "${am_cv_prog_tar_$1}" && break1347 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9321348 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
933 # tar/untar a dummy directory, and stop if the command works1349 am__untar="$_am_tar -xf -"
934 rm -rf conftest.dir1350 ;;
935 mkdir conftest.dir1351 plaintar)
936 echo GrepMe > conftest.dir/file1352 # Must skip GNU tar: if it does not support --format= it doesn't create
937 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])1353 # ustar tarball either.
938 rm -rf conftest.dir1354 (tar --version) >/dev/null 2>&1 && continue
939 if test -s conftest.tar; then1355 am__tar='tar chf - "$$tardir"'
940 AM_RUN_LOG([$am__untar <conftest.tar])1356 am__tar_='tar chf - "$tardir"'
941 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break1357 am__untar='tar xf -'
942 fi1358 ;;
943done1359 pax)
944rm -rf conftest.dir1360 am__tar='pax -L -x $1 -w "$$tardir"'
9451361 am__tar_='pax -L -x $1 -w "$tardir"'
946AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])1362 am__untar='pax -r'
947AC_MSG_RESULT([$am_cv_prog_tar_$1])])1363 ;;
1364 cpio)
1365 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1366 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1367 am__untar='cpio -i -H $1 -d'
1368 ;;
1369 none)
1370 am__tar=false
1371 am__tar_=false
1372 am__untar=false
1373 ;;
1374 esac
1375
1376 # If the value was cached, stop now. We just wanted to have am__tar
1377 # and am__untar set.
1378 test -n "${am_cv_prog_tar_$1}" && break
1379
1380 # tar/untar a dummy directory, and stop if the command works.
1381 rm -rf conftest.dir
1382 mkdir conftest.dir
1383 echo GrepMe > conftest.dir/file
1384 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1385 rm -rf conftest.dir
1386 if test -s conftest.tar; then
1387 AM_RUN_LOG([$am__untar <conftest.tar])
1388 AM_RUN_LOG([cat conftest.dir/file])
1389 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1390 fi
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: