Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 45254
Collapse All | Expand All

(-)bind-9.2.2-orig/bin/Makefile.in (-1 / +1 lines)
Lines 19-25 Link Here
19
VPATH =		@srcdir@
19
VPATH =		@srcdir@
20
top_srcdir =	@top_srcdir@
20
top_srcdir =	@top_srcdir@
21
21
22
SUBDIRS =	named rndc dig dnssec tests nsupdate check
22
SUBDIRS =	@DLZ_BDB_UTIL@ named rndc dig dnssec tests nsupdate check
23
TARGETS =
23
TARGETS =
24
24
25
@BIND9_MAKE_RULES@
25
@BIND9_MAKE_RULES@
(-)bind-9.2.2-orig/bin/dlzbdb/Makefile.in (+73 lines)
Line 0 Link Here
1
# Copyright (C) 1998-2001  Internet Software Consortium.
2
#
3
# Permission to use, copy, modify, and distribute this software for any
4
# purpose with or without fee is hereby granted, provided that the above
5
# copyright notice and this permission notice appear in all copies.
6
#
7
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
8
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
9
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
10
# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
11
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
12
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
13
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
14
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
16
# $Id: Makefile.in,v 1.74 2001/06/01 00:45:00 bwelling Exp $
17
18
srcdir =	@srcdir@
19
VPATH =		@srcdir@
20
top_srcdir =	@top_srcdir@
21
22
@BIND9_VERSION@
23
24
@BIND9_INCLUDES@
25
26
DLZINCLUDES =	@DLZ_BDB_INC@
27
28
CINCLUDES =	-I${srcdir}/include -I${srcdir}/unix/include \
29
                ${ISC_INCLUDES} ${DLZINCLUDES}
30
                
31
CDEFINES =      @USE_DLZ_BDB@
32
CWARNINGS =
33
34
DLZLIBS = 	@DLZ_BDB_LIBS@
35
ISCLIBS =	../../lib/isc/libisc.@A@
36
37
DEPLIBS =	${ISCDEPLIBS}
38
39
LIBS =		${ISCLIBS} ${DLZLIBS} @LIBS@
40
41
TARGETS =	dlzbdb
42
43
SRCS =		dlzbdb.c
44
45
#MANPAGES =	
46
47
#HTMLPAGES =	
48
49
#MANOBJS =	${MANPAGES} ${HTMLPAGES}
50
51
@BIND9_MAKE_RULES@
52
53
dlzbdb.@O@: dlzbdb.c
54
	${LIBTOOL} ${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \
55
		-c ${srcdir}/dlzbdb.c
56
57
dlzbdb: dlzbdb.@O@ ${DEPLIBS}
58
	${LIBTOOL} ${PURIFY} ${CC} ${CFLAGS} -o $@ dlzbdb.@O@ ${LIBS}
59
60
doc man:: ${MANOBJS}
61
62
#docclean manclean maintainer-clean::
63
#	rm -f ${MANOBJS}
64
65
clean distclean maintainer-clean::
66
	rm -f ${TARGETS}
67
68
installdirs:
69
	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
70
#	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
71
72
install:: dlzbdb installdirs
73
	${LIBTOOL} ${INSTALL_PROGRAM} dlzbdb ${DESTDIR}${sbindir}
(-)bind-9.2.2-orig/bin/dlzbdb/dlzbdb.c (+1120 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
/*
37
 * Copyright (C) 1999-2001  Internet Software Consortium.
38
 *
39
 * Permission to use, copy, modify, and distribute this software for any
40
 * purpose with or without fee is hereby granted, provided that the above
41
 * copyright notice and this permission notice appear in all copies.
42
 *
43
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
44
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
45
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
46
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
47
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
48
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
50
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
51
 */
52
53
#ifdef DLZ_BDB
54
55
// exit codes
56
// 0 everything ok
57
// 1 error parsing command line
58
// 2 Missing, too many or invalid combination of command line parameters
59
// 3 Unable to open BDB database.
60
// 4 Unable to allocate memory for, or create lexer.
61
// 5 unable to perform BDB cursor operation
62
63
#include <config.h>
64
#include <stdio.h>
65
#include <string.h>
66
#include <stdlib.h>
67
68
#include <isc/buffer.h>
69
#include <isc/commandline.h>
70
#include <isc/formatcheck.h>
71
#include <isc/lex.h>
72
#include <isc/mem.h>
73
#include <isc/result.h>
74
#include <isc/string.h>
75
#include <isc/util.h>
76
77
#include <db.h>
78
79
/* shut up compiler warnings about no previous prototype */
80
81
static void
82
show_usage(void);
83
84
int
85
getzone(DB *dbp, const DBT *pkey, const DBT *pdata, DBT *skey);
86
87
int
88
gethost(DB *dbp, const DBT *pkey, const DBT *pdata, DBT *skey);
89
90
void
91
bdb_cleanup(void);
92
93
isc_result_t
94
bdb_opendb(DBTYPE db_type, DB **db_out, const char *db_name, int flags);
95
96
void
97
put_data(isc_boolean_t dns_data, char *input_key, char *input_data);
98
99
void
100
insert_data(void);
101
102
isc_result_t
103
openBDB(void);
104
105
isc_result_t
106
open_lexer(void);
107
108
void
109
close_lexer(void);
110
111
void
112
operation_add(void);
113
114
void
115
operation_bulk(void);
116
117
void
118
operation_listOrDelete(isc_boolean_t dlt);
119
120
                                             
121
	/* Maximum length of a single data line that 
122
	 * may be inserted into database by this program.
123
	 * If you need to insert a line of data that is more
124
	 * than 10,000 characters change this definition.
125
     */
126
127
#define max_data_len 10000
128
129
	/* BDB database names.  If you want to use different
130
	 * database names change them here. 
131
     */
132
133
#define dlz_data "dns_data"
134
#define dlz_zone "dns_zone"
135
#define dlz_host "dns_host"
136
#define dlz_client "dns_client"
137
138
139
	/* Error code returned by BDB secondary index callback functions.
140
	 * This error is returned if the callback function could not create
141
	 * the secondary index for any reason.
142
     */
143
144
#define BDBparseErr 1
145
146
	/* A struct to hold all the relevant info about the database */
147
148
typedef struct bdb_instance {
149
	DB_ENV		*dbenv;	// BDB environment
150
	DB				*data;	// dns_data database handle
151
	DBC			*cursor;	// database cursor
152
	DBC			*cursor2;// second cursor used during list operation.
153
	DBC			*cursor3;// third cursor used during list operation
154
	DBC			*cursor4;// fourth cursor used during list operation
155
	DB				*zone;	// zone database handle
156
	DB				*host;	// host database handle
157
	DB				*client;	// client database handle
158
}bdb_instance_t;
159
160
	/* Possible operations */
161
162
#define list 1		// list data
163
#define dele 2		// delete data
164
#define add 3		// add a single piece of data
165
#define bulk 4		// bulk load data
166
167
168
	/* quit macro is used instead of exit.  quit always trys to close the lexer
169
	 * and the BDB database before exiting.
170
     */
171
172
#define quit(i) 	close_lexer(); bdb_cleanup(); exit(i);
173
174
	/* checkOp is used to verify that only one operation (list, del, add, bulk)
175
	 * is specified on the command line.  This prevents a user from specifying
176
	 * two operations on the command line, which would make no sense anyway.
177
     */
178
179
#define checkOp(x) if(x != 0){fprintf(stderr, "\nonly one operation "\
180
										"(l d a f) may be specified\n");	quit(2);}
181
182
	/* checkParam is used to only allow a parameter to be specified once.
183
	 * I.E. the parameter key can only be used on the command line once.
184
	 * any attempt to use it twice causes an error.
185
     */
186
187
#define checkParam(x, y) if(x != NULL){fprintf(stderr, "\n%s may only "\
188
													"be specified once\n", y);	quit(2);}
189
190
	/* checkInvalidParam is used to only allow paramters which make sense for
191
	 * the operation selected.  I.E. passing the key parameter makes no sense
192
	 * for the add operation, and thus it isn't allowed.
193
     */
194
195
#define checkInvalidParam(x, y, z) if(x != NULL){fprintf(stderr, "\n%s "\
196
						"may not be specified %s\n", y, z); quit(2);}
197
198
	/* Global Variables */
199
200
int operation = 0;	// operation to perform.
201
// allow new lock files or DB to be created.
202
isc_boolean_t create_allowed = isc_boolean_false;
203
char *key = NULL;		// key to use in list & del operations
204
unsigned int key_val;// key as unsigned int used in list & del operations
205
char *zone = NULL;	// zone to use in list operations
206
char *host = NULL;	// host to use in list operations
207
char *c_zone = NULL;	// client zone to use in list operations
208
char *c_ip = NULL;	// client IP to use in list operations
209
char *a_data = NULL;	// data in add operation
210
char *bulk_file = NULL; // bulk data file to load
211
char *db_envdir = NULL;	// BDB environment location 
212
char *db_file = NULL;	// BDB database file location.
213
bdb_instance_t db;		// BDB instance we are operating on
214
isc_lex_t *lexer = NULL;			// lexer for use to use in parsing input
215
isc_mem_t *lex_mctx = NULL;		// memory context for lexer
216
char lex_data_buf[max_data_len];// data array to use for lex_buffer below
217
isc_buffer_t lex_buffer; // buffer for lexer during add operation
218
 
219
220
	/* Displays usage message */
221
222
static void
223
show_usage(void) {
224
	fprintf(stderr, "\n\n\
225
---Usage:---------------------------------------------------------------------\
226
\n\n\
227
   List data:\n\
228
      dlzbdb -l [-k key] [-z zone] [-h host] [-c client_zone] [-i client_ip]\n\
229
               BDB_environment BDB_database\n\n\
230
   Delete data:\n\
231
      dlzbdb -d [-k key] [-c client_zone] [-i client_ip]\n\
232
               BDB_environment BDB_database\n\n\
233
   Bulk load data:\n\
234
      dlzbdb -f file_to_load BDB_environment BDB_database\n\n\
235
   Add data:\n\
236
      dlzbdb -a \"dns data to be added\" BDB_environment BDB_database\n\n\
237
   Normally operations can only be performed on an existing database files.\n\
238
   Use the -n flag with any operation to allow files to be created.\n\
239
   Existing files will NOT be truncated by using the -n flag.\n\
240
   The -n flag will allow a new database to be created, or allow new\n\
241
   environment files to be created for an existing database.\n\n\
242
---Format for -f & -a options:------------------------------------------------\
243
\n\n\
244
db_type zone host dns_type ttl ip\n\
245
db_type zone host dns_type ttl mx_priority mail_host\n\
246
db_type zone host dns_type ttl nm_svr resp_psn serial refresh retry expire min\
247
\n\
248
db_type zone client_ip\n\n\
249
---Examples:------------------------------------------------------------------\
250
\n\n\
251
d mynm.com www A 10 127.0.0.1\n\
252
d mynm.com @ MX 10 5 mail\n\
253
d mynm.com @ SOA 10 ns1.mynm.com. root.mynm.com. 2 28800 7200 604800 86400\n\
254
c mynm.com 127.0.0.1\n\
255
c mynm.com 192.168.0.10\n\
256
");
257
quit(1);
258
}
259
260
261
	/* BDB callback to create zone secondary index */
262
263
int
264
getzone(DB *dbp, const DBT *pkey, const DBT *pdata, DBT *skey){
265
	char *tmp;
266
	char *left;
267
	char *right;
268
	int result=0;
269
270
    UNUSED(dbp);
271
    UNUSED(pkey);
272
273
		// Allocate memory to use in parsing the string
274
	tmp = right = malloc(pdata->size + 1);
275
276
		// verify memory was allocated
277
	if(right == NULL){
278
		result = BDBparseErr;
279
		goto getzone_cleanup;
280
	}		
281
282
		// copy data string into newly allocated memory
283
	strncpy(right, pdata->data, pdata->size);
284
	right[pdata->size] = '\0';
285
286
		// split string at the first space
287
	left = isc_string_separate(&right, " ");
288
289
		// copy string for "zone" secondary index
290
	skey->data = strdup(left);
291
	if(skey->data == NULL){
292
		result = BDBparseErr;
293
		goto getzone_cleanup;
294
	}
295
		// set required values for BDB
296
	skey->size = strlen(skey->data);
297
	skey->flags = DB_DBT_APPMALLOC;
298
299
getzone_cleanup:
300
301
		// cleanup memory
302
	if(tmp != NULL)
303
		free(tmp);
304
	
305
	return result;
306
}
307
308
	/* BDB callback to create host secondary index */
309
310
int
311
gethost(DB *dbp, const DBT *pkey, const DBT *pdata, DBT *skey){
312
	char *tmp;
313
	char *left;
314
	char *right;
315
	int result=0;
316
317
    UNUSED(dbp);
318
    UNUSED(pkey);
319
320
		// allocate memory to use in parsing the string
321
	tmp = right = malloc(pdata->size + 1);
322
323
		// verify memory was allocated
324
	if(tmp == NULL){
325
		result = BDBparseErr;
326
		goto gethost_cleanup;
327
	}		
328
329
		// copy data string into newly allocated memory
330
	strncpy(right, pdata->data, pdata->size);
331
	right[pdata->size] = '\0';
332
333
		// we don't care about left string.
334
		// memory of left string will be freed when tmp is freed.
335
	isc_string_separate(&right, " ");
336
337
		// verify right still has some characters left
338
	if(right == NULL){
339
		result = BDBparseErr;
340
		goto gethost_cleanup;
341
	}
342
343
		// get "host" from data string
344
	left = isc_string_separate(&right, " ");
345
		// copy string for "host" secondary index
346
	skey->data = strdup(left);
347
	if(skey->data == NULL){
348
		result = BDBparseErr;
349
		goto gethost_cleanup;
350
	}
351
		// set required values for BDB
352
	skey->size = strlen(skey->data);
353
	skey->flags = DB_DBT_APPMALLOC;
354
355
gethost_cleanup:
356
357
		// cleanup memory
358
	if(tmp != NULL)
359
		free(tmp);
360
	
361
	return result;
362
}
363
364
	/* Performs BDB cleanup. Close each database that we opened.
365
	 * Close environment.  Set each var to NULL so we know they
366
	 * were closed and don't accidentally try to close them twice.
367
     */
368
369
void
370
bdb_cleanup(void){
371
372
		/* close cursors */
373
	if(db.cursor4 != NULL){
374
		db.cursor4->c_close(db.cursor4);
375
		db.cursor4 = NULL;
376
	}
377
378
	if(db.cursor3 != NULL){
379
		db.cursor3->c_close(db.cursor3);
380
		db.cursor3 = NULL;
381
	}
382
383
	if(db.cursor2 != NULL){
384
		db.cursor2->c_close(db.cursor2);
385
		db.cursor2 = NULL;
386
	}
387
388
	if(db.cursor != NULL){
389
		db.cursor->c_close(db.cursor);
390
		db.cursor = NULL;
391
	}
392
393
		/* close databases */
394
	if(db.data != NULL){
395
		db.data->close(db.data, 0);
396
		db.data = NULL;
397
	}
398
	if(db.host != NULL){
399
		db.host->close(db.host, 0);
400
		db.host = NULL;
401
	}
402
	if(db.zone != NULL){
403
		db.zone->close(db.zone, 0);
404
		db.zone = NULL;
405
	}
406
	if(db.client != NULL){
407
		db.client->close(db.client, 0);
408
		db.client = NULL;
409
	}
410
411
		/* close environment */
412
	if(db.dbenv != NULL){
413
		db.dbenv->close(db.dbenv, 0);
414
		db.dbenv = NULL;
415
	}
416
}
417
418
	/* Initializes, sets flags and then opens Berkeley databases. */
419
420
isc_result_t
421
bdb_opendb(DBTYPE db_type, DB **db_out, const char *db_name, int flags){
422
423
	int result;
424
	int createFlag = 0;
425
426
		/* Initialize the database. */
427
	if ((result = db_create(db_out, db.dbenv, 0)) != 0) {
428
		fprintf(stderr, "BDB could not initialize %s database. BDB error: %s",
429
												db_name, db_strerror(result));
430
		return ISC_R_FAILURE;
431
	}
432
433
		/* set database flags. */
434
	if ((result = (*db_out)->set_flags(*db_out, flags)) != 0) {
435
		fprintf(stderr, "BDB could not set flags for %s database. BDB error: %s",
436
												db_name, db_strerror(result));
437
		return ISC_R_FAILURE;
438
	}
439
440
	if(create_allowed == isc_boolean_true){
441
		createFlag = DB_CREATE;
442
	}
443
		/* open the database. */
444
	if ((result = (*db_out)->open(*db_out, NULL, db_file, db_name, db_type,
445
											createFlag, 0)) != 0) {
446
		fprintf(stderr, "BDB could not open %s database in %s. BDB error: %s",
447
									db_name, db_file, db_strerror(result));
448
		return ISC_R_FAILURE;
449
	}
450
451
	return ISC_R_SUCCESS;
452
}
453
454
	/* parses input and adds it to the BDB database
455
	 * Lexer should be instantiated, and either a file or buffer opened for it.
456
	 * The insert_data function is used by both the add, and bulk insert
457
	 * operations
458
     */
459
460
void
461
put_data(isc_boolean_t dns_data, char *input_key, char *input_data){
462
463
	int bdbres;
464
	DBT key, data;
465
466
		// make sure key & data are completely empty
467
	memset(&key, 0, sizeof(key));
468
	memset(&data, 0, sizeof(data));
469
470
		// if client data, setup key for insertion
471
	if(!dns_data && input_key != NULL){
472
		key.data = input_key;
473
		key.size = strlen(input_key);
474
		key.flags = 0;
475
	}
476
		// always setup data for insertion
477
	data.data = input_data;
478
	data.size = strlen(input_data);
479
	data.flags = 0;
480
481
		// execute insert against appropriate database.
482
	if(dns_data){
483
		bdbres = db.data->put(db.data, NULL, &key, &data, DB_APPEND);
484
	} else {
485
		bdbres = db.client->put(db.client, NULL, &key, &data, 0);
486
	}
487
488
		// if something went wrong, log error and quit
489
	if(bdbres != 0){
490
		fprintf(stderr, "BDB could not insert data.  Error: %s",
491
																db_strerror(bdbres));
492
		quit(5);
493
	}
494
}
495
496
497
void
498
insert_data(void){
499
	unsigned int opt = ISC_LEXOPT_EOL |		/* Want end-of-line token. */
500
							 ISC_LEXOPT_EOF |		/* Want end-of-file token. */
501
							 ISC_LEXOPT_QSTRING |/* Recognize qstrings. */
502
		ISC_LEXOPT_QSTRINGMULTILINE;			/* Allow multiline "" strings */
503
504
	isc_result_t result;
505
	isc_token_t token;	// token from lexer
506
	isc_boolean_t loop = isc_boolean_true;
507
	isc_boolean_t have_czone = isc_boolean_false;
508
	char data_arr[max_data_len];
509
	isc_buffer_t buf;
510
	char data_arr2[max_data_len];
511
	isc_buffer_t buf2;
512
	char data_type = 'u'; // u =unknown, b =bad token, d/D =DNS, c/C =client IP
513
514
		// Initialize buffers
515
	isc_buffer_init(&buf, &data_arr, max_data_len);
516
	isc_buffer_init(&buf2, &data_arr2, max_data_len);
517
518
	while(loop){
519
		result = isc_lex_gettoken(lexer, opt, &token); 
520
		if (result != ISC_R_SUCCESS) 
521
			goto data_cleanup;
522
523
		switch(token.type){
524
			case isc_tokentype_string:
525
				if(data_type == 'u'){
526
						// store data_type
527
					strncpy(&data_type, token.value.as_pointer, 1);
528
						// verify data_type was specified correctly on input
529
					if(strlen(token.value.as_pointer) > 1 || (
530
						   data_type != 'd' && data_type != 'D' &&
531
							data_type != 'c' && data_type != 'C') ){
532
							// if not, set to 'b' so this line is ignored.
533
						data_type = 'b';
534
					}
535
				} else if(data_type == 'c' || data_type == 'C'){
536
					if(have_czone == isc_boolean_true){
537
						isc_buffer_putstr(&buf2, token.value.as_pointer);
538
							// add string terminator to buffer
539
						isc_buffer_putmem(&buf2, "\0", 1);
540
					} else {
541
						isc_buffer_putstr(&buf, token.value.as_pointer);
542
							// add string terminator to buffer
543
						isc_buffer_putmem(&buf, "\0", 1);
544
						have_czone = isc_boolean_true;
545
					}
546
				} else {
547
					isc_buffer_putstr(&buf, token.value.as_pointer);
548
					isc_buffer_putstr(&buf, " ");
549
				}
550
				break;
551
			case isc_tokentype_qstring:
552
				isc_buffer_putstr(&buf, "\"");
553
				isc_buffer_putstr(&buf, token.value.as_pointer);
554
				isc_buffer_putstr(&buf, "\" ");
555
				break;
556
			case isc_tokentype_eol:
557
			case isc_tokentype_eof:
558
			
559
				if((data_type != 'u' && isc_buffer_usedlength(&buf) > 0) || data_type == 'b'){
560
						// perform insert operation
561
					if(data_type == 'd' || data_type == 'D'){
562
							// add string terminator to buffer
563
						isc_buffer_putmem(&buf, "\0", 1);
564
						put_data(isc_boolean_true, NULL, (char *) &data_arr);
565
					} else if (data_type == 'c' || data_type == 'C'){
566
						put_data(isc_boolean_false, (char *) &data_arr, 
567
																	(char *) &data_arr2);
568
					} else if (data_type == 'b'){
569
						fprintf(stderr, "Bad / unknown token encountered on line %lu."\
570
							"  Skipping line.",	isc_lex_getsourceline(lexer) - 1);
571
					} else {
572
						fprintf(stderr, "Bad / unknown db data type encountered on " \
573
							"line %lu.  Skipping line\n", isc_lex_getsourceline(lexer) - 1);
574
					}
575
				}
576
577
				if(token.type == isc_tokentype_eof){
578
					loop = isc_boolean_false;
579
				}	
580
581
					// reset buffer for next insert
582
				isc_buffer_clear(&buf);
583
				isc_buffer_clear(&buf2);
584
				have_czone = isc_boolean_false;
585
				data_type ='u';
586
				break;
587
			default:
588
				data_type = 'b';
589
				break;
590
		}
591
	}
592
593
	return;
594
595
data_cleanup:
596
		// let user know we had problems
597
	fprintf(stderr, "Unknown error processing tokens during \"add\" or " \
598
			"\"bulk\" operation.\nStoped processing on line %lu.", 
599
			isc_lex_getsourceline(lexer));
600
}
601
602
603
isc_result_t
604
openBDB(void){
605
606
	int bdbres;
607
	isc_result_t result;
608
609
		// create BDB environment 
610
	   // Basically BDB allocates and assigns memory to db->dbenv	    
611
	bdbres = db_env_create(&db.dbenv, 0);
612
	if(bdbres != 0){
613
		fprintf(stderr, "BDB environment could not be created. BDB error: %s", 
614
													db_strerror(bdbres));
615
		result = ISC_R_FAILURE;
616
		goto openBDB_cleanup;
617
	}
618
619
		// open BDB environment
620
	if(create_allowed == isc_boolean_true){
621
		// allowed to create new files
622
		bdbres = db.dbenv->open(db.dbenv, db_envdir, 
623
						DB_INIT_CDB | DB_INIT_MPOOL | DB_CREATE, 0);
624
	} else {	// not allowed to create new files.
625
		bdbres = db.dbenv->open(db.dbenv, db_envdir, 
626
						DB_INIT_CDB | DB_INIT_MPOOL, 0);
627
	}
628
	if(bdbres != 0){
629
		fprintf(stderr, "BDB environment at '%s' could not be opened. BDB " \
630
							 "error: %s", db_envdir, db_strerror(bdbres));
631
		result = ISC_R_FAILURE;
632
		goto openBDB_cleanup;
633
	}
634
635
		// open dlz_data database.
636
	result = bdb_opendb(DB_RECNO, &db.data, dlz_data, 0);
637
	if(result != ISC_R_SUCCESS)
638
		goto openBDB_cleanup;
639
	
640
		// open dlz_host database.
641
	result = bdb_opendb(DB_BTREE, &db.host, dlz_host, DB_DUP | DB_DUPSORT);
642
	if(result != ISC_R_SUCCESS)
643
		goto openBDB_cleanup;
644
645
		// open dlz_zone database.
646
	result = bdb_opendb(DB_BTREE, &db.zone, dlz_zone, DB_DUP | DB_DUPSORT);
647
	if(result != ISC_R_SUCCESS)
648
		goto openBDB_cleanup;
649
650
		// open dlz_client database.
651
	result = bdb_opendb(DB_BTREE, &db.client, dlz_client, DB_DUP | DB_DUPSORT);
652
	if(result != ISC_R_SUCCESS)
653
		goto openBDB_cleanup;
654
655
		// associate the host secondary database with the primary database
656
	bdbres = db.data->associate(db.data, NULL, db.host, gethost, 0);
657
	if(bdbres != 0){
658
		fprintf(stderr, "BDB could not associate %s database with %s. BDB "\
659
						"error: %s", dlz_host, dlz_data, db_strerror(bdbres));
660
		result = ISC_R_FAILURE;
661
		goto openBDB_cleanup;
662
	}
663
664
		// associate the zone secondary database with the primary database
665
	bdbres = db.data->associate(db.data, NULL, db.zone, getzone, 0);
666
	if(bdbres != 0){
667
		fprintf(stderr, "BDB could not associate %s database with %s. BDB "\
668
						"error: %s", dlz_zone, dlz_data, db_strerror(bdbres));
669
		result = ISC_R_FAILURE;
670
		goto openBDB_cleanup;
671
	}
672
673
	return result;
674
675
openBDB_cleanup:
676
677
	bdb_cleanup();
678
	return result;
679
}
680
681
	/* Create & open lexer to parse input data */
682
683
isc_result_t
684
open_lexer(void){
685
	isc_result_t result;
686
687
		// check if we already opened the lexer, if we did, return success
688
	if(lexer != NULL)
689
		return ISC_R_SUCCESS;
690
691
		// allocate memory for lexer, and verify it was allocated
692
	result = isc_mem_create(0, 0, &lex_mctx);
693
	if(result != ISC_R_SUCCESS){
694
		fprintf(stderr, "unexpected error creating lexer\n");
695
		return result;
696
	}
697
698
		// create lexer
699
	result = isc_lex_create(lex_mctx, 1500, &lexer);
700
	if(result != ISC_R_SUCCESS)
701
		fprintf(stderr, "unexpected error creating lexer\n");
702
703
		// set allowed commenting style
704
	isc_lex_setcomments(lexer, ISC_LEXCOMMENT_C |	/* Allow C comments */
705
						ISC_LEXCOMMENT_CPLUSPLUS |	/* Allow C++ comments */
706
						ISC_LEXCOMMENT_SHELL);		/* Allow shellcomments */
707
708
	isc_buffer_init(&lex_buffer, &lex_data_buf, max_data_len);
709
710
	return result;
711
}
712
713
	/* Close the lexer, and cleanup memory */
714
715
void
716
close_lexer(void){
717
		
718
		// If lexer is still open, close it & destroy it.
719
	if (lexer != NULL) {
720
		isc_lex_close(lexer);
721
		isc_lex_destroy(&lexer);
722
	}
723
724
		// if lexer memory is still allocated, destroy it.
725
	if(lex_mctx != NULL)
726
		isc_mem_destroy(&lex_mctx);
727
}
728
729
	/* Perform add operation */
730
731
void
732
operation_add(void){
733
		// check for any parameters that are not allowed during add
734
	checkInvalidParam(key, "k", "for add operation");
735
	checkInvalidParam(zone, "z", "for add operation");
736
	checkInvalidParam(host, "h", "for add operation");
737
	checkInvalidParam(c_zone, "c", "for add operation");
738
	checkInvalidParam(c_ip, "i", "for add operation");
739
740
		// if open lexer fails it alread prints error messages.
741
	if(open_lexer() != ISC_R_SUCCESS){
742
		quit(4);
743
	}
744
	
745
		// copy input data to buffer
746
	isc_buffer_putstr(&lex_buffer, a_data);
747
		
748
		// tell lexer to use buffer as input 
749
	if(isc_lex_openbuffer(lexer, &lex_buffer) != ISC_R_SUCCESS) {
750
		fprintf(stderr, "unexpected error opening lexer buffer");
751
		quit(4);
752
	}
753
754
		//common logic for "add" & "bulk" operations are handled by insert_data
755
	insert_data();
756
}
757
758
	/* Perform bulk insert operation */
759
760
void
761
operation_bulk(void){
762
		// check for any parameters that are not allowed during bulk
763
	checkInvalidParam(key, "k", "for bulk load operation");
764
	checkInvalidParam(zone, "z", "for bulk load operation");
765
	checkInvalidParam(host, "h", "for bulk load operation");
766
	checkInvalidParam(c_zone, "c", "for bulk load operation");
767
	checkInvalidParam(c_ip, "i", "for bulk load operation");
768
769
		// if open lexer fails it already prints error messages.
770
	if(open_lexer() != ISC_R_SUCCESS){
771
		quit(4);
772
	}
773
774
	if(isc_lex_openfile(lexer, bulk_file) != ISC_R_SUCCESS) {
775
		fprintf(stderr, "unexpected error opening %s by lexer.", bulk_file);
776
		quit(4);
777
	}
778
779
		// common logic for "add" & "bulk" operations are handled by insert_data
780
	insert_data();	
781
}
782
783
	/* Perform listOrDelete operation
784
	 * if dlt == true, delete data
785
	 * else list data
786
	 */
787
788
void
789
operation_listOrDelete(isc_boolean_t dlt){
790
791
	int bdbres = 0;
792
	DBC *curList[3];
793
	DBT bdbkey, bdbdata;
794
	db_recno_t recno;
795
	int curIndex = 0;
796
797
		// verify that only allowed parameters were passed.
798
	if(dlt == isc_boolean_true){
799
		checkInvalidParam(zone, "z", "for delete operation");
800
		checkInvalidParam(host, "h", "for delete operation");
801
	} else if(key != NULL || zone != NULL || host != NULL){
802
		checkInvalidParam(c_zone, "c", "for list when k, z or h are specified");
803
		checkInvalidParam(c_ip, "i", "for list when k, z, or h are specified");
804
	}
805
806
	memset(&bdbkey, 0, sizeof(bdbkey));
807
	memset(&bdbdata, 0, sizeof(bdbdata));
808
809
		// set NULL the 2nd and 3rd positions in curList.
810
		// that way later when add cursors to the join list
811
		// it is already null terminated.
812
	curList[1] = curList[2] = NULL;
813
814
	if(key != NULL){
815
			// make sure other parameters weren't
816
		checkInvalidParam(zone, "z", "when k is specified");
817
		checkInvalidParam(host, "h", "when k is specified");
818
819
		recno = key_val;
820
		bdbkey.data = &recno;
821
		bdbkey.size = sizeof(recno);
822
823
		if(dlt == isc_boolean_true){
824
			bdbres = db.data->del(db.data, NULL, &bdbkey, 0);
825
		} else {
826
			bdbdata.flags = DB_DBT_REALLOC;
827
			bdbres = db.data->get(db.data, NULL, &bdbkey, &bdbdata, 0);
828
829
			if(bdbres == 0){
830
				printf("KEY | DATA\n");
831
				printf("%lu | %.*s\n", *(u_long *) bdbkey.data,
832
									(int)bdbdata.size, (char *)bdbdata.data);
833
			}
834
		} // closes else of if(dlt == isc_boolean_true)
835
		if(bdbres == DB_NOTFOUND){
836
			printf("Key not found in database");
837
		}
838
	}	// closes if(key != NULL)
839
840
		// if zone is passed
841
	if(zone != NULL){
842
			// create a cursor and make sure it worked
843
		bdbres = db.zone->cursor(db.zone, NULL, &db.cursor2, 0);
844
		if(bdbres != 0){
845
			fprintf(stderr, "Unexpected error. BDB Error: %s\n",
846
													db_strerror(bdbres));
847
			return;
848
		}
849
850
		bdbkey.data = zone;
851
		bdbkey.size = strlen(zone);
852
		bdbres = db.cursor2->c_get(db.cursor2, &bdbkey, &bdbdata, DB_SET);
853
		if(bdbres != 0){
854
			if(bdbres != DB_NOTFOUND){
855
				fprintf(stderr, "Unexpected error. BDB Error: %s\n",
856
													db_strerror(bdbres));
857
			} else {
858
				printf("Zone not found in database");
859
			}
860
			return;
861
		}
862
863
			// add cursor to cursor list for later use in join
864
		curList[curIndex++] = db.cursor2;
865
	}
866
867
		// if host is passed
868
	if(host != NULL){
869
870
			// create a cursor and make sure it worked.
871
		bdbres = db.host->cursor(db.host, NULL, &db.cursor3, 0);
872
		if(bdbres != 0){
873
			fprintf(stderr, "Unexpected error. BDB Error: %s\n",
874
													db_strerror(bdbres));
875
			return;
876
		}
877
		bdbkey.data = host;
878
		bdbkey.size = strlen(host);
879
		bdbres = db.cursor3->c_get(db.cursor3, &bdbkey, &bdbdata, DB_SET);
880
		if(bdbres != 0){
881
			if(bdbres != DB_NOTFOUND){
882
				fprintf(stderr, "Unexpected error. BDB Error: %s\n",
883
													db_strerror(bdbres));
884
			} else {
885
				printf("Host not found in database");
886
			}
887
			return;
888
		}
889
890
			// add cursor to cursor list for later use in join
891
		curList[curIndex++] = db.cursor3;
892
	}
893
894
895
	if(zone != NULL || host != NULL){
896
897
			// join any cursors
898
		bdbres = db.data->join(db.data, curList, &db.cursor4, 0);
899
		if(bdbres != 0){
900
			fprintf(stderr, "Unexpected error. BDB Error: %s\n",
901
													db_strerror(bdbres));
902
			return;
903
		}
904
905
		memset(&bdbkey, 0, sizeof(bdbkey));
906
		bdbkey.flags = DB_DBT_REALLOC;
907
		memset(&bdbdata, 0, sizeof(bdbdata));
908
		bdbdata.flags = DB_DBT_REALLOC;
909
910
			// print a header to explain the output
911
		printf("KEY | DATA\n");
912
			// loop and list all results.
913
		while(bdbres == 0){	
914
				// get data
915
			bdbres = db.cursor4->c_get(db.cursor4, &bdbkey, &bdbdata, 0);
916
				// verify call had no errors
917
			if(bdbres != 0){
918
				break;
919
			}
920
			printf("%lu | %.*s\n", *(u_long *) bdbkey.data,
921
								(int)bdbdata.size, (char *)bdbdata.data);
922
		} // closes while loop
923
	}
924
925
	if(c_ip != NULL && c_zone == NULL){
926
		fprintf(stderr, "i may only be specified when c is also specified\n");			
927
		quit(2);
928
	}
929
		// if client_zone was passed
930
	if(c_zone != NULL){
931
932
					// create a cursor and make sure it worked.
933
		if(dlt == isc_boolean_true){
934
				// open read-write cursor
935
			bdbres = db.client->cursor(db.client, NULL, &db.cursor,
936
														DB_WRITECURSOR);
937
		} else {
938
				// open read only cursor
939
			bdbres = db.client->cursor(db.client, NULL, &db.cursor, 0);
940
				// print a header to explain the output
941
			printf("CLIENT_ZONE | CLIENT_IP\n");
942
		}
943
944
		bdbkey.data = c_zone;
945
		bdbkey.size = strlen(c_zone);
946
947
		if(c_ip != NULL){
948
			bdbdata.data = c_ip;
949
			bdbdata.size = strlen(c_ip);
950
			bdbres = db.cursor->c_get(db.cursor, &bdbkey, &bdbdata, DB_GET_BOTH);
951
			if(bdbres == DB_NOTFOUND){
952
				printf("Client zone & IP not found in database");
953
			}
954
		} else {
955
			bdbdata.flags = DB_DBT_REALLOC;
956
			bdbres = db.cursor->c_get(db.cursor, &bdbkey, &bdbdata, DB_SET);
957
			if(bdbres == DB_NOTFOUND){
958
				printf("Client zone not found in database");
959
			}
960
		}
961
962
		while(bdbres == 0){
963
			if(dlt == isc_boolean_false){
964
				printf("%.*s | %.*s\n", (int)bdbkey.size, (char *) bdbkey.data,
965
									(int)bdbdata.size, (char *) bdbdata.data);
966
			} else {
967
					// delete record.
968
				bdbres = db.cursor->c_del(db.cursor, 0);
969
				if(bdbres != 0){
970
					fprintf(stderr, "Unexpected error. BDB Error: %s\n",
971
														db_strerror(bdbres));
972
					break;
973
				}
974
			}
975
			if(c_ip != NULL){
976
				break;
977
			}
978
			bdbres = db.cursor->c_get(db.cursor, &bdbkey, &bdbdata, DB_NEXT_DUP);			
979
			if(bdbres != 0){
980
				break;
981
			}
982
		} // end while loop
983
	}
984
985
986
	if(bdbres != 0 && bdbres != DB_NOTFOUND){
987
		fprintf(stderr, "Unexpected error during list operation " \
988
									 "BDB error: %s", db_strerror(bdbres));
989
	}
990
991
	if(bdbkey.flags == DB_DBT_REALLOC && bdbkey.data != NULL){
992
		free(bdbkey.data);
993
	}
994
	if(bdbdata.flags == DB_DBT_REALLOC && bdbdata.data != NULL){
995
		free(bdbdata.data);
996
	}
997
}
998
999
1000
int
1001
main(int argc, char **argv){
1002
1003
	int ch;
1004
	char *endp;
1005
1006
		// there has to be at least 2 args, some operations require more
1007
	if(argc < 2)
1008
		show_usage();
1009
1010
		// use the ISC commandline parser to get all the program arguments
1011
	while((ch = isc_commandline_parse(argc, argv, "ldna:f:k:z:h:c:i:")) != -1){
1012
		switch (ch) {
1013
			case 'n':
1014
				create_allowed = isc_boolean_true;
1015
				break;
1016
			case 'l':
1017
				checkOp(operation)
1018
				operation = list;
1019
				break;
1020
			case 'd':
1021
				checkOp(operation);
1022
				operation = dele;
1023
				break;
1024
			case 'a':
1025
				checkOp(operation);
1026
				operation = add;
1027
				a_data = isc_commandline_argument; 
1028
				break;
1029
			case 'f':
1030
				checkOp(operation);
1031
				operation = bulk;
1032
				bulk_file = isc_commandline_argument;
1033
				break;
1034
			case 'k':
1035
				checkParam(key, "k");
1036
				key = isc_commandline_argument;
1037
				key_val = strtoul(key, &endp, 10);
1038
				if (*endp != '\0' || key_val < 1){
1039
					fprintf(stderr, "Error converting key to integer");
1040
				}
1041
				break;
1042
			case 'z':
1043
				checkParam(zone, "z");
1044
				zone = isc_commandline_argument;
1045
				break;
1046
			case 'h':
1047
				checkParam(host, "h");
1048
				host = isc_commandline_argument;
1049
				break;
1050
			case 'c':
1051
				checkParam(c_zone, "c");
1052
				c_zone = isc_commandline_argument;
1053
				break;
1054
			case 'i':
1055
				checkParam(c_ip, "i");
1056
				c_ip = isc_commandline_argument;
1057
				break;
1058
			case '?':
1059
				show_usage();
1060
				break;
1061
			default:
1062
					// should never reach this point
1063
				fprintf(stderr, "unexpected error parsing command arguments\n");
1064
				quit(1);
1065
				break;
1066
		}
1067
	}
1068
1069
	argc -= isc_commandline_index;
1070
	argv += isc_commandline_index;
1071
1072
		// argc & argv have been modified, so now only "extra" parameters are
1073
		// left in argc & argv.  "Extra" parameters are any parameters that were
1074
		// not passed using a command line flag.  Exactly 2 args should be left.
1075
		// The first should be the BDB environment path, the second should be the
1076
		// BDB database.  The BDB database path can be either relative to the
1077
		// BDB environment path, or absolute.
1078
	if (argc < 2){
1079
		fprintf(stderr, "Both a Berkeley DB environment and file "\
1080
														"must be specified");
1081
		quit(2);
1082
	} else if (argc > 2){
1083
		fprintf(stderr, "Too many parameters. Check command line for errors.");
1084
		quit(2);
1085
	}
1086
1087
		// get db_file to operate on
1088
	db_envdir = argv[0];
1089
	db_file = argv[1];
1090
1091
	if(openBDB() != ISC_R_SUCCESS){
1092
			// openBDB already prints error messages, don't do it here.
1093
		bdb_cleanup();
1094
		quit(3);
1095
	}
1096
1097
	switch(operation){
1098
		case list:
1099
			operation_listOrDelete(isc_boolean_false);
1100
			break;
1101
		case dele:
1102
			operation_listOrDelete(isc_boolean_true);
1103
			break;
1104
		case add:
1105
			operation_add();
1106
			break;
1107
		case bulk:
1108
			operation_bulk();
1109
			break;
1110
		default:
1111
			fprintf(stderr, "\nNo operation was selected. "\
1112
							"Select an operation (l d a f)");
1113
			quit(2);
1114
			break;
1115
	}
1116
1117
	quit(0);
1118
}
1119
#endif
1120
(-)bind-9.2.2-orig/bin/named/Makefile.in (-12 / +26 lines)
Lines 31-44 Link Here
31
DBDRIVER_INCLUDES =
31
DBDRIVER_INCLUDES =
32
DBDRIVER_LIBS =
32
DBDRIVER_LIBS =
33
33
34
DLZINCLUDES =	@DLZ_BDB_INC@ @DLZ_POSTGRES_INC@ @DLZ_ODBC_INC@ \
35
                @DLZ_MYSQL_INC@ @DLZ_LDAP_INC@
36
                
37
                
34
CINCLUDES =	-I${srcdir}/include -I${srcdir}/unix/include \
38
CINCLUDES =	-I${srcdir}/include -I${srcdir}/unix/include \
35
		${LWRES_INCLUDES} ${DNS_INCLUDES} \
39
		${LWRES_INCLUDES} ${DNS_INCLUDES} \
36
		${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \
40
		${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \
37
		${DBDRIVER_INCLUDES}
41
		${DLZINCLUDES} ${DBDRIVER_INCLUDES}
38
42
39
CDEFINES =
43
CDEFINES =      @USE_DLZ_POSTGRES@ @USE_DLZ_MYSQL@ @USE_DLZ_FILESYSTEM@ \
44
                @USE_DLZ_BDB@ @USE_DLZ_ODBC@ @USE_DLZ_LDAP@ @USE_DLZ_STUB@ \
45
                @USE_DLZ@
46
                
40
CWARNINGS =
47
CWARNINGS =
41
48
49
DLZLIBS = 	@DLZ_BDB_LIBS@ @DLZ_POSTGRES_LIBS@ @DLZ_ODBC_LIBS@ \
50
                @DLZ_MYSQL_LIBS@ @DLZ_LDAP_LIBS@
51
                
42
DNSLIBS =	../../lib/dns/libdns.@A@ @DNS_OPENSSL_LIBS@ @DNS_GSSAPI_LIBS@
52
DNSLIBS =	../../lib/dns/libdns.@A@ @DNS_OPENSSL_LIBS@ @DNS_GSSAPI_LIBS@
43
ISCCFGLIBS =	../../lib/isccfg/libisccfg.@A@
53
ISCCFGLIBS =	../../lib/isccfg/libisccfg.@A@
44
ISCCCLIBS =	../../lib/isccc/libisccc.@A@
54
ISCCCLIBS =	../../lib/isccc/libisccc.@A@
Lines 55-74 Link Here
55
		${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${ISCDEPLIBS}
65
		${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${ISCDEPLIBS}
56
66
57
LIBS =		${LWRESLIBS} ${DNSLIBS} \
67
LIBS =		${LWRESLIBS} ${DNSLIBS} \
58
		${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} ${DBDRIVER_LIBS} @LIBS@
68
		${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} ${DLZLIBS} \
69
		${DBDRIVER_LIBS} @LIBS@
59
70
60
SUBDIRS =	unix
71
SUBDIRS =	unix
61
72
62
TARGETS =	named lwresd
73
TARGETS =	named lwresd
63
74
64
OBJS =		aclconf.@O@ client.@O@ config.@O@ control.@O@ controlconf.@O@ interfacemgr.@O@ \
75
OBJS =		aclconf.@O@ client.@O@ config.@O@ control.@O@ controlconf.@O@ \
65
		listenlist.@O@ log.@O@ logconf.@O@ main.@O@ notify.@O@ \
76
                interfacemgr.@O@ listenlist.@O@ log.@O@ logconf.@O@ main.@O@ \
66
		query.@O@ server.@O@ sortlist.@O@ \
77
                notify.@O@ query.@O@ server.@O@ sortlist.@O@ tkeyconf.@O@ \
67
		tkeyconf.@O@ tsigconf.@O@ update.@O@ xfrout.@O@ \
78
                tsigconf.@O@ update.@O@ xfrout.@O@ zoneconf.@O@ lwaddr.@O@ \
68
		zoneconf.@O@ \
79
                lwresd.@O@ lwdclient.@O@ lwderror.@O@ lwdgabn.@O@ lwdgnba.@O@ \
69
		lwaddr.@O@ lwresd.@O@ lwdclient.@O@ lwderror.@O@ lwdgabn.@O@ \
80
                lwdgrbn.@O@ lwdnoop.@O@ lwsearch.@O@ dlz_postgres_driver.@O@ \
70
		lwdgnba.@O@ lwdgrbn.@O@ lwdnoop.@O@ lwsearch.@O@ \
81
                dlz_stub_driver.@O@ sdlz_helper.@O@ dlz_filesystem_driver.@O@ \
71
		$(DBDRIVER_OBJS)
82
                dlz_mysql_driver.@O@ dlz_odbc_driver.@O@ dlz_bdb_driver.@O@ \
83
		dlz_ldap_driver.@O@ $(DBDRIVER_OBJS)
72
84
73
UOBJS =		unix/os.@O@
85
UOBJS =		unix/os.@O@
74
86
Lines 79-85 Link Here
79
		zoneconf.c \
91
		zoneconf.c \
80
		lwaddr.c lwresd.c lwdclient.c lwderror.c lwdgabn.c \
92
		lwaddr.c lwresd.c lwdclient.c lwderror.c lwdgabn.c \
81
		lwdgnba.c lwdgrbn.c lwdnoop.c lwsearch.c \
93
		lwdgnba.c lwdgrbn.c lwdnoop.c lwsearch.c \
82
		$(DBDRIVER_SRCS)
94
		dlz_postgres_driver.c  dlz_stub_driver.c sdlz_helper.c \
95
		dlz_filesystem_driver.c dlz_mysql_driver.c dlz_odbc_driver.c \
96
                dlz_bdb_driver.c dlz_ldap_driver.c $(DBDRIVER_SRCS)
83
97
84
MANPAGES =	named.8 lwresd.8
98
MANPAGES =	named.8 lwresd.8
85
99
(-)bind-9.2.2-orig/bin/named/dlz_bdb_driver.c (+793 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
/*
37
 * Copyright (C) 1999-2001  Internet Software Consortium.
38
 *
39
 * Permission to use, copy, modify, and distribute this software for any
40
 * purpose with or without fee is hereby granted, provided that the above
41
 * copyright notice and this permission notice appear in all copies.
42
 *
43
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
44
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
45
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
46
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
47
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
48
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
50
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
51
 */
52
53
#ifdef DLZ_BDB
54
55
#include <config.h>
56
#include <stdio.h>
57
#include <string.h>
58
#include <stdlib.h>
59
60
#include <dns/log.h>
61
#include <dns/sdlz.h>
62
#include <dns/result.h>
63
64
#include <isc/mem.h>
65
#include <isc/print.h>
66
#include <isc/result.h>
67
#include <isc/util.h>
68
69
#include <named/globals.h>
70
#include <named/dlz_bdb_driver.h>
71
72
#include <db.h>
73
74
dns_sdlzimplementation_t *dlz_bdb = NULL;
75
76
// BDB database names
77
#define dlz_data "dns_data"
78
#define dlz_zone "dns_zone"
79
#define dlz_host "dns_host"
80
#define dlz_client "dns_client"
81
82
	/* This structure contains all the Berkeley DB handles
83
	 * for this instance of the BDB driver.
84
	 */
85
86
typedef struct bdb_instance {
87
	DB_ENV		*dbenv;	// BDB environment
88
	DB				*data;	// dns_data database handle
89
	DB				*zone;	// zone database handle
90
	DB				*host;	// host database handle
91
	DB				*client;	// client database handle
92
	isc_mem_t	*mctx;	// memory context
93
94
}bdb_instance_t;
95
96
typedef struct parsed_data {
97
	char *zone;
98
	char *host;
99
	char *type;
100
	int ttl;
101
	char *data;
102
}parsed_data_t;
103
104
105
    /* shut up compiler warnings about no previous prototype */
106
107
void
108
bdb_cleanup(bdb_instance_t *db);
109
110
isc_result_t
111
bdb_opendb(DB_ENV *db_env, DBTYPE db_type, DB **db, const char *db_name, 
112
												char *db_file, int flags);
113
114
isc_result_t
115
bdb_findzone(void *driverarg, void *dbdata, const char *name);
116
117
isc_result_t
118
bdb_parse_data(char *in, parsed_data_t *pd);
119
120
isc_result_t
121
bdb_allowzonexfr(void *driverarg, void *dbdata, const char *name,
122
                                                const char *client);
123
124
isc_result_t
125
bdb_allnodes(const char *zone, void *driverarg, void *dbdata,
126
						  dns_sdlzallnodes_t *allnodes);
127
128
isc_result_t
129
bdb_lookup(const char *zone, const char *name, void *driverarg, 
130
			void *dbdata, dns_sdlzlookup_t *lookup);
131
132
isc_result_t
133
bdb_create(const char *dlzname, unsigned int argc, char *argv[],
134
				void *driverarg, void **dbdata);
135
136
void
137
bdb_destroy(void *driverarg, void *dbdata);
138
	
139
	/* Parses the DBT from the Berkeley DB into a parsed_data record
140
	 * The parsed_data record should be allocated before and passed into the
141
	 * bdb_parse_data function.  The char (type & data) fields should not
142
	 * be "free"d as that memory is part of the DBT data field.  It will be
143
	 * "free"d when the DBT is freed.
144
	 */
145
146
isc_result_t
147
bdb_parse_data(char *in, parsed_data_t *pd){
148
149
	char *endp, *ttlStr;
150
	char *tmp = in;
151
	char *lastchar = (char *) &tmp[strlen(tmp) + 1];
152
153
		// String should be formated as: 
154
	   // zone(a space)host(a space)ttl(a space)type(a space)remaining data
155
		// examples: 
156
		// example.com www 10 A 127.0.0.1
157
		// example.com mail 10 A 127.0.0.2
158
		// example.com @ 10 MX 20 mail.example.com
159
160
		// save pointer to zone
161
	pd->zone = tmp;
162
163
		/* find space after zone and change it to a '\0' */
164
	tmp = strchr(tmp, ' ');
165
		// verify we found a space
166
	if(tmp == NULL)
167
		return ISC_R_FAILURE;
168
		// change the space to a null (string terminator)
169
	tmp[0] = '\0';
170
		// make sure it is safe to increment pointer
171
	if(++tmp > lastchar)
172
		return ISC_R_FAILURE;
173
174
		// save pointer to host
175
	pd->host = tmp;
176
177
		/* find space after type and change it to a '\0' */
178
	tmp = strchr(tmp, ' ');
179
		// verify we found a space
180
	if(tmp == NULL)
181
		return ISC_R_FAILURE;
182
		// change the space to a null (string terminator)
183
	tmp[0] = '\0';
184
		// make sure it is safe to increment pointer
185
	if(++tmp > lastchar)
186
		return ISC_R_FAILURE;
187
188
		// save pointer to dns type
189
	pd->type = tmp;
190
191
		/* find space after type and change it to a '\0' */
192
	tmp = strchr(tmp, ' ');
193
		// verify we found a space
194
	if(tmp == NULL)
195
		return ISC_R_FAILURE;
196
		// change the space to a null (string terminator)
197
	tmp[0] = '\0';
198
		// make sure it is safe to increment pointer
199
	if(++tmp > lastchar)
200
		return ISC_R_FAILURE;
201
202
		// save pointer to dns ttl
203
	ttlStr = tmp;
204
205
		/* find space after ttl and change it to a '\0' */
206
	tmp = strchr(tmp, ' ');
207
		// verify we found a space
208
	if(tmp == NULL)
209
		return ISC_R_FAILURE;
210
		// change the space to a null (string terminator)
211
	tmp[0] = '\0';
212
		// make sure it is safe to increment pointer
213
	if(++tmp > lastchar)
214
		return ISC_R_FAILURE;
215
216
		// save pointer to remainder of DNS data
217
	pd->data = tmp;
218
219
		// convert ttl string to integer
220
	pd->ttl = strtol(ttlStr, &endp, 10);
221
	if (*endp != '\0' || pd->ttl < 0){
222
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
223
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
224
				"BDB driver ttl must be a postive number");
225
		return ISC_R_FAILURE;
226
	}
227
228
		// if we get this far everything should have worked.
229
	return ISC_R_SUCCESS;
230
}
231
232
/***
233
 *** DLZ methods
234
 ***/
235
236
isc_result_t
237
bdb_allowzonexfr(void *driverarg, void *dbdata, const char *name,
238
                                                const char *client)
239
{
240
	isc_result_t result;
241
	bdb_instance_t *db = (bdb_instance_t *) dbdata;
242
	DBC *client_cursor = NULL;
243
	DBT key, data;
244
245
		// check to see if we are authoritative for the zone first.
246
	result = bdb_findzone(driverarg, dbdata, name);
247
	if(result != ISC_R_SUCCESS)
248
		return (ISC_R_NOTFOUND);
249
250
	memset(&key, 0, sizeof(DBT));
251
	key.flags = DB_DBT_MALLOC;
252
	key.data = strdup(name);
253
	if(key.data == NULL){
254
		result = ISC_R_NOMEMORY;
255
		goto xfr_cleanup;
256
	}
257
	key.size = strlen(key.data);
258
259
	memset(&data, 0, sizeof(DBT));
260
	data.flags = DB_DBT_MALLOC;
261
	data.data = strdup(client);
262
	if(data.data == NULL){
263
		result = ISC_R_NOMEMORY;
264
		goto xfr_cleanup;
265
	}
266
	data.size = strlen(data.data);
267
268
		// get a cursor to loop through zone data
269
	if(db->client->cursor(db->client, NULL, &client_cursor, 0) != 0){
270
		result = ISC_R_FAILURE;
271
		goto xfr_cleanup;
272
	}
273
274
	switch(client_cursor->c_get(client_cursor, &key, &data, DB_FIRST | DB_GET_BOTH)){
275
		case DB_NOTFOUND:
276
		case DB_SECONDARY_BAD:
277
			result = ISC_R_NOTFOUND;
278
			break;
279
		case 0:
280
			result = ISC_R_SUCCESS;
281
			break;
282
		default:
283
			result = ISC_R_FAILURE;
284
	}
285
286
xfr_cleanup:
287
288
		// free any memory duplicate string in the key field
289
	if(key.data != NULL)
290
			free(key.data);
291
292
		// free any memory allocated to the data field.
293
	if(data.data != NULL)
294
			free(data.data);
295
296
		// get rid of zone_cursor
297
	if(client_cursor != NULL)
298
		client_cursor->c_close(client_cursor);
299
300
	return result;
301
302
}
303
304
isc_result_t
305
bdb_allnodes(const char *zone, void *driverarg, void *dbdata,
306
						  dns_sdlzallnodes_t *allnodes)
307
{
308
309
   isc_result_t result = ISC_R_NOTFOUND;
310
	bdb_instance_t *db = (bdb_instance_t *) dbdata;
311
	DBC *zone_cursor = NULL;
312
	DBT key, data;
313
	int flags;
314
	int bdbres;
315
	parsed_data_t pd;
316
	char *tmp = NULL, *tmp_zone;
317
318
   UNUSED(driverarg);
319
320
	memset(&key, 0, sizeof(DBT));
321
	memset(&data, 0, sizeof(DBT));
322
323
	key.data = tmp_zone = strdup(zone);
324
325
	if(key.data == NULL)
326
		return (ISC_R_NOMEMORY);
327
328
	key.size = strlen(key.data);
329
330
		// get a cursor to loop through zone data
331
	if(db->zone->cursor(db->zone, NULL, &zone_cursor, 0) != 0){
332
		result = ISC_R_FAILURE;
333
		goto allnodes_cleanup;
334
	}
335
336
	flags = DB_FIRST | DB_SET;
337
338
	while((bdbres = zone_cursor->c_get(zone_cursor, &key, &data, flags)) == 0){
339
340
		flags = DB_NEXT_DUP;
341
342
		tmp = realloc(tmp, data.size + 1);
343
		if(tmp == NULL)
344
			goto allnodes_cleanup;
345
346
		strncpy(tmp, data.data, data.size);
347
		tmp[data.size] = '\0';
348
349
		if(bdb_parse_data(tmp, &pd) != ISC_R_SUCCESS)
350
			goto allnodes_cleanup;
351
352
		result = dns_sdlz_putnamedrr(allnodes, pd.host, pd.type, pd.ttl, pd.data);
353
		if(result != ISC_R_SUCCESS)
354
			goto allnodes_cleanup;
355
356
	} // end while loop
357
358
allnodes_cleanup:
359
360
	if(tmp != NULL)
361
		free(tmp);
362
363
		// free any memory duplicate string in the key field
364
	if(tmp_zone != NULL)
365
			free(tmp_zone);
366
367
		// get rid of zone_cursor
368
	if(zone_cursor != NULL)
369
		zone_cursor->c_close(zone_cursor);
370
371
	return result;
372
373
}
374
375
	/* Performs BDB cleanup.
376
	 * Used by bdb_create if there is an error starting up.
377
	 * Used by bdb_destroy when the driver is shutting down.
378
	 */
379
380
void
381
bdb_cleanup(bdb_instance_t *db){
382
	
383
	isc_mem_t *mctx;
384
385
		/* close databases */
386
	if(db->data != NULL)
387
		db->data->close(db->data, 0);
388
	if(db->host != NULL)
389
		db->host->close(db->host, 0);
390
	if(db->zone != NULL)
391
		db->zone->close(db->zone, 0);
392
	if(db->client != NULL)
393
		db->client->close(db->client, 0);
394
395
		/* close environment */
396
	if(db->dbenv != NULL)
397
		db->dbenv->close(db->dbenv, 0);
398
399
		/* cleanup memory */
400
	if(db->mctx != NULL){
401
			/* save mctx for later */
402
		mctx = db->mctx;
403
			/* return, and detach the memory */
404
		isc_mem_put(mctx, db, sizeof(bdb_instance_t));
405
		isc_mem_detach(&mctx);
406
	}
407
}
408
409
isc_result_t
410
bdb_findzone(void *driverarg, void *dbdata, const char *name)
411
{
412
413
   isc_result_t result;
414
	bdb_instance_t *db = (bdb_instance_t *) dbdata;
415
	DBC *zone_cursor = NULL;
416
	DBT key, data;
417
	char *tmp;
418
419
   UNUSED(driverarg);
420
421
	memset(&key, 0, sizeof(DBT));
422
	memset(&data, 0, sizeof(DBT));
423
	data.flags = DB_DBT_MALLOC;
424
425
	key.data = tmp = strdup(name);
426
427
	if(key.data == NULL)
428
		return (ISC_R_NOMEMORY);
429
430
	key.size = strlen(key.data);
431
432
		// get a cursor to loop through zone data
433
	if(db->zone->cursor(db->zone, NULL, &zone_cursor, 0) != 0){
434
		result = ISC_R_FAILURE;
435
		goto findzone_cleanup;
436
	}
437
438
	switch(zone_cursor->c_get(zone_cursor, &key, &data, DB_FIRST | DB_SET)){
439
		case DB_NOTFOUND:
440
		case DB_SECONDARY_BAD:
441
			result = ISC_R_NOTFOUND;
442
			break;
443
		case 0:
444
			result = ISC_R_SUCCESS;
445
			break;
446
		default:
447
			result = ISC_R_FAILURE;
448
	}
449
450
findzone_cleanup:
451
452
		// free any memory duplicate string in the key field
453
	if(key.data != NULL)
454
			free(key.data);
455
456
		// free any memory allocated to the data field.
457
	if(data.data != NULL)
458
			free(data.data);
459
460
		// get rid of zone_cursor
461
	if(zone_cursor != NULL)
462
		zone_cursor->c_close(zone_cursor);
463
464
	return result;
465
}
466
467
isc_result_t
468
bdb_lookup(const char *zone, const char *name, void *driverarg, 
469
			void *dbdata, dns_sdlzlookup_t *lookup)
470
{
471
472
   isc_result_t result = ISC_R_NOTFOUND;
473
	bdb_instance_t *db = (bdb_instance_t *) dbdata;
474
	DBC *zone_cursor = NULL;
475
	DBC *host_cursor = NULL;
476
	DBC *join_cursor = NULL;
477
	DBT key, data;
478
	DBC *cur_arr[3];
479
	int bdbres;
480
	parsed_data_t pd;
481
	char *tmp_zone, *tmp_host = NULL;
482
	char *tmp = NULL;
483
484
   UNUSED(driverarg);
485
486
	memset(&key, 0, sizeof(DBT));
487
	memset(&data, 0, sizeof(DBT));
488
489
		// set zone key
490
	key.data = tmp_zone = strdup(zone);
491
	if(key.data == NULL){
492
		result = ISC_R_NOMEMORY;
493
		goto lookup_cleanup;
494
	}
495
	key.size = strlen(key.data);
496
497
		// get a cursor to loop through zone data
498
	if(db->zone->cursor(db->zone, NULL, &zone_cursor, 0) != 0){
499
		result = ISC_R_FAILURE;
500
		goto lookup_cleanup;
501
	}
502
503
		// initialize zone_cursor with zone_key
504
	if(zone_cursor->c_get(zone_cursor, &key, &data, DB_SET) != 0){
505
		result = ISC_R_FAILURE;
506
		goto lookup_cleanup;
507
	}
508
509
		// set host key
510
	key.data = tmp_host = strdup(name);
511
	if(key.data == NULL){
512
		result = ISC_R_NOMEMORY;
513
		goto lookup_cleanup;
514
	}
515
	key.size = strlen(key.data);
516
517
		// get a cursor to loop through host data
518
	if(db->host->cursor(db->host, NULL, &host_cursor, 0) != 0){
519
		result = ISC_R_FAILURE;
520
		goto lookup_cleanup;
521
	}
522
523
		// initialize host_cursor with host_key
524
	if(host_cursor->c_get(host_cursor, &key, &data, DB_SET) != 0){
525
		result = ISC_R_FAILURE;
526
		goto lookup_cleanup;
527
	}
528
529
	cur_arr[0] = zone_cursor;
530
	cur_arr[1] = host_cursor;
531
	cur_arr[2] = NULL;
532
533
	db->data->join(db->data, cur_arr, &join_cursor, 0);
534
535
	while((bdbres = join_cursor->c_get(join_cursor, &key, &data, 0)) == 0){
536
537
		tmp = realloc(tmp, data.size + 1);
538
		if(tmp == NULL)
539
			goto lookup_cleanup;
540
541
		strncpy(tmp, data.data, data.size);
542
		tmp[data.size] = '\0';
543
544
		if(bdb_parse_data(tmp, &pd) != ISC_R_SUCCESS)
545
			goto lookup_cleanup;
546
547
		result = dns_sdlz_putrr(lookup, pd.type, pd.ttl, pd.data);
548
549
		if(result != ISC_R_SUCCESS)
550
			goto lookup_cleanup;
551
	} // end while loop
552
553
lookup_cleanup:
554
555
	if(tmp != NULL)
556
		free(tmp);
557
	if(tmp_zone != NULL)
558
		free(tmp_zone);
559
	if(tmp_host != NULL)
560
		free(tmp_host);
561
562
		// get rid of the joined cusor
563
	if(join_cursor != NULL)
564
		join_cursor->c_close(join_cursor);
565
566
		// get rid of zone_cursor
567
	if(zone_cursor != NULL)
568
		zone_cursor->c_close(zone_cursor);
569
570
		// get rid of host_cursor
571
	if(host_cursor != NULL)
572
		host_cursor->c_close(host_cursor);
573
574
	return result;
575
576
return ISC_R_NOTFOUND;
577
}
578
579
580
	/* Initializes, sets flags and then opens Berkeley databases. */
581
582
isc_result_t
583
bdb_opendb(DB_ENV *db_env, DBTYPE db_type, DB **db, const char *db_name, 
584
													char *db_file, int flags){
585
586
	int result;
587
588
		/* Initialize the database. */
589
	if ((result = db_create(db, db_env, 0)) != 0) {
590
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
591
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
592
			"BDB could not initialize %s database. BDB error: %s",
593
												db_name, db_strerror(result));
594
		return ISC_R_FAILURE;
595
	}
596
597
		/* set database flags. */
598
	if ((result = (*db)->set_flags(*db, flags)) != 0) {
599
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
600
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
601
			"BDB could not set flags for %s database. BDB error: %s",
602
												db_name, db_strerror(result));
603
		return ISC_R_FAILURE;
604
	}
605
606
		/* open the database. */
607
	if ((result = (*db)->open(*db, NULL, db_file, db_name, db_type,
608
											DB_RDONLY | DB_THREAD, 0)) != 0) {
609
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
610
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
611
			"BDB could not open %s database in %s. BDB error: %s",
612
									db_name, db_file, db_strerror(result));
613
		return ISC_R_FAILURE;
614
	}
615
616
	return ISC_R_SUCCESS;
617
}
618
619
isc_result_t
620
bdb_create(const char *dlzname, unsigned int argc, char *argv[],
621
				void *driverarg, void **dbdata)
622
{
623
   isc_result_t result;
624
	int bdbres;
625
	bdb_instance_t *db = NULL;
626
627
    UNUSED(dlzname);
628
	 UNUSED(driverarg);
629
630
			/* verify we have 3 arg's passed to the driver */
631
	if(argc != 3){
632
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
633
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
634
			"Berkeley DB driver requires at least 2 command line args.");
635
		return (ISC_R_FAILURE);
636
	}
637
638
		/* allocate and zero memory for driver structure */
639
	db = isc_mem_get(ns_g_mctx, sizeof(bdb_instance_t));
640
	if (db == NULL){
641
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
642
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
643
			"Could not allocate memory for database instance object.");
644
		return (ISC_R_NOMEMORY);
645
	}
646
	memset(db, 0, sizeof(bdb_instance_t));
647
648
		/* attach to the memory context */
649
	isc_mem_attach(ns_g_mctx, &db->mctx);
650
651
		/* create BDB environment 
652
	    * Basically BDB allocates and assigns memory to db->dbenv
653
	    */
654
	bdbres = db_env_create(&db->dbenv, 0);
655
	if(bdbres != 0){
656
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
657
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
658
			"BDB environment could not be created. BDB error: %s", 
659
													db_strerror(bdbres));
660
		result = ISC_R_FAILURE;
661
		goto init_cleanup;
662
	}
663
664
		/* open BDB environment */
665
	bdbres = db->dbenv->open(db->dbenv, argv[1], 
666
		DB_INIT_CDB | DB_INIT_MPOOL | DB_THREAD | DB_CREATE, 0);
667
	if(bdbres != 0){
668
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
669
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
670
			"BDB environment at '%s' could not be opened. BDB error: %s", 
671
													argv[1], db_strerror(bdbres));
672
		result = ISC_R_FAILURE;
673
		goto init_cleanup;
674
	}
675
676
		/* open dlz_data database. */
677
	result = bdb_opendb(db->dbenv, DB_UNKNOWN, &db->data, dlz_data, argv[2], 0);
678
	if(result != ISC_R_SUCCESS)
679
		goto init_cleanup;
680
	
681
		/* open dlz_host database. */
682
	result = bdb_opendb(db->dbenv, DB_UNKNOWN, &db->host, dlz_host, argv[2], 
683
																			DB_DUP | DB_DUPSORT);
684
	if(result != ISC_R_SUCCESS)
685
		goto init_cleanup;
686
687
		/* open dlz_zone database. */
688
	result = bdb_opendb(db->dbenv, DB_UNKNOWN, &db->zone, dlz_zone, argv[2], 
689
																			DB_DUP | DB_DUPSORT);
690
	if(result != ISC_R_SUCCESS)
691
		goto init_cleanup;
692
693
		/* open dlz_client database. */
694
	result = bdb_opendb(db->dbenv, DB_UNKNOWN, &db->client,
695
						dlz_client, argv[2], DB_DUP | DB_DUPSORT);
696
	if(result != ISC_R_SUCCESS)
697
		goto init_cleanup;
698
699
		/* associate the host secondary database with the primary database */
700
	bdbres = db->data->associate(db->data, NULL, db->host, NULL, 0);
701
	if(bdbres != 0){
702
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
703
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
704
			"BDB could not associate %s database with %s. BDB error: %s",
705
											dlz_host, dlz_data, db_strerror(bdbres));
706
		result = ISC_R_FAILURE;
707
		goto init_cleanup;
708
	}
709
710
		/* associate the zone secondary database with the primary database */
711
	bdbres = db->data->associate(db->data, NULL, db->zone, NULL, 0);
712
	if(bdbres != 0){
713
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
714
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
715
			"BDB could not associate %s database with %s. BDB error: %s",
716
											dlz_zone, dlz_data, db_strerror(bdbres));
717
		result = ISC_R_FAILURE;
718
		goto init_cleanup;
719
	}
720
721
	*dbdata = db;
722
723
	return(ISC_R_SUCCESS);
724
725
init_cleanup:
726
727
	bdb_cleanup(db);
728
	return result;
729
}
730
731
void
732
bdb_destroy(void *driverarg, void *dbdata)
733
{
734
	UNUSED(driverarg);
735
736
	bdb_cleanup((bdb_instance_t *) dbdata);	
737
}
738
739
static dns_sdlzmethods_t dlz_bdb_methods = {
740
	bdb_create, 
741
	bdb_destroy,
742
	bdb_findzone,
743
	bdb_lookup,
744
	NULL, //	bdb_authority not needed as authority data is returned by lookup
745
	bdb_allnodes,
746
	bdb_allowzonexfr};
747
748
/*
749
 * Wrapper around dns_sdlzregister().
750
 */
751
isc_result_t
752
dlz_bdb_init(void) {
753
	isc_result_t result;
754
755
	/*
756
	 * Write debugging message to log
757
	 */
758
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
759
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
760
	      "Registering DLZ bdb driver.");
761
762
	result = dns_sdlzregister("bdb", &dlz_bdb_methods, NULL, 
763
							DNS_SDLZFLAG_RELATIVEOWNER | DNS_SDLZFLAG_RELATIVERDATA
764
							| DNS_SDLZFLAG_THREADSAFE, ns_g_mctx, &dlz_bdb);
765
	if(result != ISC_R_SUCCESS){
766
		UNEXPECTED_ERROR(__FILE__, __LINE__,
767
				 "dns_sdlzregister() failed: %s",
768
				 isc_result_totext(result));
769
		result = ISC_R_UNEXPECTED;
770
	}
771
772
773
	return result;
774
}
775
776
/*
777
 * Wrapper around dns_sdlzunregister().
778
 */
779
void
780
dlz_bdb_clear(void) {
781
782
	/*
783
	 * Write debugging message to log
784
	 */
785
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
786
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
787
	      "Unregistering DLZ bdb driver.");
788
789
	if (dlz_bdb != NULL)
790
		dns_sdlzunregister(&dlz_bdb);
791
}
792
793
#endif
(-)bind-9.2.2-orig/bin/named/dlz_filesystem_driver.c (+994 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
/*
37
 * Copyright (C) 1999-2001  Internet Software Consortium.
38
 *
39
 * Permission to use, copy, modify, and distribute this software for any
40
 * purpose with or without fee is hereby granted, provided that the above
41
 * copyright notice and this permission notice appear in all copies.
42
 *
43
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
44
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
45
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
46
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
47
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
48
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
50
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
51
 */
52
53
#ifdef DLZ_FILESYSTEM
54
55
#include <config.h>
56
#include <stdio.h>
57
#include <string.h>
58
#include <stdlib.h>
59
60
61
#include <sys/stat.h>
62
63
64
#include <dns/log.h>
65
#include <dns/sdlz.h>
66
#include <dns/result.h>
67
68
69
#include <isc/dir.h>
70
#include <isc/mem.h>
71
#include <isc/platform.h>
72
#include <isc/print.h>
73
#include <isc/result.h>
74
#include <isc/util.h>
75
76
#include <named/globals.h>
77
#include <named/dlz_filesystem_driver.h>
78
79
dns_sdlzimplementation_t *dlz_fs = NULL;
80
81
typedef struct config_data {
82
	char			*basedir;
83
	int			basedirsize;
84
	char			*datadir;
85
	int			datadirsize;
86
	char			*xfrdir;
87
	int			xfrdirsize;
88
	int			splitcnt;
89
   char			separator;
90
	char			pathsep;
91
	isc_mem_t	*mctx;
92
}config_data_t;
93
94
typedef struct dir_entry dir_entry_t;
95
96
struct dir_entry {
97
	char dirpath[ISC_DIR_PATHMAX];
98
	ISC_LINK(dir_entry_t)	link;
99
};
100
101
typedef ISC_LIST(dir_entry_t) dlist_t;
102
103
/***
104
 *** method prototypes
105
 *** Declared here to shut up compiler warnings
106
 *** about "no previous prototype"
107
 ***/
108
109
isc_boolean_t is_safe(const char *input);
110
111
isc_result_t create_path_helper(char *out, const char *in, config_data_t *cd);
112
113
isc_result_t create_path(const char *zone, const char *host,
114
								 const char *client, config_data_t *cd, char **path);
115
116
isc_result_t process_dir(isc_dir_t dir, void *passback, config_data_t *cd,
117
											dlist_t *dir_list, unsigned int basedirlen);
118
119
isc_result_t fs_allowzonexfr(void *driverarg, void *dbdata,
120
													const char *name,	const char *client);
121
122
isc_result_t fs_allnodes(const char *zone, void *driverarg, void *dbdata,
123
																dns_sdlzallnodes_t *allnodes);
124
125
isc_result_t fs_findzone(void *driverarg, void *dbdata, const char *name);
126
127
isc_result_t fs_lookup(const char *zone, const char *name, void *driverarg, 
128
													void *dbdata, dns_sdlzlookup_t *lookup);
129
130
isc_result_t fs_create(const char *dlzname, unsigned int argc,
131
										char *argv[], void *driverarg, void **dbdata);
132
133
void fs_destroy(void *driverarg, void *dbdata);
134
135
isc_result_t dlz_fs_init(void);
136
137
void dlz_fs_clear(void);
138
139
/***
140
 *** Private methods
141
 ***/
142
143
isc_boolean_t
144
is_safe(const char *input)
145
{
146
    unsigned int i;
147
    unsigned int len = strlen(input);
148
149
        // check that only allowed characters  are in the domain name
150
    for (i=0; i < len; i++) {            
151
            // '.' is allowed, but has special requirements
152
        if(input[i] == '.'){
153
                // '.' is not allowed as first char
154
            if(i == 0)  
155
                return ISC_FALSE;
156
                // '..', two dots together is not allowed.
157
            else if (input[i-1] == '.')
158
                return ISC_FALSE;
159
                // '.' is not allowed as last char
160
            if(i == len)
161
                return ISC_FALSE;
162
                // only 1 dot in ok location, continue at next char
163
            continue;
164
        }
165
           // '-' is allowed, continue at next char
166
        if(input[i] == '-')
167
           continue;
168
           // 0-9 is allowed, continue at next char
169
        if(input[i] >= '0' && input[i] <= '9')
170
           continue;
171
           // A-Z uppercase is allowed, continue at next char
172
        if(input[i] >= 'A' && input[i] <= 'Z')
173
           continue;
174
           // a-z lowercase is allowed, continue at next char
175
        if(input[i] >= 'a' && input[i] <= 'z')
176
           continue;
177
178
			  // colon needs to be allowed for IPV6 client addresses.
179
			  // Not dangerous in domain names, as not a special char.
180
		  if(input[i] == ':')
181
			  continue;
182
183
			  // '@' needs to be allowed for in zone data.
184
			  // Not dangerous in domain names, as not a special char.
185
		  if(input[i] == '@')
186
			  continue;     
187
		  
188
            // if we reach this point we have encountered a disallowed char!
189
        return ISC_FALSE;
190
    }
191
        // everything ok.
192
    return ISC_TRUE;
193
}
194
195
isc_result_t
196
create_path_helper(char *out, const char *in, config_data_t *cd)
197
{
198
199
	char *tmpString;
200
	char *tmpPtr;
201
	int i;
202
203
	tmpString = isc_mem_strdup(ns_g_mctx, in);
204
	if(tmpString == NULL)
205
		return (ISC_R_NOMEMORY);
206
207
		// don't forget is_safe guarantees '.' will NOT be the first/last char
208
	while( (tmpPtr = strrchr(tmpString, '.')) != NULL){
209
		i = 0;
210
		while(tmpPtr[i+1] != '\0'){
211
			if(cd->splitcnt < 1)
212
				strcat(out, (char *) &tmpPtr[i+1]);
213
			else
214
				strncat(out, (char *) &tmpPtr[i+1], cd->splitcnt);
215
			strncat(out, (char *) &cd->pathsep, 1);
216
			if(cd->splitcnt == 0)
217
				break;
218
			if(strlen( (char *) &tmpPtr[i+1]) <= (unsigned int) cd->splitcnt)
219
				break;
220
			i += cd->splitcnt;
221
		}	
222
		tmpPtr[0] = '\0';
223
	}
224
225
			// handle the "first" label properly
226
	i=0;
227
	tmpPtr = tmpString;
228
	while(tmpPtr[i] != '\0'){
229
		if(cd->splitcnt < 1)
230
			strcat(out, (char *) &tmpPtr[i]);
231
		else
232
			strncat(out, (char *) &tmpPtr[i], cd->splitcnt);
233
		strncat(out, (char *) &cd->pathsep, 1);
234
		if(cd->splitcnt == 0)
235
			break;
236
		if(strlen( (char *) &tmpPtr[i]) <= (unsigned int) cd->splitcnt)
237
			break;
238
		i += cd->splitcnt;
239
	}
240
241
	isc_mem_free(ns_g_mctx, tmpString);
242
	return (ISC_R_SUCCESS);
243
}
244
245
 /*
246
  * Checks to make sure zone and host are safe.  If safe, then
247
  * hashes zone and host strings to build a path.  If zone / host
248
  * are not safe an error is returned.
249
  */
250
251
isc_result_t
252
create_path(const char *zone, const char *host, const char *client, 
253
												config_data_t *cd, char **path)
254
{
255
256
	char *tmpPath;
257
	int pathsize;
258
	int len;
259
	isc_result_t result;
260
261
		// we require a zone & cd parameter
262
	REQUIRE(zone != NULL);
263
	REQUIRE(cd != NULL);
264
		// require path to be a pointer to NULL
265
	REQUIRE(path != NULL && *path == NULL);
266
		// client and host may both be NULL, but they can't both be NON-NULL
267
	REQUIRE( (host == NULL && client == NULL) ||
268
			 (host != NULL && client == NULL) ||
269
			 (host == NULL && client != NULL) );
270
271
		// if the requested zone is "unsafe", return error
272
	if(is_safe(zone) != ISC_TRUE)
273
		return (ISC_R_FAILURE);
274
275
		// if host was passed, verify that it is safe
276
	if( (host != NULL) && (is_safe(host) != ISC_TRUE) )
277
		return (ISC_R_FAILURE);
278
279
		// if host was passed, verify that it is safe
280
	if( (client != NULL) && (is_safe(client) != ISC_TRUE) )
281
		return (ISC_R_FAILURE);
282
283
		// Determine how much memory the split up string will require
284
	if(host != NULL)
285
	   len = strlen(zone) + strlen(host);
286
	else if(client != NULL)
287
		len = strlen(zone) + strlen(client);
288
	else
289
	   len = strlen(zone);
290
291
		// even though datadir and xfrdir will never be in the same string
292
		// we only waste a few bytes by allocating for both, and then we are
293
		// safe from buffer overruns.
294
	pathsize = len + cd->basedirsize + cd->datadirsize + cd->xfrdirsize + 4;
295
296
		// if we are splitting names, we will need extra space.
297
	if(cd->splitcnt > 0)
298
		pathsize += len/cd->splitcnt;
299
300
	tmpPath = isc_mem_allocate(ns_g_mctx , pathsize * sizeof(char));
301
	if(tmpPath == NULL){
302
			// write error message
303
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
304
		  DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
305
		  "Filesystem driver unable to allocate memory in create_path().");
306
		result = ISC_R_NOMEMORY;
307
		goto cleanup_mem;
308
	}
309
310
		// build path string
311
		// start out with base directory.
312
	strcpy(tmpPath, cd->basedir);
313
314
		// add zone name - parsed properly
315
	if((result = create_path_helper(tmpPath, zone, cd)) != ISC_R_SUCCESS)
316
		goto cleanup_mem;
317
318
		/*
319
		 * When neither client or host is passed we are building a path
320
		 * to see if a zone is supported.  We require that a zone path
321
		 * have the "data dir" directory contained within it so that we
322
		 * know this zone is really supported.  Otherwise, this zone may not
323
		 * really be supported because we are supporting a delagated sub zone.
324
		 * Example:
325
		 * We are supporting long.domain.com and using a splitcnt of 0.
326
		 * the base dir is "/base-dir/" and the data dir is "/.datadir"
327
		 * We want to see if we are authoritative for domain.com.
328
		 * Path /base-dir/com/domain/.datadir
329
		 * since /base-dir/com/domain/.datadir does not exist, we are not
330
		 * authoritative for the domain "domain.com".  However we are
331
		 * authoritative for the domain "long.domain.com" because the path
332
		 * /base-dir/com/domain/long/.datadir does exist!
333
		 */
334
335
		// if client is passed append xfr dir, otherwise append data dir
336
	if(client != NULL){
337
		strcat(tmpPath, cd->xfrdir);
338
		strncat(tmpPath, (char *) &cd->pathsep, 1);
339
		strcat(tmpPath, client);
340
	}else{
341
		strcat(tmpPath, cd->datadir);
342
	}
343
344
		// if host not null, add it.
345
	if(host != NULL){
346
		strncat(tmpPath, (char *) &cd->pathsep, 1);
347
		if((result = create_path_helper(tmpPath, host, cd)) != ISC_R_SUCCESS)
348
			goto cleanup_mem;
349
	}
350
351
		//return the path we built.
352
	*path = tmpPath;
353
354
		// return success
355
	result = ISC_R_SUCCESS;
356
357
cleanup_mem:	// cleanup memory
358
359
		// free tmpPath memory
360
	if(tmpPath != NULL && result != ISC_R_SUCCESS)
361
		isc_mem_free(ns_g_mctx, tmpPath);
362
363
		// free tmpPath memory
364
	return result;
365
}
366
367
isc_result_t
368
process_dir(isc_dir_t dir, void *passback, config_data_t *cd,
369
							dlist_t *dir_list, unsigned int basedirlen)
370
{
371
372
	char tmp[ISC_DIR_PATHMAX + ISC_DIR_NAMEMAX];
373
	int astPos;
374
	struct stat	sb;
375
	isc_result_t result = ISC_R_FAILURE;
376
	char *endp;
377
	char *type;
378
	char *ttlStr;
379
	char *data;
380
	char host[ISC_DIR_NAMEMAX];
381
	char *tmpString;
382
	char *tmpPtr;
383
	int ttl;
384
	int i;
385
	int len;
386
	dir_entry_t *direntry;
387
	isc_boolean_t foundHost;
388
389
	tmp[0] = '\0'; // set 1st byte to '\0' so strcpy works right.
390
	host[0] = '\0';
391
	foundHost = ISC_FALSE;
392
393
		// copy base directory name to tmp.
394
	strcpy(tmp, dir.dirname);
395
396
		// dir.dirname will always have '*' as the last char.
397
	astPos = strlen(dir.dirname) - 1;
398
399
		// if dir_list != NULL, were are performing a zone xfr
400
	if(dir_list != NULL){
401
			// if splitcnt == 0, determine host from path.
402
		if(cd->splitcnt == 0){
403
			if(strlen(tmp) - 3 > basedirlen){
404
				tmp[astPos-1] = '\0';
405
				tmpString = (char *) &tmp[basedirlen+1];
406
					// handle filesystem's special wildcard "-" 
407
				if(strcmp(tmpString, "-") == 0){
408
					strcpy(host, "*");
409
				}else{  // not special wildcard -- normal name
410
					while( (tmpPtr = strrchr(tmpString, cd->pathsep)) != NULL){	
411
						strcat(host, tmpPtr + 1);
412
						strcat(host, ".");
413
						tmpPtr[0] = '\0';
414
					}
415
					strcat(host, tmpString);
416
				}
417
418
				foundHost = ISC_TRUE;
419
				// set tmp again for use later
420
				strcpy(tmp, dir.dirname);
421
			}		
422
		}else{ // if splitcnt != 0
423
				// determine host from ".host" directory entry
424
			while (isc_dir_read(&dir) == ISC_R_SUCCESS){
425
				if(strncasecmp(".host", dir.entry.name, 5) == 0){
426
						// handle filesystem's special wildcard "-" 
427
					if(strcmp( (char *) &dir.entry.name[6], "-") == 0)
428
						strcpy(host, "*");
429
					else
430
						strcpy(host, (char *) &dir.entry.name[6]);
431
					foundHost = ISC_TRUE;
432
					break;
433
				}
434
			}
435
				// reset dir list for use later
436
			isc_dir_reset(&dir);
437
		} // end of else
438
	}
439
440
	while (isc_dir_read(&dir) == ISC_R_SUCCESS) {
441
442
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
443
		   DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
444
		   "Filesystem driver Dir name: '%s' Dir entry: '%s'\n", 
445
		   dir.dirname, dir.entry.name);
446
447
			// skip any entries starting with "."
448
		if(dir.entry.name[0] == '.')
449
			continue;
450
451
			// get rid of '*', set to NULL.  Effectively trims string from
452
			// previous loop  to base directory only while still leaving
453
			// memory for concat to be performed next.
454
455
		tmp[astPos] = '\0';
456
457
			// add name to base directory name.
458
		strcat(tmp, dir.entry.name);
459
460
			// make sure we can stat entry
461
		if (stat(tmp, &sb) == 0 ){
462
				// if entry is a directory
463
			if((sb.st_mode & S_IFDIR) != 0){
464
					// if dir list is NOT NULL, add dir to dir list
465
				if(dir_list != NULL){
466
					direntry = isc_mem_get(ns_g_mctx, sizeof(dir_entry_t));
467
					if(direntry == NULL)
468
						return (ISC_R_NOMEMORY);
469
					strcpy(direntry->dirpath, tmp);
470
					ISC_LINK_INIT(direntry, link);
471
					ISC_LIST_APPEND(*dir_list, direntry, link);
472
					result = ISC_R_SUCCESS;
473
				}
474
				continue;
475
				// if entry is a file be sure we do not add entry
476
				// to DNS results if we are performing a zone xfr
477
				// and we could not find a host entry.
478
			} else if(dir_list != NULL && foundHost == ISC_FALSE){
479
				continue;
480
			}
481
		}else // if we cannot stat entry, skip it.
482
			continue;
483
484
		type = dir.entry.name;
485
		ttlStr = strchr(type,  cd->separator);
486
		if(ttlStr == NULL){
487
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
488
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
489
				"Filesystem driver: %s could not be parsed properly", tmp);
490
			return ISC_R_FAILURE;
491
		}
492
493
			// replace separator char with NULL to split string
494
		ttlStr[0] = '\0';
495
			// start string after NULL of previous string
496
		ttlStr = (char *) &ttlStr[1];
497
498
		data = strchr(ttlStr, cd->separator);
499
		if(data == NULL){
500
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
501
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
502
				"Filesystem driver: %s could not be parsed properly", tmp);
503
			return ISC_R_FAILURE;
504
		}
505
506
			// replace separator char with NULL to split string
507
		data[0] = '\0';
508
509
			// start string after NULL of previous string
510
		data = (char *) &data[1];
511
512
			// replace all cd->separator chars with a space.
513
		len = strlen(data);
514
515
		for(i=0; i < len; i++){
516
			if(data[i] == cd->separator)
517
				data[i] = ' ';
518
		}
519
520
			// convert text to int, make sure it worked right
521
		ttl = strtol(ttlStr, &endp, 10);
522
		if (*endp != '\0' || ttl < 0){
523
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
524
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
525
				"Filesystem driver ttl must be a postive number");
526
		}
527
528
			// pass data back to Bind
529
		if(dir_list == NULL)
530
			result = dns_sdlz_putrr( (dns_sdlzlookup_t *) passback, type, 
531
																					ttl, data);
532
		else
533
			result = dns_sdlz_putnamedrr( (dns_sdlzallnodes_t *) passback,
534
														(char *) host, type, ttl, data);
535
536
			// if error, return error right away
537
		if(result != ISC_R_SUCCESS)
538
			return result;
539
	} // end of while loop
540
541
	return result;
542
}  
543
544
/***
545
 *** SDLZ interface methods
546
 ***/
547
548
isc_result_t
549
fs_allowzonexfr(void *driverarg, void *dbdata, const char *name,
550
																const char *client)
551
{
552
553
	isc_result_t result;
554
	char *path;
555
	struct stat	sb;
556
	config_data_t *cd;
557
	path = NULL;
558
559
   UNUSED(driverarg);
560
561
	cd = (config_data_t *) dbdata;
562
563
	if(create_path(name, NULL, client, cd, &path) != ISC_R_SUCCESS){
564
		return (ISC_R_NOTFOUND);
565
	}
566
567
	if (stat(path, &sb) != 0) {
568
		result = ISC_R_NOTFOUND;
569
		goto complete_AXFR;
570
	}
571
572
	if( (sb.st_mode & S_IFREG) != 0){
573
		result = ISC_R_SUCCESS;
574
		goto complete_AXFR;
575
	}
576
577
	result = ISC_R_NOTFOUND;
578
579
complete_AXFR:
580
   isc_mem_free(ns_g_mctx, path);
581
	return result;
582
}
583
584
isc_result_t
585
fs_allnodes(const char *zone, void *driverarg, void *dbdata,
586
													dns_sdlzallnodes_t *allnodes)
587
{
588
589
	isc_result_t result;
590
	dlist_t *dir_list;
591
	config_data_t *cd;
592
	char *basepath;
593
	unsigned int basepathlen;
594
	struct stat	sb;
595
	isc_dir_t dir;
596
	dir_entry_t *dir_entry;
597
	dir_entry_t *next_de;
598
599
	basepath = NULL;
600
	dir_list = NULL;
601
602
	UNUSED(driverarg);
603
	UNUSED(allnodes);
604
605
	cd = (config_data_t *) dbdata;
606
607
		/* allocate memory for list */
608
	dir_list = isc_mem_get(ns_g_mctx, sizeof(dlist_t));
609
	if (dir_list == NULL){
610
		result = ISC_R_NOTFOUND;
611
		goto complete_allnds;
612
	}
613
614
		/* initialize list */
615
	ISC_LIST_INIT(*dir_list);
616
617
	if(create_path(zone, NULL, NULL, cd, &basepath) != ISC_R_SUCCESS){
618
		return (ISC_R_NOTFOUND);
619
	}
620
621
		// remove path separator at end of path so stat works properly
622
	basepathlen = strlen(basepath);
623
624
	if (stat(basepath, &sb) != 0) {
625
		result = ISC_R_NOTFOUND;
626
		goto complete_allnds;
627
	}
628
629
	if( (sb.st_mode & S_IFDIR) == 0){
630
		result = ISC_R_NOTFOUND;
631
		goto complete_allnds;
632
	}
633
634
		// initialize and open directory
635
	isc_dir_init(&dir);
636
	result = isc_dir_open(&dir, basepath);
637
638
		// if directory open failed, return error.
639
	if (result != ISC_R_SUCCESS){
640
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
641
		 DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
642
		 "Unable to open %s directory to read entries.", basepath);
643
		result = ISC_R_FAILURE;
644
		goto complete_allnds;
645
	}
646
647
		// process the directory
648
	result = process_dir(dir, allnodes, cd, dir_list, basepathlen);
649
650
		// close the directory
651
	isc_dir_close(&dir);
652
653
	if(result != ISC_R_SUCCESS)
654
		goto complete_allnds;
655
656
		// get first dir entry from list.
657
	dir_entry = ISC_LIST_HEAD(*dir_list);
658
	while (dir_entry != NULL){
659
660
		result = isc_dir_open(&dir, dir_entry->dirpath);
661
			// if directory open failed, return error.
662
		if (result != ISC_R_SUCCESS){
663
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
664
			 DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
665
			 "Unable to open %s directory to read entries.", basepath);
666
			result = ISC_R_FAILURE;
667
			goto complete_allnds;
668
		}
669
670
			// process the directory
671
		result = process_dir(dir, allnodes, cd, dir_list, basepathlen);
672
673
			// close the directory
674
		isc_dir_close(&dir);
675
676
		if(result != ISC_R_SUCCESS)
677
			goto complete_allnds;
678
679
		dir_entry = ISC_LIST_NEXT(dir_entry, link);
680
	} // end while
681
682
complete_allnds:
683
	if(dir_list != NULL){
684
			// clean up entries from list.
685
		dir_entry = ISC_LIST_HEAD(*dir_list);
686
		while (dir_entry != NULL){
687
			next_de = ISC_LIST_NEXT(dir_entry, link);
688
			isc_mem_put(ns_g_mctx, dir_entry, sizeof(dir_entry_t));
689
			dir_entry = next_de;
690
		} // end while
691
		isc_mem_put(ns_g_mctx, dir_list, sizeof(dlist_t));
692
	}
693
694
	if(basepath != NULL)
695
		isc_mem_free(ns_g_mctx, basepath);
696
697
	return result;
698
}
699
700
isc_result_t
701
fs_findzone(void *driverarg, void *dbdata, const char *name)
702
{
703
704
	isc_result_t result;
705
	char *path;
706
	struct stat	sb;
707
	path = NULL;
708
709
   UNUSED(driverarg);
710
711
	if(create_path(name, NULL, NULL, (config_data_t *) dbdata, &path) != ISC_R_SUCCESS){
712
		return (ISC_R_NOTFOUND);
713
	}
714
715
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
716
	   DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
717
	   "Filesystem driver Findzone() Checking for path: '%s'\n", path);
718
719
	if (stat(path, &sb) != 0) {
720
		result = ISC_R_NOTFOUND;
721
		goto complete_FZ;
722
	}
723
724
	if( (sb.st_mode & S_IFDIR) != 0){
725
		result = ISC_R_SUCCESS;
726
		goto complete_FZ;
727
	}
728
729
	result = ISC_R_NOTFOUND;
730
731
complete_FZ:
732
733
   isc_mem_free(ns_g_mctx, path);
734
	return result;
735
}
736
737
isc_result_t
738
fs_lookup(const char *zone, const char *name, void *driverarg, 
739
										void *dbdata, dns_sdlzlookup_t *lookup)
740
{
741
	isc_result_t result;
742
	char *path;
743
	struct stat	sb;
744
	isc_dir_t dir;
745
	path = NULL;
746
747
   UNUSED(driverarg);
748
   UNUSED(lookup);
749
750
	if(strcmp(name, "*") == 0) // handle filesystem's special wildcard "-"
751
		result = create_path(zone, "-", NULL, (config_data_t *) dbdata, &path);
752
	else
753
		result = create_path(zone, name, NULL, (config_data_t *) dbdata, &path);
754
	
755
	if( result != ISC_R_SUCCESS){
756
		return (ISC_R_NOTFOUND);
757
	}
758
759
		// remove path separator at end of path so stat works properly
760
	path[strlen(path)-1] = '\0';
761
762
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
763
	   DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
764
	   "Filesystem driver lookup() Checking for path: '%s'\n", path);
765
766
767
	if (stat(path, &sb) != 0) {
768
		result = ISC_R_NOTFOUND;
769
		goto complete_lkup;
770
	}
771
	
772
	if( (sb.st_mode & S_IFDIR) == 0){
773
		result = ISC_R_NOTFOUND;
774
		goto complete_lkup;
775
	}
776
777
		// initialize and open directory
778
	isc_dir_init(&dir);
779
	result = isc_dir_open(&dir, path);
780
781
		// if directory open failed, return error.
782
	if (result != ISC_R_SUCCESS){
783
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
784
		 DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
785
		 "Unable to open %s directory to read entries.", path);
786
		result = ISC_R_FAILURE;
787
		goto complete_lkup;
788
	}
789
790
		// process any records in the directory
791
	result = process_dir(dir, lookup, (config_data_t *) dbdata, NULL, 0);
792
793
		// close the directory
794
	isc_dir_close(&dir);
795
796
complete_lkup:
797
798
   isc_mem_free(ns_g_mctx, path);
799
	return result;
800
}
801
802
isc_result_t
803
fs_create(const char *dlzname, unsigned int argc, char *argv[],
804
													void *driverarg, void **dbdata)
805
{
806
	config_data_t *cd;
807
	char *endp;
808
	int len;
809
	char pathsep;
810
811
	UNUSED(driverarg);
812
	UNUSED(dlzname);
813
814
		// we require 5 command line args.
815
	if(argc != 6){
816
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
817
		 DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
818
	     "Filesystem driver requires 6 command line args.");
819
		return (ISC_R_FAILURE);
820
	}
821
822
	if(strlen(argv[5]) > 1){
823
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
824
		 DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
825
		 "Filesystem driver can only accept a single character for separator.");
826
		return (ISC_R_FAILURE);
827
	}
828
829
		// verify base dir ends with '/' or '\'
830
	len = strlen(argv[1]);
831
	if(argv[1][len-1] != '\\' && argv[1][len-1] != '/'){
832
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
833
		 DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
834
		 "Base dir parameter for filesystem driver should end with %s",
835
		 "either '/' or '\\' ");
836
		return (ISC_R_FAILURE);
837
	}
838
839
		// determine and save path separator for later
840
	if(argv[1][len-1] == '\\')
841
		pathsep = '\\';
842
	else
843
		pathsep = '/';
844
845
		// allocate memory for our config data
846
	cd = isc_mem_get(ns_g_mctx, sizeof(config_data_t));
847
	if(cd == NULL)
848
		goto no_mem;
849
850
		// zero the memory
851
	memset(cd, 0, sizeof(config_data_t));
852
853
	cd->pathsep = pathsep;
854
855
		// get and store our base directory
856
	cd->basedir = isc_mem_strdup(ns_g_mctx, argv[1]);
857
	if(cd->basedir == NULL)
858
		goto no_mem;
859
	cd->basedirsize = strlen(cd->basedir);
860
861
		// get and store our data sub-dir
862
	cd->datadir = isc_mem_strdup(ns_g_mctx, argv[2]);
863
	if(cd->datadir == NULL)
864
		goto no_mem;
865
	cd->datadirsize = strlen(cd->datadir);
866
867
		// get and store our zone xfr sub-dir
868
	cd->xfrdir = isc_mem_strdup(ns_g_mctx, argv[3]);
869
	if(cd->xfrdir == NULL)
870
		goto no_mem;
871
	cd->xfrdirsize = strlen(cd->xfrdir);
872
873
		// get and store our directory split count
874
	cd->splitcnt = strtol(argv[4], &endp, 10);
875
	if (*endp != '\0' || cd->splitcnt < 0){
876
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
877
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
878
			"Directory split count must be zero (0) or a postive number");
879
	}
880
881
		// get and store our separator character
882
	cd->separator = *argv[5];
883
884
		// attach config data to memory context
885
	isc_mem_attach(ns_g_mctx, &cd->mctx);
886
887
		// pass back config data
888
	*dbdata = cd;
889
890
		// return success
891
	return(ISC_R_SUCCESS);
892
893
	// handle no memory error
894
no_mem:
895
896
		// if we allocated a config data object clean it up
897
	if(cd != NULL)
898
		fs_destroy(NULL, cd);
899
	
900
		// write error message
901
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
902
	  DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
903
	  "Filesystem driver unable to allocate memory for config data.");
904
	
905
		// return error
906
	return (ISC_R_NOMEMORY);
907
}
908
909
void
910
fs_destroy(void *driverarg, void *dbdata)
911
{
912
	isc_mem_t *mctx;
913
	config_data_t *cd;
914
915
	UNUSED(driverarg);
916
917
	cd = (config_data_t *) dbdata;
918
919
		// free memory for each section of config data that was allocated
920
	if(cd->basedir != NULL)
921
		isc_mem_free(ns_g_mctx, cd->basedir);
922
923
	if(cd->datadir != NULL)
924
		isc_mem_free(ns_g_mctx, cd->datadir);
925
926
	if(cd->xfrdir != NULL)
927
		isc_mem_free(ns_g_mctx, cd->xfrdir);
928
929
		// hold memory context to use later
930
	mctx = cd->mctx;
931
932
		// free config data memory
933
	isc_mem_put(mctx, cd, sizeof(config_data_t));
934
935
		// detach memory from context
936
	isc_mem_detach(&mctx);
937
}
938
939
static dns_sdlzmethods_t dlz_fs_methods = {
940
	fs_create, 
941
	fs_destroy,
942
	fs_findzone,
943
	fs_lookup,
944
	NULL,
945
	fs_allnodes,
946
	fs_allowzonexfr};
947
948
/*
949
 * Wrapper around dns_sdlzregister().
950
 */
951
isc_result_t
952
dlz_fs_init(void)
953
{
954
	isc_result_t result;
955
956
	/*
957
	 * Write debugging message to log
958
	 */
959
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
960
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
961
	      "Registering DLZ filesystem driver.");
962
963
	result = dns_sdlzregister("filesystem", &dlz_fs_methods, NULL, 
964
							DNS_SDLZFLAG_RELATIVEOWNER | DNS_SDLZFLAG_RELATIVERDATA,
965
							ns_g_mctx, &dlz_fs);
966
	if(result != ISC_R_SUCCESS){
967
		UNEXPECTED_ERROR(__FILE__, __LINE__,
968
				 "dns_sdlzregister() failed: %s",
969
				 isc_result_totext(result));
970
		result = ISC_R_UNEXPECTED;
971
	}
972
973
	return result;
974
}
975
976
/*
977
 * Wrapper around dns_sdlzunregister().
978
 */
979
void
980
dlz_fs_clear(void) {
981
982
	/*
983
	 * Write debugging message to log
984
	 */
985
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
986
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
987
	      "Unregistering DLZ filesystem driver.");
988
989
	if (dlz_fs != NULL)
990
		dns_sdlzunregister(&dlz_fs);
991
}
992
993
#endif
994
(-)bind-9.2.2-orig/bin/named/dlz_ldap_driver.c (+1270 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
/*
37
 * Copyright (C) 1999-2001  Internet Software Consortium.
38
 *
39
 * Permission to use, copy, modify, and distribute this software for any
40
 * purpose with or without fee is hereby granted, provided that the above
41
 * copyright notice and this permission notice appear in all copies.
42
 *
43
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
44
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
45
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
46
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
47
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
48
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
50
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
51
 */
52
53
#ifdef DLZ_LDAP
54
 
55
#include <config.h>
56
#include <stdio.h>
57
#include <string.h>
58
#include <stdlib.h>
59
60
#include <dns/log.h>
61
#include <dns/sdlz.h>
62
#include <dns/result.h>
63
64
#include <isc/mem.h>
65
#include <isc/platform.h>
66
#include <isc/print.h>
67
#include <isc/result.h>
68
#include <isc/string.h>
69
#include <isc/util.h>
70
71
#include <named/globals.h>
72
#include <named/dlz_ldap_driver.h>
73
#include <named/sdlz_helper.h>
74
75
#include <ldap.h>
76
77
#define SIMPLE "simple"
78
#define KRB41 "krb41"
79
#define KRB42 "krb42"
80
#define V2 "v2"
81
#define V3 "v3"
82
83
84
dns_sdlzimplementation_t *dlz_ldap = NULL;
85
86
#define dbc_search_limit 30
87
#define ALLNODES 1
88
#define ALLOWXFR 2
89
#define AUTHORITY 3
90
#define FINDZONE 4
91
#define LOOKUP 5
92
93
/***
94
 *** Structure to hold everthing needed by this "instance" of the LDAP driver
95
 *** remember, the driver code is only loaded once, but may have many separate
96
 *** instances
97
 ***/
98
99
typedef struct {
100
101
#ifdef ISC_PLATFORM_USETHREADS
102
103
   db_list_t    *db;       // handle to a list of DB
104
105
#else
106
    
107
   dbinstance_t *db;       // handle to db
108
109
#endif
110
111
	int method;		// security authentication method
112
	char *user;		// who is authenticating
113
	char *cred;		// password for simple authentication method
114
   int protocol;	// LDAP communication protocol version
115
	char *hosts;	// LDAP server hosts
116
117
} ldap_instance_t;
118
119
isc_result_t
120
dlz_ldap_connect(ldap_instance_t *dbi, dbinstance_t *dbc);
121
122
void 
123
ldap_destroy_dblist(db_list_t *dblist);
124
125
dbinstance_t *
126
ldap_find_avail_conn(db_list_t *dblist);
127
128
isc_result_t
129
ldap_get_results(const char *zone, const char *record,
130
					   const char *client, unsigned int query,
131
					   void *dbdata, void *ptr);
132
133
isc_result_t
134
ldap_process_results(LDAP *dbc, LDAPMessage *msg, char ** attrs,
135
												void *ptr, isc_boolean_t allnodes);
136
137
isc_result_t
138
dlz_ldap_checkURL(char *URL, int attrCnt, const char *msg);
139
140
/***
141
 *** DLZ method prototypes
142
 ***/
143
144
isc_result_t
145
dlz_ldap_allowzonexfr(void *driverarg, void *dbdata, const char *name,
146
                                                    const char *client);
147
148
isc_result_t
149
dlz_ldap_allnodes(const char *zone, void *driverarg, void *dbdata,
150
						                dns_sdlzallnodes_t *allnodes);
151
152
isc_result_t
153
dlz_ldap_authority(const char *zone, void *driverarg, void *dbdata,
154
                                            dns_sdlzlookup_t *lookup);
155
156
isc_result_t
157
dlz_ldap_findzone(void *driverarg, void *dbdata, const char *name);
158
159
isc_result_t
160
dlz_ldap_lookup(const char *zone, const char *name, void *driverarg, 
161
                                void *dbdata, dns_sdlzlookup_t *lookup);
162
163
isc_result_t
164
dlz_ldap_create(const char *dlzname, unsigned int argc, char *argv[],
165
				                        void *driverarg, void **dbdata);
166
167
void
168
dlz_ldap_destroy(void *driverarg, void *dbdata);
169
170
171
/***
172
 *** Private methods
173
 ***/ 
174
175
	/* checks that the LDAP URL parameters make sense */
176
177
isc_result_t
178
dlz_ldap_checkURL(char *URL, int attrCnt, const char *msg){
179
180
	isc_result_t result = ISC_R_SUCCESS;
181
	int ldap_result;
182
	LDAPURLDesc *ldap_url = NULL;
183
184
	if(!ldap_is_ldap_url(URL)){
185
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
186
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
187
			"%s query is not a valid LDAP URL", msg);
188
		result = ISC_R_FAILURE;
189
		goto cleanup;
190
	}
191
192
	ldap_result = ldap_url_parse(URL, &ldap_url);
193
	if(ldap_result != LDAP_SUCCESS || ldap_url == NULL){
194
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
195
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
196
			"parsing %s query failed", msg);
197
		result = ISC_R_FAILURE;
198
		goto cleanup;
199
	}
200
201
	if(ldap_count_values(ldap_url->lud_attrs) < attrCnt){
202
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
203
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
204
			"%s query must specify at least %d attributes to return",
205
			msg, attrCnt);
206
		result = ISC_R_FAILURE;
207
		goto cleanup;
208
	}
209
210
	if(ldap_url->lud_host != NULL){
211
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
212
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
213
			"%s query must not specify a host", msg);
214
		result = ISC_R_FAILURE;
215
		goto cleanup;
216
	}
217
218
	if(ldap_url->lud_port != 389){
219
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
220
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
221
			"%s query must not specify a port", msg);
222
		result = ISC_R_FAILURE;
223
		goto cleanup;
224
	}
225
226
	if(ldap_url->lud_dn == NULL || strlen (ldap_url->lud_dn) < 1){
227
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
228
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
229
			"%s query must specify a search base", msg);
230
		result = ISC_R_FAILURE;
231
		goto cleanup;
232
	}
233
234
	if(ldap_url->lud_exts != NULL ||	ldap_url->lud_crit_exts != 0){
235
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
236
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
237
			"%s uses extensions. The driver does not support LDAP extensions.",
238
			msg);
239
		result = ISC_R_FAILURE;
240
		goto cleanup;
241
	}
242
243
cleanup:
244
245
	if(ldap_url != NULL)
246
		ldap_free_urldesc(ldap_url);
247
248
	return result;
249
}
250
	/* Connects / reconnects to LDAP server */
251
252
isc_result_t
253
dlz_ldap_connect(ldap_instance_t *dbi, dbinstance_t *dbc){
254
255
	isc_result_t result;
256
	int ldap_result;
257
258
		// if we have a connection, get ride of it.
259
	if(dbc->dbconn != NULL){
260
		ldap_unbind_s((LDAP *) dbc->dbconn);
261
		dbc->dbconn = NULL;
262
	}
263
264
	// now connect / reconnect.
265
266
		// initialize.
267
	dbc->dbconn = ldap_init(dbi->hosts, LDAP_PORT);
268
	if(dbc->dbconn == NULL)
269
		return ISC_R_NOMEMORY;
270
271
		// set protocol version.
272
	ldap_result = ldap_set_option((LDAP *) dbc->dbconn,
273
							LDAP_OPT_PROTOCOL_VERSION, &(dbi->protocol));
274
	if(ldap_result != LDAP_SUCCESS){
275
		result = ISC_R_NOPERM;
276
		goto cleanup;
277
	}
278
279
		// "bind" to server.  i.e. send username / pass
280
	ldap_result = ldap_bind_s((LDAP *) dbc->dbconn, dbi->user,
281
													dbi->cred, dbi->method);
282
	if(ldap_result != LDAP_SUCCESS){
283
		result = ISC_R_FAILURE;
284
		goto cleanup;
285
	}
286
287
	return ISC_R_SUCCESS;
288
289
cleanup:
290
291
		// cleanup if failure.
292
	if(dbc->dbconn != NULL){
293
		ldap_unbind_s((LDAP *) dbc->dbconn);
294
		dbc->dbconn = NULL;
295
	}
296
297
	return result;
298
}
299
300
#ifdef ISC_PLATFORM_USETHREADS
301
302
303
	/* Properly cleans up a list of database instances.
304
	 * This function is only used when the driver is compiled for
305
	 * multithreaded operation.
306
	 */
307
void 
308
ldap_destroy_dblist(db_list_t *dblist)
309
{
310
311
	dbinstance_t *ndbi = NULL;
312
	dbinstance_t *dbi = NULL;
313
314
		// get the first DBI in the list
315
	ndbi = ISC_LIST_HEAD(*dblist);
316
	
317
		// loop through the list
318
	while(ndbi != NULL){
319
		dbi = ndbi;
320
			// get the next DBI in the list
321
		ndbi = ISC_LIST_NEXT(dbi, link);
322
			// release DB connection
323
		if(dbi->dbconn != NULL)
324
			ldap_unbind_s((LDAP *) dbi->dbconn);
325
			// release all memory that comprised a DBI
326
		destroy_sqldbinstance(dbi);
327
	}
328
		// release memory for the list structure
329
	isc_mem_put(ns_g_mctx, dblist, sizeof(db_list_t));
330
}
331
332
	/* Loops through the list of DB instances, attempting to lock
333
	 * on the mutex.  If successful, the DBI is reserved for use
334
	 * and the thread can perform queries against the database.
335
	 * If the lock fails, the next one in the list is tried.
336
	 * looping continues until a lock is obtained, or until
337
	 * the list has been searched dbc_search_limit times.
338
	 * This function is only used when the driver is compiled for
339
	 * multithreaded operation.
340
	 */
341
342
dbinstance_t *
343
ldap_find_avail_conn(db_list_t *dblist)
344
{
345
	dbinstance_t *dbi = NULL;
346
	dbinstance_t *head;
347
	int count = 0;
348
349
		// get top of list
350
	head = dbi = ISC_LIST_HEAD(*dblist);
351
352
		// loop through list
353
	while(count < dbc_search_limit){
354
			// try to lock on the mutex
355
		if(isc_mutex_trylock(&dbi->instance_lock) == ISC_R_SUCCESS)
356
			return dbi;		// success, return the DBI for use.
357
358
			// not successful, keep trying
359
		dbi = ISC_LIST_NEXT(dbi, link);
360
361
			// check to see if we have gone to the top of the list.
362
		if(dbi == NULL){
363
			count++;
364
			dbi = head;
365
		}
366
	}
367
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
368
		DNS_LOGMODULE_DLZ, ISC_LOG_INFO,
369
		"LDAP driver unable to find available connection after searching %d times",
370
		count);
371
	return NULL;
372
}
373
374
#endif /* ISC_PLATFORM_USETHREADS */
375
376
isc_result_t
377
ldap_process_results(LDAP *dbc, LDAPMessage *msg, char ** attrs,
378
														void *ptr, isc_boolean_t allnodes)
379
{
380
	isc_result_t result = ISC_R_SUCCESS;
381
	int i = 0;
382
	int j;
383
	int len;
384
	char *attribute = NULL;
385
	LDAPMessage *entry;
386
	char *endp = NULL;
387
	char *host = NULL;
388
	char *type = NULL;
389
	char *data = NULL;
390
	char **vals = NULL;
391
	int ttl; 
392
393
		// make sure there are at least some attributes to process.
394
	REQUIRE(attrs != NULL || attrs[0] != NULL);
395
396
		// get the first entry to process
397
	entry = ldap_first_entry(dbc, msg);
398
	if(entry == NULL){
399
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
400
			DNS_LOGMODULE_DLZ, ISC_LOG_INFO,
401
			"LDAP no entries to process.");
402
		return ISC_R_FAILURE;
403
	}
404
405
		// loop through all entries returned
406
	while(entry != NULL){
407
408
			// reset for this loop
409
		ttl = 0;
410
		len = 0;
411
		i = 0;
412
		attribute = attrs[i];
413
414
			// determine how much space we need for data string
415
		for(j=0; attrs[j] != NULL; j++){
416
				// get the list of values for this attribute.
417
			vals = ldap_get_values(dbc, entry, attrs[j]);
418
				// skip empty attributes.
419
			if(vals == NULL || ldap_count_values(vals) < 1)
420
				continue;
421
				// we only use the first value 
422
				// this driver does not support multi-valued attributes.
423
			len = len + strlen(vals[0]) + 1;
424
				// free vals for next loop
425
			ldap_value_free(vals);
426
		} // end for(j=0; attrs[j] != NULL, j++) loop
427
428
			// allocate memory for data string
429
		data = isc_mem_allocate(ns_g_mctx, len + 1);
430
		if(data == NULL){
431
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
432
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
433
				"LDAP driver unable to allocate memory while processing results");
434
			result = ISC_R_FAILURE;
435
			goto cleanup;
436
		}
437
		
438
			// Make sure data is null termed at the beginning so we
439
			// can check if any data was stored to it later.
440
		data[0] = '\0';
441
442
			// reset j to re-use below
443
		j = 0;
444
		
445
			// loop through the attributes in the order specified.
446
		while(attribute != NULL){
447
			
448
				// get the list of values for this attribute.
449
			vals = ldap_get_values(dbc, entry, attribute);
450
451
				// skip empty attributes.
452
			if(vals == NULL || vals[0] == NULL){
453
					// increment attibute pointer
454
				attribute = attrs[++i];
455
					// start loop over
456
				continue;
457
			}
458
459
				// j initially = 0.  Increment j each time we set a field
460
				// that way next loop will set next field.
461
			switch(j){
462
				case 0:
463
					j++;
464
						// convert text to int, make sure it worked right
465
					ttl = strtol(vals[0], &endp, 10);
466
					if (*endp != '\0' || ttl < 0){
467
						isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
468
							DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
469
							"LDAP driver ttl must be a postive number");
470
						goto cleanup;
471
					}
472
					break;
473
				case 1:
474
					j++;
475
					type = isc_mem_strdup(ns_g_mctx, vals[0]);
476
					break;					
477
				case 2:
478
					j++;
479
					if(allnodes == isc_boolean_true){
480
						host = isc_mem_strdup(ns_g_mctx, vals[0]);
481
					} else {
482
						strcpy(data, vals[0]);
483
					}
484
					break;
485
				case 3:
486
					j++;
487
					if(allnodes == isc_boolean_true){
488
						strcpy(data, vals[0]);
489
					} else {
490
						strcat(data, " ");
491
						strcat(data, vals[0]);
492
					}
493
					break;
494
				default:
495
					strcat(data, " ");
496
					strcat(data, vals[0]);
497
					break;
498
			} // end switch(j)
499
500
				// free values
501
			ldap_value_free(vals);
502
			vals = NULL;
503
504
				// increment attibute pointer
505
			attribute = attrs[++i];
506
		}	// end while(attribute != NULL)
507
508
		if(type == NULL){
509
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
510
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
511
				"LDAP driver unable to retrieve dns type");
512
			result = ISC_R_FAILURE;
513
			goto cleanup;
514
		}		
515
		if(strlen(data) < 1){
516
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
517
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
518
				"LDAP driver unable to retrieve dns data");
519
			result = ISC_R_FAILURE;
520
			goto cleanup;
521
		}
522
		if(allnodes == isc_boolean_true){
523
			if(strcasecmp(host, "~") == 0)
524
				result = dns_sdlz_putnamedrr((dns_sdlzallnodes_t *) ptr,
525
																"*", type, ttl, data);
526
			else
527
				result = dns_sdlz_putnamedrr((dns_sdlzallnodes_t *) ptr,
528
																host, type, ttl, data);
529
		}
530
		else
531
			result = dns_sdlz_putrr((dns_sdlzlookup_t *) ptr, type, ttl, data);
532
533
		if(result != ISC_R_SUCCESS){
534
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
535
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
536
				"LDAP driver failed while sending data to Bind.");
537
			goto cleanup;
538
		}
539
540
			// free memory for type, data and host for next loop		
541
		isc_mem_free(ns_g_mctx, type);
542
		isc_mem_free(ns_g_mctx, data);
543
		if(host != NULL)
544
			isc_mem_free(ns_g_mctx, host);
545
		
546
			// get the next entry to process
547
		entry = ldap_next_entry(dbc, entry);
548
	} // end while(entry != NULL)
549
550
cleanup:
551
552
		// de-allocate memory
553
	if(vals != NULL)
554
		ldap_value_free(vals);
555
	if(host != NULL)
556
		isc_mem_free(ns_g_mctx, host);	
557
	if(type != NULL)
558
		isc_mem_free(ns_g_mctx, type);
559
	if(data != NULL)
560
		isc_mem_free(ns_g_mctx, data);
561
562
	return result;
563
}
564
565
	/* This function is the real core of the driver.   Zone, record
566
	 * and client strings are passed in (or NULL is passed if the
567
	 * string is not available).  The type of query we want to run
568
	 * is indicated by the query flag, and the dbdata object is passed
569
	 * passed in to.  dbdata really holds either:
570
	 *		1) a list of database instances (in multithreaded mode) OR
571
	 *		2) a single database instance (in single threaded mode)
572
	 * The function will construct the query and obtain an available
573
	 * database instance (DBI).  It will then run the query and hopefully
574
	 * obtain a result set. 
575
     */
576
isc_result_t
577
ldap_get_results(const char *zone, const char *record,
578
					   const char *client, unsigned int query,
579
					   void *dbdata, void *ptr)
580
{
581
   isc_result_t result;
582
	dbinstance_t *dbi = NULL;
583
	char *querystring = NULL;
584
   LDAPURLDesc *ldap_url = NULL;
585
   int ldap_result = 0;
586
   LDAPMessage *ldap_msg = NULL;
587
	int i;
588
	int entries;
589
590
		// get db instance / connection
591
#ifdef ISC_PLATFORM_USETHREADS
592
593
		// find an available DBI from the list
594
	dbi = ldap_find_avail_conn((db_list_t *) ((ldap_instance_t *)dbdata)->db);
595
596
#else /* ISC_PLATFORM_USETHREADS */
597
598
		// only 1 DBI - no need to lock instance lock either
599
		// only 1 thread in the whole process, no possible contention.
600
	dbi =  (dbinstance_t *) ((ldap_instance_t *)dbdata)->db;
601
602
#endif /* ISC_PLATFORM_USETHREADS */
603
604
		// if DBI is null, can't do anything else
605
	if(dbi == NULL)
606
		return  ISC_R_FAILURE;
607
608
		// set fields
609
	if(zone != NULL){
610
		dbi->zone = isc_mem_strdup(ns_g_mctx, zone);
611
		if(dbi->zone == NULL){
612
			result = ISC_R_NOMEMORY;
613
			goto cleanup;
614
		}
615
	} else {
616
		dbi->zone = NULL;
617
	}
618
	if(record != NULL){
619
		dbi->record = isc_mem_strdup(ns_g_mctx, record);
620
		if(dbi->record == NULL){
621
			result = ISC_R_NOMEMORY;
622
			goto cleanup;
623
		}
624
	} else {
625
		dbi->record = NULL;
626
	}
627
	if(client != NULL){
628
		dbi->client = isc_mem_strdup(ns_g_mctx, client);
629
		if(dbi->client == NULL){
630
			result = ISC_R_NOMEMORY;
631
			goto cleanup;
632
		}
633
	} else {
634
		dbi->client = NULL;
635
	}
636
637
		// what type of query are we going to run?
638
	switch(query){
639
		case ALLNODES:
640
				// if the query was not passed in from the config file
641
				// then we can't run it.  return not_implemented,
642
				// so it's like the code for that operation
643
				// was never built into the driver.... AHHH  flexibility!!!
644
			if(dbi->allnodes_q == NULL){
645
				result = ISC_R_NOTIMPLEMENTED;
646
				goto cleanup;
647
			} else {
648
                querystring = build_querystring(ns_g_mctx, dbi->allnodes_q);
649
            }
650
			break;				
651
		case ALLOWXFR:
652
				// same as comments as ALLNODES
653
			if(dbi->allowxfr_q == NULL){
654
				result = ISC_R_NOTIMPLEMENTED;
655
				goto cleanup;
656
			} else {
657
                querystring = build_querystring(ns_g_mctx, dbi->allowxfr_q);
658
            }
659
			break;
660
		case AUTHORITY:
661
				// same as comments as ALLNODES
662
			if(dbi->authority_q == NULL){
663
				result = ISC_R_NOTIMPLEMENTED;
664
				goto cleanup;
665
			} else {
666
                querystring = build_querystring(ns_g_mctx, dbi->authority_q);
667
            }
668
			break;
669
		case FINDZONE:
670
				// this is required.  It's the whole point of DLZ!
671
			if(dbi->findzone_q == NULL){
672
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
673
					  DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
674
					  "No query specified for findzone.  Findzone requires a query");
675
				result = ISC_R_FAILURE;
676
				goto cleanup;
677
			} else {
678
                querystring = build_querystring(ns_g_mctx, dbi->findzone_q);
679
            }
680
			break;
681
		case LOOKUP:
682
				// this is required.  It's also a major point of DLZ!
683
			if(dbi->lookup_q == NULL){
684
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
685
					  DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
686
					  "No query specified for lookup.  Lookup requires a query");
687
				result = ISC_R_FAILURE;
688
				goto cleanup;
689
			} else {
690
                querystring = build_querystring(ns_g_mctx, dbi->lookup_q);
691
            }
692
			break;
693
		default:
694
				// this should never happen.  If it does, the code is screwed up!
695
			UNEXPECTED_ERROR(__FILE__, __LINE__,
696
				 "Incorrect query flag passed to postgres_get_resultset");
697
			result = ISC_R_UNEXPECTED;
698
			goto cleanup;
699
	}
700
701
		// if the querystring is null, Bummer, outta RAM.  UPGRADE TIME!!!  
702
	if(querystring  == NULL){
703
		result = ISC_R_NOMEMORY;
704
		goto cleanup;
705
	}
706
707
		// output the full query string during debug so we can see
708
		// what lame error the query has.
709
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
710
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
711
	      "\nQuery String: %s\n", querystring);
712
713
        // break URL down into it's component parts, if error cleanup
714
    ldap_result = ldap_url_parse(querystring, &ldap_url);
715
    if(ldap_result != LDAP_SUCCESS || ldap_url == NULL){
716
        result = ISC_R_FAILURE;
717
        goto cleanup;
718
    }
719
720
	 for(i=0; i < 3; i++){
721
722
			// dbi->dbconn may be null if trying to reconnect on a previous
723
			// query failed.
724
		if(dbi->dbconn == NULL){
725
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
726
				DNS_LOGMODULE_DLZ, ISC_LOG_INFO,
727
				"LDAP driver attempting to re-connect");
728
729
			result = dlz_ldap_connect((ldap_instance_t *) dbdata, dbi);
730
			if(result != ISC_R_SUCCESS){
731
				result = ISC_R_FAILURE;
732
				continue;
733
			}
734
		 }
735
736
			  // perform ldap search syncronously
737
		 ldap_result = ldap_search_s((LDAP *) dbi->dbconn, ldap_url->lud_dn,
738
								 ldap_url->lud_scope, ldap_url->lud_filter,
739
								 ldap_url->lud_attrs, 0, &ldap_msg);
740
741
			  // check return code.
742
			  //No such object is ok, just didn't find what we wanted
743
		 switch(ldap_result){
744
			case LDAP_NO_SUCH_OBJECT:
745
    			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
746
    					DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
747
    					"No object found matching query requirements");
748
				result = ISC_R_NOTFOUND;
749
				goto cleanup;
750
				break;
751
			case LDAP_SUCCESS:	// on success do nothing
752
				result = ISC_R_SUCCESS;
753
				i = 3;
754
				break;
755
			case LDAP_SERVER_DOWN:
756
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
757
					DNS_LOGMODULE_DLZ, ISC_LOG_INFO,
758
					"LDAP driver attempting to re-connect");
759
				result = dlz_ldap_connect((ldap_instance_t *) dbdata, dbi);
760
				if(result != ISC_R_SUCCESS)
761
					result = ISC_R_FAILURE;
762
				break;
763
			default:
764
					// other errors not ok.  Log error message and get out
765
    			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
766
    				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
767
    				"LDAP error: %s", ldap_err2string(ldap_result));
768
				result = ISC_R_FAILURE;
769
				goto cleanup;
770
				break;
771
		} // close switch(ldap_result)
772
	} // end for(int i=0 i < 3; i++)
773
774
	if(result != ISC_R_SUCCESS)
775
		goto cleanup;
776
777
	switch(query){
778
		case ALLNODES:
779
			result = ldap_process_results((LDAP *) dbi->dbconn, ldap_msg,
780
											ldap_url->lud_attrs, ptr, isc_boolean_true);
781
			break;
782
      case AUTHORITY:
783
      case LOOKUP:
784
			result = ldap_process_results((LDAP *) dbi->dbconn, ldap_msg,
785
											ldap_url->lud_attrs, ptr, isc_boolean_false);
786
			break;
787
      case ALLOWXFR:
788
         entries = ldap_count_entries((LDAP *) dbi->dbconn, ldap_msg);
789
         if (entries == 0)
790
            result = ISC_R_NOPERM;
791
         else if (entries > 0)
792
            result = ISC_R_SUCCESS;
793
         else 
794
            result = ISC_R_FAILURE;     
795
         break;
796
      case FINDZONE:
797
         entries = ldap_count_entries((LDAP *) dbi->dbconn, ldap_msg);
798
         if (entries == 0)
799
            result = ISC_R_NOTFOUND;
800
         else if (entries > 0)
801
            result = ISC_R_SUCCESS;
802
         else 
803
            result = ISC_R_FAILURE;     
804
         break;
805
		default:
806
				// this should never happen.  If it does, the code is screwed up!
807
			UNEXPECTED_ERROR(__FILE__, __LINE__,
808
				 "Incorrect query flag passed to postgres_get_resultset");
809
			result = ISC_R_UNEXPECTED;
810
    }
811
812
813
cleanup:	// it's always good to cleanup after yourself
814
815
        // if we retrieved results, free them
816
	if(ldap_msg != NULL)
817
		ldap_msgfree(ldap_msg);
818
819
	if(ldap_url != NULL)
820
		ldap_free_urldesc(ldap_url);
821
822
		// cleanup
823
	if(dbi->zone != NULL)
824
		isc_mem_free(ns_g_mctx, dbi->zone);
825
	if(dbi->record != NULL)
826
		isc_mem_free(ns_g_mctx, dbi->record);
827
	if(dbi->client != NULL)
828
		isc_mem_free(ns_g_mctx, dbi->client);
829
830
#ifdef ISC_PLATFORM_USETHREADS
831
832
		// release the lock so another thread can use this dbi
833
	isc_mutex_unlock(&dbi->instance_lock);
834
835
#endif /* ISC_PLATFORM_USETHREADS */
836
837
        // release query string
838
	if(querystring  != NULL)
839
		isc_mem_free(ns_g_mctx, querystring );
840
841
		// return result
842
	return result;
843
}
844
845
/***
846
 *** DLZ methods
847
 ***/
848
849
isc_result_t
850
dlz_ldap_allowzonexfr(void *driverarg, void *dbdata, const char *name,
851
                                                    const char *client)
852
{
853
	isc_result_t result;
854
855
	UNUSED(driverarg);
856
857
		// check to see if we are authoritative for the zone first
858
	result = dlz_ldap_findzone(driverarg, dbdata, name);
859
   if(result != ISC_R_SUCCESS){
860
      return result;
861
   }
862
863
        // get all the zone data
864
   return ldap_get_results(name, NULL, client, ALLOWXFR, dbdata, NULL);
865
}
866
867
isc_result_t
868
dlz_ldap_allnodes(const char *zone, void *driverarg, void *dbdata,
869
						                dns_sdlzallnodes_t *allnodes)
870
{
871
	UNUSED(driverarg);
872
   return ldap_get_results(zone, NULL, NULL, ALLNODES, dbdata, allnodes);
873
}
874
875
isc_result_t
876
dlz_ldap_authority(const char *zone, void *driverarg, void *dbdata,
877
                                            dns_sdlzlookup_t *lookup)
878
{
879
   UNUSED(driverarg);
880
   return ldap_get_results(zone, NULL, NULL, AUTHORITY, dbdata, lookup);
881
}
882
883
isc_result_t
884
dlz_ldap_findzone(void *driverarg, void *dbdata, const char *name)
885
{
886
   UNUSED(driverarg);    
887
   return ldap_get_results(name, NULL, NULL, FINDZONE, dbdata, NULL);
888
}
889
890
isc_result_t
891
dlz_ldap_lookup(const char *zone, const char *name, void *driverarg, 
892
                                void *dbdata, dns_sdlzlookup_t *lookup)
893
{
894
   UNUSED(driverarg);
895
	if(strcmp(name, "*") == 0)
896
		return ldap_get_results(zone, "~", NULL, LOOKUP, dbdata, lookup);
897
	else
898
		return ldap_get_results(zone, name, NULL, LOOKUP, dbdata, lookup);
899
}
900
901
902
isc_result_t
903
dlz_ldap_create(const char *dlzname, unsigned int argc, char *argv[],
904
				                        void *driverarg, void **dbdata)
905
{
906
907
	isc_result_t result;
908
	ldap_instance_t *ldap_inst = NULL;
909
	dbinstance_t *dbi = NULL;
910
	int protocol;	
911
	int method;
912
913
#ifdef ISC_PLATFORM_USETHREADS
914
		// if multi-threaded, we need a few extra variables.
915
	int dbcount;
916
	char *endp;
917
	db_list_t *dblist = NULL;
918
	int i;
919
920
#endif /* ISC_PLATFORM_USETHREADS */
921
	
922
   UNUSED(dlzname);
923
	UNUSED(driverarg);
924
925
#ifdef ISC_PLATFORM_USETHREADS
926
		// if debugging, let user know we are multithreaded.
927
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
928
		DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
929
		"LDAP driver running multithreaded");
930
#else /* ISC_PLATFORM_USETHREADS */
931
		// if debugging, let user know we are single threaded.
932
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
933
		DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
934
		"LDAP driver running single threaded");
935
#endif /* ISC_PLATFORM_USETHREADS */
936
937
	if(argc < 9){
938
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
939
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
940
			"LDAP driver requires at least 8 command line args.");
941
		return (ISC_R_FAILURE);
942
	}
943
944
		/* no more than 13 arg's should be passed to the driver */
945
	if(argc > 12){
946
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
947
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
948
			"LDAP driver cannot accept more than 11 command line args.");
949
		return (ISC_R_FAILURE);
950
	}
951
952
		// determine protocol version.
953
	if(strncasecmp(argv[2], V2, strlen(V2)) == 0){
954
		protocol = 2;
955
	} else if(strncasecmp(argv[2], V3, strlen(V3)) == 0){
956
		protocol = 3;
957
	} else {
958
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
959
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
960
			"LDAP driver protocol must be either %s or %s", V2, V3);
961
		return (ISC_R_FAILURE);
962
	}
963
964
		// determine connection method.
965
	if(strncasecmp(argv[3], SIMPLE, strlen(SIMPLE)) == 0){
966
		method = LDAP_AUTH_SIMPLE;
967
	} else if(strncasecmp(argv[3], KRB41, strlen(KRB41)) == 0){
968
		method = LDAP_AUTH_KRBV41;
969
	} else if(strncasecmp(argv[3], KRB42, strlen(KRB42)) == 0){
970
		method = LDAP_AUTH_KRBV42;
971
	} else {
972
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
973
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
974
			"LDAP driver authentication method must be one of %s, %s or %s",
975
			SIMPLE, KRB41, KRB42);
976
		return (ISC_R_FAILURE);
977
	}
978
979
	// multithreaded build can have multiple DB connections
980
#ifdef ISC_PLATFORM_USETHREADS
981
982
		/* check how many db connections we should create */
983
	dbcount = strtol(argv[1], &endp, 10);
984
	if (*endp != '\0' || dbcount < 0){
985
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
986
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
987
			"LDAP driver database connection count must be positive.");
988
		return (ISC_R_FAILURE);
989
	}
990
#endif
991
992
		// check that LDAP URL parameters make sense
993
	switch(argc){
994
		case 12:
995
			result = dlz_ldap_checkURL(argv[11], 0, "allow zone transfer");
996
			if(result != ISC_R_SUCCESS)
997
				return result;
998
		case 11:
999
			result = dlz_ldap_checkURL(argv[10], 3, "all nodes");
1000
			if(result != ISC_R_SUCCESS)
1001
				return result;
1002
		case 10:
1003
			if(strlen(argv[9]) > 0){
1004
				result = dlz_ldap_checkURL(argv[9], 3, "authority");
1005
				if(result != ISC_R_SUCCESS)
1006
					return result;
1007
			}
1008
		case 9:
1009
			result = dlz_ldap_checkURL(argv[8], 3, "lookup");
1010
			if(result != ISC_R_SUCCESS)
1011
				return result;
1012
			result = dlz_ldap_checkURL(argv[7], 0, "find zone");
1013
			if(result != ISC_R_SUCCESS)
1014
				return result;
1015
			break;
1016
		default:
1017
			result = ISC_R_FAILURE;	// not really needed, should shut up compiler.
1018
	}
1019
1020
    /* allocate memory for LDAP instance */
1021
	ldap_inst = isc_mem_get(ns_g_mctx, sizeof(ldap_instance_t));
1022
	if(ldap_inst == NULL)
1023
      return (ISC_R_NOMEMORY);
1024
	memset(ldap_inst, 0, sizeof(ldap_instance_t));
1025
1026
		// store info needed to automatically re-connect.
1027
	ldap_inst->protocol = protocol;
1028
	ldap_inst->method = method;
1029
	ldap_inst->hosts = isc_mem_strdup(ns_g_mctx, argv[6]);
1030
	if(ldap_inst->hosts == NULL){
1031
		result = ISC_R_NOMEMORY;
1032
		goto cleanup;
1033
	}
1034
	ldap_inst->user = isc_mem_strdup(ns_g_mctx, argv[4]);
1035
	if(ldap_inst->user == NULL){
1036
		result = ISC_R_NOMEMORY;
1037
		goto cleanup;
1038
	}
1039
	ldap_inst->cred = isc_mem_strdup(ns_g_mctx, argv[5]);
1040
	if(ldap_inst->cred == NULL){
1041
		result = ISC_R_NOMEMORY;
1042
		goto cleanup;
1043
	}
1044
1045
#ifdef ISC_PLATFORM_USETHREADS
1046
		/* allocate memory for database connection list */
1047
	ldap_inst->db = isc_mem_get(ns_g_mctx, sizeof(db_list_t));
1048
	if (ldap_inst->db == NULL){
1049
		result = ISC_R_NOMEMORY;
1050
		goto cleanup;
1051
	}
1052
1053
		/* initialize DB connection list */
1054
	ISC_LIST_INIT(*(ldap_inst->db));
1055
1056
		// create the appropriate number of database instances (DBI)
1057
		// append each new DBI to the end of the list
1058
	for(i=0; i < dbcount; i++){
1059
1060
#endif /* ISC_PLATFORM_USETHREADS */
1061
1062
			// how many queries were passed in from config file?
1063
		switch(argc){
1064
			case 9:
1065
				result = build_sqldbinstance(ns_g_mctx, NULL, NULL, NULL, 
1066
													argv[7], argv[8], NULL, &dbi);
1067
				break;
1068
			case 10:
1069
				result = build_sqldbinstance(ns_g_mctx, NULL, NULL, argv[9],
1070
													argv[7], argv[8], NULL, &dbi);
1071
				break;
1072
			case 11:
1073
				result = build_sqldbinstance(ns_g_mctx, argv[10], NULL, argv[9],
1074
													argv[7], argv[8], NULL, &dbi);
1075
				break;
1076
			case 12:
1077
				result = build_sqldbinstance(ns_g_mctx, argv[10], argv[11], argv[9],
1078
													argv[7], argv[8], NULL, &dbi);
1079
				break;
1080
			default:
1081
				result = ISC_R_FAILURE;	// not really needed, should shut up compiler.
1082
		}
1083
		
1084
		if(result == ISC_R_SUCCESS){
1085
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1086
				DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
1087
				"LDAP driver created database instance object.");
1088
		} else { // unsuccessful?, log err msg and cleanup.
1089
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1090
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1091
				"LDAP driver could not create database instance object.");
1092
			goto cleanup;
1093
		}
1094
1095
#ifdef ISC_PLATFORM_USETHREADS
1096
			// when multithreaded, build a list of DBI's
1097
		ISC_LINK_INIT(dbi, link);
1098
		ISC_LIST_APPEND(*(ldap_inst->db), dbi, link);
1099
#else
1100
			// when single threaded, hold onto the one connection instance.
1101
		ldap_inst->db = dbi;
1102
1103
#endif
1104
			// attempt to connect
1105
		result = dlz_ldap_connect(ldap_inst, dbi);
1106
1107
			// if db connection cannot be created, log err msg and cleanup.
1108
		switch(result){
1109
				// success, do nothing
1110
			case ISC_R_SUCCESS:
1111
				break;
1112
				// no memory means ldap_init could not allocate memory
1113
			case ISC_R_NOMEMORY:
1114
#ifdef ISC_PLATFORM_USETHREADS
1115
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1116
					DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1117
					"LDAP driver could not allocate memory for connection number %u",
1118
					i+1);
1119
#else
1120
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1121
					DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1122
					"LDAP driver could not allocate memory for connection");
1123
#endif
1124
				goto cleanup;
1125
				break;
1126
				// no perm means ldap_set_option could not set protocol version
1127
			case ISC_R_NOPERM:
1128
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1129
					DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1130
					"LDAP driver could not set protocol version.");	
1131
					result = ISC_R_FAILURE;
1132
					goto cleanup;
1133
				break;
1134
				// failure means couldn't connect to ldap server
1135
			case ISC_R_FAILURE:
1136
#ifdef ISC_PLATFORM_USETHREADS
1137
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1138
					DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1139
					"LDAP driver could not bind connection number %u to server.");
1140
#else
1141
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1142
					DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1143
					"LDAP driver could not bind connection to server.");
1144
#endif
1145
				goto cleanup;
1146
				break;
1147
				// default should never happen.  If it does, major errors.
1148
			default:
1149
				UNEXPECTED_ERROR(__FILE__, __LINE__,
1150
					"dlz_ldap_create() failed: %s", isc_result_totext(result));
1151
				result = ISC_R_UNEXPECTED;
1152
				goto cleanup;
1153
				break;
1154
		} // end switch(result)
1155
		
1156
1157
#ifdef ISC_PLATFORM_USETHREADS
1158
1159
			// set DBI = null for next loop through.
1160
		dbi = NULL;
1161
	}	// end for loop
1162
1163
#endif /* ISC_PLATFORM_USETHREADS */
1164
1165
1166
		// set dbdata to the ldap_instance we created.
1167
	*dbdata = ldap_inst;
1168
1169
		// hey, we got through all of that ok, return success.
1170
	return(ISC_R_SUCCESS);
1171
1172
cleanup:
1173
1174
	dlz_ldap_destroy(NULL, ldap_inst);
1175
1176
	return(ISC_R_FAILURE);	
1177
}
1178
1179
void
1180
dlz_ldap_destroy(void *driverarg, void *dbdata)
1181
{
1182
1183
   UNUSED(driverarg);
1184
1185
	if(dbdata != NULL){
1186
1187
#ifdef ISC_PLATFORM_USETHREADS
1188
1189
			// cleanup the list of DBI's
1190
		ldap_destroy_dblist((db_list_t *) ((ldap_instance_t *)dbdata)->db);
1191
1192
#else /* ISC_PLATFORM_USETHREADS */
1193
1194
			// release connection
1195
	   if(((ldap_instance_t *)dbdata)->db->dbconn != NULL)
1196
		   ldap_unbind_s((LDAP *) ((ldap_instance_t *)dbdata)->db->dbconn);
1197
1198
		   // destroy single DB instance
1199
       destroy_sqldbinstance(((ldap_instance_t *)dbdata)->db);
1200
1201
#endif /* ISC_PLATFORM_USETHREADS */
1202
1203
		if(((ldap_instance_t *)dbdata)->hosts != NULL)
1204
			isc_mem_free(ns_g_mctx, ((ldap_instance_t *)dbdata)->hosts);
1205
		
1206
		if(((ldap_instance_t *)dbdata)->user != NULL)
1207
			isc_mem_free(ns_g_mctx, ((ldap_instance_t *)dbdata)->user);
1208
1209
		if(((ldap_instance_t *)dbdata)->cred != NULL)
1210
			isc_mem_free(ns_g_mctx, ((ldap_instance_t *)dbdata)->cred);
1211
1212
		isc_mem_put(ns_g_mctx, dbdata, sizeof(ldap_instance_t));
1213
	}
1214
}
1215
1216
static dns_sdlzmethods_t dlz_ldap_methods = {
1217
	dlz_ldap_create, 
1218
	dlz_ldap_destroy,
1219
	dlz_ldap_findzone,
1220
	dlz_ldap_lookup,
1221
	dlz_ldap_authority,
1222
	dlz_ldap_allnodes,
1223
	dlz_ldap_allowzonexfr};
1224
1225
/*
1226
 * Wrapper around dns_sdlzregister().
1227
 */
1228
isc_result_t
1229
dlz_ldap_init(void) {
1230
	isc_result_t result;
1231
1232
	/*
1233
	 * Write debugging message to log
1234
	 */
1235
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1236
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
1237
	      "Registering DLZ ldap driver.");
1238
1239
	result = dns_sdlzregister("ldap", &dlz_ldap_methods, NULL, 
1240
							DNS_SDLZFLAG_RELATIVEOWNER | DNS_SDLZFLAG_RELATIVERDATA,
1241
							ns_g_mctx, &dlz_ldap);
1242
	if(result != ISC_R_SUCCESS){
1243
		UNEXPECTED_ERROR(__FILE__, __LINE__,
1244
				 "dns_sdlzregister() failed: %s",
1245
				 isc_result_totext(result));
1246
		result = ISC_R_UNEXPECTED;
1247
	}
1248
1249
1250
	return result;
1251
}
1252
1253
/*
1254
 * Wrapper around dns_sdlzunregister().
1255
 */
1256
void
1257
dlz_ldap_clear(void) {
1258
1259
	/*
1260
	 * Write debugging message to log
1261
	 */
1262
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1263
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
1264
	      "Unregistering DLZ ldap driver.");
1265
1266
	if (dlz_ldap != NULL)
1267
		dns_sdlzunregister(&dlz_ldap);
1268
}
1269
1270
#endif
(-)bind-9.2.2-orig/bin/named/dlz_mysql_driver.c (+993 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
/*
37
 * Copyright (C) 1999-2001  Internet Software Consortium.
38
 *
39
 * Permission to use, copy, modify, and distribute this software for any
40
 * purpose with or without fee is hereby granted, provided that the above
41
 * copyright notice and this permission notice appear in all copies.
42
 *
43
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
44
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
45
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
46
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
47
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
48
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
50
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
51
 */
52
53
#ifdef DLZ_MYSQL
54
55
#include <config.h>
56
#include <stdio.h>
57
#include <string.h>
58
#include <stdlib.h>
59
60
#include <dns/log.h>
61
#include <dns/sdlz.h>
62
#include <dns/result.h>
63
64
#include <isc/mem.h>
65
#include <isc/platform.h>
66
#include <isc/print.h>
67
#include <isc/result.h>
68
#include <isc/string.h>
69
#include <isc/util.h>
70
71
#include <named/globals.h>
72
#include <named/dlz_mysql_driver.h>
73
#include <named/sdlz_helper.h>
74
75
#include <mysql.h>
76
77
dns_sdlzimplementation_t *dlz_mysql = NULL;
78
79
#define dbc_search_limit 30
80
#define ALLNODES 1
81
#define ALLOWXFR 2
82
#define AUTHORITY 3
83
#define FINDZONE 4
84
#define COUNTZONE 5
85
#define LOOKUP 6
86
87
#define safeGet(in) in == NULL ? "" : in
88
89
/***
90
 *** method prototypes
91
 *** Declared here to shut up compiler warnings
92
 *** about "no previous prototype"
93
 ***/
94
95
char *
96
mysqldrv_escape_string(MYSQL *mysql, const char *instr);
97
98
isc_result_t
99
mysql_get_resultset(const char *zone, const char *record,
100
					const char *client, unsigned int query,
101
				   void *dbdata, MYSQL_RES **rs);
102
103
isc_result_t
104
mysql_process_rs(dns_sdlzlookup_t *lookup, MYSQL_RES *rs);
105
106
isc_result_t
107
mysql_findzone(void *driverarg, void *dbdata, const char *name);
108
109
isc_result_t
110
mysql_allowzonexfr(void *driverarg, void *dbdata, const char *name,
111
						const char *client);
112
113
isc_result_t
114
mysql_allnodes(const char *zone, void *driverarg, void *dbdata,
115
					dns_sdlzallnodes_t *allnodes);
116
117
isc_result_t
118
mysql_authority(const char *zone, void *driverarg, void *dbdata,
119
			  		dns_sdlzlookup_t *lookup);
120
121
isc_result_t
122
mysql_lookup(const char *zone, const char *name, void *driverarg, 
123
			void *dbdata, dns_sdlzlookup_t *lookup);
124
125
isc_result_t
126
mysql_create(const char *dlzname, unsigned int argc, char *argv[],
127
				void *driverarg, void **dbdata);
128
129
void
130
mysql_destroy(void *driverarg, void *dbdata);
131
132
/***
133
 *** Private methods
134
 ***/
135
136
	/* Allocates memory for a new string, and then constructs the new
137
	 * string by "escaping" the input string.  The new string is
138
	 * safe to be used in queries.  This is necessary because we cannot
139
	 * be sure of what types of strings are passed to us, and we don't
140
	 * want special characters in the string causing problems.
141
	 */
142
143
char *
144
mysqldrv_escape_string(MYSQL *mysql, const char *instr){
145
146
	char *outstr;
147
	unsigned int len;
148
149
	if(instr == NULL)
150
		return NULL;
151
152
	len = strlen(instr);
153
154
	outstr = isc_mem_allocate(ns_g_mctx ,(2 * len * sizeof(char)) + 1);
155
	if(outstr == NULL)
156
		return NULL;
157
158
   mysql_real_escape_string(mysql, outstr, instr, len);
159
160
	return outstr;
161
}
162
163
	/* This function is the real core of the driver.   Zone, record
164
	 * and client strings are passed in (or NULL is passed if the
165
	 * string is not available).  The type of query we want to run
166
	 * is indicated by the query flag, and the dbdata object is passed
167
	 * passed in to.  dbdata really holds a single database instance.
168
	 * The function will construct and run the query, hopefully getting
169
	 * a result set.  
170
    */
171
172
isc_result_t
173
mysql_get_resultset(const char *zone, const char *record,
174
					   const char *client, unsigned int query,
175
					   void *dbdata, MYSQL_RES **rs)
176
{
177
   isc_result_t result;
178
	dbinstance_t *dbi = NULL;
179
	char *querystring = NULL;
180
	unsigned int i = 0;
181
	unsigned int j = 0;
182
	int qres = 0;
183
184
	if(query != COUNTZONE)
185
		REQUIRE(*rs == NULL);
186
	else
187
		REQUIRE(rs == NULL);
188
189
		// get db instance / connection
190
	dbi =  (dbinstance_t *) dbdata;
191
192
		// if DBI is null, can't do anything else
193
	if(dbi == NULL){
194
		result = ISC_R_FAILURE;
195
		goto cleanup;
196
	}
197
198
		// what type of query are we going to run?
199
	switch(query){
200
		case ALLNODES:
201
				// if the query was not passed in from the config file
202
				// then we can't run it.  return not_implemented,
203
				// so it's like the code for that operation
204
				// was never built into the driver.... AHHH  flexibility!!!
205
			if(dbi->allnodes_q == NULL){
206
				result = ISC_R_NOTIMPLEMENTED;
207
				goto cleanup;
208
			}
209
			break;				
210
		case ALLOWXFR:
211
				// same as comments as ALLNODES
212
			if(dbi->allowxfr_q == NULL){
213
				result = ISC_R_NOTIMPLEMENTED;
214
				goto cleanup;
215
			}
216
			break;
217
		case AUTHORITY:
218
				// same as comments as ALLNODES
219
			if(dbi->authority_q == NULL){
220
				result = ISC_R_NOTIMPLEMENTED;
221
				goto cleanup;
222
			}
223
			break;
224
		case FINDZONE:
225
				// this is required.  It's the whole point of DLZ!
226
			if(dbi->findzone_q == NULL){
227
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
228
					  DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
229
					  "No query specified for findzone.  Findzone requires a query");
230
				result = ISC_R_FAILURE;
231
				goto cleanup;
232
			}
233
			break;
234
		case COUNTZONE:
235
				// same as comments as ALLNODES
236
			if(dbi->countzone_q == NULL){
237
				result = ISC_R_NOTIMPLEMENTED;
238
				goto cleanup;
239
			}
240
			break;
241
		case LOOKUP:
242
				// this is required.  It's also a major point of DLZ!
243
			if(dbi->lookup_q == NULL){
244
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
245
					  DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
246
					  "No query specified for lookup.  Lookup requires a query");
247
				result = ISC_R_FAILURE;
248
				goto cleanup;
249
			}
250
			break;
251
		default:
252
				// this should never happen.  If it does, the code is screwed up!
253
			UNEXPECTED_ERROR(__FILE__, __LINE__,
254
				 "Incorrect query flag passed to mysql_get_resultset");
255
			result = ISC_R_UNEXPECTED;
256
			goto cleanup;
257
	}
258
259
260
		// was a zone string passed?  If so, make it safe for use in queries.
261
	if(zone != NULL){
262
		dbi->zone = mysqldrv_escape_string((MYSQL *) dbi->dbconn, zone);
263
		if(dbi->zone == NULL){
264
			result = ISC_R_NOMEMORY;
265
			goto cleanup;
266
		}
267
	} else {	// no string passed, set the string pointer to NULL
268
		dbi->zone = NULL;
269
	}
270
271
		// was a record string passed?  If so, make it safe for use in queries.
272
	if(record != NULL){
273
		dbi->record = mysqldrv_escape_string((MYSQL *) dbi->dbconn, record);
274
		if(dbi->record == NULL){
275
			result = ISC_R_NOMEMORY;
276
			goto cleanup;
277
		}
278
	} else {	// no string passed, set the string pointer to NULL
279
		dbi->record = NULL;
280
	}
281
282
		// was a client string passed?  If so, make it safe for use in queries.
283
	if(client != NULL){
284
		dbi->client = mysqldrv_escape_string((MYSQL *) dbi->dbconn, client);
285
		if(dbi->client == NULL){
286
			result = ISC_R_NOMEMORY;
287
			goto cleanup;
288
		}
289
	} else {	// no string passed, set the string pointer to NULL
290
		dbi->client = NULL;
291
	}
292
293
		// what type of query are we going to run?
294
		// this time we build the actual query to run.
295
	switch(query){
296
		case ALLNODES:
297
			querystring = build_querystring(ns_g_mctx, dbi->allnodes_q);
298
			break;
299
		case ALLOWXFR:
300
			querystring = build_querystring(ns_g_mctx, dbi->allowxfr_q);
301
			break;
302
		case AUTHORITY:
303
			querystring = build_querystring(ns_g_mctx, dbi->authority_q);
304
			break;
305
		case FINDZONE:
306
			querystring = build_querystring(ns_g_mctx, dbi->findzone_q);
307
			break;
308
		case COUNTZONE:
309
			querystring = build_querystring(ns_g_mctx, dbi->countzone_q);
310
			break;
311
		case LOOKUP:
312
			querystring = build_querystring(ns_g_mctx, dbi->lookup_q);
313
			break;
314
		default:
315
				// this should never happen.  If it does, the code is screwed up!
316
			UNEXPECTED_ERROR(__FILE__, __LINE__,
317
				 "Incorrect query flag passed to mysql_get_resultset");
318
			result = ISC_R_UNEXPECTED;
319
			goto cleanup;
320
	}
321
322
		// if the querystring is null, Bummer, outta RAM.  UPGRADE TIME!!!  
323
	if(querystring == NULL){
324
		result = ISC_R_NOMEMORY;
325
		goto cleanup;
326
	}
327
328
		// output the full query string during debug so we can see
329
		// what lame error the query has.
330
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
331
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
332
	      "\nQuery String: %s\n", querystring);
333
334
		// attempt query up to 3 times.
335
	for(i=0; i < 3; i++){
336
		qres = mysql_query((MYSQL *) dbi->dbconn, querystring);
337
		if(qres == 0)
338
			break;
339
		for(j=0;	mysql_ping((MYSQL *) dbi->dbconn) != 0 && j < 4; j++);
340
	}
341
342
	if(qres == 0){
343
		result = ISC_R_SUCCESS;
344
		if(query != COUNTZONE){
345
			*rs = mysql_store_result((MYSQL *) dbi->dbconn);
346
			if(*rs == NULL)
347
				result = ISC_R_FAILURE;
348
		}
349
	} else {
350
		result = ISC_R_FAILURE;
351
	}
352
353
354
cleanup:	// it's always good to cleanup after yourself
355
356
		// if we couldn't even get DBI, just return NULL
357
	if(dbi == NULL)
358
		return ISC_R_FAILURE;
359
360
		// free dbi->zone string
361
	if(dbi->zone != NULL)
362
		isc_mem_free(ns_g_mctx, dbi->zone);
363
364
		// free dbi->record string
365
	if(dbi->record != NULL)
366
		isc_mem_free(ns_g_mctx, dbi->record);
367
368
		// free dbi->client string
369
	if(dbi->client != NULL)
370
		isc_mem_free(ns_g_mctx, dbi->client);
371
372
		// release query string
373
	if(querystring  != NULL)
374
		isc_mem_free(ns_g_mctx, querystring);
375
376
		// return result
377
	return result;
378
}
379
380
	/* The processing of result sets for lookup and authority are
381
	 * exactly the same.  So that functionality has been moved
382
	 * into this function to minimize code.
383
	 */
384
385
isc_result_t
386
mysql_process_rs(dns_sdlzlookup_t *lookup, MYSQL_RES *rs)
387
{
388
	isc_result_t result = ISC_R_NOTFOUND;
389
	MYSQL_ROW row;
390
	unsigned int fields;
391
	unsigned int j;
392
	unsigned int len;
393
	char *tmpString;
394
	char *endp;
395
	int ttl;
396
397
	row = mysql_fetch_row(rs);	// get a row from the result set
398
	fields = mysql_num_fields(rs);	// how many columns in result set
399
	while(row != NULL){
400
		switch(fields){
401
			case 1:		// one column in rs, it's the data field
402
					// use default type of A record, and default TTL of 86400
403
				result = dns_sdlz_putrr(lookup, "a", 86400, safeGet(row[0]));
404
				break;
405
			case 2:		// two columns, data field, and data type.
406
						// use default TTL of 86400
407
				result = dns_sdlz_putrr(lookup, safeGet(row[0]), 86400, safeGet(row[1]));
408
				break;
409
			case 3:		// three columns, all data no defaults
410
					// convert text to int, make sure it worked right
411
				ttl = strtol(safeGet(row[0]), &endp, 10);
412
				if (*endp != '\0' || ttl < 0){
413
					isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
414
						DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
415
						"mysql driver ttl must be a postive number");
416
				}
417
				result = dns_sdlz_putrr(lookup, safeGet(row[1]), ttl, safeGet(row[2]));
418
				break;
419
			default:	// more than 3 fields, concatonate the last ones together.
420
					// figure out how long to make string
421
				for(j=2, len=0; j < fields; j++){
422
					len += strlen(safeGet(row[j])) + 1;
423
				}
424
					// allocate string memory, allow for NULL to term string
425
				tmpString = isc_mem_allocate(ns_g_mctx, len + 1); 
426
				if(tmpString == NULL){	// major bummer, need more ram
427
					isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
428
						DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
429
						"mysql driver unable to allocate memory for temporary string");
430
					mysql_free_result(rs);	// can't use it now, get rid of it.
431
					return (ISC_R_FAILURE);	// Yeah, I'd say!
432
				}
433
					// copy field to tmpString
434
				strcpy(tmpString, safeGet(row[2]));
435
436
437
					// concat the rest of fields together, space between each one.
438
				for(j=3; j < fields; j++){
439
					strcat(tmpString, " ");
440
					strcat(tmpString, safeGet(row[j]));
441
				}
442
					// convert text to int, make sure it worked right
443
				ttl = strtol(safeGet(row[0]), &endp, 10);
444
				if (*endp != '\0' || ttl < 0){
445
					isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
446
						DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
447
						"mysql driver ttl must be a postive number");
448
				}
449
					// ok, now tell Bind about it.
450
				result = dns_sdlz_putrr(lookup, safeGet(row[1]), ttl, tmpString);
451
					// done, get rid of this thing.
452
				isc_mem_free(ns_g_mctx, tmpString);
453
		}
454
			// I sure hope we were successful
455
		if(result != ISC_R_SUCCESS){
456
			mysql_free_result(rs);	// nope, get rid of the Result set, and log a msg
457
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
458
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
459
				"dns_sdlz_putrr returned error. Error code was: %s",
460
                                                isc_result_totext(result));
461
			return (ISC_R_FAILURE);
462
		}
463
		row = mysql_fetch_row(rs);	// get next row
464
	}
465
466
		// free result set memory
467
	mysql_free_result(rs);
468
469
		// return result code
470
	return result;
471
}
472
473
/***
474
 *** SDLZ interface methods
475
 ***/
476
477
	/* determine if the zone is supported by (in) the database */
478
479
isc_result_t
480
mysql_findzone(void *driverarg, void *dbdata, const char *name)
481
{
482
	isc_result_t result;
483
	MYSQL_RES *rs = NULL;
484
	my_ulonglong rows;
485
   
486
	UNUSED(driverarg);
487
488
		// run the query and get the result set from the database.
489
	result = mysql_get_resultset(name, NULL, NULL, FINDZONE, dbdata, &rs);
490
		// if we didn't get a result set, log an err msg.
491
	if(result != ISC_R_SUCCESS || rs == NULL){
492
		if(rs != NULL)
493
			mysql_free_result(rs);
494
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
495
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
496
			"mysql driver unable to return result set for findzone query");
497
		return (ISC_R_FAILURE);
498
	}
499
		// count how many rows in result set
500
	rows = mysql_num_rows(rs);
501
		// get rid of result set, we are done with it.
502
	mysql_free_result(rs);
503
504
		// if we returned any rows, zone is supported.
505
	if(rows > 0){
506
		mysql_get_resultset(name, NULL, NULL, COUNTZONE, dbdata, NULL);
507
		return (ISC_R_SUCCESS);
508
	}
509
510
		// no rows returned, zone is not supported.
511
	return (ISC_R_NOTFOUND);
512
}
513
514
	/* Determine if the client is allowed to perform a zone transfer */
515
isc_result_t
516
mysql_allowzonexfr(void *driverarg, void *dbdata, const char *name,
517
															const char *client)
518
{
519
	isc_result_t result;
520
	MYSQL_RES *rs = NULL;
521
	my_ulonglong rows;
522
   
523
	UNUSED(driverarg);
524
525
		// first check if the zone is supported by the database.
526
	result = mysql_findzone(driverarg, dbdata, name);
527
	if(result != ISC_R_SUCCESS)
528
		return (ISC_R_NOTFOUND);
529
530
	// if we get to this point we know the zone is supported by the database
531
	// the only questions now are is the zone transfer is allowed for this client
532
	// and did the config file have an allow zone xfr query
533
534
		// Run our query, and get a result set from the database.
535
	result = mysql_get_resultset(name, NULL, client, ALLOWXFR, dbdata, &rs);
536
		// if we get "not implemented", send it along.
537
	if(result == ISC_R_NOTIMPLEMENTED)
538
		return result;
539
		// if we didn't get a result set, log an err msg.
540
	if(result != ISC_R_SUCCESS || rs == NULL){
541
		if(rs != NULL)
542
			mysql_free_result(rs);
543
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
544
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
545
			"mysql driver unable to return result set for allow xfr query");
546
		return (ISC_R_FAILURE);
547
	}
548
		// count how many rows in result set
549
	rows = mysql_num_rows(rs);
550
		// get rid of result set, we are done with it.
551
	mysql_free_result(rs);
552
553
		// if we returned any rows, zone xfr is allowed.
554
	if(rows > 0)
555
		return (ISC_R_SUCCESS);
556
	
557
		// no rows returned, zone xfr not allowed
558
	return (ISC_R_NOPERM);
559
}
560
561
	/* If the client is allowed to perform a zone transfer, the next order of
562
	 * business is to get all the nodes in the zone, so bind can respond to the
563
	 * query.
564
	 */
565
isc_result_t
566
mysql_allnodes(const char *zone, void *driverarg, void *dbdata,
567
						  dns_sdlzallnodes_t *allnodes)
568
{
569
	isc_result_t result;
570
	MYSQL_RES *rs = NULL;
571
	MYSQL_ROW row;
572
	unsigned int fields;
573
	unsigned int j;
574
	unsigned int len;
575
	char *tmpString;
576
	char *endp;
577
	int ttl;
578
579
    UNUSED(driverarg);
580
581
		// run the query and get the result set from the database.
582
	result = mysql_get_resultset(zone, NULL, NULL, ALLNODES, dbdata, &rs);
583
		// if we get "not implemented", send it along
584
	if(result == ISC_R_NOTIMPLEMENTED)
585
		return result;
586
		// if we didn't get a result set, log an err msg.
587
	if(result != ISC_R_SUCCESS){
588
		if(rs != NULL)
589
			mysql_free_result(rs);
590
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
591
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
592
			"mysql driver unable to return result set for all nodes query");
593
		return (ISC_R_FAILURE);
594
	}
595
596
	result = ISC_R_NOTFOUND;
597
598
	row = mysql_fetch_row(rs);	// get a row from the result set
599
	fields = mysql_num_fields(rs);	// how many columns in result set
600
	while(row != NULL){
601
		if(fields < 4){	// gotta have at least 4 columns
602
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
603
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
604
				"mysql driver too few fields returned by all nodes query");
605
		}
606
			// convert text to int, make sure it worked right 
607
		ttl = strtol(safeGet(row[0]), &endp, 10);
608
		if (*endp != '\0' || ttl < 0){
609
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
610
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
611
				"mysql driver ttl must be a postive number");
612
		}
613
		if(fields == 4){
614
				// tell Bind about it.
615
			result = dns_sdlz_putnamedrr(allnodes, safeGet(row[0]),
616
						safeGet(row[1]), ttl, safeGet(row[3]));
617
		} else {  // more than 4 fields, concatonat the last ones together.
618
			// figure out how long to make string
619
			for(j=3, len=0; j < fields; j++){
620
				len += strlen(safeGet(row[j])) + 1;
621
			}
622
				// allocate memory, allow for NULL to term string
623
			tmpString = isc_mem_allocate(ns_g_mctx, len + 1); 
624
			if(tmpString == NULL){	// we need more ram.
625
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
626
					DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
627
					"mysql driver unable to allocate memory for temporary string");
628
				mysql_free_result(rs);
629
				return (ISC_R_FAILURE);
630
			}
631
				// copy this field to tmpString
632
			strcpy(tmpString, safeGet(row[3]));
633
				// concatonate the rest, with spaces between
634
			for(j=4; j < fields; j++){
635
				strcat(tmpString, " ");
636
				strcat(tmpString, safeGet(row[j]));
637
			}
638
				// tell Bind about it.
639
			result = dns_sdlz_putnamedrr(allnodes, safeGet(row[2]), safeGet(row[1]), ttl, tmpString);
640
			isc_mem_free(ns_g_mctx, tmpString);
641
		}
642
			// if we weren't successful, log err msg
643
		if(result != ISC_R_SUCCESS){
644
			mysql_free_result(rs);
645
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
646
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
647
				"dns_sdlz_putnamedrr returned error. Error code was: %s",
648
                                                    isc_result_totext(result));
649
			result = ISC_R_FAILURE;
650
			break;
651
		}
652
	row = mysql_fetch_row(rs);	// get next row from the result set
653
	}
654
655
		// free result set memory
656
	mysql_free_result(rs);
657
658
	return result;
659
}
660
661
	/* if the lookup function does not return SOA or NS records for the zone,
662
	 * use this function to get that information for Bind.
663
	 */
664
665
isc_result_t
666
mysql_authority(const char *zone, void *driverarg, void *dbdata,
667
			  dns_sdlzlookup_t *lookup)
668
{
669
	isc_result_t result;
670
	MYSQL_RES *rs = NULL;
671
672
    UNUSED(driverarg);
673
674
		// run the query and get the result set from the database.
675
	result = mysql_get_resultset(zone, NULL, NULL, AUTHORITY, dbdata, &rs);
676
		// if we get "not implemented", send it along
677
	if(result == ISC_R_NOTIMPLEMENTED)
678
		return result;
679
		// if we didn't get a result set, log an err msg.
680
	if(result != ISC_R_SUCCESS){
681
		if(rs != NULL)
682
			mysql_free_result(rs);
683
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
684
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
685
			"mysql driver unable to return result set for authority query");
686
		return (ISC_R_FAILURE);
687
	}
688
		// lookup and authority result sets are processed in the same manner
689
		// mysql_process_rs does the job for both functions.
690
	return mysql_process_rs(lookup, rs);
691
}
692
693
	/* if zone is supported, lookup up a (or multiple) record(s) in it */
694
isc_result_t
695
mysql_lookup(const char *zone, const char *name, void *driverarg, 
696
			void *dbdata, dns_sdlzlookup_t *lookup)
697
{
698
	isc_result_t result;
699
	MYSQL_RES *rs = NULL;
700
701
    UNUSED(driverarg);
702
703
		// run the query and get the result set from the database.
704
	result = mysql_get_resultset(zone, name, NULL, LOOKUP, dbdata, &rs);
705
		// if we didn't get a result set, log an err msg.
706
	if(result != ISC_R_SUCCESS){
707
		if(rs != NULL)
708
			mysql_free_result(rs);
709
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
710
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
711
			"mysql driver unable to return result set for lookup query");
712
		return (ISC_R_FAILURE);
713
	}
714
		// lookup and authority result sets are processed in the same manner
715
		// mysql_process_rs does the job for both functions.
716
	return mysql_process_rs(lookup, rs);
717
}
718
719
	/* create an instance of the driver.  Remember, only 1 copy of the driver's
720
	 * code is ever loaded, the driver has to remember which context it's
721
	 * operating in.  This is done via use of the dbdata arguement which is
722
	 * passed into all query functions.
723
	 */
724
isc_result_t
725
mysql_create(const char *dlzname, unsigned int argc, char *argv[],
726
				void *driverarg, void **dbdata)
727
{
728
	isc_result_t result;
729
	dbinstance_t *dbi = NULL;
730
	char *tmp = NULL;
731
	char *dbname = NULL;
732
	char *host = NULL;
733
	char *user = NULL;
734
	char *pass = NULL;
735
	char *socket = NULL;
736
	int port;
737
	MYSQL *dbc;
738
	char *endp;
739
	int j;
740
	unsigned int flags = 0;
741
742
	UNUSED(driverarg);
743
    UNUSED(dlzname);
744
	
745
		/* verify we have at least 4 arg's passed to the driver */
746
	if(argc < 4){
747
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
748
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
749
			"mysql driver requires at least 4 command line args.");
750
		return (ISC_R_FAILURE);
751
	}
752
753
		/* no more than 8 arg's should be passed to the driver */
754
	if(argc > 8){
755
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
756
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
757
			"mysql driver cannot accept more than 7 command line args.");
758
		return (ISC_R_FAILURE);
759
	}
760
761
	/* parse connection string and get paramters. */
762
763
		// get db name - required
764
	dbname = getParameterValue(argv[1], "dbname=");		
765
	if(dbname == NULL){
766
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
767
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
768
			"mysql driver requires a dbname parameter.");
769
		result = ISC_R_FAILURE;
770
		goto full_cleanup;
771
	}
772
773
		// get db port.  Not required, but must be > 0 if specified
774
	tmp = getParameterValue(argv[1], "port=");
775
	if(tmp == NULL){
776
		port = 0;
777
	} else {
778
		port = strtol(tmp, &endp, 10);
779
		if (*endp != '\0' || port < 0){
780
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
781
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
782
				"Mysql driver port must be a positive number.");	
783
			isc_mem_free(ns_g_mctx, tmp);
784
			result = ISC_R_FAILURE;
785
			goto full_cleanup;
786
		}
787
		isc_mem_free(ns_g_mctx, tmp);
788
	}
789
790
		// how many queries were passed in from config file?
791
	switch(argc){
792
		case 4:
793
			result = build_sqldbinstance(ns_g_mctx, NULL, NULL, NULL, 
794
												argv[2], argv[3], NULL, &dbi);
795
			break;
796
		case 5:
797
			result = build_sqldbinstance(ns_g_mctx, NULL, NULL, argv[4],
798
												argv[2], argv[3], NULL, &dbi);
799
			break;
800
		case 6:
801
			result = build_sqldbinstance(ns_g_mctx, argv[5], NULL, argv[4],
802
												argv[2], argv[3], NULL, &dbi);
803
			break;
804
		case 7:
805
			result = build_sqldbinstance(ns_g_mctx, argv[5], argv[6], argv[4],
806
												argv[2], argv[3], NULL, &dbi);
807
			break;
808
		case 8:
809
			result = build_sqldbinstance(ns_g_mctx, argv[5], argv[6], argv[4],
810
												argv[2], argv[3], argv[7], &dbi);
811
			break;
812
		default:
813
			result = ISC_R_FAILURE;	// not really needed, should shut up compiler.
814
	}
815
816
			// unsuccessful?, log err msg and cleanup.
817
	if(result != ISC_R_SUCCESS){
818
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
819
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
820
			"mysql driver could not create database instance object.");
821
		result = ISC_R_FAILURE;
822
		goto full_cleanup;
823
	}
824
825
		// create and set db connection
826
	dbi->dbconn = mysql_init(NULL);
827
828
		// if db connection cannot be created, log err msg and cleanup.
829
	if(dbi->dbconn == NULL){
830
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
831
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
832
			"mysql driver could not allocate memory for database connection");
833
		result = ISC_R_FAILURE;
834
		goto full_cleanup;
835
	}
836
837
	tmp = getParameterValue(argv[1], "compress=");
838
	if(tmp != NULL){
839
		if(strcasecmp(tmp, "true") == 0)
840
			flags = CLIENT_COMPRESS;
841
		isc_mem_free(ns_g_mctx, tmp);	
842
	}
843
844
	tmp = getParameterValue(argv[1], "ssl=");
845
	if(tmp != NULL){
846
		if(strcasecmp(tmp, "true") == 0)
847
			flags = flags | CLIENT_SSL;
848
		isc_mem_free(ns_g_mctx, tmp);	
849
	}
850
851
	tmp = getParameterValue(argv[1], "space=");
852
	if(tmp != NULL){
853
		if(strcasecmp(tmp, "ignore") == 0)
854
			flags = flags | CLIENT_IGNORE_SPACE;
855
		isc_mem_free(ns_g_mctx, tmp);	
856
	}
857
858
	dbc = NULL;
859
	host = getParameterValue(argv[1], "host=");
860
	user = getParameterValue(argv[1], "user=");
861
	pass = getParameterValue(argv[1], "pass=");
862
	socket = getParameterValue(argv[1], "socket=");
863
864
	for(j=0;	dbc == NULL && j < 4; j++)
865
		dbc = mysql_real_connect((MYSQL *) dbi->dbconn, host, user, pass,
866
		                                        dbname, port, socket, flags);
867
868
		// let user know if we couldn't connect.
869
	if(dbc == NULL){
870
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
871
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
872
			"mysql driver failed to create database connection after 4 attempts");
873
		result = ISC_R_FAILURE;
874
		goto full_cleanup;
875
	}
876
877
		// return db connection via dbdata
878
	*dbdata = dbi;
879
880
	result = ISC_R_SUCCESS;
881
	goto cleanup;
882
883
full_cleanup:
884
	
885
	destroy_sqldbinstance(dbi);
886
887
cleanup:
888
889
	if(dbname != NULL)
890
		isc_mem_free(ns_g_mctx, dbname);
891
	if(host != NULL)
892
		isc_mem_free(ns_g_mctx, host);
893
	if(user != NULL)
894
		isc_mem_free(ns_g_mctx, user);
895
	if(pass != NULL)
896
		isc_mem_free(ns_g_mctx, pass);
897
	if(socket != NULL)
898
		isc_mem_free(ns_g_mctx, socket);
899
900
901
	return result;
902
}
903
904
	/* destroy the driver.  Remember, only 1 copy of the driver's
905
	 * code is ever loaded, the driver has to remember which context it's
906
	 * operating in.  This is done via use of the dbdata arguement.
907
	 * so we really only need to clean it up since we are not using driverarg.
908
	 */
909
910
void
911
mysql_destroy(void *driverarg, void *dbdata)
912
{
913
	dbinstance_t *dbi;
914
   
915
	UNUSED(driverarg);
916
	
917
	dbi = (dbinstance_t *) dbdata;
918
    
919
		// release DB connection
920
	if(dbi->dbconn != NULL)
921
		mysql_close((MYSQL *) dbi->dbconn);
922
923
		// destroy DB instance
924
   destroy_sqldbinstance(dbi);
925
}
926
927
	// pointers to all our runtime methods.
928
	// this is used during driver registration
929
	// i.e. in dlz_mysql_init below.
930
static dns_sdlzmethods_t dlz_mysql_methods = {
931
	mysql_create, 
932
	mysql_destroy,
933
	mysql_findzone,
934
	mysql_lookup,
935
	mysql_authority,
936
	mysql_allnodes,
937
	mysql_allowzonexfr};
938
939
/*
940
 * Wrapper around dns_sdlzregister().
941
 */
942
isc_result_t
943
dlz_mysql_init(void) {
944
	isc_result_t result;
945
946
	/*
947
	 * Write debugging message to log
948
	 */
949
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
950
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
951
	      "Registering DLZ mysql driver.");
952
953
		/* Driver is always threadsafe.  Because of the way MySQL handles
954
         * threads the MySQL driver can only be used when bind is run single
955
         * threaded.  Using MySQL with Bind running multi-threaded is not
956
         * allowed.  When using the MySQL driver "-n1" should always be
957
         * passed to Bind to guarantee single threaded operation.
958
   		 */
959
	result = dns_sdlzregister("mysql", &dlz_mysql_methods, NULL, 
960
							DNS_SDLZFLAG_RELATIVEOWNER | DNS_SDLZFLAG_RELATIVERDATA
961
							| DNS_SDLZFLAG_THREADSAFE,	ns_g_mctx, &dlz_mysql);
962
		// if we can't register the driver, there are big problems.
963
	if(result != ISC_R_SUCCESS){
964
		UNEXPECTED_ERROR(__FILE__, __LINE__,
965
				 "dns_sdlzregister() failed: %s",
966
				 isc_result_totext(result));
967
		result = ISC_R_UNEXPECTED;
968
	}
969
970
971
	return result;
972
}
973
974
/*
975
 * Wrapper around dns_sdlzunregister().
976
 */
977
void
978
dlz_mysql_clear(void) {
979
980
	/*
981
	 * Write debugging message to log
982
	 */
983
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
984
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
985
	      "Unregistering DLZ mysql driver.");
986
987
		// unregister the driver.
988
	if (dlz_mysql != NULL)
989
		dns_sdlzunregister(&dlz_mysql);
990
}
991
992
#endif
993
(-)bind-9.2.2-orig/bin/named/dlz_odbc_driver.c (+1509 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
/*
37
 * Copyright (C) 1999-2001  Internet Software Consortium.
38
 *
39
 * Permission to use, copy, modify, and distribute this software for any
40
 * purpose with or without fee is hereby granted, provided that the above
41
 * copyright notice and this permission notice appear in all copies.
42
 *
43
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
44
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
45
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
46
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
47
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
48
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
50
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
51
 */
52
53
#ifdef DLZ_ODBC
54
55
#include <config.h>
56
#include <stdio.h>
57
#include <string.h>
58
#include <stdlib.h>
59
60
#include <dns/log.h>
61
#include <dns/sdlz.h>
62
#include <dns/result.h>
63
64
#include <isc/mem.h>
65
#include <isc/platform.h>
66
#include <isc/print.h>
67
#include <isc/result.h>
68
#include <isc/string.h>
69
#include <isc/util.h>
70
71
#include <named/globals.h>
72
#include <named/dlz_odbc_driver.h>
73
#include <named/sdlz_helper.h>
74
75
#include <sql.h>
76
#include <sqlext.h>
77
#include <sqltypes.h>
78
79
dns_sdlzimplementation_t *dlz_odbc = NULL;
80
81
#define dbc_search_limit 30
82
#define ALLNODES 1
83
#define ALLOWXFR 2
84
#define AUTHORITY 3
85
#define FINDZONE 4
86
#define LOOKUP 5
87
88
#define sqlOK(a) ((a == SQL_SUCCESS || a == SQL_SUCCESS_WITH_INFO) ? -1 : 0)
89
90
/***
91
 *** Private Structures
92
 ***/
93
94
/***
95
 *** structure to hold ODBC connection & statement
96
 ***/
97
98
typedef struct{    
99
	SQLHDBC   dbc;
100
	SQLHSTMT  stmnt;
101
} odbc_db_t;
102
103
/***
104
 *** Structure to hold everthing needed by this "instance" of the odbc driver
105
 *** remember, the driver code is only loaded once, but may have many separate
106
 *** instances
107
 ***/
108
109
typedef struct {
110
111
#ifdef ISC_PLATFORM_USETHREADS
112
113
    db_list_t    *db;       // handle to a list of DB
114
115
#else
116
    
117
    dbinstance_t *db;       // handle to db
118
119
#endif
120
    
121
    SQLHENV      sql_env;  // handle to SQL environment
122
    SQLCHAR      *dsn;
123
    SQLCHAR      *user;
124
    SQLCHAR      *pass;
125
} odbc_instance_t;
126
127
/***
128
 *** method prototypes
129
 *** Declared here to shut up compiler warnings
130
 *** about "no previous prototype"
131
 ***/
132
133
void
134
destroy_odbc_instance(odbc_instance_t *odbc_inst);
135
136
dbinstance_t *
137
odbc_find_avail_conn(db_list_t *dblist);
138
139
char *
140
odbc_escape_string(const char *instr);
141
142
size_t
143
odbc_makesafe(char *to, const char *from, size_t length);
144
145
isc_result_t
146
odbc_connect(odbc_instance_t *dbi, odbc_db_t **dbc);
147
148
isc_result_t
149
odbc_get_resultset(const char *zone, const char *record,
150
					   const char *client, unsigned int query,
151
					   void *dbdata, dbinstance_t **r_dbi);
152
153
isc_result_t
154
odbc_getField(SQLHSTMT  *stmnt, SQLSMALLINT field, char **data);
155
156
isc_result_t
157
odbc_getManyFields(SQLHSTMT *stmnt, SQLSMALLINT startField,
158
										SQLSMALLINT endField, char **retData);
159
160
isc_result_t
161
odbc_process_rs(dns_sdlzlookup_t *lookup, dbinstance_t *r_dbi);
162
163
isc_result_t
164
odbc_findzone(void *driverarg, void *dbdata, const char *name);
165
166
isc_result_t
167
odbc_allowzonexfr(void *driverarg, void *dbdata, const char *name,
168
						const char *client);
169
170
isc_result_t
171
odbc_allnodes(const char *zone, void *driverarg, void *dbdata,
172
					dns_sdlzallnodes_t *allnodes);
173
174
isc_result_t
175
odbc_authority(const char *zone, void *driverarg, void *dbdata,
176
			  		dns_sdlzlookup_t *lookup);
177
178
isc_result_t
179
odbc_lookup(const char *zone, const char *name, void *driverarg, 
180
			void *dbdata, dns_sdlzlookup_t *lookup);
181
182
isc_result_t
183
odbc_create(const char *dlzname, unsigned int argc, char *argv[],
184
				void *driverarg, void **dbdata);
185
186
void
187
odbc_destroy(void *driverarg, void *dbdata);
188
189
SQLSMALLINT
190
safeLen(void *a);
191
192
/***
193
 *** Private methods
194
 ***/
195
196
SQLSMALLINT
197
safeLen(void *a){
198
	if(a == NULL)
199
		return 0;
200
	return strlen((char *) a);
201
}
202
203
	/* propertly cleans up an odbc_instance_t */
204
205
void
206
destroy_odbc_instance(odbc_instance_t *odbc_inst){
207
208
#ifdef ISC_PLATFORM_USETHREADS
209
210
	dbinstance_t *ndbi = NULL;
211
	dbinstance_t *dbi = NULL;
212
213
		// get the first DBI in the list
214
	ndbi = ISC_LIST_HEAD(*odbc_inst->db);
215
	
216
		// loop through the list
217
	while(ndbi != NULL){
218
		dbi = ndbi;
219
			// get the next DBI in the list
220
		ndbi = ISC_LIST_NEXT(dbi, link);
221
222
			// if we have a connection / statement object in memory
223
		if(dbi->dbconn != NULL){
224
				// free statement handle
225
			if(((odbc_db_t *) (dbi->dbconn))->stmnt != NULL){
226
				SQLFreeHandle(SQL_HANDLE_STMT,((odbc_db_t *)(dbi->dbconn))->stmnt);
227
				((odbc_db_t *) (dbi->dbconn))->stmnt = NULL;
228
			}
229
230
				// disconnect from database & free connection handle
231
			if(((odbc_db_t *) (dbi->dbconn))->dbc != NULL){
232
				SQLDisconnect(((odbc_db_t *) dbi->dbconn)->dbc);
233
				SQLFreeHandle(SQL_HANDLE_DBC, ((odbc_db_t *) (dbi->dbconn))->dbc);
234
				((odbc_db_t *) (dbi->dbconn))->dbc = NULL;
235
			}
236
237
				// free memory that held connection & statement.
238
			isc_mem_free(ns_g_mctx, dbi->dbconn);
239
		}
240
			// release all memory that comprised a DBI
241
		destroy_sqldbinstance(dbi);
242
	}
243
		// release memory for the list structure
244
	isc_mem_put(ns_g_mctx, odbc_inst->db, sizeof(db_list_t));
245
246
#else /* ISC_PLATFORM_USETHREADS */
247
248
			// free statement handle
249
	if(((odbc_db_t *) (odbc_inst->db->dbconn))->stmnt != NULL){
250
		SQLFreeHandle(SQL_HANDLE_STMT, ((odbc_db_t *) (odbc_inst->db->dbconn))->stmnt);
251
		((odbc_db_t *) (odbc_inst->db->dbconn))->stmnt = NULL;
252
	}
253
254
			// disconnect from database, free connection handle
255
	if(((odbc_db_t *) (odbc_inst->db->dbconn))->dbc != NULL){
256
		SQLDisconnect(((odbc_db_t *) (odbc_inst->db->dbconn))->dbc);
257
		SQLFreeHandle(SQL_HANDLE_DBC, ((odbc_db_t *) (odbc_inst->db->dbconn))->dbc);
258
		((odbc_db_t *) (odbc_inst->db->dbconn))->dbc = NULL;
259
	}
260
		//	free mem for the odbc_db_t structure held in db
261
	if(((odbc_db_t *) odbc_inst->db->dbconn) != NULL){
262
		isc_mem_free(ns_g_mctx, odbc_inst->db->dbconn);
263
		odbc_inst->db->dbconn = NULL;
264
	}
265
266
	if(odbc_inst->db != NULL)
267
		destroy_sqldbinstance(odbc_inst->db);
268
269
#endif /* ISC_PLATFORM_USETHREADS */
270
271
272
		// free sql environment
273
	if(odbc_inst->sql_env != NULL)
274
		SQLFreeHandle(SQL_HANDLE_ENV, odbc_inst->sql_env);
275
276
		// free ODBC instance strings
277
	if(odbc_inst->dsn != NULL)
278
		isc_mem_free(ns_g_mctx, odbc_inst->dsn);
279
	if(odbc_inst->pass != NULL)
280
		isc_mem_free(ns_g_mctx, odbc_inst->pass);
281
	if(odbc_inst->user != NULL)
282
		isc_mem_free(ns_g_mctx, odbc_inst->user);
283
284
		// free memory for odbc_inst
285
  if(odbc_inst != NULL)
286
    isc_mem_put(ns_g_mctx, odbc_inst, sizeof(odbc_instance_t));
287
288
}
289
290
	/* Connects to database, and creates ODBC statements */
291
292
isc_result_t
293
odbc_connect(odbc_instance_t *dbi, odbc_db_t **dbc){
294
295
	odbc_db_t *ndb = *dbc;
296
	SQLRETURN sqlRes;
297
	isc_result_t result = ISC_R_SUCCESS;
298
299
	if(ndb != NULL){ // if db != null, we have to do some cleanup
300
			// if statement handle != null free it
301
		if(ndb->stmnt != NULL){
302
			SQLFreeHandle(SQL_HANDLE_STMT, ndb->stmnt);
303
			ndb->stmnt = NULL;
304
		}
305
306
			// if connection handle != null free it
307
		if(ndb->dbc != NULL){
308
			SQLFreeHandle(SQL_HANDLE_DBC, ndb->dbc);
309
			ndb->dbc = NULL;
310
		}
311
	} else {
312
		ndb = isc_mem_allocate(ns_g_mctx, sizeof(odbc_db_t));
313
		if(ndb == NULL){
314
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
315
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
316
			"Odbc driver unable to allocate memory");
317
			return ISC_R_NOMEMORY;
318
		}
319
		memset(ndb, 0, sizeof(odbc_db_t));
320
	}
321
322
	sqlRes = SQLAllocHandle(SQL_HANDLE_DBC, dbi->sql_env, &(ndb->dbc));
323
	if(!sqlOK(sqlRes)){
324
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
325
		DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
326
		"Odbc driver unable to allocate memory");
327
		result = ISC_R_NOMEMORY;
328
		goto cleanup;
329
	}
330
331
	sqlRes = SQLConnect(ndb->dbc, dbi->dsn, safeLen(dbi->dsn), dbi->user,
332
							  safeLen(dbi->user), dbi->pass, safeLen(dbi->pass));
333
	if(!sqlOK(sqlRes)){
334
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
335
		DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
336
		"Odbc driver unable to connect");
337
		result = ISC_R_FAILURE;
338
		goto cleanup;
339
	}
340
341
	sqlRes = SQLAllocHandle(SQL_HANDLE_STMT, ndb->dbc, &(ndb->stmnt));
342
	if(!sqlOK(sqlRes)){
343
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
344
		DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
345
		"Odbc driver unable to allocate memory");
346
		result = ISC_R_NOMEMORY;
347
		goto cleanup;
348
	}
349
350
	*dbc = ndb;
351
352
	return ISC_R_SUCCESS;
353
354
cleanup:
355
356
	if(ndb != NULL){
357
358
			// if statement handle != null free it
359
		if(ndb->stmnt != NULL){
360
			SQLFreeHandle(SQL_HANDLE_STMT, ndb->stmnt);
361
			ndb->stmnt = NULL;
362
		}
363
364
			// if connection handle != null free it
365
		if(ndb->dbc != NULL){
366
			SQLDisconnect(ndb->dbc);
367
			SQLFreeHandle(SQL_HANDLE_DBC, ndb->dbc);
368
			ndb->dbc = NULL;
369
		}
370
			// free memory holding ndb
371
		isc_mem_free(ns_g_mctx, ndb);
372
	}
373
374
	return result;
375
}
376
377
	/* Loops through the list of DB instances, attempting to lock
378
	 * on the mutex.  If successful, the DBI is reserved for use
379
	 * and the thread can perform queries against the database.
380
	 * If the lock fails, the next one in the list is tried.
381
	 * looping continues until a lock is obtained, or until
382
	 * the list has been searched dbc_search_limit times.
383
	 * This function is only used when the driver is compiled for
384
	 * multithreaded operation.
385
	 */
386
387
#ifdef ISC_PLATFORM_USETHREADS
388
389
dbinstance_t *
390
odbc_find_avail_conn(db_list_t *dblist)
391
{	
392
   dbinstance_t *dbi = NULL;
393
	dbinstance_t *head;
394
	int count = 0;
395
396
		// get top of list
397
	head = dbi = ISC_LIST_HEAD(*dblist);
398
399
		// loop through list
400
	while(count < dbc_search_limit){
401
			// try to lock on the mutex
402
		if(isc_mutex_trylock(&dbi->instance_lock) == ISC_R_SUCCESS)
403
			return dbi;		// success, return the DBI for use.
404
		
405
			// not successful, keep trying
406
		dbi = ISC_LIST_NEXT(dbi, link);
407
408
			// check to see if we have gone to the top of the list.
409
		if(dbi == NULL){
410
			count++;
411
			dbi = head;
412
		}
413
	}
414
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
415
		DNS_LOGMODULE_DLZ, ISC_LOG_INFO,
416
		"Odbc driver unable to find available connection after searching %d times",
417
		count);
418
	return NULL;    
419
}
420
421
#endif /* ISC_PLATFORM_USETHREADS */
422
423
	/* Allocates memory for a new string, and then constructs the new
424
	 * string by "escaping" the input string.  The new string is
425
	 * safe to be used in queries.  This is necessary because we cannot
426
	 * be sure of what types of strings are passed to us, and we don't
427
	 * want special characters in the string causing problems.
428
	 */
429
430
char *
431
odbc_escape_string(const char *instr){
432
433
	char *outstr;
434
	unsigned int len;
435
436
	if(instr == NULL)
437
		return NULL;
438
439
	len = strlen(instr);
440
441
	outstr = isc_mem_allocate(ns_g_mctx ,(2 * len * sizeof(char)) + 1);
442
	if(outstr == NULL)
443
		return NULL;
444
445
	odbc_makesafe(outstr, instr, len);
446
447
	return outstr;
448
}
449
450
/* ---------------
451
 * Escaping arbitrary strings to get valid SQL strings/identifiers.
452
 *
453
 * Replaces "\\" with "\\\\" and "'" with "''".
454
 * length is the length of the buffer pointed to by
455
 * from.  The buffer at to must be at least 2*length + 1 characters
456
 * long.  A terminating NUL character is written.
457
 *
458
 * NOTICE!!!
459
 * This function was borrowed directly from PostgreSQL's libpq.
460
 *
461
 * The copyright statements from the original file containing this
462
 * function are included below:
463
 * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
464
 * Portions Copyright (c) 1994, Regents of the University of California
465
 * ---------------
466
 */
467
468
size_t
469
odbc_makesafe(char *to, const char *from, size_t length)
470
{
471
	const char *source = from;
472
	char	   *target = to;
473
	unsigned int remaining = length;
474
475
	while (remaining > 0)
476
	{
477
		switch (*source)
478
		{
479
			case '\\':
480
				*target = '\\';
481
				target++;
482
				*target = '\\';
483
				/* target and remaining are updated below. */
484
				break;
485
486
			case '\'':
487
				*target = '\'';
488
				target++;
489
				*target = '\'';
490
				/* target and remaining are updated below. */
491
				break;
492
493
			default:
494
				*target = *source;
495
				/* target and remaining are updated below. */
496
		}
497
		source++;
498
		target++;
499
		remaining--;
500
	}
501
502
	/* Write the terminating NUL character. */
503
	*target = '\0';
504
505
	return target - to;
506
}
507
508
	/* This function is the real core of the driver.   Zone, record
509
	 * and client strings are passed in (or NULL is passed if the
510
	 * string is not available).  The type of query we want to run
511
	 * is indicated by the query flag, and the dbdata object is passed
512
	 * passed in to.  dbdata really holds either:
513
	 *		1) a list of database instances (in multithreaded mode) OR
514
	 *		2) a single database instance (in single threaded mode)
515
	 * The function will construct the query and obtain an available
516
	 * database instance (DBI).  It will then run the query and hopefully
517
	 * obtain a result set.  The data base instance that is used is returned
518
	 * to the caller so they can get the data from the result set from it.
519
	 * If successfull, it will be the responsibility of the caller to close
520
	 * the cursor, and unlock the mutex of the DBI when they are done with it.
521
	 * If not successfull, this function will perform all the cleanup.
522
	 */
523
524
525
isc_result_t
526
odbc_get_resultset(const char *zone, const char *record,
527
					   const char *client, unsigned int query,
528
					   void *dbdata, dbinstance_t **r_dbi)
529
{
530
531
   isc_result_t result;
532
	dbinstance_t *dbi = NULL;
533
	char *querystring = NULL;
534
	unsigned int j = 0;
535
	SQLRETURN sqlRes;
536
537
	REQUIRE(*r_dbi == NULL);
538
539
		// get db instance / connection
540
#ifdef ISC_PLATFORM_USETHREADS
541
542
		// find an available DBI from the list
543
	dbi = odbc_find_avail_conn(((odbc_instance_t *) dbdata)->db);
544
545
#else /* ISC_PLATFORM_USETHREADS */
546
547
		// only 1 DBI - no need to lock instance lock either
548
		// only 1 thread in the whole process, no possible contention.
549
	dbi =  (dbinstance_t *) ((odbc_instance_t *) dbdata)->db;
550
551
#endif /* ISC_PLATFORM_USETHREADS */
552
553
		// if DBI is null, can't do anything else
554
	if(dbi == NULL){
555
		result = ISC_R_FAILURE;
556
		goto cleanup;
557
	}
558
559
		// what type of query are we going to run?
560
	switch(query){
561
		case ALLNODES:
562
				// if the query was not passed in from the config file
563
				// then we can't run it.  return not_implemented,
564
				// so it's like the code for that operation
565
				// was never built into the driver.... AHHH  flexibility!!!
566
			if(dbi->allnodes_q == NULL){
567
				result = ISC_R_NOTIMPLEMENTED;
568
				goto cleanup;
569
			}
570
			break;				
571
		case ALLOWXFR:
572
				// same as comments as ALLNODES
573
			if(dbi->allowxfr_q == NULL){
574
				result = ISC_R_NOTIMPLEMENTED;
575
				goto cleanup;
576
			}
577
			break;
578
		case AUTHORITY:
579
				// same as comments as ALLNODES
580
			if(dbi->authority_q == NULL){
581
				result = ISC_R_NOTIMPLEMENTED;
582
				goto cleanup;
583
			}
584
			break;
585
		case FINDZONE:
586
				// this is required.  It's the whole point of DLZ!
587
			if(dbi->findzone_q == NULL){
588
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
589
					  DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
590
					  "No query specified for findzone.  Findzone requires a query");
591
				result = ISC_R_FAILURE;
592
				goto cleanup;
593
			}
594
			break;
595
		case LOOKUP:
596
				// this is required.  It's also a major point of DLZ!
597
			if(dbi->lookup_q == NULL){
598
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
599
					  DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
600
					  "No query specified for lookup.  Lookup requires a query");
601
				result = ISC_R_FAILURE;
602
				goto cleanup;
603
			}
604
			break;
605
		default:
606
				// this should never happen.  If it does, the code is screwed up!
607
			UNEXPECTED_ERROR(__FILE__, __LINE__,
608
				 "Incorrect query flag passed to odbc_get_resultset");
609
			result = ISC_R_UNEXPECTED;
610
			goto cleanup;
611
	}
612
613
614
		// was a zone string passed?  If so, make it safe for use in queries.
615
	if(zone != NULL){
616
		dbi->zone = odbc_escape_string(zone);
617
		if(dbi->zone == NULL){
618
			result = ISC_R_NOMEMORY;
619
			goto cleanup;
620
		}
621
	} else {	// no string passed, set the string pointer to NULL
622
		dbi->zone = NULL;
623
	}
624
625
		// was a record string passed?  If so, make it safe for use in queries.
626
	if(record != NULL){
627
		dbi->record = odbc_escape_string(record);
628
		if(dbi->record == NULL){
629
			result = ISC_R_NOMEMORY;
630
			goto cleanup;
631
		}
632
	} else {	// no string passed, set the string pointer to NULL
633
		dbi->record = NULL;
634
	}
635
636
		// was a client string passed?  If so, make it safe for use in queries.
637
	if(client != NULL){
638
		dbi->client = odbc_escape_string(client);
639
		if(dbi->client == NULL){
640
			result = ISC_R_NOMEMORY;
641
			goto cleanup;
642
		}
643
	} else {	// no string passed, set the string pointer to NULL
644
		dbi->client = NULL;
645
	}
646
647
		// what type of query are we going to run?
648
		// this time we build the actual query to run.
649
	switch(query){
650
		case ALLNODES:
651
			querystring = build_querystring(ns_g_mctx, dbi->allnodes_q);
652
			break;
653
		case ALLOWXFR:
654
			querystring = build_querystring(ns_g_mctx, dbi->allowxfr_q);
655
			break;
656
		case AUTHORITY:
657
			querystring = build_querystring(ns_g_mctx, dbi->authority_q);
658
			break;
659
		case FINDZONE:
660
			querystring = build_querystring(ns_g_mctx, dbi->findzone_q);
661
			break;
662
		case LOOKUP:
663
			querystring = build_querystring(ns_g_mctx, dbi->lookup_q);
664
			break;
665
		default:
666
				// this should never happen.  If it does, the code is screwed up!
667
			UNEXPECTED_ERROR(__FILE__, __LINE__,
668
				 "Incorrect query flag passed to odbc_get_resultset");
669
			result = ISC_R_UNEXPECTED;
670
			goto cleanup;
671
	}
672
673
		// if the querystring is null, Bummer, outta RAM.  UPGRADE TIME!!!  
674
	if(querystring  == NULL){
675
		result = ISC_R_NOMEMORY;
676
		goto cleanup;
677
	}
678
679
		// output the full query string during debug so we can see
680
		// what lame error the query has.
681
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
682
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
683
	      "\nQuery String: %s\n", querystring);
684
685
		// attempt query up to 3 times.
686
	for(j=0; j < 3; j++){
687
			// try to get result set
688
		sqlRes = SQLExecDirect(((odbc_db_t *) dbi->dbconn)->stmnt,
689
			(SQLCHAR *) querystring, (SQLINTEGER) strlen(querystring));
690
691
			// if error, reset DB connection
692
		if(!sqlOK(sqlRes)){
693
				// close cursor
694
			SQLCloseCursor(((odbc_db_t *) dbi->dbconn)->stmnt);
695
				// attempt to reconnect
696
			result = odbc_connect((odbc_instance_t *) dbdata, (odbc_db_t **) &(dbi->dbconn));
697
				// check if we reconnected
698
			if(result != ISC_R_SUCCESS)
699
				break;
700
				// incase this is the last time through the loop
701
			result = ISC_R_FAILURE;
702
		} else {
703
			result = ISC_R_SUCCESS;
704
				// return dbi
705
			*r_dbi = dbi;
706
				// result set ok, break loop
707
			break;
708
		}
709
	}	// end for loop
710
711
cleanup:	// it's always good to cleanup after yourself
712
713
		// if we couldn't even allocate DBI, just return NULL
714
	if(dbi == NULL)
715
		return ISC_R_FAILURE;
716
717
		// free dbi->zone string
718
	if(dbi->zone != NULL)
719
		isc_mem_free(ns_g_mctx, dbi->zone);
720
721
		// free dbi->record string
722
	if(dbi->record != NULL)
723
		isc_mem_free(ns_g_mctx, dbi->record);
724
725
		// free dbi->client string
726
	if(dbi->client != NULL)
727
		isc_mem_free(ns_g_mctx, dbi->client);
728
729
#ifdef ISC_PLATFORM_USETHREADS
730
731
		// if we are done using this dbi, release the lock
732
	if(result != ISC_R_SUCCESS)
733
		isc_mutex_unlock(&dbi->instance_lock);
734
735
#endif /* ISC_PLATFORM_USETHREADS */
736
737
		// release query string
738
	if(querystring  != NULL)
739
		isc_mem_free(ns_g_mctx, querystring );
740
741
		// return result
742
	return result;
743
   
744
}
745
746
	/* Gets a single field from the ODBC statement.  The memory for the
747
	 * returned data is dynamically allocated.  If this method is successful
748
	 * it is the reponsibility of the caller to free the memory using 
749
	 * isc_mem_free(ns_g_mctx, *ptr);
750
	 */
751
752
isc_result_t
753
odbc_getField(SQLHSTMT *stmnt, SQLSMALLINT field, char **data){
754
755
	SQLINTEGER size;
756
757
	REQUIRE(data != NULL && *data == NULL);
758
759
	if(sqlOK(SQLColAttribute(stmnt, field, SQL_DESC_DISPLAY_SIZE,
760
					NULL, 0, NULL, &size)) && size > 0){
761
		*data = isc_mem_allocate(ns_g_mctx, size + 1);
762
		if(data != NULL){
763
			if(sqlOK(SQLGetData(stmnt, field, SQL_C_CHAR, *data, size + 1,&size)))
764
				return ISC_R_SUCCESS;
765
			isc_mem_free(ns_g_mctx, *data);
766
		}
767
	}
768
	return ISC_R_FAILURE;
769
}
770
771
	/* Gets multiple fields from the ODBC statement.  The memory for the
772
	 * returned data is dynamically allocated.  If this method is successful
773
	 * it is the reponsibility of the caller to free the memory using 
774
	 * isc_mem_free(ns_g_mctx, *ptr);
775
	 */
776
777
isc_result_t
778
odbc_getManyFields(SQLHSTMT *stmnt, SQLSMALLINT startField,
779
										SQLSMALLINT endField, char **retData){
780
781
	isc_result_t result;
782
	SQLINTEGER size;
783
	int totSize = 0;
784
	SQLSMALLINT i; 
785
	int j = 0;
786
	char *data;
787
788
	REQUIRE(retData != NULL && *retData == NULL);
789
	REQUIRE(startField > 0 && startField <= endField);
790
791
		// determine how large the data is
792
	for(i=startField; i <= endField; i++)
793
		if(sqlOK(SQLColAttribute(stmnt, i, SQL_DESC_DISPLAY_SIZE,
794
										NULL, 0, NULL, &size)) && size > 0){
795
			totSize += (size + 1);	// always allow for a " " (space) character
796
											// after the data item
797
		}
798
	
799
	if(totSize < 1)
800
		return ISC_R_FAILURE;
801
802
		// allow for a "\n" at the end of the string/
803
	data = isc_mem_allocate(ns_g_mctx, ++totSize);
804
	if(data == NULL)
805
		return ISC_R_NOMEMORY;
806
807
	result = ISC_R_FAILURE;
808
809
		// get the data and concat all fields into a large string
810
	for(i=startField; i <= endField; i++){
811
		if(sqlOK(SQLGetData(stmnt, i, SQL_C_CHAR, &(data[j]), totSize - j, &size))){
812
			if(size > 0){
813
				j += size;
814
				data[j++] = ' ';
815
				data[j] = '\0';
816
				result = ISC_R_SUCCESS;
817
			}
818
		} else {
819
			isc_mem_free(ns_g_mctx, data);
820
			return ISC_R_FAILURE;
821
		}
822
	}
823
824
	if(result != ISC_R_SUCCESS){
825
		isc_mem_free(ns_g_mctx, data);
826
		return result;
827
	}
828
829
	*retData = data;
830
	return ISC_R_SUCCESS;
831
		
832
}
833
834
	/* The processing of result sets for lookup and authority are
835
	 * exactly the same.  So that functionality has been moved
836
	 * into this function to minimize code.
837
	 */
838
839
isc_result_t
840
odbc_process_rs(dns_sdlzlookup_t *lookup, dbinstance_t *dbi)
841
{
842
843
844
	isc_result_t result;
845
	SQLSMALLINT fields;
846
	SQLHSTMT  *stmnt;
847
	char *ttl_s;
848
	char *type;
849
	char *data;
850
	char *endp;
851
	int ttl;
852
853
	REQUIRE(dbi != NULL);
854
855
	stmnt = ((odbc_db_t *) (dbi->dbconn))->stmnt;
856
857
		// get number of columns
858
	if(!sqlOK(SQLNumResultCols(stmnt, &fields))){		
859
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
860
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
861
			"Odbc driver unable to process result set");
862
		result = ISC_R_FAILURE;
863
		goto process_rs_cleanup;
864
	}
865
866
		// get things ready for processing
867
	result = ISC_R_FAILURE;
868
869
	while(sqlOK(SQLFetch(stmnt))){
870
871
			// set to null for next pass through
872
		data = type = ttl_s = NULL;
873
874
		switch(fields){
875
			case 1:	// one column in rs, it's the data field
876
						// use default type of A record, and default TTL of 86400
877
878
					//	attempt to get data, & tell bind about it
879
				if((result = odbc_getField(stmnt, 1, &data)) == ISC_R_SUCCESS){
880
					result = dns_sdlz_putrr(lookup, "a", 86400, data);
881
				}
882
				break;
883
			case 2:	// two columns, data field, and data type.
884
						// use default TTL of 86400
885
					// attempt to get DNS type & data, then tell bind about it
886
				if((result = odbc_getField(stmnt, 1, &type)) == ISC_R_SUCCESS &&
887
					(result = odbc_getField(stmnt, 2, &data)) == ISC_R_SUCCESS){
888
					result = dns_sdlz_putrr(lookup, type, 86400, data);
889
				}
890
				break;
891
			default:	// 3 fields or more, concatonate the last ones together.	
892
					// attempt to get DNS ttl, type, data then tell Bind about them
893
				if((result = odbc_getField(stmnt, 1, &ttl_s)) == ISC_R_SUCCESS &&
894
					(result = odbc_getField(stmnt, 2, &type)) == ISC_R_SUCCESS &&
895
					(result = odbc_getManyFields(stmnt, 3, fields, &data))
896
																				== ISC_R_SUCCESS){
897
						// try to convert ttl string to int
898
					ttl = strtol(ttl_s, &endp, 10);
899
						// failure converting ttl.
900
					if (*endp != '\0' || ttl < 0){
901
						isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
902
							DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
903
							"Odbc driver ttl must be a postive number");
904
						result = ISC_R_FAILURE;
905
					} else {
906
							// successful converting TTL, tell Bind everything
907
						result = dns_sdlz_putrr(lookup, type, ttl, data);
908
					}
909
				} // closes bid if()
910
		} // closes switch(fields)
911
912
			// clean up mem
913
		if(ttl_s != NULL)
914
			isc_mem_free(ns_g_mctx, ttl_s);
915
		if(type != NULL)
916
			isc_mem_free(ns_g_mctx, type);
917
		if(data != NULL)
918
			isc_mem_free(ns_g_mctx, data);
919
920
			// I sure hope we were successful
921
		if(result != ISC_R_SUCCESS){
922
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
923
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
924
				"dns_sdlz_putrr returned error. Error code was: %s",
925
														isc_result_totext(result));
926
			result = ISC_R_FAILURE;
927
			goto process_rs_cleanup;
928
		}
929
	} // closes while loop
930
931
process_rs_cleanup:
932
933
			// close cursor
934
	SQLCloseCursor(((odbc_db_t *) (dbi->dbconn))->stmnt);
935
936
#ifdef ISC_PLATFORM_USETHREADS
937
938
		// free lock on dbi so someone else can use it.
939
	isc_mutex_unlock(&dbi->instance_lock);
940
941
#endif
942
943
   return result;
944
}
945
946
/***
947
 *** SDLZ interface methods
948
 ***/
949
950
	/* determine if the zone is supported by (in) the database */
951
952
isc_result_t
953
odbc_findzone(void *driverarg, void *dbdata, const char *name)
954
{
955
956
	isc_result_t result;
957
	dbinstance_t *dbi = NULL;
958
   
959
	UNUSED(driverarg);
960
961
		// run the query and get the result set from the database.
962
		// if result != ISC_R_SUCCESS cursor and mutex already cleaned up.
963
		// so we don't have to do it here.
964
	result = odbc_get_resultset(name, NULL, NULL, FINDZONE, dbdata, &dbi);
965
	
966
		// Check that we got a result set with data
967
	if(result == ISC_R_SUCCESS &&
968
		!sqlOK(SQLFetch(((odbc_db_t *) (dbi->dbconn))->stmnt))){
969
		result = ISC_R_NOTFOUND;
970
	}
971
		
972
	if(dbi != NULL){
973
		// get rid of result set, we are done with it.
974
		SQLCloseCursor(((odbc_db_t *) (dbi->dbconn))->stmnt);
975
976
#ifdef ISC_PLATFORM_USETHREADS
977
978
		// free lock on dbi so someone else can use it.
979
		isc_mutex_unlock(&dbi->instance_lock);
980
#endif 
981
	}
982
	
983
	return result;
984
}
985
986
	/* Determine if the client is allowed to perform a zone transfer */
987
isc_result_t
988
odbc_allowzonexfr(void *driverarg, void *dbdata, const char *name,
989
															const char *client)
990
{
991
   isc_result_t result;
992
	dbinstance_t *dbi = NULL;
993
994
   UNUSED(driverarg);
995
996
		// first check if the zone is supported by the database.
997
	result = odbc_findzone(driverarg, dbdata, name);
998
	if(result != ISC_R_SUCCESS)
999
		return (ISC_R_NOTFOUND);
1000
1001
	// if we get to this point we know the zone is supported by the database
1002
	// the only questions now are is the zone transfer is allowed for this client
1003
	// and did the config file have an allow zone xfr query
1004
1005
		// Run our query, and get a result set from the database.
1006
		// if result != ISC_R_SUCCESS cursor and mutex already cleaned up.
1007
		// so we don't have to do it here.
1008
	result = odbc_get_resultset(name, NULL, client, ALLOWXFR, dbdata, &dbi);
1009
	
1010
		// if we get "not implemented", send it along.
1011
	if(result == ISC_R_NOTIMPLEMENTED)
1012
		return result;
1013
1014
		// Check that we got a result set with data
1015
	if(result == ISC_R_SUCCESS &&
1016
		!sqlOK(SQLFetch(((odbc_db_t *) (dbi->dbconn))->stmnt))){
1017
		result = ISC_R_NOPERM;
1018
	}
1019
		
1020
	if(dbi != NULL){
1021
		// get rid of result set, we are done with it.
1022
		SQLCloseCursor(((odbc_db_t *) (dbi->dbconn))->stmnt);
1023
1024
#ifdef ISC_PLATFORM_USETHREADS
1025
1026
		// free lock on dbi so someone else can use it.
1027
		isc_mutex_unlock(&dbi->instance_lock);
1028
#endif
1029
1030
	}
1031
	
1032
	return result;  
1033
}
1034
1035
	/* If the client is allowed to perform a zone transfer, the next order of
1036
	 * business is to get all the nodes in the zone, so bind can respond to the
1037
	 * query.
1038
	 */
1039
1040
isc_result_t
1041
odbc_allnodes(const char *zone, void *driverarg, void *dbdata,
1042
						  dns_sdlzallnodes_t *allnodes)
1043
{
1044
1045
	isc_result_t result;
1046
	dbinstance_t *dbi = NULL;
1047
	SQLHSTMT  *stmnt;
1048
	SQLSMALLINT fields;
1049
	char *data;
1050
	char *type;
1051
	char *ttl_s;
1052
	int ttl;
1053
	char *host;
1054
	char *endp;
1055
1056
   UNUSED(driverarg);
1057
1058
		// run the query and get the result set from the database.
1059
	result = odbc_get_resultset(zone, NULL, NULL, ALLNODES, dbdata, &dbi);
1060
1061
		// if we get "not implemented", send it along
1062
	if(result == ISC_R_NOTIMPLEMENTED)
1063
		return result;
1064
1065
		// if we didn't get a result set, log an err msg.
1066
	if(result != ISC_R_SUCCESS){
1067
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1068
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1069
			"Odbc driver unable to return result set for all nodes query");
1070
		return (ISC_R_FAILURE);
1071
	}
1072
1073
	stmnt = ((odbc_db_t *) (dbi->dbconn))->stmnt;
1074
1075
		// get number of columns
1076
	if(!sqlOK(SQLNumResultCols(stmnt, &fields))){		
1077
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1078
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1079
			"Odbc driver unable to process result set");
1080
		result = ISC_R_FAILURE;
1081
		goto allnodes_cleanup;
1082
	}
1083
1084
	if(fields < 4){	// gotta have at least 4 columns
1085
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1086
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1087
			"Odbc driver too few fields returned by all nodes query");
1088
		result = ISC_R_FAILURE;
1089
		goto allnodes_cleanup;
1090
	}
1091
1092
		// get things ready for processing
1093
	result = ISC_R_FAILURE;
1094
1095
	while(sqlOK(SQLFetch(stmnt))){
1096
1097
			// set to null for next pass through
1098
		data = host = type = ttl_s = NULL;
1099
1100
			// attempt to get DNS ttl, type, host, data then tell Bind about them
1101
		if((result = odbc_getField(stmnt, 1, &ttl_s)) == ISC_R_SUCCESS &&
1102
			(result = odbc_getField(stmnt, 2, &type)) == ISC_R_SUCCESS &&
1103
			(result = odbc_getField(stmnt, 3, &host)) == ISC_R_SUCCESS &&
1104
			(result = odbc_getManyFields(stmnt, 4, fields,&data))==ISC_R_SUCCESS){
1105
				// convert ttl string to int
1106
			ttl = strtol(ttl_s, &endp, 10);
1107
				// failure converting ttl.
1108
			if (*endp != '\0' || ttl < 0){
1109
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1110
					DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1111
					"Odbc driver ttl must be a postive number");
1112
				result = ISC_R_FAILURE;
1113
			} else {
1114
					// successful converting TTL, tell Bind 
1115
				result = dns_sdlz_putnamedrr(allnodes, host,	type,	ttl, data);
1116
			}
1117
		} // closes big if()
1118
1119
					// clean up mem
1120
		if(ttl_s != NULL)
1121
			isc_mem_free(ns_g_mctx, ttl_s);
1122
		if(type != NULL)
1123
			isc_mem_free(ns_g_mctx, type);
1124
		if(host != NULL)
1125
			isc_mem_free(ns_g_mctx, host);
1126
		if(data != NULL)
1127
			isc_mem_free(ns_g_mctx, data);
1128
1129
			// if we weren't successful, log err msg
1130
		if(result != ISC_R_SUCCESS){
1131
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1132
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1133
				"dns_sdlz_putnamedrr returned error. Error code was: %s",
1134
                                                    isc_result_totext(result));
1135
			result = ISC_R_FAILURE;
1136
			goto allnodes_cleanup;
1137
		}
1138
	} // closes while loop
1139
1140
allnodes_cleanup:
1141
1142
			// close cursor
1143
	SQLCloseCursor(((odbc_db_t *) (dbi->dbconn))->stmnt);
1144
1145
#ifdef ISC_PLATFORM_USETHREADS
1146
1147
		// free lock on dbi so someone else can use it.
1148
	isc_mutex_unlock(&dbi->instance_lock);
1149
1150
#endif
1151
1152
   return result;    
1153
}
1154
1155
	/* if the lookup function does not return SOA or NS records for the zone,
1156
	 * use this function to get that information for Bind.
1157
	 */
1158
1159
isc_result_t
1160
odbc_authority(const char *zone, void *driverarg, void *dbdata,
1161
			  dns_sdlzlookup_t *lookup)
1162
{
1163
	isc_result_t result;
1164
	dbinstance_t *dbi = NULL;
1165
1166
   UNUSED(driverarg);
1167
1168
		// run the query and get the result set from the database.
1169
	result = odbc_get_resultset(zone, NULL, NULL, AUTHORITY, dbdata, &dbi);
1170
		// if we get "not implemented", send it along
1171
	if(result == ISC_R_NOTIMPLEMENTED)
1172
		return result;
1173
		// if we didn't get a result set, log an err msg.
1174
	if(result != ISC_R_SUCCESS){
1175
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1176
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1177
			"Odbc driver unable to return result set for authority query");
1178
		return (ISC_R_FAILURE);
1179
	}
1180
		// lookup and authority result sets are processed in the same manner
1181
		// odbc_process_rs does the job for both functions.
1182
	return odbc_process_rs(lookup, dbi);
1183
}
1184
1185
	/* if zone is supported, lookup up a (or multiple) record(s) in it */
1186
1187
isc_result_t
1188
odbc_lookup(const char *zone, const char *name, void *driverarg, 
1189
			void *dbdata, dns_sdlzlookup_t *lookup)
1190
{
1191
   isc_result_t result;
1192
	dbinstance_t *dbi = NULL;
1193
1194
   UNUSED(driverarg);
1195
1196
		// run the query and get the result set from the database.
1197
	result = odbc_get_resultset(zone, name, NULL, LOOKUP, dbdata, &dbi);
1198
		// if we didn't get a result set, log an err msg.
1199
	if(result != ISC_R_SUCCESS){
1200
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1201
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1202
			"Odbc driver unable to return result set for lookup query");
1203
		return (ISC_R_FAILURE);
1204
	}
1205
		// lookup and authority result sets are processed in the same manner
1206
		// odbc_process_rs does the job for both functions.
1207
	return odbc_process_rs(lookup, dbi);  
1208
}
1209
1210
	/* create an instance of the driver.  Remember, only 1 copy of the driver's
1211
	 * code is ever loaded, the driver has to remember which context it's
1212
	 * operating in.  This is done via use of the dbdata arguement which is
1213
	 * passed into all query functions.
1214
	 */
1215
isc_result_t
1216
odbc_create(const char *dlzname, unsigned int argc, char *argv[],
1217
				void *driverarg, void **dbdata)
1218
{
1219
	isc_result_t result;
1220
   odbc_instance_t *odbc_inst = NULL;
1221
	dbinstance_t *db = NULL;
1222
	SQLRETURN sqlRes;
1223
1224
#ifdef ISC_PLATFORM_USETHREADS
1225
		// if multi-threaded, we need a few extra variables.
1226
	int dbcount;
1227
	int i;
1228
	char *endp;
1229
1230
#endif /* ISC_PLATFORM_USETHREADS */
1231
1232
	UNUSED(dlzname);
1233
	UNUSED(driverarg);
1234
1235
#ifdef ISC_PLATFORM_USETHREADS
1236
		// if debugging, let user know we are multithreaded.
1237
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1238
		DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
1239
		"Odbc driver running multithreaded");
1240
#else /* ISC_PLATFORM_USETHREADS */
1241
		// if debugging, let user know we are single threaded.
1242
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1243
		DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
1244
		"Odbc driver running single threaded");
1245
#endif /* ISC_PLATFORM_USETHREADS */
1246
	
1247
		/* verify we have at least 5 arg's passed to the driver */
1248
	if(argc < 5){
1249
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1250
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1251
			"Odbc driver requires at least 4 command line args.");
1252
		return (ISC_R_FAILURE);
1253
	}
1254
1255
		/* no more than 8 arg's should be passed to the driver */
1256
	if(argc > 8){
1257
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1258
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1259
			"Odbc driver cannot accept more than 7 command line args.");
1260
		return (ISC_R_FAILURE);
1261
	}
1262
1263
	// multithreaded build can have multiple DB connections
1264
#ifdef ISC_PLATFORM_USETHREADS
1265
1266
		/* check how many db connections we should create */
1267
	dbcount = strtol(argv[1], &endp, 10);
1268
	if (*endp != '\0' || dbcount < 0){
1269
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1270
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1271
			"Odbc driver database connection count must be positive.");
1272
		return (ISC_R_FAILURE);
1273
	}
1274
1275
#endif /* ISC_PLATFORM_USETHREADS */
1276
1277
    /* allocate memory for odbc instance */
1278
	odbc_inst = isc_mem_get(ns_g_mctx, sizeof(odbc_instance_t));
1279
	if(odbc_inst == NULL)
1280
      return (ISC_R_NOMEMORY);
1281
	memset(odbc_inst, 0, sizeof(odbc_instance_t));
1282
1283
	/* parse connection string and get paramters. */
1284
1285
		// get odbc database dsn - required
1286
	odbc_inst->dsn = (SQLCHAR *) getParameterValue(argv[2], "dsn=");		
1287
	if(odbc_inst->dsn == NULL){
1288
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1289
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1290
			"odbc driver requires a dns parameter.");
1291
		result = ISC_R_FAILURE;
1292
		goto cleanup;
1293
	}
1294
		// get odbc database username
1295
      // if no username was passed, set odbc_inst.user = NULL;
1296
	odbc_inst->user = (SQLCHAR *) getParameterValue(argv[2], "user=");		
1297
1298
		// get odbc database password
1299
      // if no password was passed, set odbc_inst.pass = NULL;
1300
	odbc_inst->pass = (SQLCHAR *) getParameterValue(argv[2], "pass=");		
1301
1302
		// create odbc environment & set environment to ODBC V3
1303
	if(odbc_inst->sql_env == NULL){
1304
			// create environment handle
1305
		sqlRes = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE,
1306
															&(odbc_inst->sql_env));
1307
		if(!sqlOK(sqlRes)){
1308
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1309
			DNS_LOGMODULE_DLZ, ISC_LOG_INFO,
1310
			"Odbc driver unable to allocate memory");
1311
			result = ISC_R_NOMEMORY;
1312
			goto cleanup;
1313
		}
1314
			//set ODBC version = 3
1315
		sqlRes = SQLSetEnvAttr(odbc_inst->sql_env, SQL_ATTR_ODBC_VERSION,
1316
					(void *) SQL_OV_ODBC3, 0);
1317
		if(!sqlOK(sqlRes)){
1318
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1319
			DNS_LOGMODULE_DLZ, ISC_LOG_INFO,
1320
			"Unable to configure ODBC environment");
1321
			result = ISC_R_NOMEMORY;
1322
			goto cleanup;
1323
		}
1324
	}
1325
1326
#ifdef ISC_PLATFORM_USETHREADS
1327
1328
		/* allocate memory for database connection list */
1329
	odbc_inst->db = isc_mem_get(ns_g_mctx, sizeof(db_list_t));
1330
	if (odbc_inst->db == NULL){
1331
      result = ISC_R_NOMEMORY;
1332
      goto cleanup;
1333
  }
1334
1335
1336
		/* initialize DB connection list */
1337
	ISC_LIST_INIT(*odbc_inst->db);
1338
1339
		// create the appropriate number of database instances (DBI)
1340
		// append each new DBI to the end of the list
1341
	for(i=0; i < dbcount; i++){
1342
1343
#endif /* ISC_PLATFORM_USETHREADS */
1344
1345
			// how many queries were passed in from config file?
1346
		switch(argc){
1347
			case 5:
1348
				result = build_sqldbinstance(ns_g_mctx, NULL, NULL, NULL, 
1349
													argv[3], argv[4], NULL, &db);
1350
				break;
1351
			case 6:
1352
				result = build_sqldbinstance(ns_g_mctx, NULL, NULL, argv[5],
1353
													argv[3], argv[4], NULL, &db);
1354
				break;
1355
			case 7:
1356
				result = build_sqldbinstance(ns_g_mctx, argv[6], NULL, argv[5],
1357
													argv[3], argv[4], NULL, &db);
1358
				break;
1359
			case 8:
1360
				result = build_sqldbinstance(ns_g_mctx, argv[6], argv[7], argv[5],
1361
													argv[3], argv[4], NULL, &db);
1362
				break;
1363
			default:
1364
				result = ISC_R_FAILURE;	// not really needed, should shut up compiler.
1365
		}
1366
1367
			// unsuccessful?, log err msg and cleanup.
1368
		if(result != ISC_R_SUCCESS){
1369
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1370
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1371
				"Odbc driver could not create database instance object.");
1372
			goto cleanup;
1373
		}
1374
1375
#ifdef ISC_PLATFORM_USETHREADS
1376
1377
			// when multithreaded, build a list of DBI's
1378
		ISC_LINK_INIT(db, link);
1379
		ISC_LIST_APPEND(*odbc_inst->db, db, link);
1380
1381
#endif
1382
1383
		result = odbc_connect(odbc_inst, (odbc_db_t **) &(db->dbconn));
1384
1385
		if(result != ISC_R_SUCCESS){
1386
1387
#ifdef ISC_PLATFORM_USETHREADS
1388
1389
				// if multi threaded, let user know which connection failed.
1390
				// user could be attempting to create 10 db connections
1391
				// and for some reason the db backend only allows 9
1392
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1393
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1394
				"Odbc driver failed to create database connection number %u after 3 attempts", i+1);
1395
#else
1396
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1397
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1398
				"Odbc driver failed to create database connection after 3 attempts");
1399
#endif
1400
			goto cleanup;
1401
		}
1402
1403
#ifdef ISC_PLATFORM_USETHREADS
1404
1405
			// set DB = null for next loop through.
1406
		db = NULL;
1407
1408
	}	// end for loop
1409
1410
#else
1411
		// tell odbc_inst about the db connection we just created.
1412
	odbc_inst->db = db;
1413
1414
#endif
1415
		
1416
	   // set dbdata to the odbc_instance we created.
1417
	*dbdata = odbc_inst;
1418
  
1419
     // hey, we got through all of that ok, return success.
1420
	return(ISC_R_SUCCESS);
1421
1422
cleanup:
1423
1424
	destroy_odbc_instance(odbc_inst);
1425
1426
	return result;
1427
}
1428
1429
	/* destroy an instance of the driver.  Remember, only 1 copy of the driver's
1430
	 * code is ever loaded, the driver has to remember which context it's
1431
	 * operating in.  This is done via use of the dbdata arguement.
1432
	 * so we really only need to clean it up since we are not using driverarg.
1433
	 */
1434
1435
void
1436
odbc_destroy(void *driverarg, void *dbdata)
1437
{	
1438
	UNUSED(driverarg);
1439
	
1440
	destroy_odbc_instance((odbc_instance_t *) dbdata);
1441
}
1442
1443
1444
	// pointers to all our runtime methods.
1445
	// this is used during driver registration
1446
	// i.e. in dlz_odbc_init below.
1447
static dns_sdlzmethods_t dlz_odbc_methods = {
1448
	odbc_create, 
1449
	odbc_destroy,
1450
	odbc_findzone,
1451
	odbc_lookup,
1452
	odbc_authority,
1453
	odbc_allnodes,
1454
	odbc_allowzonexfr};
1455
1456
/*
1457
 * Wrapper around dns_sdlzregister().
1458
 */
1459
isc_result_t
1460
dlz_odbc_init(void) {
1461
	isc_result_t result;
1462
1463
	/*
1464
	 * Write debugging message to log
1465
	 */
1466
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1467
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
1468
	      "Registering DLZ odbc driver.");
1469
1470
		/* Driver is always threadsafe.  When multithreaded all functions use
1471
		 * multithreaded code.  When not multithreaded, all functions can only
1472
		 * be entered once, but only 1 thread of operation is available in Bind.
1473
		 * So everything is still threadsafe.
1474
		 */
1475
	result = dns_sdlzregister("odbc", &dlz_odbc_methods, NULL, 
1476
							DNS_SDLZFLAG_RELATIVEOWNER | DNS_SDLZFLAG_RELATIVERDATA
1477
							| DNS_SDLZFLAG_THREADSAFE,	ns_g_mctx, &dlz_odbc);
1478
		// if we can't register the driver, there are big problems.
1479
	if(result != ISC_R_SUCCESS){
1480
		UNEXPECTED_ERROR(__FILE__, __LINE__,
1481
				 "dns_sdlzregister() failed: %s",
1482
				 isc_result_totext(result));
1483
		result = ISC_R_UNEXPECTED;
1484
	}
1485
1486
1487
	return result;
1488
}
1489
1490
/*
1491
 * Wrapper around dns_sdlzunregister().
1492
 */
1493
void
1494
dlz_odbc_clear(void) {
1495
1496
	/*
1497
	 * Write debugging message to log
1498
	 */
1499
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1500
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
1501
	      "Unregistering DLZ odbc driver.");
1502
1503
		// unregister the driver.
1504
	if (dlz_odbc != NULL)
1505
		dns_sdlzunregister(&dlz_odbc);
1506
}
1507
1508
#endif
1509
(-)bind-9.2.2-orig/bin/named/dlz_postgres_driver.c (+1171 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
/*
37
 * Copyright (C) 1999-2001  Internet Software Consortium.
38
 *
39
 * Permission to use, copy, modify, and distribute this software for any
40
 * purpose with or without fee is hereby granted, provided that the above
41
 * copyright notice and this permission notice appear in all copies.
42
 *
43
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
44
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
45
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
46
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
47
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
48
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
50
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
51
 */
52
53
#ifdef DLZ_POSTGRES
54
55
#include <config.h>
56
#include <stdio.h>
57
#include <string.h>
58
#include <stdlib.h>
59
60
#include <dns/log.h>
61
#include <dns/sdlz.h>
62
#include <dns/result.h>
63
64
#include <isc/mem.h>
65
#include <isc/platform.h>
66
#include <isc/print.h>
67
#include <isc/result.h>
68
#include <isc/string.h>
69
#include <isc/util.h>
70
71
#include <named/globals.h>
72
#include <named/dlz_postgres_driver.h>
73
#include <named/sdlz_helper.h>
74
75
#include <libpq-fe.h>
76
77
dns_sdlzimplementation_t *dlz_postgres = NULL;
78
79
#define dbc_search_limit 30
80
#define ALLNODES 1
81
#define ALLOWXFR 2
82
#define AUTHORITY 3
83
#define FINDZONE 4
84
#define LOOKUP 5
85
86
/***
87
 *** method prototypes
88
 *** Declared here to shut up compiler warnings
89
 *** about "no previous prototype"
90
 ***/
91
92
size_t
93
postgres_makesafe(char *to, const char *from, size_t length);
94
95
void 
96
postgres_destroy_dblist(db_list_t *dblist);
97
98
dbinstance_t *
99
postgres_find_avail_conn(db_list_t *dblist);
100
101
char *
102
postgres_escape_string(const char *instr);
103
104
isc_result_t
105
postgres_get_resultset(const char *zone, const char *record,
106
			   const char *client, unsigned int query,
107
				   void *dbdata, PGresult **rs);
108
109
isc_result_t
110
postgres_process_rs(dns_sdlzlookup_t *lookup, PGresult *rs);
111
112
isc_result_t
113
postgres_findzone(void *driverarg, void *dbdata, const char *name);
114
115
isc_result_t
116
postgres_allowzonexfr(void *driverarg, void *dbdata, const char *name,
117
						const char *client);
118
119
isc_result_t
120
postgres_allnodes(const char *zone, void *driverarg, void *dbdata,
121
					dns_sdlzallnodes_t *allnodes);
122
123
isc_result_t
124
postgres_authority(const char *zone, void *driverarg, void *dbdata,
125
			  		dns_sdlzlookup_t *lookup);
126
127
isc_result_t
128
postgres_lookup(const char *zone, const char *name, void *driverarg, 
129
			void *dbdata, dns_sdlzlookup_t *lookup);
130
131
isc_result_t
132
postgres_create(const char *dlzname, unsigned int argc, char *argv[],
133
				void *driverarg, void **dbdata);
134
135
void
136
postgres_destroy(void *driverarg, void *dbdata);
137
138
/***
139
 *** Private methods
140
 ***/
141
142
/* ---------------
143
 * Escaping arbitrary strings to get valid SQL strings/identifiers.
144
 *
145
 * Replaces "\\" with "\\\\" and "'" with "''".
146
 * length is the length of the buffer pointed to by
147
 * from.  The buffer at to must be at least 2*length + 1 characters
148
 * long.  A terminating NUL character is written.
149
 *
150
 * NOTICE!!!
151
 * This function was borrowed directly from PostgreSQL's libpq.
152
 * The function was originally called PQescapeString and renamed
153
 * to postgres_makesafe to avoid a naming collision.
154
 * PQescapeString is a new function made available in Postgres 7.2.
155
 * For some reason the function is not properly exported on Win32
156
 * builds making the function unavailable on Windows.  Also, since
157
 * this function is new it would require building this driver with
158
 * the libpq 7.2.  By borrowing this function the Windows problem
159
 * is solved, and the dependence on libpq 7.2 is removed.  Libpq is
160
 * still required of course, but an older version should work now too.
161
 *
162
 * The copyright statements from the original file containing this
163
 * function are included below:
164
 * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
165
 * Portions Copyright (c) 1994, Regents of the University of California
166
 * ---------------
167
 */
168
169
size_t
170
postgres_makesafe(char *to, const char *from, size_t length)
171
{
172
	const char *source = from;
173
	char	   *target = to;
174
	unsigned int remaining = length;
175
176
	while (remaining > 0)
177
	{
178
		switch (*source)
179
		{
180
			case '\\':
181
				*target = '\\';
182
				target++;
183
				*target = '\\';
184
				/* target and remaining are updated below. */
185
				break;
186
187
			case '\'':
188
				*target = '\'';
189
				target++;
190
				*target = '\'';
191
				/* target and remaining are updated below. */
192
				break;
193
194
			default:
195
				*target = *source;
196
				/* target and remaining are updated below. */
197
		}
198
		source++;
199
		target++;
200
		remaining--;
201
	}
202
203
	/* Write the terminating NUL character. */
204
	*target = '\0';
205
206
	return target - to;
207
}
208
209
#ifdef ISC_PLATFORM_USETHREADS
210
211
	/* Properly cleans up a list of database instances.
212
	 * This function is only used when the driver is compiled for
213
	 * multithreaded operation.
214
	 */
215
void 
216
postgres_destroy_dblist(db_list_t *dblist)
217
{
218
219
	dbinstance_t *ndbi = NULL;
220
	dbinstance_t *dbi = NULL;
221
222
		// get the first DBI in the list
223
	ndbi = ISC_LIST_HEAD(*dblist);
224
	
225
		// loop through the list
226
	while(ndbi != NULL){
227
		dbi = ndbi;
228
			// get the next DBI in the list
229
		ndbi = ISC_LIST_NEXT(dbi, link);
230
			// release DB connection
231
		if(dbi->dbconn != NULL)
232
			PQfinish((PGconn *) dbi->dbconn);
233
			// release all memory that comprised a DBI
234
		destroy_sqldbinstance(dbi);
235
	}
236
		// release memory for the list structure
237
	isc_mem_put(ns_g_mctx, dblist, sizeof(db_list_t));
238
}
239
240
	/* Loops through the list of DB instances, attempting to lock
241
	 * on the mutex.  If successful, the DBI is reserved for use
242
	 * and the thread can perform queries against the database.
243
	 * If the lock fails, the next one in the list is tried.
244
	 * looping continues until a lock is obtained, or until
245
	 * the list has been searched dbc_search_limit times.
246
	 * This function is only used when the driver is compiled for
247
	 * multithreaded operation.
248
	 */
249
250
dbinstance_t *
251
postgres_find_avail_conn(db_list_t *dblist)
252
{
253
	dbinstance_t *dbi = NULL;
254
	dbinstance_t *head;
255
	int count = 0;
256
257
		// get top of list
258
	head = dbi = ISC_LIST_HEAD(*dblist);
259
260
		// loop through list
261
	while(count < dbc_search_limit){
262
			// try to lock on the mutex
263
		if(isc_mutex_trylock(&dbi->instance_lock) == ISC_R_SUCCESS)
264
			return dbi;		// success, return the DBI for use.
265
266
			// not successful, keep trying
267
		dbi = ISC_LIST_NEXT(dbi, link);
268
269
			// check to see if we have gone to the top of the list.
270
		if(dbi == NULL){
271
			count++;
272
			dbi = head;
273
		}
274
	}
275
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
276
		DNS_LOGMODULE_DLZ, ISC_LOG_INFO,
277
		"Postgres driver unable to find available connection after searching %d times",
278
		count);
279
	return NULL;
280
}
281
282
#endif /* ISC_PLATFORM_USETHREADS */
283
284
	/* Allocates memory for a new string, and then constructs the new
285
	 * string by "escaping" the input string.  The new string is
286
	 * safe to be used in queries.  This is necessary because we cannot
287
	 * be sure of what types of strings are passed to us, and we don't
288
	 * want special characters in the string causing problems.
289
	 */
290
291
char *
292
postgres_escape_string(const char *instr){
293
294
	char *outstr;
295
	unsigned int len;
296
297
	if(instr == NULL)
298
		return NULL;
299
300
	len = strlen(instr);
301
302
	outstr = isc_mem_allocate(ns_g_mctx ,(2 * len * sizeof(char)) + 1);
303
	if(outstr == NULL)
304
		return NULL;
305
306
	postgres_makesafe(outstr, instr, len);
307
//    PQescapeString(outstr, instr, len);
308
309
	return outstr;
310
}
311
312
	/* This function is the real core of the driver.   Zone, record
313
	 * and client strings are passed in (or NULL is passed if the
314
	 * string is not available).  The type of query we want to run
315
	 * is indicated by the query flag, and the dbdata object is passed
316
	 * passed in to.  dbdata really holds either:
317
	 *		1) a list of database instances (in multithreaded mode) OR
318
	 *		2) a single database instance (in single threaded mode)
319
	 * The function will construct the query and obtain an available
320
	 * database instance (DBI).  It will then run the query and hopefully
321
	 * obtain a result set.  Postgres is nice, in that once the result
322
	 * set is returned, we can make the db connection available for another
323
	 * thread to use, while this thread continues on.  So, the DBI is made
324
	 * available ASAP by unlocking the instance_lock after we have cleaned
325
	 * it up properly.
326
	 */
327
isc_result_t
328
postgres_get_resultset(const char *zone, const char *record,
329
					   const char *client, unsigned int query,
330
					   void *dbdata, PGresult **rs)
331
{
332
    isc_result_t result;
333
	dbinstance_t *dbi = NULL;
334
	char *querystring = NULL;
335
	unsigned int i = 0;
336
	unsigned int j = 0;
337
338
	REQUIRE(*rs == NULL);
339
340
		// get db instance / connection
341
#ifdef ISC_PLATFORM_USETHREADS
342
343
		// find an available DBI from the list
344
	dbi = postgres_find_avail_conn((db_list_t *) dbdata);
345
346
#else /* ISC_PLATFORM_USETHREADS */
347
348
		// only 1 DBI - no need to lock instance lock either
349
		// only 1 thread in the whole process, no possible contention.
350
	dbi =  (dbinstance_t *) dbdata;
351
352
#endif /* ISC_PLATFORM_USETHREADS */
353
354
		// if DBI is null, can't do anything else
355
	if(dbi == NULL){
356
		result = ISC_R_FAILURE;
357
		goto cleanup;
358
	}
359
360
		// what type of query are we going to run?
361
	switch(query){
362
		case ALLNODES:
363
				// if the query was not passed in from the config file
364
				// then we can't run it.  return not_implemented,
365
				// so it's like the code for that operation
366
				// was never built into the driver.... AHHH  flexibility!!!
367
			if(dbi->allnodes_q == NULL){
368
				result = ISC_R_NOTIMPLEMENTED;
369
				goto cleanup;
370
			}
371
			break;				
372
		case ALLOWXFR:
373
				// same as comments as ALLNODES
374
			if(dbi->allowxfr_q == NULL){
375
				result = ISC_R_NOTIMPLEMENTED;
376
				goto cleanup;
377
			}
378
			break;
379
		case AUTHORITY:
380
				// same as comments as ALLNODES
381
			if(dbi->authority_q == NULL){
382
				result = ISC_R_NOTIMPLEMENTED;
383
				goto cleanup;
384
			}
385
			break;
386
		case FINDZONE:
387
				// this is required.  It's the whole point of DLZ!
388
			if(dbi->findzone_q == NULL){
389
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
390
					  DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
391
					  "No query specified for findzone.  Findzone requires a query");
392
				result = ISC_R_FAILURE;
393
				goto cleanup;
394
			}
395
			break;
396
		case LOOKUP:
397
				// this is required.  It's also a major point of DLZ!
398
			if(dbi->lookup_q == NULL){
399
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
400
					  DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
401
					  "No query specified for lookup.  Lookup requires a query");
402
				result = ISC_R_FAILURE;
403
				goto cleanup;
404
			}
405
			break;
406
		default:
407
				// this should never happen.  If it does, the code is screwed up!
408
			UNEXPECTED_ERROR(__FILE__, __LINE__,
409
				 "Incorrect query flag passed to postgres_get_resultset");
410
			result = ISC_R_UNEXPECTED;
411
			goto cleanup;
412
	}
413
414
415
		// was a zone string passed?  If so, make it safe for use in queries.
416
	if(zone != NULL){
417
		dbi->zone = postgres_escape_string(zone);
418
		if(dbi->zone == NULL){
419
			result = ISC_R_NOMEMORY;
420
			goto cleanup;
421
		}
422
	} else {	// no string passed, set the string pointer to NULL
423
		dbi->zone = NULL;
424
	}
425
426
		// was a record string passed?  If so, make it safe for use in queries.
427
	if(record != NULL){
428
		dbi->record = postgres_escape_string(record);
429
		if(dbi->record == NULL){
430
			result = ISC_R_NOMEMORY;
431
			goto cleanup;
432
		}
433
	} else {	// no string passed, set the string pointer to NULL
434
		dbi->record = NULL;
435
	}
436
437
		// was a client string passed?  If so, make it safe for use in queries.
438
	if(client != NULL){
439
		dbi->client = postgres_escape_string(client);
440
		if(dbi->client == NULL){
441
			result = ISC_R_NOMEMORY;
442
			goto cleanup;
443
		}
444
	} else {	// no string passed, set the string pointer to NULL
445
		dbi->client = NULL;
446
	}
447
448
		// what type of query are we going to run?
449
		// this time we build the actual query to run.
450
	switch(query){
451
		case ALLNODES:
452
			querystring = build_querystring(ns_g_mctx, dbi->allnodes_q);
453
			break;
454
		case ALLOWXFR:
455
			querystring = build_querystring(ns_g_mctx, dbi->allowxfr_q);
456
			break;
457
		case AUTHORITY:
458
			querystring = build_querystring(ns_g_mctx, dbi->authority_q);
459
			break;
460
		case FINDZONE:
461
			querystring = build_querystring(ns_g_mctx, dbi->findzone_q);
462
			break;
463
		case LOOKUP:
464
			querystring = build_querystring(ns_g_mctx, dbi->lookup_q);
465
			break;
466
		default:
467
				// this should never happen.  If it does, the code is screwed up!
468
			UNEXPECTED_ERROR(__FILE__, __LINE__,
469
				 "Incorrect query flag passed to postgres_get_resultset");
470
			result = ISC_R_UNEXPECTED;
471
			goto cleanup;
472
	}
473
474
		// if the querystring is null, Bummer, outta RAM.  UPGRADE TIME!!!  
475
	if(querystring  == NULL){
476
		result = ISC_R_NOMEMORY;
477
		goto cleanup;
478
	}
479
480
		// output the full query string during debug so we can see
481
		// what lame error the query has.
482
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
483
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
484
	      "\nQuery String: %s\n", querystring);
485
486
		// attempt query up to 3 times.
487
	for(j=0; j < 3; j++){
488
			// try to get result set
489
		*rs = PQexec((PGconn *)dbi->dbconn, querystring );
490
		result = ISC_R_SUCCESS;
491
			// if result set is null, reset DB connection, max 3 attempts.
492
		for(i=0; *rs == NULL && i < 3; i++){
493
			result = ISC_R_FAILURE;
494
			PQreset((PGconn *) dbi->dbconn);
495
				// connection ok, break inner loop
496
			if(PQstatus((PGconn *) dbi->dbconn) == CONNECTION_OK)
497
				 break;
498
		}
499
			// result set ok, break outter loop
500
		if(PQresultStatus(*rs) == PGRES_TUPLES_OK)
501
			break;
502
		else{	// we got a result set object, but it's not right.
503
			PQclear(*rs);	// get rid of it
504
			result = ISC_R_FAILURE;	// incase this was the last attempt
505
		}
506
	}
507
508
cleanup:	// it's always good to cleanup after yourself
509
510
		// if we couldn't even allocate DBI, just return NULL
511
	if(dbi == NULL)
512
		return ISC_R_FAILURE;
513
514
		// free dbi->zone string
515
	if(dbi->zone != NULL)
516
		isc_mem_free(ns_g_mctx, dbi->zone);
517
518
		// free dbi->record string
519
	if(dbi->record != NULL)
520
		isc_mem_free(ns_g_mctx, dbi->record);
521
522
		// free dbi->client string
523
	if(dbi->client != NULL)
524
		isc_mem_free(ns_g_mctx, dbi->client);
525
526
#ifdef ISC_PLATFORM_USETHREADS
527
528
		// release the lock so another thread can use this dbi
529
	isc_mutex_unlock(&dbi->instance_lock);
530
531
#endif /* ISC_PLATFORM_USETHREADS */
532
533
		// release query string
534
	if(querystring  != NULL)
535
		isc_mem_free(ns_g_mctx, querystring );
536
537
		// return result
538
	return result;
539
}
540
541
	/* The processing of result sets for lookup and authority are
542
	 * exactly the same.  So that functionality has been moved
543
	 * into this function to minimize code.
544
	 */
545
546
isc_result_t
547
postgres_process_rs(dns_sdlzlookup_t *lookup, PGresult *rs)
548
{
549
	isc_result_t result;
550
	unsigned int i;
551
	unsigned int rows;
552
	unsigned int fields;
553
	unsigned int j;
554
	unsigned int len;
555
	char *tmpString;
556
	char *endp;
557
	int ttl;
558
559
	rows = PQntuples(rs);	// how many rows in result set
560
	fields = PQnfields(rs);	// how many columns in result set
561
	for(i=0; i < rows; i++){
562
		switch(fields){
563
			case 1:		// one column in rs, it's the data field
564
						// use default type of A record, and default TTL of 86400
565
				result = dns_sdlz_putrr(lookup, "a", 86400, PQgetvalue(rs, i, 0));
566
				break;
567
			case 2:		// two columns, data field, and data type.
568
						// use default TTL of 86400
569
				result = dns_sdlz_putrr(lookup, PQgetvalue(rs, i, 0), 
570
										86400, PQgetvalue(rs, i, 1));
571
				break;
572
			case 3:		// three columns, all data no defaults
573
					// convert text to int, make sure it worked right
574
				ttl = strtol(PQgetvalue(rs, i, 0), &endp, 10);
575
				if (*endp != '\0' || ttl < 0){
576
					isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
577
						DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
578
						"Postgres driver ttl must be a postive number");
579
				}
580
				result = dns_sdlz_putrr(lookup, PQgetvalue(rs, i, 1),
581
									ttl, PQgetvalue(rs, i, 2));
582
				break;
583
			default:	// more than 3 fields, concatonate the last ones together.
584
					// figure out how long to make string
585
				for(j=2, len=0; j < fields; j++){
586
					len += strlen(PQgetvalue(rs, i, j)) + 1;
587
				}
588
					// allocate string memory, allow for NULL to term string
589
				tmpString = isc_mem_allocate(ns_g_mctx, len + 1); 
590
				if(tmpString == NULL){	// major bummer, need more ram
591
					isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
592
						DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
593
						"Postgres driver unable to allocate memory for temporary string");
594
					PQclear(rs);	// can't use it now, get rid of it.
595
					return (ISC_R_FAILURE);	// Yeah, I'd say!
596
				}
597
					// copy field to tmpString
598
				strcpy(tmpString, PQgetvalue(rs, i, 2));
599
					// concat the rest of fields together, space between each one.
600
				for(j=3; j < fields; j++){
601
					strcat(tmpString, " ");
602
					strcat(tmpString, PQgetvalue(rs, i, j));
603
				}
604
					// convert text to int, make sure it worked right
605
				ttl = strtol(PQgetvalue(rs, i, 0), &endp, 10);
606
				if (*endp != '\0' || ttl < 0){
607
					isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
608
						DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
609
						"Postgres driver ttl must be a postive number");
610
				}
611
					// ok, now tell Bind about it.
612
				result = dns_sdlz_putrr(lookup, PQgetvalue(rs, i, 1),
613
									ttl, tmpString);
614
					// done, get rid of this thing.
615
				isc_mem_free(ns_g_mctx, tmpString);
616
		}
617
			// I sure hope we were successful
618
		if(result != ISC_R_SUCCESS){
619
			PQclear(rs);	// nope, get rid of the Result set, and log a msg
620
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
621
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
622
				"dns_sdlz_putrr returned error. Error code was: %s",
623
                                                isc_result_totext(result));
624
			return (ISC_R_FAILURE);
625
		}
626
	}
627
628
		// free result set memory
629
	PQclear(rs);
630
631
		// if we did return results, we are successful
632
	if(rows > 0)
633
		return (ISC_R_SUCCESS);
634
635
		// empty result set, no data found
636
	return (ISC_R_NOTFOUND);
637
}
638
639
/***
640
 *** SDLZ interface methods
641
 ***/
642
643
	/* determine if the zone is supported by (in) the database */
644
645
isc_result_t
646
postgres_findzone(void *driverarg, void *dbdata, const char *name)
647
{
648
	isc_result_t result;
649
	PGresult *rs = NULL;
650
	unsigned int rows;
651
    UNUSED(driverarg);
652
653
		// run the query and get the result set from the database.
654
	result = postgres_get_resultset(name, NULL, NULL, FINDZONE, dbdata, &rs);
655
		// if we didn't get a result set, log an err msg.
656
	if(result != ISC_R_SUCCESS){
657
		if(rs != NULL)
658
			PQclear(rs);
659
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
660
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
661
			"Postgres driver unable to return result set for findzone query");
662
		return (ISC_R_FAILURE);
663
	}
664
		// count how many rows in result set
665
	rows = PQntuples(rs);
666
		// get rid of result set, we are done with it.
667
	PQclear(rs);
668
669
		// if we returned any rows, zone is supported.
670
	if(rows > 0)
671
		return (ISC_R_SUCCESS);
672
673
		// no rows returned, zone is not supported.
674
	return (ISC_R_NOTFOUND);
675
}
676
677
	/* Determine if the client is allowed to perform a zone transfer */
678
isc_result_t
679
postgres_allowzonexfr(void *driverarg, void *dbdata, const char *name,
680
															const char *client)
681
{
682
	isc_result_t result;
683
	PGresult *rs = NULL;
684
	unsigned int rows;
685
   UNUSED(driverarg);
686
687
		// first check if the zone is supported by the database.
688
	result = postgres_findzone(driverarg, dbdata, name);
689
	if(result != ISC_R_SUCCESS)
690
		return (ISC_R_NOTFOUND);
691
692
	// if we get to this point we know the zone is supported by the database
693
	// the only questions now are is the zone transfer is allowed for this client
694
	// and did the config file have an allow zone xfr query
695
696
		// Run our query, and get a result set from the database.
697
	result = postgres_get_resultset(name, NULL, client, ALLOWXFR, dbdata, &rs);
698
		// if we get "not implemented", send it along.
699
	if(result == ISC_R_NOTIMPLEMENTED)
700
		return result;
701
		// if we didn't get a result set, log an err msg.
702
	if(result != ISC_R_SUCCESS){
703
		if(rs != NULL)
704
			PQclear(rs);
705
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
706
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
707
			"Postgres driver unable to return result set for allow xfr query");
708
		return (ISC_R_FAILURE);
709
	}
710
		// count how many rows in result set
711
	rows = PQntuples(rs);
712
		// get rid of result set, we are done with it.
713
	PQclear(rs);
714
715
		// if we returned any rows, zone xfr is allowed.
716
	if(rows > 0)
717
		return (ISC_R_SUCCESS);
718
	
719
		// no rows returned, zone xfr not allowed
720
	return (ISC_R_NOPERM);
721
}
722
723
	/* If the client is allowed to perform a zone transfer, the next order of
724
	 * business is to get all the nodes in the zone, so bind can respond to the
725
	 * query.
726
	 */
727
isc_result_t
728
postgres_allnodes(const char *zone, void *driverarg, void *dbdata,
729
						  dns_sdlzallnodes_t *allnodes)
730
{
731
	isc_result_t result;
732
	PGresult *rs = NULL;
733
	unsigned int i;
734
	unsigned int rows;
735
	unsigned int fields;
736
	unsigned int j;
737
	unsigned int len;
738
	char *tmpString;
739
	char *endp;
740
	int ttl;
741
742
    UNUSED(driverarg);
743
744
		// run the query and get the result set from the database.
745
	result = postgres_get_resultset(zone, NULL, NULL, ALLNODES, dbdata, &rs);
746
		// if we get "not implemented", send it along
747
	if(result == ISC_R_NOTIMPLEMENTED)
748
		return result;
749
		// if we didn't get a result set, log an err msg.
750
	if(result != ISC_R_SUCCESS){
751
		if(rs != NULL)
752
			PQclear(rs);
753
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
754
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
755
			"Postgres driver unable to return result set for all nodes query");
756
		return (ISC_R_FAILURE);
757
	}
758
759
	rows = PQntuples(rs);	// how many rows in result set
760
	fields = PQnfields(rs);	// how many columns in result set
761
	for(i=0; i < rows; i++){
762
		if(fields < 4){	// gotta have at least 4 columns
763
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
764
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
765
				"Postgres driver too few fields returned by all nodes query");
766
		}
767
			// convert text to int, make sure it worked right 
768
		ttl = strtol(PQgetvalue(rs, i, 0), &endp, 10);
769
		if (*endp != '\0' || ttl < 0){
770
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
771
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
772
				"Postgres driver ttl must be a postive number");
773
		}
774
		if(fields == 4){
775
				// tell Bind about it.
776
			result = dns_sdlz_putnamedrr(allnodes, PQgetvalue(rs, i, 2),
777
						PQgetvalue(rs, i, 1), ttl, PQgetvalue(rs, i, 3));
778
		} else {  // more than 4 fields, concatonat the last ones together.
779
			// figure out how long to make string
780
			for(j=3, len=0; j < fields; j++){
781
				len += strlen(PQgetvalue(rs, i, j)) + 1;
782
			}
783
				// allocate memory, allow for NULL to term string
784
			tmpString = isc_mem_allocate(ns_g_mctx, len + 1); 
785
			if(tmpString == NULL){	// we need more ram.
786
				isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
787
					DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
788
					"Postgres driver unable to allocate memory for temporary string");
789
				PQclear(rs);
790
				return (ISC_R_FAILURE);
791
			}
792
				// copy this field to tmpString
793
			strcpy(tmpString, PQgetvalue(rs, i, 3));
794
				// concatonate the rest, with spaces between
795
			for(j=4; j < fields; j++){
796
				strcat(tmpString, " ");
797
				strcat(tmpString, PQgetvalue(rs, i, j));
798
			}
799
				// tell Bind about it.
800
			result = dns_sdlz_putnamedrr(allnodes, PQgetvalue(rs, i, 2),
801
				PQgetvalue(rs, i, 1), ttl, tmpString);
802
			isc_mem_free(ns_g_mctx, tmpString);
803
		}
804
			// if we weren't successful, log err msg
805
		if(result != ISC_R_SUCCESS){
806
			PQclear(rs);
807
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
808
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
809
				"dns_sdlz_putnamedrr returned error. Error code was: %s",
810
                                                    isc_result_totext(result));
811
			return (ISC_R_FAILURE);
812
		}
813
	}
814
815
		// free result set memory
816
	PQclear(rs);
817
818
		// if we did return results, we are successful
819
	if(rows > 0)
820
		return (ISC_R_SUCCESS);
821
822
		// empty result set, no data found
823
	return (ISC_R_NOTFOUND);
824
}
825
826
	/* if the lookup function does not return SOA or NS records for the zone,
827
	 * use this function to get that information for Bind.
828
	 */
829
830
isc_result_t
831
postgres_authority(const char *zone, void *driverarg, void *dbdata,
832
			  dns_sdlzlookup_t *lookup)
833
{
834
	isc_result_t result;
835
	PGresult *rs = NULL;
836
837
    UNUSED(driverarg);
838
839
		// run the query and get the result set from the database.
840
	result = postgres_get_resultset(zone, NULL, NULL, AUTHORITY, dbdata, &rs);
841
		// if we get "not implemented", send it along
842
	if(result == ISC_R_NOTIMPLEMENTED)
843
		return result;
844
		// if we didn't get a result set, log an err msg.
845
	if(result != ISC_R_SUCCESS){
846
		if(rs != NULL)
847
			PQclear(rs);
848
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
849
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
850
			"Postgres driver unable to return result set for authority query");
851
		return (ISC_R_FAILURE);
852
	}
853
		// lookup and authority result sets are processed in the same manner
854
		// postgres_process_rs does the job for both functions.
855
	return postgres_process_rs(lookup, rs);
856
}
857
858
	/* if zone is supported, lookup up a (or multiple) record(s) in it */
859
isc_result_t
860
postgres_lookup(const char *zone, const char *name, void *driverarg, 
861
			void *dbdata, dns_sdlzlookup_t *lookup)
862
{
863
	isc_result_t result;
864
	PGresult *rs = NULL;
865
866
    UNUSED(driverarg);
867
868
		// run the query and get the result set from the database.
869
	result = postgres_get_resultset(zone, name, NULL, LOOKUP, dbdata, &rs);
870
		// if we didn't get a result set, log an err msg.
871
	if(result != ISC_R_SUCCESS){
872
		if(rs != NULL)
873
			PQclear(rs);
874
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
875
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
876
			"Postgres driver unable to return result set for lookup query");
877
		return (ISC_R_FAILURE);
878
	}
879
		// lookup and authority result sets are processed in the same manner
880
		// postgres_process_rs does the job for both functions.
881
	return postgres_process_rs(lookup, rs);
882
}
883
884
	/* create an instance of the driver.  Remember, only 1 copy of the driver's
885
	 * code is ever loaded, the driver has to remember which context it's
886
	 * operating in.  This is done via use of the dbdata arguement which is
887
	 * passed into all query functions.
888
	 */
889
isc_result_t
890
postgres_create(const char *dlzname, unsigned int argc, char *argv[],
891
				void *driverarg, void **dbdata)
892
{
893
	isc_result_t result;
894
	dbinstance_t *dbi = NULL;
895
	unsigned int j;
896
897
#ifdef ISC_PLATFORM_USETHREADS
898
		// if multi-threaded, we need a few extra variables.
899
	int dbcount;
900
	db_list_t *dblist = NULL;
901
	int i;
902
	char *endp;
903
904
#endif /* ISC_PLATFORM_USETHREADS */
905
906
	UNUSED(driverarg);
907
   UNUSED(dlzname);
908
909
#ifdef ISC_PLATFORM_USETHREADS
910
		// if debugging, let user know we are multithreaded.
911
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
912
		DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
913
		"Postgres driver running multithreaded");
914
#else /* ISC_PLATFORM_USETHREADS */
915
		// if debugging, let user know we are single threaded.
916
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
917
		DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
918
		"Postgres driver running single threaded");
919
#endif /* ISC_PLATFORM_USETHREADS */
920
	
921
		/* verify we have at least 5 arg's passed to the driver */
922
	if(argc < 5){
923
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
924
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
925
			"Postgres driver requires at least 4 command line args.");
926
		return (ISC_R_FAILURE);
927
	}
928
929
		/* no more than 8 arg's should be passed to the driver */
930
	if(argc > 8){
931
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
932
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
933
			"Postgres driver cannot accept more than 7 command line args.");
934
		return (ISC_R_FAILURE);
935
	}
936
937
	// multithreaded build can have multiple DB connections
938
#ifdef ISC_PLATFORM_USETHREADS
939
940
		/* check how many db connections we should create */
941
	dbcount = strtol(argv[1], &endp, 10);
942
	if (*endp != '\0' || dbcount < 0){
943
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
944
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
945
			"Postgres driver database connection count must be positive.");
946
		return (ISC_R_FAILURE);
947
	}
948
949
		/* allocate memory for database connection list */
950
	dblist = isc_mem_get(ns_g_mctx, sizeof(db_list_t));
951
	if (dblist == NULL)
952
		return (ISC_R_NOMEMORY);
953
954
		/* initialize DB connection list */
955
	ISC_LIST_INIT(*dblist);
956
957
		// create the appropriate number of database instances (DBI)
958
		// append each new DBI to the end of the list
959
	for(i=0; i < dbcount; i++){
960
961
#endif /* ISC_PLATFORM_USETHREADS */
962
963
			// how many queries were passed in from config file?
964
		switch(argc){
965
			case 5:
966
				result = build_sqldbinstance(ns_g_mctx, NULL, NULL, NULL, 
967
													argv[3], argv[4], NULL, &dbi);
968
				break;
969
			case 6:
970
				result = build_sqldbinstance(ns_g_mctx, NULL, NULL, argv[5],
971
													argv[3], argv[4], NULL, &dbi);
972
				break;
973
			case 7:
974
				result = build_sqldbinstance(ns_g_mctx, argv[6], NULL, argv[5],
975
													argv[3], argv[4], NULL, &dbi);
976
				break;
977
			case 8:
978
				result = build_sqldbinstance(ns_g_mctx, argv[6], argv[7], argv[5],
979
													argv[3], argv[4], NULL, &dbi);
980
				break;
981
			default:
982
				result = ISC_R_FAILURE;	// not really needed, should shut up compiler.
983
		}
984
985
			
986
		if(result == ISC_R_SUCCESS){
987
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
988
				DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
989
				"Postgres driver created database instance object.");
990
		} else { // unsuccessful?, log err msg and cleanup.
991
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
992
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
993
				"Postgres driver could not create database instance object.");
994
			goto cleanup;
995
		}
996
997
#ifdef ISC_PLATFORM_USETHREADS
998
999
			// when multithreaded, build a list of DBI's
1000
		ISC_LINK_INIT(dbi, link);
1001
		ISC_LIST_APPEND(*dblist, dbi, link);
1002
1003
#endif
1004
1005
			// create and set db connection
1006
		dbi->dbconn = PQconnectdb(argv[2]);
1007
			// if db connection cannot be created, log err msg and cleanup.
1008
		if(dbi->dbconn == NULL){
1009
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1010
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1011
				"Postgres driver could not allocate memory for database connection");
1012
			goto cleanup;
1013
		}
1014
1015
			// if we cannot connect the first time, try 3 more times.
1016
		for(j=0; PQstatus((PGconn *) dbi->dbconn) != CONNECTION_OK && j < 3; j++)
1017
			PQreset((PGconn *) dbi->dbconn);
1018
1019
1020
#ifdef ISC_PLATFORM_USETHREADS
1021
1022
			// if multi threaded, let user know which connection failed.
1023
			// user could be attempting to create 10 db connections
1024
			// and for some reason the db backend only allows 9
1025
		if(PQstatus((PGconn *) dbi->dbconn) != CONNECTION_OK){
1026
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1027
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1028
				"Postgres driver failed to create database connection number %u after 4 attempts", i+1);
1029
			goto cleanup;
1030
		}
1031
1032
			// set DBI = null for next loop through.
1033
		dbi = NULL;
1034
	}	// end for loop
1035
1036
		// set dbdata to the list we created.
1037
	*dbdata = dblist;
1038
1039
#else /* ISC_PLATFORM_USETHREADS */
1040
			// if single threaded, just let user know we couldn't connect.
1041
		if(PQstatus((PGconn *) dbi->dbconn) != CONNECTION_OK){
1042
			isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1043
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1044
				"Postgres driver failed to create database connection after 4 attempts");
1045
			goto cleanup;
1046
		}
1047
1048
		// single threaded build can only use 1 db connection, return it via dbdata
1049
	*dbdata = dbi;
1050
1051
#endif /* ISC_PLATFORM_USETHREADS */
1052
1053
		// hey, we got through all of that ok, return success.
1054
	return(ISC_R_SUCCESS);
1055
1056
cleanup:
1057
1058
#ifdef ISC_PLATFORM_USETHREADS
1059
		// if multithreaded, we could fail because only 1 connection 
1060
		// couldn't be made.  We should cleanup the other successful
1061
		// connections properly.
1062
	postgres_destroy_dblist(dblist);
1063
1064
#else /* ISC_PLATFORM_USETHREADS */
1065
	if(dbi != NULL)
1066
		destroy_sqldbinstance(dbi);
1067
1068
#endif /* ISC_PLATFORM_USETHREADS */
1069
	return(ISC_R_FAILURE);
1070
}
1071
1072
1073
	/* destroy an instance of the driver.  Remember, only 1 copy of the driver's
1074
	 * code is ever loaded, the driver has to remember which context it's
1075
	 * operating in.  This is done via use of the dbdata arguement.
1076
	 * so we really only need to clean it up since we are not using driverarg.
1077
	 */
1078
void
1079
postgres_destroy(void *driverarg, void *dbdata)
1080
{
1081
	
1082
#ifdef ISC_PLATFORM_USETHREADS
1083
1084
    UNUSED(driverarg);
1085
		// cleanup the list of DBI's
1086
	postgres_destroy_dblist((db_list_t *) dbdata);
1087
1088
#else /* ISC_PLATFORM_USETHREADS */
1089
1090
    dbinstance_t *dbi;
1091
1092
    UNUSED(driverarg);
1093
1094
    dbi = (dbinstance_t *) dbdata;
1095
    
1096
		// release DB connection
1097
	if(dbi->dbconn != NULL)
1098
		PQfinish((PGconn *) dbi->dbconn);
1099
1100
		// destroy single DB instance
1101
    destroy_sqldbinstance(dbi);
1102
1103
#endif /* ISC_PLATFORM_USETHREADS */
1104
}
1105
1106
	// pointers to all our runtime methods.
1107
	// this is used during driver registration
1108
	// i.e. in dlz_postgres_init below.
1109
static dns_sdlzmethods_t dlz_postgres_methods = {
1110
	postgres_create, 
1111
	postgres_destroy,
1112
	postgres_findzone,
1113
	postgres_lookup,
1114
	postgres_authority,
1115
	postgres_allnodes,
1116
	postgres_allowzonexfr};
1117
1118
/*
1119
 * Wrapper around dns_sdlzregister().
1120
 */
1121
isc_result_t
1122
dlz_postgres_init(void) {
1123
	isc_result_t result;
1124
1125
	/*
1126
	 * Write debugging message to log
1127
	 */
1128
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1129
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
1130
	      "Registering DLZ postgres driver.");
1131
1132
		/* Driver is always threadsafe.  When multithreaded all functions use
1133
		 * multithreaded code.  When not multithreaded, all functions can only
1134
		 * be entered once, but only 1 thread of operation is available in Bind.
1135
		 * So everything is still threadsafe.
1136
		 */
1137
	result = dns_sdlzregister("postgres", &dlz_postgres_methods, NULL, 
1138
							DNS_SDLZFLAG_RELATIVEOWNER | DNS_SDLZFLAG_RELATIVERDATA
1139
							| DNS_SDLZFLAG_THREADSAFE,	ns_g_mctx, &dlz_postgres);
1140
		// if we can't register the driver, there are big problems.
1141
	if(result != ISC_R_SUCCESS){
1142
		UNEXPECTED_ERROR(__FILE__, __LINE__,
1143
				 "dns_sdlzregister() failed: %s",
1144
				 isc_result_totext(result));
1145
		result = ISC_R_UNEXPECTED;
1146
	}
1147
1148
1149
	return result;
1150
}
1151
1152
/*
1153
 * Wrapper around dns_sdlzunregister().
1154
 */
1155
void
1156
dlz_postgres_clear(void) {
1157
1158
	/*
1159
	 * Write debugging message to log
1160
	 */
1161
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1162
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
1163
	      "Unregistering DLZ postgres driver.");
1164
1165
		// unregister the driver.
1166
	if (dlz_postgres != NULL)
1167
		dns_sdlzunregister(&dlz_postgres);
1168
}
1169
1170
#endif
1171
(-)bind-9.2.2-orig/bin/named/dlz_stub_driver.c (+356 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
/*
37
 * Copyright (C) 1999-2001  Internet Software Consortium.
38
 *
39
 * Permission to use, copy, modify, and distribute this software for any
40
 * purpose with or without fee is hereby granted, provided that the above
41
 * copyright notice and this permission notice appear in all copies.
42
 *
43
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
44
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
45
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
46
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
47
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
48
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
50
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
51
 */
52
53
#ifdef DLZ_STUB
54
55
#include <config.h>
56
#include <stdio.h>
57
#include <string.h>
58
#include <stdlib.h>
59
60
#include <dns/log.h>
61
#include <dns/sdlz.h>
62
#include <dns/result.h>
63
64
#include <isc/mem.h>
65
#include <isc/print.h>
66
#include <isc/result.h>
67
#include <isc/util.h>
68
69
#include <named/globals.h>
70
#include <named/dlz_stub_driver.h>
71
72
dns_sdlzimplementation_t *dlz_stub = NULL;
73
74
typedef struct config_data {
75
	char		*myzone;
76
	char		*myname;
77
	char		*myip;
78
	isc_mem_t	*mctx;
79
}config_data_t;
80
81
/***
82
 *** method prototypes
83
 *** Declared here to shut up compiler warnings
84
 *** about "no previous prototype"
85
 ***/
86
87
isc_result_t
88
stub_dlz_allnodes(const char *zone, void *driverarg, void *dbdata,
89
					  dns_sdlzallnodes_t *allnodes);
90
91
isc_result_t
92
stub_dlz_allowzonexfr(void *driverarg, void *dbdata, const char *name, 
93
					  const char *client);
94
95
isc_result_t
96
stub_dlz_authority(const char *zone, void *driverarg, void *dbdata,
97
			  dns_sdlzlookup_t *lookup);
98
99
isc_result_t
100
stub_dlz_findzonedb(void *driverarg, void *dbdata, const char *name);
101
102
isc_result_t
103
stub_dlz_lookup(const char *zone, const char *name, void *driverarg, 
104
			void *dbdata, dns_sdlzlookup_t *lookup);
105
106
isc_result_t
107
stub_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
108
				void *driverarg, void **dbdata);
109
110
void
111
stub_dlz_destroy(void *driverarg, void *dbdata);
112
113
/***
114
 *** SDLZ methods
115
 ***/
116
isc_result_t
117
stub_dlz_allnodes(const char *zone, void *driverarg, void *dbdata,
118
						  dns_sdlzallnodes_t *allnodes)
119
{
120
	config_data_t *cd;
121
	isc_result_t result;
122
123
	UNUSED(zone);
124
	UNUSED(driverarg);
125
126
	cd = (config_data_t *) dbdata;
127
128
	result = dns_sdlz_putnamedrr(allnodes, cd->myname, "soa", 86400, "web root.localhost. 0 28800 7200 604800 86400");
129
	if (result != ISC_R_SUCCESS)
130
		return (ISC_R_FAILURE);
131
	result = dns_sdlz_putnamedrr(allnodes, "ns", "ns", 86400, cd->myname);
132
	if (result != ISC_R_SUCCESS)
133
		return (ISC_R_FAILURE);
134
	result = dns_sdlz_putnamedrr(allnodes, cd->myname, "a", 1, cd->myip);
135
	if (result != ISC_R_SUCCESS)
136
		return (ISC_R_FAILURE);		
137
	return (ISC_R_SUCCESS);
138
}
139
140
isc_result_t
141
stub_dlz_allowzonexfr(void *driverarg, void *dbdata, const char *name, 
142
					  const char *client)
143
{
144
	UNUSED(driverarg);
145
	UNUSED(dbdata);
146
	UNUSED(name);
147
	UNUSED(client);
148
	return ISC_R_SUCCESS;
149
}
150
151
isc_result_t
152
stub_dlz_authority(const char *zone, void *driverarg, void *dbdata,
153
			  dns_sdlzlookup_t *lookup)
154
{
155
	isc_result_t result;
156
	config_data_t *cd;
157
158
	UNUSED(driverarg);
159
160
	cd = (config_data_t *) dbdata;
161
162
	if (strcmp(zone, cd->myzone) == 0) {
163
		result = dns_sdlz_putsoa(lookup, cd->myname, "root.localhost.", 0);
164
		if (result != ISC_R_SUCCESS)
165
			return (ISC_R_FAILURE);
166
167
		result = dns_sdlz_putrr(lookup, "ns", 86400, cd->myname);
168
		if (result != ISC_R_SUCCESS)
169
			return (ISC_R_FAILURE);
170
171
		return (ISC_R_SUCCESS);
172
	}
173
	return (ISC_R_NOTFOUND);
174
}
175
176
isc_result_t
177
stub_dlz_findzonedb(void *driverarg, void *dbdata, const char *name)
178
{
179
180
	config_data_t *cd;
181
182
	UNUSED(driverarg);
183
184
	cd = (config_data_t *) dbdata;
185
	
186
		// Write info message to log
187
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
188
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
189
	      "dlz_stub findzone looking for '%s'", name);
190
191
	if(strcmp(cd->myzone, name) == 0)
192
		return (ISC_R_SUCCESS);
193
	else
194
		return (ISC_R_SUCCESS);
195
}
196
197
198
isc_result_t
199
stub_dlz_lookup(const char *zone, const char *name, void *driverarg, 
200
			void *dbdata, dns_sdlzlookup_t *lookup)
201
{
202
	isc_result_t result;
203
	config_data_t *cd;
204
205
	UNUSED(zone);
206
	UNUSED(driverarg);
207
208
	cd = (config_data_t *) dbdata;
209
210
	if (strcmp(name, cd->myname) == 0) {
211
		result = dns_sdlz_putrr(lookup, "a", 1, cd->myip);
212
		if (result != ISC_R_SUCCESS)
213
			return (ISC_R_FAILURE);		
214
215
		return (ISC_R_SUCCESS);
216
	}
217
  return (ISC_R_FAILURE);
218
219
}
220
221
222
isc_result_t
223
stub_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
224
				void *driverarg, void **dbdata)
225
{
226
227
	config_data_t *cd;
228
229
	UNUSED(driverarg);
230
231
	if(argc < 4)
232
		return (ISC_R_FAILURE);
233
	/*
234
	 * Write info message to log
235
	 */
236
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
237
	      DNS_LOGMODULE_DLZ, ISC_LOG_INFO,
238
	      "Loading '%s' using DLZ_stub driver. Zone: %s, Name: %s IP: %s", 
239
		  dlzname, argv[1], argv[2], argv[3]);
240
241
	cd = isc_mem_get(ns_g_mctx, sizeof(config_data_t));
242
	if((cd) == NULL){
243
		return (ISC_R_NOMEMORY);
244
	}
245
246
	memset(cd, 0, sizeof(config_data_t));
247
248
	cd->myzone = isc_mem_strdup(ns_g_mctx, argv[1]);
249
	if(cd->myzone == NULL){
250
		isc_mem_put(ns_g_mctx, cd, sizeof(config_data_t));
251
		return (ISC_R_NOMEMORY);
252
	}
253
254
	cd->myname = isc_mem_strdup(ns_g_mctx, argv[2]);
255
	if(cd->myname == NULL){
256
		isc_mem_put(ns_g_mctx, cd, sizeof(config_data_t));
257
		isc_mem_free(ns_g_mctx, cd->myzone);
258
		return (ISC_R_NOMEMORY);
259
	}
260
261
	cd->myip = isc_mem_strdup(ns_g_mctx, argv[3]);
262
	if(cd->myip == NULL){
263
		isc_mem_put(ns_g_mctx, cd, sizeof(config_data_t));
264
		isc_mem_free(ns_g_mctx, cd->myname);
265
		isc_mem_free(ns_g_mctx, cd->myzone);
266
		return (ISC_R_NOMEMORY);
267
	}
268
269
	isc_mem_attach(ns_g_mctx, &cd->mctx);
270
271
	*dbdata = cd;
272
273
	return(ISC_R_SUCCESS);
274
}
275
276
void
277
stub_dlz_destroy(void *driverarg, void *dbdata)
278
{
279
	config_data_t *cd;
280
	isc_mem_t *mctx;
281
282
	UNUSED(driverarg);
283
	
284
	cd = (config_data_t *) dbdata;
285
286
	/*
287
	 * Write debugging message to log
288
	 */
289
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
290
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
291
	      "Unloading DLZ_stub driver.");
292
293
	isc_mem_free(ns_g_mctx, cd->myzone);
294
	isc_mem_free(ns_g_mctx, cd->myname);
295
	isc_mem_free(ns_g_mctx, cd->myip);
296
	mctx = cd->mctx;
297
	isc_mem_put(mctx, cd, sizeof(config_data_t));
298
	isc_mem_detach(&mctx);
299
}
300
301
static dns_sdlzmethods_t dlz_stub_methods = {
302
	stub_dlz_create, 
303
	stub_dlz_destroy,
304
	stub_dlz_findzonedb,
305
	stub_dlz_lookup,
306
	stub_dlz_authority,
307
	stub_dlz_allnodes, 
308
	stub_dlz_allowzonexfr};
309
310
/*
311
 * Wrapper around dns_sdlzregister().
312
 */
313
isc_result_t
314
dlz_stub_init(void) {
315
	isc_result_t result;
316
317
	/*
318
	 * Write debugging message to log
319
	 */
320
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
321
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
322
	      "Registering DLZ_stub driver.");
323
324
	result = dns_sdlzregister("dlz_stub", &dlz_stub_methods, NULL, 
325
							DNS_SDLZFLAG_RELATIVEOWNER | DNS_SDLZFLAG_RELATIVERDATA,
326
							ns_g_mctx, &dlz_stub);
327
	if(result != ISC_R_SUCCESS){
328
		UNEXPECTED_ERROR(__FILE__, __LINE__,
329
				 "dns_sdlzregister() failed: %s",
330
				 isc_result_totext(result));
331
		result = ISC_R_UNEXPECTED;
332
	}
333
334
335
	return result;
336
}
337
338
/*
339
 * Wrapper around dns_sdlzunregister().
340
 */
341
void
342
dlz_stub_clear(void) {
343
344
	/*
345
	 * Write debugging message to log
346
	 */
347
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
348
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
349
	      "Unregistering DLZ_stub driver.");
350
351
	if (dlz_stub != NULL)
352
		dns_sdlzunregister(&dlz_stub);
353
}
354
355
#endif
356
(-)bind-9.2.2-orig/bin/named/include/named/dlz_bdb_driver.h (+41 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
isc_result_t
37
dlz_bdb_init(void);
38
39
void
40
dlz_bdb_clear(void);
41
(-)bind-9.2.2-orig/bin/named/include/named/dlz_filesystem_driver.h (+41 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
isc_result_t
37
dlz_fs_init(void);
38
39
void
40
dlz_fs_clear(void);
41
(-)bind-9.2.2-orig/bin/named/include/named/dlz_ldap_driver.h (+41 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
isc_result_t
37
dlz_ldap_init(void);
38
39
void
40
dlz_ldap_clear(void);
41
(-)bind-9.2.2-orig/bin/named/include/named/dlz_mysql_driver.h (+41 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
isc_result_t
37
dlz_mysql_init(void);
38
39
void
40
dlz_mysql_clear(void);
41
(-)bind-9.2.2-orig/bin/named/include/named/dlz_odbc_driver.h (+41 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
isc_result_t
37
dlz_odbc_init(void);
38
39
void
40
dlz_odbc_clear(void);
41
(-)bind-9.2.2-orig/bin/named/include/named/dlz_postgres_driver.h (+41 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
isc_result_t
37
dlz_postgres_init(void);
38
39
void
40
dlz_postgres_clear(void);
41
(-)bind-9.2.2-orig/bin/named/include/named/dlz_stub_driver.h (+40 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
isc_result_t
37
dlz_stub_init(void);
38
39
void
40
dlz_stub_clear(void);
(-)bind-9.2.2-orig/bin/named/include/named/sdlz_helper.h (+109 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
#ifndef SDLZHELPER_H
37
#define SDLZHELPER_H 1
38
39
/***
40
 *** Types
41
 ***/
42
#define SDLZH_REQUIRE_CLIENT 0x01
43
#define SDLZH_REQUIRE_QUERY 0x02
44
#define SDLZH_REQUIRE_RECORD 0x04
45
#define SDLZH_REQUIRE_ZONE 0x08 
46
47
typedef struct query_segment query_segment_t;
48
typedef ISC_LIST(query_segment_t) query_list_t;
49
typedef struct dbinstance dbinstance_t;
50
typedef ISC_LIST(dbinstance_t) db_list_t;
51
typedef struct driverinstance driverinstance_t;
52
53
	/* a query segment is all the text between our special tokens
54
	 * special tokens are %zone%, %record%, %client%
55
	 */
56
struct query_segment {
57
	void						*sql;
58
	unsigned int				strlen;
59
	isc_boolean_t				direct;
60
	ISC_LINK(query_segment_t)	link;	
61
};
62
63
	/* a database instance contains everything we need for running
64
	 * a query against the database.  Using it each separate thread
65
	 * can dynamically construct a query and execute it against the 
66
	 * database.  The "instance_lock" and locking code in the driver's
67
	 * make sure no two threads try to use the same DBI at a time.
68
	 */
69
struct dbinstance {
70
	void				*dbconn;
71
	query_list_t	*allnodes_q;
72
	query_list_t	*allowxfr_q;
73
	query_list_t	*authority_q;
74
	query_list_t	*findzone_q;
75
	query_list_t	*lookup_q;
76
	query_list_t	*countzone_q;
77
	char				*query_buf;
78
	char				*zone;
79
	char				*record;
80
	char				*client;
81
	isc_mem_t		*mctx;
82
	isc_mutex_t		instance_lock;
83
	ISC_LINK(dbinstance_t)	link;
84
85
};
86
87
/***
88
 *** Method declarations
89
 ***/
90
91
	/* see the code in sdlz_helper.c for more information on these methods */
92
93
char *
94
build_querystring(isc_mem_t *mctx, query_list_t *querylist);
95
96
isc_result_t
97
build_sqldbinstance(isc_mem_t *mctx, const char *allnodes_str, 
98
					const char *allowxfr_str, const char *authority_str,
99
					const char *findzone_str, const char *lookup_str,
100
					const char *countzone_str, dbinstance_t **dbi);
101
102
void 
103
destroy_sqldbinstance(dbinstance_t *dbi);
104
105
char *
106
getParameterValue(const char *input, const char* key);
107
108
#endif /* SDLZHELPER_H */
109
(-)bind-9.2.2-orig/bin/named/main.c (-1 / +86 lines)
Lines 63-68 Link Here
63
 */
63
 */
64
/* #include "xxdb.h" */
64
/* #include "xxdb.h" */
65
65
66
#ifdef DLZ_STUB
67
#include <named/dlz_stub_driver.h>
68
#endif
69
70
#ifdef DLZ_POSTGRES
71
#include <named/dlz_postgres_driver.h>
72
#endif
73
74
#ifdef DLZ_MYSQL
75
#include <named/dlz_mysql_driver.h>
76
#endif
77
78
#ifdef DLZ_FILESYSTEM
79
#include <named/dlz_filesystem_driver.h>
80
#endif
81
82
#ifdef DLZ_BDB
83
#include <named/dlz_bdb_driver.h>
84
#endif
85
86
#ifdef DLZ_LDAP
87
#include <named/dlz_ldap_driver.h>
88
#endif
89
90
#ifdef DLZ_ODBC
91
#include <named/dlz_odbc_driver.h>
92
#endif
93
66
static isc_boolean_t	want_stats = ISC_FALSE;
94
static isc_boolean_t	want_stats = ISC_FALSE;
67
static char		program_name[ISC_DIR_NAMEMAX] = "named";
95
static char		program_name[ISC_DIR_NAMEMAX] = "named";
68
static char		absolute_conffile[ISC_DIR_PATHMAX];
96
static char		absolute_conffile[ISC_DIR_PATHMAX];
Lines 528-533 Link Here
528
	 */
556
	 */
529
	/* xxdb_init(); */
557
	/* xxdb_init(); */
530
558
559
#ifdef DLZ_STUB
560
    dlz_stub_init();
561
#endif
562
563
#ifdef DLZ_POSTGRES
564
    dlz_postgres_init();
565
#endif
566
567
#ifdef DLZ_MYSQL
568
	dlz_mysql_init();
569
#endif
570
571
#ifdef DLZ_FILESYSTEM
572
    dlz_fs_init();
573
#endif
574
575
#ifdef DLZ_BDB
576
    dlz_bdb_init();
577
#endif
578
579
#ifdef DLZ_LDAP
580
    dlz_ldap_init();
581
#endif
582
583
#ifdef DLZ_ODBC
584
    dlz_odbc_init();
585
#endif
586
531
	ns_server_create(ns_g_mctx, &ns_g_server);
587
	ns_server_create(ns_g_mctx, &ns_g_server);
532
}
588
}
533
589
Lines 542-554 Link Here
542
	 */
598
	 */
543
	/* xxdb_clear(); */
599
	/* xxdb_clear(); */
544
600
601
#ifdef DLZ_STUB
602
    dlz_stub_clear();
603
#endif
604
605
#ifdef DLZ_POSTGRES
606
    dlz_postgres_clear();
607
#endif
608
609
#ifdef DLZ_MYSQL
610
	dlz_mysql_clear();
611
#endif
612
613
#ifdef DLZ_FILESYSTEM
614
    dlz_fs_clear();
615
#endif
616
617
#ifdef DLZ_BDB
618
    dlz_bdb_clear();
619
#endif
620
621
#ifdef DLZ_LDAP
622
    dlz_ldap_clear();
623
#endif
624
625
#ifdef DLZ_ODBC
626
    dlz_odbc_clear();
627
#endif
628
629
545
	isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
630
	isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
546
		      ISC_LOG_NOTICE, "exiting");
631
		      ISC_LOG_NOTICE, "exiting");
547
	ns_log_shutdown();
632
	ns_log_shutdown();
548
}
633
}
549
634
550
int
635
int
551
main(int argc, char *argv[]) {
636
main(int argc, char **argv) {
552
	isc_result_t result;
637
	isc_result_t result;
553
638
554
	result = isc_file_progname(*argv, program_name, sizeof(program_name));
639
	result = isc_file_progname(*argv, program_name, sizeof(program_name));
(-)bind-9.2.2-orig/bin/named/query.c (-2 / +70 lines)
Lines 27-32 Link Here
27
#include <dns/adb.h>
27
#include <dns/adb.h>
28
#include <dns/byaddr.h>
28
#include <dns/byaddr.h>
29
#include <dns/db.h>
29
#include <dns/db.h>
30
#ifdef DLZ
31
#include <dns/dlz.h>
32
#endif
30
#include <dns/events.h>
33
#include <dns/events.h>
31
#include <dns/message.h>
34
#include <dns/message.h>
32
#include <dns/rdata.h>
35
#include <dns/rdata.h>
Lines 817-825 Link Here
817
{
820
{
818
	isc_result_t result;
821
	isc_result_t result;
819
822
823
#ifdef DLZ
824
825
	isc_result_t tresult;
826
	unsigned int namelabels;
827
	unsigned int zonelabels;
828
	dns_zone_t *zone = NULL;
829
	dns_db_t *tdbp;
830
831
	REQUIRE(zonep != NULL && *zonep == NULL);
832
833
	tdbp = NULL;
834
	
835
	 /* Calculate how many labels are in name. */
836
	namelabels = dns_name_countlabels(name);
837
	zonelabels = 0;
838
839
	 /* Try to find name in bind's standard database. */
840
	result = query_getzonedb(client, name, options, &zone, dbp, versionp);
841
842
	 /* See how many labels are in the zone's name.	  */
843
	if (result == ISC_R_SUCCESS && zone != NULL)
844
		zonelabels = dns_name_countlabels(dns_zone_getorigin(zone));
845
	 /*
846
	  * If # zone labels < # name labels, try to find an even better match
847
	  * Only try if a DLZ driver is loaded for this view
848
	  */
849
	if(zonelabels < namelabels && client->view->dlzdatabase != NULL){
850
		tresult = dns_dlzfindzone(client->view, name, zonelabels, &tdbp);
851
		 /* If we successful, we found a better match. */
852
		if(tresult == ISC_R_SUCCESS){	
853
			 /* If the previous search returned a zone, detach it. */
854
			if(zone != NULL)
855
				dns_zone_detach(&zone);
856
			 /* If the previous search returned a database, detach it. */
857
			if(*dbp != NULL)
858
				dns_db_detach(dbp);
859
			 /* incase the previous search returned a version, clear it */
860
			*versionp = NULL;
861
			 /* get our database version */
862
			dns_db_currentversion(tdbp, versionp);
863
			 /* be sure to return our database */
864
			*dbp = tdbp;
865
			 /* We return a null zone, No stats for DLZ zones */
866
			zone = NULL;
867
			result = tresult;
868
		}
869
	}
870
871
#else
872
820
	result = query_getzonedb(client, name, options, zonep, dbp, versionp);
873
	result = query_getzonedb(client, name, options, zonep, dbp, versionp);
821
	if (result == ISC_R_SUCCESS) {
874
875
#endif
876
877
	 /* If successfull, Transfer ownership of zone. */
878
	if(result == ISC_R_SUCCESS){
822
		*is_zonep = ISC_TRUE;
879
		*is_zonep = ISC_TRUE;
880
#ifdef DLZ
881
		*zonep = zone;
882
#endif
883
	  /* If neither attempt above succeeded, return the cache instead */
823
	} else if (result == ISC_R_NOTFOUND) {
884
	} else if (result == ISC_R_NOTFOUND) {
824
		result = query_getcachedb(client, dbp, options);
885
		result = query_getcachedb(client, dbp, options);
825
		*is_zonep = ISC_FALSE;
886
		*is_zonep = ISC_FALSE;
Lines 2476-2482 Link Here
2476
       
2537
       
2477
	if (event == NULL && client->query.restarts == 0) {
2538
	if (event == NULL && client->query.restarts == 0) {
2478
		if (is_zone) {
2539
		if (is_zone) {
2479
			dns_zone_attach(zone, &client->query.authzone);
2540
#ifdef DLZ
2541
			if(zone != NULL){	// if is_zone = true, zone = NULL then this is
2542
								// a DLZ zone.  Don't attempt to attach zone
2543
#endif
2544
				dns_zone_attach(zone, &client->query.authzone);
2545
#ifdef DLZ
2546
			}
2547
#endif
2480
			dns_db_attach(db, &client->query.authdb);
2548
			dns_db_attach(db, &client->query.authdb);
2481
		}
2549
		}
2482
		client->query.authdbset = ISC_TRUE;
2550
		client->query.authdbset = ISC_TRUE;
(-)bind-9.2.2-orig/bin/named/sdlz_helper.c (+507 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
/*
37
 * Copyright (C) 1999-2001  Internet Software Consortium.
38
 *
39
 * Permission to use, copy, modify, and distribute this software for any
40
 * purpose with or without fee is hereby granted, provided that the above
41
 * copyright notice and this permission notice appear in all copies.
42
 *
43
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
44
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
45
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
46
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
47
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
48
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
50
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
51
 */
52
53
#ifdef DLZ
54
55
#include <config.h>
56
57
#include <dns/log.h>
58
#include <dns/result.h>
59
60
#include <isc/mem.h>
61
#include <isc/result.h>
62
#include <isc/string.h>
63
#include <isc/util.h>
64
65
#include <named/globals.h>
66
#include <named/sdlz_helper.h>
67
68
/***
69
 *** method prototypes
70
 *** Declared here to shut up compiler warnings
71
 *** about "no previous prototype"
72
 ***/
73
74
void 
75
destroy_querylist(isc_mem_t *mctx, query_list_t **querylist);
76
77
isc_result_t
78
build_querylist(isc_mem_t *mctx, const char *query_str, char **zone,
79
				char **record, char **client, query_list_t **querylist,
80
				unsigned int flags);
81
82
/***
83
 *** sdlz helper methods
84
 ***/
85
86
	/* properly destroys a querylist by de-allocating the
87
	 * memory for each query segment, and then the list itself
88
	 */
89
void 
90
destroy_querylist(isc_mem_t *mctx, query_list_t **querylist)
91
{
92
	query_segment_t *tseg = NULL;
93
	query_segment_t *nseg = NULL;
94
95
	REQUIRE(mctx != NULL);
96
97
		// if query list is null, nothing to do
98
	if(*querylist == NULL)
99
		return;
100
101
		// start at the top of the list
102
	nseg = ISC_LIST_HEAD(**querylist);
103
	while(nseg != NULL){	// loop, until end of list
104
		tseg = nseg;
105
			// free the query segment's text string
106
			// but only if it was really a query segment, and not
107
			// a pointer to %zone%, or %record%, or %client%
108
		if (tseg->sql != NULL && tseg->direct == isc_boolean_true)
109
			isc_mem_free(mctx, tseg->sql);				
110
			// get the next query segment, before we destroy this one.
111
		nseg = ISC_LIST_NEXT(nseg, link);
112
			// deallocate this query segment.
113
		isc_mem_put(mctx, tseg, sizeof(query_segment_t));
114
	}
115
		// deallocate the query segment list
116
	isc_mem_put(mctx, *querylist, sizeof(query_list_t));
117
}
118
119
	/* constructs a query list by parsing a string into query segments */
120
isc_result_t
121
build_querylist(isc_mem_t *mctx, const char *query_str, char **zone,
122
				char **record, char **client, query_list_t **querylist,
123
				unsigned int flags)
124
{
125
	isc_result_t result;
126
	isc_boolean_t foundzone = isc_boolean_false;
127
	isc_boolean_t foundrecord = isc_boolean_false;
128
	isc_boolean_t foundclient = isc_boolean_false;
129
	char *temp_str = NULL;
130
	char *right_str = NULL;
131
	query_list_t *tql;
132
	query_segment_t *tseg = NULL;
133
134
	REQUIRE(querylist != NULL && *querylist == NULL);
135
	REQUIRE(mctx != NULL);
136
137
		// if query string is null, or zero length
138
	if(query_str == NULL || strlen(query_str) < 1){	
139
		if((flags & SDLZH_REQUIRE_QUERY) == 0)	// we don't need it were ok.
140
			return (ISC_R_SUCCESS);
141
		else									// we did need it, PROBLEM!!!
142
			return (ISC_R_FAILURE);
143
	}
144
145
		/* allocate memory for query list */
146
	tql = isc_mem_get(mctx, sizeof(query_list_t));
147
		// couldn't allocate memory.  Problem!!
148
	if (tql == NULL)
149
		return (ISC_R_NOMEMORY);
150
	
151
		// initialize the query segment list
152
	ISC_LIST_INIT(*tql);
153
154
	// make a copy of query_str so we can chop it up
155
	temp_str = right_str = isc_mem_strdup(mctx, query_str);	
156
		// couldn't make a copy, problem!!
157
	if (right_str == NULL){
158
		result = ISC_R_NOMEMORY;
159
		goto cleanup;
160
	}
161
162
		// loop through the string and chop it up
163
	while(right_str != NULL){
164
			// allocate memory for tseg
165
		tseg = isc_mem_get(mctx, sizeof(query_segment_t));
166
		if (tseg  == NULL) {	// no memory, clean everything up.
167
			result = ISC_R_NOMEMORY;
168
			goto cleanup;
169
		}
170
		tseg->sql = NULL;
171
		tseg->direct = isc_boolean_false;
172
			// initialize the query segment link
173
		ISC_LINK_INIT(tseg, link);			
174
			// append the query segment to the list
175
		ISC_LIST_APPEND(*tql, tseg, link);
176
177
			//split string at the first "%". set query segment to left portion
178
		tseg->sql = isc_mem_strdup(mctx, isc_string_separate(&right_str, "%"));
179
		if (tseg->sql == NULL) {	// no memory, clean everything up.
180
			result = ISC_R_NOMEMORY;
181
			goto cleanup;
182
		}
183
			// tseg->sql points directly to a string.
184
		tseg->direct = isc_boolean_true;	
185
		tseg->strlen = strlen(tseg->sql);
186
187
			// check if we encountered "%zone%" token
188
		if(strcasecmp(tseg->sql, "zone") == 0){
189
			// we don't really need, or want the "zone" text, so get rid of it.
190
			isc_mem_free(mctx, tseg->sql);
191
			tseg->sql = (char**) zone;	// set tseg->sql to in-direct zone string
192
			tseg->strlen = 0;
193
                // tseg->sql points in-directly to a string
194
			tseg->direct = isc_boolean_false;	
195
			foundzone = isc_boolean_true;
196
			// check if we encountered "%record%" token
197
		} else if(strcasecmp(tseg->sql, "record") == 0){
198
			// we don't really need, or want the "record" text, so get rid of it.
199
			isc_mem_free(mctx, tseg->sql);
200
                // set tseg->sql to in-direct record string
201
			tseg->sql = (char**) record;	
202
			tseg->strlen = 0;
203
                // tseg->sql points in-directly poinsts to a string
204
			tseg->direct = isc_boolean_false;	
205
			foundrecord = isc_boolean_true;
206
			// check if we encountered "%client%" token
207
		} else if(strcasecmp(tseg->sql, "client") == 0){
208
			// we don't really need, or want the "client" text, so get rid of it.
209
			isc_mem_free(mctx, tseg->sql);
210
                // set tseg->sql to in-direct record string
211
			tseg->sql = (char**) client;	
212
			tseg->strlen = 0;
213
                 // tseg->sql points in-directly poinsts to a string
214
			tseg->direct = isc_boolean_false;  
215
			foundclient = isc_boolean_true;
216
		}
217
	}
218
219
		// we don't need temp_str any more
220
	isc_mem_free(mctx, temp_str);
221
	// add checks later to verify zone and record are found if necessary.
222
223
		// if this query requires %client%, make sure we found it
224
	if( ((flags & SDLZH_REQUIRE_CLIENT) != 0) && (!foundclient) ){
225
		/* Write error message to log */
226
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
227
					DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
228
					"Required token %%client%% not found.");
229
		result = ISC_R_FAILURE;
230
		goto flag_fail;
231
	}
232
233
		// if this query requires %record%, make sure we found it
234
	if( ((flags & SDLZH_REQUIRE_RECORD) != 0) && (!foundrecord) ){
235
		/* Write error message to log */
236
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
237
					DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
238
					"Required token %%record%% not found.");
239
		result = ISC_R_FAILURE;
240
		goto flag_fail;
241
	}
242
243
		// if this query requires %zone%, make sure we found it
244
	if( ((flags & SDLZH_REQUIRE_ZONE) != 0) && (!foundzone) ){
245
		/* Write error message to log */
246
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
247
					DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
248
					"Required token %%zone%% not found.");
249
		result = ISC_R_FAILURE;
250
		goto flag_fail;
251
	}
252
253
		// pass back the query list
254
	*querylist = (query_list_t *) tql;
255
256
		// return success
257
	return (ISC_R_SUCCESS);
258
259
cleanup:
260
		// get rid of temp_str
261
	if(temp_str != NULL)
262
		isc_mem_free(mctx, temp_str);
263
264
flag_fail:
265
		// get rid of what was build of the query list
266
	if(tql != NULL)
267
		destroy_querylist(mctx, &tql);
268
	return result;
269
}
270
271
	/* build a query string from query segments, and dynamic segments
272
	 * dynamic segments replace where the tokens %zone%, %record%, %client%
273
	 * used to be in our queries from named.conf
274
	 */
275
char *
276
build_querystring(isc_mem_t *mctx, query_list_t *querylist)
277
{
278
	query_segment_t *tseg = NULL;
279
	unsigned int length = 0;
280
	char *qs = NULL;
281
282
	REQUIRE(mctx != NULL);
283
	REQUIRE(querylist != NULL);
284
285
		// start at the top of the list
286
	tseg = ISC_LIST_HEAD(*querylist);
287
	while(tseg != NULL){	// loop to the end of the list
288
			// if this is a query segment, use the
289
			// precalculated string length
290
		if (tseg->direct == isc_boolean_true)
291
			length += tseg->strlen;
292
		else	// calculate string length for dynamic segments.
293
			length += strlen(* (char**) tseg->sql);
294
		tseg = ISC_LIST_NEXT(tseg, link);	// get the next segment
295
	}
296
297
		// allocate memory for the string
298
	qs = isc_mem_allocate(mctx, length + 1);
299
		// couldn't allocate memory,  We need more ram!
300
	if(qs == NULL)
301
		return NULL;
302
	
303
		// start at the top of the list again
304
    tseg = ISC_LIST_HEAD(*querylist);
305
		// copy the first item in the list to the query string
306
	if(tseg->direct == isc_boolean_true)	// query segment
307
		strcpy(qs, tseg->sql);
308
	else	
309
		strcpy(qs, * (char**) tseg->sql);	// dynamic segment
310
311
		// concatonate the rest of the segments
312
	while((tseg = ISC_LIST_NEXT(tseg, link)) != NULL){
313
		if(tseg->direct == isc_boolean_true) 		// query segments
314
			strcat(qs, tseg->sql);
315
		else
316
			strcat(qs, * (char**) tseg->sql);		// dynamic segments
317
	}
318
319
	return qs;
320
}
321
322
	/* constructs a sql dbinstance (DBI) */
323
isc_result_t
324
build_sqldbinstance(isc_mem_t *mctx, const char *allnodes_str, 
325
					const char *allowxfr_str, const char *authority_str,
326
					const char *findzone_str, const char *lookup_str,
327
					const char *countzone_str, dbinstance_t **dbi)
328
{
329
330
	isc_result_t result;
331
	dbinstance_t *db = NULL;
332
333
	REQUIRE(dbi != NULL && *dbi == NULL);
334
	REQUIRE(mctx != NULL);
335
336
		/* allocate and zero memory for driver structure */
337
	db = isc_mem_get(mctx, sizeof(dbinstance_t));
338
	if (db == NULL){
339
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
340
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
341
			"Could not allocate memory for database instance object.");
342
		return (ISC_R_NOMEMORY);
343
	}
344
	memset(db, 0, sizeof(dbinstance_t));
345
	db->dbconn = NULL;
346
	db->client = NULL;
347
	db->record = NULL;
348
	db->zone = NULL;
349
	db->mctx = NULL;
350
	db->query_buf = NULL;
351
	db->allnodes_q = NULL;
352
	db->allowxfr_q = NULL;
353
	db->authority_q = NULL;
354
	db->findzone_q = NULL;
355
	db->countzone_q = NULL;
356
	db->lookup_q = NULL;
357
358
		/* attach to the memory context */
359
	isc_mem_attach(mctx, &db->mctx);
360
361
		/* initialize the reference count mutex */
362
	result = isc_mutex_init(&db->instance_lock);
363
	if (result != ISC_R_SUCCESS){
364
		UNEXPECTED_ERROR(__FILE__, __LINE__,
365
			"isc_mutex_init() failed: %s",
366
			 isc_result_totext(result));
367
		goto cleanup;
368
	}
369
370
		// build the all nodes query list
371
	result = build_querylist(mctx, allnodes_str, &db->zone, &db->record, &db->client, 
372
				&db->allnodes_q, SDLZH_REQUIRE_ZONE);
373
		// if unsuccessful, log err msg and cleanup
374
	if(result != ISC_R_SUCCESS){
375
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
376
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
377
			"Could not build all nodes query list");
378
		goto cleanup;
379
	}
380
381
		// build the allow zone transfer query list
382
	result = build_querylist(mctx, allowxfr_str, &db->zone, &db->record, &db->client, 
383
				&db->allowxfr_q, SDLZH_REQUIRE_ZONE | SDLZH_REQUIRE_CLIENT);
384
		// if unsuccessful, log err msg and cleanup
385
	if(result != ISC_R_SUCCESS){
386
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
387
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
388
			"Could not build allow xfr query list");		
389
		goto cleanup;
390
	}
391
392
		// build the authority query, query list
393
	result = build_querylist(mctx, authority_str, &db->zone, &db->record, &db->client, 
394
				&db->authority_q, SDLZH_REQUIRE_ZONE);
395
		// if unsuccessful, log err msg and cleanup
396
	if(result != ISC_R_SUCCESS){
397
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
398
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
399
			"Could not build authority query list");
400
		goto cleanup;
401
	}
402
403
		// build findzone query, query list
404
	result = build_querylist(mctx, findzone_str, &db->zone, &db->record, &db->client, 
405
				&db->findzone_q, SDLZH_REQUIRE_ZONE);
406
		// if unsuccessful, log err msg and cleanup
407
	if(result != ISC_R_SUCCESS){
408
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
409
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
410
			"Could not build find zone query list");
411
		goto cleanup;
412
	}
413
414
		// build countzone query, query list
415
	result = build_querylist(mctx, countzone_str, &db->zone, &db->record, &db->client, 
416
				&db->countzone_q, SDLZH_REQUIRE_ZONE);
417
		// if unsuccessful, log err msg and cleanup
418
	if(result != ISC_R_SUCCESS){
419
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
420
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
421
			"Could not build count zone query list");
422
		goto cleanup;
423
	}
424
	
425
		// build lookup query, query list
426
	result = build_querylist(mctx, lookup_str, &db->zone, &db->record, &db->client, 
427
				&db->lookup_q, SDLZH_REQUIRE_RECORD);
428
		// if unsuccessful, log err msg and cleanup
429
	if(result != ISC_R_SUCCESS){
430
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
431
			DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
432
			"Could not build lookup query list");
433
		goto cleanup;
434
	}
435
436
		/* pass back the db instance */
437
	*dbi = (dbinstance_t *) db;
438
439
		// return success
440
	return (ISC_R_SUCCESS);
441
442
cleanup:
443
		// destroy whatever was build of the db instance
444
	destroy_sqldbinstance(db);
445
		// return failure
446
	return (ISC_R_FAILURE);
447
}
448
449
void 
450
destroy_sqldbinstance(dbinstance_t *dbi)
451
{
452
	isc_mem_t *mctx;
453
454
		/* save mctx for later */
455
	mctx = dbi->mctx;
456
457
		/* destroy any query lists we created */
458
	destroy_querylist(mctx, &dbi->allnodes_q);
459
	destroy_querylist(mctx, &dbi->allowxfr_q);
460
	destroy_querylist(mctx, &dbi->authority_q);
461
	destroy_querylist(mctx, &dbi->findzone_q);
462
	destroy_querylist(mctx, &dbi->countzone_q);
463
	destroy_querylist(mctx, &dbi->lookup_q);
464
465
		/* get rid of the mutex */
466
	isc_mutex_destroy(&dbi->instance_lock);
467
468
		/* return, and detach the memory */
469
	isc_mem_put(mctx, dbi, sizeof(dbinstance_t));
470
	isc_mem_detach(&mctx);
471
}
472
473
char *
474
getParameterValue(const char *input, const char* key)
475
{
476
	int keylen;
477
	char *keystart;
478
	char value[255];
479
	int i;
480
481
	if(key == NULL || input == NULL || strlen(input) < 1)
482
		return NULL;
483
484
	keylen = strlen(key);
485
486
	if(keylen < 1)
487
		return NULL;
488
489
	keystart = strstr(input, key);
490
491
	if(keystart == NULL)
492
		return NULL;
493
494
	for(i=0; i < 255; i++){
495
		value[i] = keystart[keylen + i];
496
		if(value[i] == ' ' || value[i] == '\0'){
497
			value[i] = '\0';
498
			break;
499
		}
500
	}	
501
502
	return isc_mem_strdup(ns_g_mctx, value);
503
	
504
}
505
506
#endif
507
(-)bind-9.2.2-orig/bin/named/server.c (+36 lines)
Lines 41-46 Link Here
41
#include <dns/cache.h>
41
#include <dns/cache.h>
42
#include <dns/db.h>
42
#include <dns/db.h>
43
#include <dns/dispatch.h>
43
#include <dns/dispatch.h>
44
#ifdef DLZ
45
#include <dns/dlz.h>
46
#endif
44
#include <dns/forward.h>
47
#include <dns/forward.h>
45
#include <dns/journal.h>
48
#include <dns/journal.h>
46
#include <dns/keytable.h>
49
#include <dns/keytable.h>
Lines 496-501 Link Here
496
	cfg_obj_t *forwardtype;
499
	cfg_obj_t *forwardtype;
497
	cfg_obj_t *forwarders;
500
	cfg_obj_t *forwarders;
498
	cfg_obj_t *zonelist;
501
	cfg_obj_t *zonelist;
502
#ifdef DLZ
503
	cfg_obj_t *dlz;
504
	unsigned int dlzargc;
505
	char **dlzargv;
506
#endif
499
	cfg_obj_t *obj;
507
	cfg_obj_t *obj;
500
	cfg_listelt_t *element;
508
	cfg_listelt_t *element;
501
	in_port_t port;
509
	in_port_t port;
Lines 559-564 Link Here
559
		CHECK(configure_zone(config, zconfig, vconfig, mctx, view,
567
		CHECK(configure_zone(config, zconfig, vconfig, mctx, view,
560
				     actx));
568
				     actx));
561
	}
569
	}
570
571
#ifdef DLZ
572
	/*
573
	 * Create Dynamically Loadable Zone driver.
574
	 */
575
	dlz = NULL;
576
	if (voptions != NULL)
577
		(void)cfg_map_get(voptions, "dlz", &dlz);
578
	else
579
		(void)cfg_map_get(config, "dlz", &dlz);
580
581
	obj = NULL;
582
	if (dlz != NULL){
583
		(void)cfg_map_get(cfg_tuple_get(dlz, "options"), "database", &obj);
584
		if(obj != NULL){
585
			dns_dlzstrtoargv(mctx, cfg_obj_asstring(obj), &dlzargc, &dlzargv);
586
			result = dns_dlzcreate(mctx, cfg_obj_asstring(
587
                cfg_tuple_get(dlz, "name")), dlzargv[0], dlzargc, dlzargv,
588
                                                        &view->dlzdatabase);
589
            if(result == ISC_R_SUCCESS){
590
                isc_mem_put(mctx, dlzargv, dlzargc * sizeof(*dlzargv));
591
            } else {
592
                goto cleanup;
593
            }
594
		}
595
	}
596
597
#endif
562
598
563
	/*
599
	/*
564
	 * Configure the view's cache.  Try to reuse an existing
600
	 * Configure the view's cache.  Try to reuse an existing
(-)bind-9.2.2-orig/bin/named/xfrout.c (-25 / +78 lines)
Lines 27-32 Link Here
27
27
28
#include <dns/db.h>
28
#include <dns/db.h>
29
#include <dns/dbiterator.h>
29
#include <dns/dbiterator.h>
30
#ifdef DLZ
31
#include <dns/dlz.h>
32
#endif
30
#include <dns/fixedname.h>
33
#include <dns/fixedname.h>
31
#include <dns/journal.h>
34
#include <dns/journal.h>
32
#include <dns/message.h>
35
#include <dns/message.h>
Lines 890-895 Link Here
890
	char msg[DNS_RDATACLASS_FORMATSIZE + DNS_NAME_FORMATSIZE
893
	char msg[DNS_RDATACLASS_FORMATSIZE + DNS_NAME_FORMATSIZE
891
		 + sizeof("zone transfer '/'")];
894
		 + sizeof("zone transfer '/'")];
892
	isc_boolean_t is_poll = ISC_FALSE;
895
	isc_boolean_t is_poll = ISC_FALSE;
896
#ifdef DLZ
897
	isc_boolean_t is_dlz = ISC_FALSE;
898
#endif
893
899
894
	switch (reqtype) {
900
	switch (reqtype) {
895
	case dns_rdatatype_axfr:
901
	case dns_rdatatype_axfr:
Lines 940-958 Link Here
940
946
941
	result = dns_zt_find(client->view->zonetable, question_name, 0, NULL,
947
	result = dns_zt_find(client->view->zonetable, question_name, 0, NULL,
942
			     &zone);
948
			     &zone);
949
943
	if (result != ISC_R_SUCCESS)
950
	if (result != ISC_R_SUCCESS)
944
		FAILQ(DNS_R_NOTAUTH, "non-authoritative zone",
951
#ifdef DLZ
945
		      question_name, question_class);
952
	{
946
	switch(dns_zone_gettype(zone)) {
953
		/* Normal zone table does not have a match.  Try the DLZ database */
947
	case dns_zone_master:
954
		if(client->view->dlzdatabase != NULL)
948
	case dns_zone_slave:
955
		{
949
		break;	/* Master and slave zones are OK for transfer. */
956
			result = dns_dlzallowzonexfr(client->view, question_name, &client->peeraddr, &db);
950
	default:
957
            if(result == ISC_R_NOPERM){
951
		FAILQ(DNS_R_NOTAUTH, "non-authoritative zone",
958
                result = DNS_R_REFUSED;
952
		      question_name, question_class);
959
                goto failure;
960
            }
961
			if(result != ISC_R_SUCCESS)
962
#endif
963
				FAILQ(DNS_R_NOTAUTH, "non-authoritative zone",
964
					  question_name, question_class);
965
#ifdef DLZ
966
			is_dlz = ISC_TRUE;
967
				/* DLZ only support full zone transfer, not incremental */
968
			if(reqtype != dns_rdatatype_axfr){
969
				mnemonic = "AXFR-style IXFR";
970
				reqtype = dns_rdatatype_axfr;
971
			}
972
		} else { /* not DLZ and not in normal zone table, we are not authoritative */
973
			FAILQ(DNS_R_NOTAUTH, "non-authoritative zone", question_name, question_class);
974
		}
975
	} else { /* zone table does have a match */
976
#endif
977
		switch(dns_zone_gettype(zone)) {
978
			case dns_zone_master:
979
			case dns_zone_slave:
980
				break;	/* Master and slave zones are OK for transfer. */
981
			default:
982
				FAILQ(DNS_R_NOTAUTH, "non-authoritative zone", question_name, question_class);
983
			}
984
		CHECK(dns_zone_getdb(zone, &db));
985
		dns_db_currentversion(db, &ver);
986
#ifdef DLZ
953
	}
987
	}
954
	CHECK(dns_zone_getdb(zone, &db));
988
#endif
955
	dns_db_currentversion(db, &ver);
956
989
957
	xfrout_log1(client, question_name, question_class, ISC_LOG_DEBUG(6),
990
	xfrout_log1(client, question_name, question_class, ISC_LOG_DEBUG(6),
958
		    "%s question section OK", mnemonic);
991
		    "%s question section OK", mnemonic);
Lines 1005-1018 Link Here
1005
	xfrout_log1(client, question_name, question_class, ISC_LOG_DEBUG(6),
1038
	xfrout_log1(client, question_name, question_class, ISC_LOG_DEBUG(6),
1006
		    "%s authority section OK", mnemonic);
1039
		    "%s authority section OK", mnemonic);
1007
1040
1041
#ifdef DLZ
1008
	/*
1042
	/*
1009
	 * Decide whether to allow this transfer.
1043
	 * if not a DLZ zone decide whether to allow this transfer.
1010
	 */
1044
	 */
1011
	ns_client_aclmsg("zone transfer", question_name,
1045
	if( !is_dlz ){
1012
			 client->view->rdclass, msg, sizeof(msg));
1046
#endif
1013
	CHECK(ns_client_checkacl(client, msg,
1047
		ns_client_aclmsg("zone transfer", question_name,
1014
				 dns_zone_getxfracl(zone), ISC_TRUE,
1048
				 client->view->rdclass, msg, sizeof(msg));
1015
				 ISC_LOG_ERROR));
1049
		CHECK(ns_client_checkacl(client, msg,
1050
					 dns_zone_getxfracl(zone), ISC_TRUE,
1051
					 ISC_LOG_ERROR));
1052
#ifdef DLZ
1053
	}
1054
#endif
1016
1055
1017
	/*
1056
	/*
1018
	 * AXFR over UDP is not possible.
1057
	 * AXFR over UDP is not possible.
Lines 1118-1132 Link Here
1118
	 * Create the xfrout context object.  This transfers the ownership
1157
	 * Create the xfrout context object.  This transfers the ownership
1119
	 * of "stream", "db", "ver", and "quota" to the xfrout context object.
1158
	 * of "stream", "db", "ver", and "quota" to the xfrout context object.
1120
	 */
1159
	 */
1121
	CHECK(xfrout_ctx_create(mctx, client, request->id, question_name,
1160
#ifdef DLZ
1122
				reqtype, question_class, db, ver, quota,
1161
	if(is_dlz)
1123
				stream, dns_message_gettsigkey(request),
1162
		CHECK(xfrout_ctx_create(mctx, client, request->id, question_name,
1124
				tsigbuf,
1163
					reqtype, question_class, db, ver, quota,
1125
				dns_zone_getmaxxfrout(zone),
1164
					stream, dns_message_gettsigkey(request),
1126
				dns_zone_getidleout(zone),
1165
					tsigbuf,
1127
				(format == dns_many_answers) ?
1166
					3600,
1167
					3600,
1168
					(format == dns_many_answers) ?
1128
					ISC_TRUE : ISC_FALSE,
1169
					ISC_TRUE : ISC_FALSE,
1129
				&xfr));
1170
					&xfr));
1171
	else
1172
#endif
1173
		CHECK(xfrout_ctx_create(mctx, client, request->id, question_name,
1174
					reqtype, question_class, db, ver, quota,
1175
					stream, dns_message_gettsigkey(request),
1176
					tsigbuf,
1177
					dns_zone_getmaxxfrout(zone),
1178
					dns_zone_getidleout(zone),
1179
					(format == dns_many_answers) ?
1180
					ISC_TRUE : ISC_FALSE,
1181
					&xfr));
1182
1130
	stream = NULL;
1183
	stream = NULL;
1131
	db = NULL;
1184
	db = NULL;
1132
	ver = NULL;
1185
	ver = NULL;
(-)bind-9.2.2-orig/configure (-14673 / +10846 lines)
Lines 1-14673 Link Here
1
#! /bin/sh
1
#! /bin/sh
2
# From configure.in Revision: 1.294.2.16.4.2 .
2
3
# Guess values for system-dependent variables and create Makefiles.
3
# From configure.in Revision: 1.294.2.16.4.2 
4
# Generated by GNU Autoconf 2.53.
4
5
#
5
# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
6
# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
6
## Copyright 1996, 1997, 1998, 1999, 2000, 2001
7
# Free Software Foundation, Inc.
7
## Free Software Foundation, Inc.
8
# This configure script is free software; the Free Software Foundation
8
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
9
# gives unlimited permission to copy, distribute and modify it.
9
##
10
10
## This program is free software; you can redistribute it and/or modify
11
# Find the correct PATH separator.  Usually this is `:', but
11
## it under the terms of the GNU General Public License as published by
12
# DJGPP uses `;' like DOS.
12
## the Free Software Foundation; either version 2 of the License, or
13
if test "X${PATH_SEPARATOR+set}" != Xset; then
13
## (at your option) any later version.
14
  UNAME=${UNAME-`uname 2>/dev/null`}
14
##
15
  case X$UNAME in
15
## This program is distributed in the hope that it will be useful, but
16
    *-DOS) lt_cv_sys_path_separator=';' ;;
16
## WITHOUT ANY WARRANTY; without even the implied warranty of
17
    *)     lt_cv_sys_path_separator=':' ;;
17
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18
  esac
18
## General Public License for more details.
19
fi
19
##
20
20
## You should have received a copy of the GNU General Public License
21
21
## along with this program; if not, write to the Free Software
22
# Check that we are running under the correct shell.
22
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
SHELL=${CONFIG_SHELL-/bin/sh}
23
##
24
24
## As a special exception to the GNU General Public License, if you
25
case X$ECHO in
25
## distribute this file as part of a program that contains a
26
X*--fallback-echo)
26
## configuration script generated by Autoconf, you may include it under
27
  # Remove one level of quotation (which was required for Make).
27
## the same distribution terms that you use for the rest of that program.
28
  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
28
29
  ;;
29
# serial 46 AC_PROG_LIBTOOL
30
esac
30
31
31
32
echo=${ECHO-echo}
32
33
if test "X$1" = X--no-reexec; then
33
34
  # Discard the --no-reexec flag, and continue.
34
# _LT_AC_CHECK_DLFCN
35
  shift
35
# --------------------
36
elif test "X$1" = X--fallback-echo; then
36
# _LT_AC_CHECK_DLFCN
37
  # Avoid inline document here, it may be left over
37
38
  :
38
# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
39
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
39
# ---------------------------------
40
  # Yippee, $echo works!
40
 # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
41
  :
41
42
else
42
# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
43
  # Restart under the correct shell.
43
# ---------------------------------
44
  exec $SHELL "$0" --no-reexec ${1+"$@"}
44
# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
45
fi
45
46
46
# _LT_AC_PROG_ECHO_BACKSLASH
47
if test "X$1" = X--fallback-echo; then
47
# --------------------------
48
  # used as fallback echo
48
# Add some code to the start of the generated configure script which
49
  shift
49
# will find an echo command which doesn;t interpret backslashes.
50
  cat <<EOF
50
# _LT_AC_PROG_ECHO_BACKSLASH
51
51
52
EOF
52
# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
53
  exit 0
53
#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
54
fi
54
# ------------------------------------------------------------------
55
55
# _LT_AC_TRY_DLOPEN_SELF
56
# The HP-UX ksh and POSIX shell print the target directory to stdout
56
57
# if CDPATH is set.
57
# AC_LIBTOOL_DLOPEN_SELF
58
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
58
# -------------------
59
59
# AC_LIBTOOL_DLOPEN_SELF
60
if test -z "$ECHO"; then
60
61
if test "X${echo_test_string+set}" != Xset; then
61
# _LT_AC_LTCONFIG_HACK
62
# find a string as large as possible, as long as the shell can cope with it
62
63
  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
63
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
64
    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
64
65
    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
65
66
       echo_test_string="`eval $cmd`" &&
66
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
67
       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
67
68
    then
68
69
      break
69
# AC_ENABLE_SHARED - implement the --enable-shared flag
70
    fi
70
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
71
  done
71
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
72
fi
72
#   `yes'.
73
73
74
if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
74
75
   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
75
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
76
   test "X$echo_testing_string" = "X$echo_test_string"; then
76
77
  :
77
78
else
78
# AC_ENABLE_STATIC - implement the --enable-static flag
79
  # The Solaris, AIX, and Digital Unix default echo programs unquote
79
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
80
  # backslashes.  This makes it impossible to quote backslashes using
80
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
81
  #   echo "$something" | sed 's/\\/\\\\/g'
81
#   `yes'.
82
  #
82
83
  # So, first we look for a working echo in the user's PATH.
83
84
84
# AC_DISABLE_STATIC - set the default static flag to --disable-static
85
  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
85
86
  for dir in $PATH /usr/ucb; do
86
87
    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
87
88
       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
88
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
89
       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
89
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
90
       test "X$echo_testing_string" = "X$echo_test_string"; then
90
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
91
      echo="$dir/echo"
91
#   `yes'.
92
      break
92
93
    fi
93
94
  done
94
# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
95
  IFS="$save_ifs"
95
96
96
97
  if test "X$echo" = Xecho; then
97
# AC_LIBTOOL_PICMODE - implement the --with-pic flag
98
    # We didn't find a better echo, so look for alternatives.
98
# Usage: AC_LIBTOOL_PICMODE[(MODE)]
99
    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
99
#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
100
       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
100
#   `both'.
101
       test "X$echo_testing_string" = "X$echo_test_string"; then
101
102
      # This shell has a builtin print -r that does the trick.
102
103
      echo='print -r'
103
104
    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
104
# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
105
	 test "X$CONFIG_SHELL" != X/bin/ksh; then
105
106
      # If we have ksh, try running configure again with it.
106
107
      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
107
108
      export ORIGINAL_CONFIG_SHELL
108
# AC_PATH_MAGIC - find a file program which can recognise a shared library
109
      CONFIG_SHELL=/bin/ksh
109
110
      export CONFIG_SHELL
110
111
      exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
111
112
    else
112
# AC_PROG_LD - find the path to the GNU or non-GNU linker
113
      # Try using printf.
113
114
      echo='printf %s\n'
114
115
      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
115
# AC_PROG_LD_GNU -
116
	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
116
117
	 test "X$echo_testing_string" = "X$echo_test_string"; then
117
118
	# Cool, printf works
118
# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
119
	:
119
#   -- PORTME Some linkers may need a different reload flag.
120
      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
120
121
	   test "X$echo_testing_string" = 'X\t' &&
121
122
	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
122
# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
123
	   test "X$echo_testing_string" = "X$echo_test_string"; then
123
#  -- PORTME fill in with the dynamic library characteristics
124
	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
124
125
	export CONFIG_SHELL
125
126
	SHELL="$CONFIG_SHELL"
126
127
	export SHELL
127
# AC_PROG_NM - find the path to a BSD-compatible name lister
128
	echo="$CONFIG_SHELL $0 --fallback-echo"
128
129
      elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
129
130
	   test "X$echo_testing_string" = 'X\t' &&
130
# AC_CHECK_LIBM - check for math library
131
	   echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
131
132
	   test "X$echo_testing_string" = "X$echo_test_string"; then
132
133
	echo="$CONFIG_SHELL $0 --fallback-echo"
133
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
134
      else
134
# the libltdl convenience library and INCLTDL to the include flags for
135
	# maybe with a smaller string...
135
# the libltdl header and adds --enable-ltdl-convenience to the
136
	prev=:
136
# configure arguments.  Note that LIBLTDL and INCLTDL are not
137
137
# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
138
	for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
138
# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
139
	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
139
# with '${top_builddir}/' and INCLTDL will be prefixed with
140
	  then
140
# '${top_srcdir}/' (note the single quotes!).  If your package is not
141
	    break
141
# flat and you're not using automake, define top_builddir and
142
	  fi
142
# top_srcdir appropriately in the Makefiles.
143
	  prev="$cmd"
143
144
	done
144
145
145
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
146
	if test "$prev" != 'sed 50q "$0"'; then
146
# the libltdl installable library and INCLTDL to the include flags for
147
	  echo_test_string=`eval $prev`
147
# the libltdl header and adds --enable-ltdl-install to the configure
148
	  export echo_test_string
148
# arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
149
	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
149
# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
150
	else
150
# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
151
	  # Oops.  We lost completely, so just stick with echo.
151
# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
152
	  echo=echo
152
# with '${top_srcdir}/' (note the single quotes!).  If your package is
153
	fi
153
# not flat and you're not using automake, define top_builddir and
154
      fi
154
# top_srcdir appropriately in the Makefiles.
155
    fi
155
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
156
  fi
156
157
fi
157
158
fi
158
# old names
159
159
160
# Copy echo and quote the copy suitably for passing to libtool from
160
161
# the Makefile, instead of quoting the original, which is used later.
161
162
ECHO=$echo
162
163
if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
163
164
   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
164
165
fi
165
166
166
167
167
# This is just to silence aclocal about the macro not being used
168
168
169
if expr a : '\(a\)' >/dev/null 2>&1; then
169
170
  as_expr=expr
170
# Guess values for system-dependent variables and create Makefiles.
171
else
171
# Generated automatically using autoconf version 2.13 
172
  as_expr=false
172
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
173
fi
173
#
174
174
# This configure script is free software; the Free Software Foundation
175
175
# gives unlimited permission to copy, distribute and modify it.
176
## --------------------- ##
176
177
## M4sh Initialization.  ##
177
# Defaults:
178
## --------------------- ##
178
ac_help=
179
179
ac_default_prefix=/usr/local
180
# Be Bourne compatible
180
# Any additions from configure.in:
181
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
181
ac_help="$ac_help
182
  emulate sh
182
  --with-dlz-postgres[=PATH]   Build with Postgres DLZ driver [yes|no|path].
183
  NULLCMD=:
183
                               (Required to use Postgres with DLZ)"
184
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
184
ac_help="$ac_help
185
  set -o posix
185
  --with-dlz-mysql[=PATH]   Build with MySQL DLZ driver [yes|no|path].
186
fi
186
                               (Required to use MySQL with DLZ)"
187
187
ac_help="$ac_help
188
# NLS nuisances.
188
  --with-dlz-bdb[=PATH]   Build with Berkeley DB DLZ driver [yes|no|path].
189
# Support unset when possible.
189
                               (Required to use Berkeley DB with DLZ)"
190
if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
190
ac_help="$ac_help
191
  as_unset=unset
191
  --with-dlz-filesystem[=PATH]   Build with filesystem DLZ driver [yes|no].
192
else
192
                               (Required to use file system driver with DLZ)"
193
  as_unset=false
193
ac_help="$ac_help
194
fi
194
  --with-dlz-ldap[=PATH]   Build with LDAP DLZ driver [yes|no|path].
195
195
                               (Required to use LDAP with DLZ)"
196
(set +x; test -n "`(LANG=C; export LANG) 2>&1`") &&
196
ac_help="$ac_help
197
    { $as_unset LANG || test "${LANG+set}" != set; } ||
197
  --with-dlz-odbc[=PATH]   Build with ODBC DLZ driver [yes|no|path].
198
      { LANG=C; export LANG; }
198
                               (Required to use ODBC with DLZ)"
199
(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") &&
199
ac_help="$ac_help
200
    { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } ||
200
  --with-dlz-stub[=PATH]   Build with stub DLZ driver [yes|no].
201
      { LC_ALL=C; export LC_ALL; }
201
                               (Required to use stub driver with DLZ)"
202
(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") &&
202
ac_help="$ac_help
203
    { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } ||
203
  --with-openssl[=PATH]   Build with OpenSSL [yes|no|path].
204
      { LC_TIME=C; export LC_TIME; }
204
                          (Required for DNSSEC)"
205
(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") &&
205
ac_help="$ac_help
206
    { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } ||
206
  --with-randomdev=PATH Specify path for random device"
207
      { LC_CTYPE=C; export LC_CTYPE; }
207
ac_help="$ac_help
208
(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") &&
208
  --enable-threads	enable multithreading"
209
    { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } ||
209
ac_help="$ac_help
210
      { LANGUAGE=C; export LANGUAGE; }
210
  --with-ptl2		on NetBSD, use the ptl2 thread library (experimental)"
211
(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") &&
211
ac_help="$ac_help
212
    { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } ||
212
  --with-purify[=PATH]	use Rational purify"
213
      { LC_COLLATE=C; export LC_COLLATE; }
213
ac_help="$ac_help
214
(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") &&
214
  --with-libtool	use GNU libtool (following indented options supported)"
215
    { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } ||
215
ac_help="$ac_help
216
      { LC_NUMERIC=C; export LC_NUMERIC; }
216
    --enable-shared[=PKGS]  build shared libraries [default=yes]"
217
(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") &&
217
ac_help="$ac_help
218
    { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
218
    --enable-static[=PKGS]  build static libraries [default=yes]"
219
      { LC_MESSAGES=C; export LC_MESSAGES; }
219
ac_help="$ac_help
220
220
    --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
221
221
ac_help="$ac_help
222
# Name of the executable.
222
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
223
as_me=`(basename "$0") 2>/dev/null ||
223
224
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
224
# Find the correct PATH separator.  Usually this is `:', but
225
	 X"$0" : 'X\(//\)$' \| \
225
# DJGPP uses `;' like DOS.
226
	 X"$0" : 'X\(/\)$' \| \
226
if test "X${PATH_SEPARATOR+set}" != Xset; then
227
	 .     : '\(.\)' 2>/dev/null ||
227
  UNAME=${UNAME-`uname 2>/dev/null`}
228
echo X/"$0" |
228
  case X$UNAME in
229
    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
229
    *-DOS) lt_cv_sys_path_separator=';' ;;
230
  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
230
    *)     lt_cv_sys_path_separator=':' ;;
231
  	  /^X\/\(\/\).*/{ s//\1/; q; }
231
  esac
232
  	  s/.*/./; q'`
232
fi
233
233
234
# PATH needs CR, and LINENO needs CR and PATH.
234
235
# Avoid depending upon Character Ranges.
235
# Check that we are running under the correct shell.
236
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
236
SHELL=${CONFIG_SHELL-/bin/sh}
237
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
237
238
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
238
case X$ECHO in
239
as_cr_digits='0123456789'
239
X*--fallback-echo)
240
as_cr_alnum=$as_cr_Letters$as_cr_digits
240
  # Remove one level of quotation (which was required for Make).
241
241
  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
242
# The user is always right.
242
  ;;
243
if test "${PATH_SEPARATOR+set}" != set; then
243
esac
244
  echo "#! /bin/sh" >conftest.sh
244
245
  echo  "exit 0"   >>conftest.sh
245
echo=${ECHO-echo}
246
  chmod +x conftest.sh
246
if test "X$1" = X--no-reexec; then
247
  if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
247
  # Discard the --no-reexec flag, and continue.
248
    PATH_SEPARATOR=';'
248
  shift
249
  else
249
elif test "X$1" = X--fallback-echo; then
250
    PATH_SEPARATOR=:
250
  # Avoid inline document here, it may be left over
251
  fi
251
  :
252
  rm -f conftest.sh
252
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
253
fi
253
  # Yippee, $echo works!
254
254
  :
255
255
else
256
  as_lineno_1=$LINENO
256
  # Restart under the correct shell.
257
  as_lineno_2=$LINENO
257
  exec $SHELL "$0" --no-reexec ${1+"$@"}
258
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
258
fi
259
  test "x$as_lineno_1" != "x$as_lineno_2" &&
259
260
  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
260
if test "X$1" = X--fallback-echo; then
261
  # Find who we are.  Look in the path if we contain no path at all
261
  # used as fallback echo
262
  # relative or not.
262
  shift
263
  case $0 in
263
  cat <<EOF
264
    *[\\/]* ) as_myself=$0 ;;
264
265
    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
265
EOF
266
for as_dir in $PATH
266
  exit 0
267
do
267
fi
268
  IFS=$as_save_IFS
268
269
  test -z "$as_dir" && as_dir=.
269
# The HP-UX ksh and POSIX shell print the target directory to stdout
270
  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
270
# if CDPATH is set.
271
done
271
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
272
272
273
       ;;
273
if test -z "$ECHO"; then
274
  esac
274
if test "X${echo_test_string+set}" != Xset; then
275
  # We did not find ourselves, most probably we were run as `sh COMMAND'
275
# find a string as large as possible, as long as the shell can cope with it
276
  # in which case we are not to be found in the path.
276
  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
277
  if test "x$as_myself" = x; then
277
    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
278
    as_myself=$0
278
    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
279
  fi
279
       echo_test_string="`eval $cmd`" &&
280
  if test ! -f "$as_myself"; then
280
       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
281
    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
281
    then
282
   { (exit 1); exit 1; }; }
282
      break
283
  fi
283
    fi
284
  case $CONFIG_SHELL in
284
  done
285
  '')
285
fi
286
    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
286
287
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
287
if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
288
do
288
   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
289
  IFS=$as_save_IFS
289
   test "X$echo_testing_string" = "X$echo_test_string"; then
290
  test -z "$as_dir" && as_dir=.
290
  :
291
  for as_base in sh bash ksh sh5; do
291
else
292
	 case $as_dir in
292
  # The Solaris, AIX, and Digital Unix default echo programs unquote
293
	 /*)
293
  # backslashes.  This makes it impossible to quote backslashes using
294
	   if ("$as_dir/$as_base" -c '
294
  #   echo "$something" | sed 's/\\/\\\\/g'
295
  as_lineno_1=$LINENO
295
  #
296
  as_lineno_2=$LINENO
296
  # So, first we look for a working echo in the user's PATH.
297
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
297
298
  test "x$as_lineno_1" != "x$as_lineno_2" &&
298
  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
299
  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
299
  for dir in $PATH /usr/ucb; do
300
	     CONFIG_SHELL=$as_dir/$as_base
300
    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
301
	     export CONFIG_SHELL
301
       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
302
	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
302
       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
303
	   fi;;
303
       test "X$echo_testing_string" = "X$echo_test_string"; then
304
	 esac
304
      echo="$dir/echo"
305
       done
305
      break
306
done
306
    fi
307
;;
307
  done
308
  esac
308
  IFS="$save_ifs"
309
309
310
  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
310
  if test "X$echo" = Xecho; then
311
  # uniformly replaced by the line number.  The first 'sed' inserts a
311
    # We didn't find a better echo, so look for alternatives.
312
  # line-number line before each line; the second 'sed' does the real
312
    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
313
  # work.  The second script uses 'N' to pair each line-number line
313
       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
314
  # with the numbered line, and appends trailing '-' during
314
       test "X$echo_testing_string" = "X$echo_test_string"; then
315
  # substitution so that $LINENO is not a special case at line end.
315
      # This shell has a builtin print -r that does the trick.
316
  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
316
      echo='print -r'
317
  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
317
    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
318
  sed '=' <$as_myself |
318
	 test "X$CONFIG_SHELL" != X/bin/ksh; then
319
    sed '
319
      # If we have ksh, try running configure again with it.
320
      N
320
      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
321
      s,$,-,
321
      export ORIGINAL_CONFIG_SHELL
322
      : loop
322
      CONFIG_SHELL=/bin/ksh
323
      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
323
      export CONFIG_SHELL
324
      t loop
324
      exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
325
      s,-$,,
325
    else
326
      s,^['$as_cr_digits']*\n,,
326
      # Try using printf.
327
    ' >$as_me.lineno &&
327
      echo='printf %s\n'
328
  chmod +x $as_me.lineno ||
328
      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
329
    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
329
	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
330
   { (exit 1); exit 1; }; }
330
	 test "X$echo_testing_string" = "X$echo_test_string"; then
331
331
	# Cool, printf works
332
  # Don't try to exec as it changes $[0], causing all sort of problems
332
	:
333
  # (the dirname of $[0] is not the place where we might find the
333
      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
334
  # original and so on.  Autoconf is especially sensible to this).
334
	   test "X$echo_testing_string" = 'X\t' &&
335
  . ./$as_me.lineno
335
	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
336
  # Exit status is that of the last command.
336
	   test "X$echo_testing_string" = "X$echo_test_string"; then
337
  exit
337
	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
338
}
338
	export CONFIG_SHELL
339
339
	SHELL="$CONFIG_SHELL"
340
340
	export SHELL
341
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
341
	echo="$CONFIG_SHELL $0 --fallback-echo"
342
  *c*,-n*) ECHO_N= ECHO_C='
342
      elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
343
' ECHO_T='	' ;;
343
	   test "X$echo_testing_string" = 'X\t' &&
344
  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
344
	   echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
345
  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
345
	   test "X$echo_testing_string" = "X$echo_test_string"; then
346
esac
346
	echo="$CONFIG_SHELL $0 --fallback-echo"
347
347
      else
348
if expr a : '\(a\)' >/dev/null 2>&1; then
348
	# maybe with a smaller string...
349
  as_expr=expr
349
	prev=:
350
else
350
351
  as_expr=false
351
	for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
352
fi
352
	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
353
353
	  then
354
rm -f conf$$ conf$$.exe conf$$.file
354
	    break
355
echo >conf$$.file
355
	  fi
356
if ln -s conf$$.file conf$$ 2>/dev/null; then
356
	  prev="$cmd"
357
  # We could just check for DJGPP; but this test a) works b) is more generic
357
	done
358
  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
358
359
  if test -f conf$$.exe; then
359
	if test "$prev" != 'sed 50q "$0"'; then
360
    # Don't use ln at all; we don't have any links
360
	  echo_test_string=`eval $prev`
361
    as_ln_s='cp -p'
361
	  export echo_test_string
362
  else
362
	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
363
    as_ln_s='ln -s'
363
	else
364
  fi
364
	  # Oops.  We lost completely, so just stick with echo.
365
elif ln conf$$.file conf$$ 2>/dev/null; then
365
	  echo=echo
366
  as_ln_s=ln
366
	fi
367
else
367
      fi
368
  as_ln_s='cp -p'
368
    fi
369
fi
369
  fi
370
rm -f conf$$ conf$$.exe conf$$.file
370
fi
371
371
fi
372
as_executable_p="test -f"
372
373
373
# Copy echo and quote the copy suitably for passing to libtool from
374
# Sed expression to map a string onto a valid CPP name.
374
# the Makefile, instead of quoting the original, which is used later.
375
as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
375
ECHO=$echo
376
376
if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
377
# Sed expression to map a string onto a valid variable name.
377
   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
378
as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
378
fi
379
379
380
380
381
# IFS
381
ac_help="$ac_help
382
# We need space, tab and new line, in precisely that order.
382
    --disable-libtool-lock  avoid locking (might break parallel builds)"
383
as_nl='
383
ac_help="$ac_help
384
'
384
    --with-pic              try to use only PIC/non-PIC objects [default=use both]"
385
IFS=" 	$as_nl"
385
ac_help="$ac_help
386
386
  --enable-libbind		build libbind [default=no]"
387
# CDPATH.
387
ac_help="$ac_help
388
$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
388
  --enable-ipv6		use IPv6 [default=autodetect]"
389
389
ac_help="$ac_help
390
390
  --with-kame[=PATH]	use Kame IPv6 [default path /usr/local/v6]"
391
# Name of the host.
391
ac_help="$ac_help
392
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
392
  --disable-linux-caps	disable linux capabilities"
393
# so uname gets run too.
393
394
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
394
# Initialize some variables set by options.
395
395
# The variables have the same names as the options, with
396
exec 6>&1
396
# dashes changed to underlines.
397
397
build=NONE
398
#
398
cache_file=./config.cache
399
# Initializations.
399
exec_prefix=NONE
400
#
400
host=NONE
401
ac_default_prefix=/usr/local
401
no_create=
402
cross_compiling=no
402
nonopt=NONE
403
subdirs=
403
no_recursion=
404
MFLAGS=
404
prefix=NONE
405
MAKEFLAGS=
405
program_prefix=NONE
406
SHELL=${CONFIG_SHELL-/bin/sh}
406
program_suffix=NONE
407
407
program_transform_name=s,x,x,
408
# Maximum number of lines to put in a shell here document.
408
silent=
409
# This variable seems obsolete.  It should probably be removed, and
409
site=
410
# only ac_max_sed_lines should be used.
410
srcdir=
411
: ${ac_max_here_lines=38}
411
target=NONE
412
412
verbose=
413
# Identity of this package.
413
x_includes=NONE
414
PACKAGE_NAME=
414
x_libraries=NONE
415
PACKAGE_TARNAME=
415
bindir='${exec_prefix}/bin'
416
PACKAGE_VERSION=
416
sbindir='${exec_prefix}/sbin'
417
PACKAGE_STRING=
417
libexecdir='${exec_prefix}/libexec'
418
PACKAGE_BUGREPORT=
418
datadir='${prefix}/share'
419
419
sysconfdir='${prefix}/etc'
420
ac_unique_file="lib/dns/name.c"
420
sharedstatedir='${prefix}/com'
421
ac_subdirs_all="$ac_subdirs_all lib/bind"
421
localstatedir='${prefix}/var'
422
# Factoring default headers for most tests.
422
libdir='${exec_prefix}/lib'
423
ac_includes_default="\
423
includedir='${prefix}/include'
424
#include <stdio.h>
424
oldincludedir='/usr/include'
425
#if HAVE_SYS_TYPES_H
425
infodir='${prefix}/info'
426
# include <sys/types.h>
426
mandir='${prefix}/man'
427
#endif
427
428
#if HAVE_SYS_STAT_H
428
# Initialize some other variables.
429
# include <sys/stat.h>
429
subdirs=
430
#endif
430
MFLAGS= MAKEFLAGS=
431
#if STDC_HEADERS
431
SHELL=${CONFIG_SHELL-/bin/sh}
432
# include <stdlib.h>
432
# Maximum number of lines to put in a shell here document.
433
# include <stddef.h>
433
ac_max_here_lines=12
434
#else
434
435
# if HAVE_STDLIB_H
435
ac_prev=
436
#  include <stdlib.h>
436
for ac_option
437
# endif
437
do
438
#endif
438
439
#if HAVE_STRING_H
439
  # If the previous option needs an argument, assign it.
440
# if !STDC_HEADERS && HAVE_MEMORY_H
440
  if test -n "$ac_prev"; then
441
#  include <memory.h>
441
    eval "$ac_prev=\$ac_option"
442
# endif
442
    ac_prev=
443
# include <string.h>
443
    continue
444
#endif
444
  fi
445
#if HAVE_STRINGS_H
445
446
# include <strings.h>
446
  case "$ac_option" in
447
#endif
447
  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
448
#if HAVE_INTTYPES_H
448
  *) ac_optarg= ;;
449
# include <inttypes.h>
449
  esac
450
#else
450
451
# if HAVE_STDINT_H
451
  # Accept the important Cygnus configure options, so we can diagnose typos.
452
#  include <stdint.h>
452
453
# endif
453
  case "$ac_option" in
454
#endif
454
455
#if HAVE_UNISTD_H
455
  -bindir | --bindir | --bindi | --bind | --bin | --bi)
456
# include <unistd.h>
456
    ac_prev=bindir ;;
457
#endif"
457
  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
458
458
    bindir="$ac_optarg" ;;
459
459
460
# Initialize some variables set by options.
460
  -build | --build | --buil | --bui | --bu)
461
ac_init_help=
461
    ac_prev=build ;;
462
ac_init_version=false
462
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
463
# The variables have the same names as the options, with
463
    build="$ac_optarg" ;;
464
# dashes changed to underlines.
464
465
cache_file=/dev/null
465
  -cache-file | --cache-file | --cache-fil | --cache-fi \
466
exec_prefix=NONE
466
  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
467
no_create=
467
    ac_prev=cache_file ;;
468
no_recursion=
468
  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
469
prefix=NONE
469
  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
470
program_prefix=NONE
470
    cache_file="$ac_optarg" ;;
471
program_suffix=NONE
471
472
program_transform_name=s,x,x,
472
  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
473
silent=
473
    ac_prev=datadir ;;
474
site=
474
  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
475
srcdir=
475
  | --da=*)
476
verbose=
476
    datadir="$ac_optarg" ;;
477
x_includes=NONE
477
478
x_libraries=NONE
478
  -disable-* | --disable-*)
479
479
    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
480
# Installation directory options.
480
    # Reject names that are not valid shell variable names.
481
# These are left unexpanded so users can "make install exec_prefix=/foo"
481
    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
482
# and all the variables that are supposed to be based on exec_prefix
482
      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
483
# by default will actually change.
483
    fi
484
# Use braces instead of parens because sh, perl, etc. also accept them.
484
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
485
bindir='${exec_prefix}/bin'
485
    eval "enable_${ac_feature}=no" ;;
486
sbindir='${exec_prefix}/sbin'
486
487
libexecdir='${exec_prefix}/libexec'
487
  -enable-* | --enable-*)
488
datadir='${prefix}/share'
488
    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
489
sysconfdir='${prefix}/etc'
489
    # Reject names that are not valid shell variable names.
490
sharedstatedir='${prefix}/com'
490
    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
491
localstatedir='${prefix}/var'
491
      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
492
libdir='${exec_prefix}/lib'
492
    fi
493
includedir='${prefix}/include'
493
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
494
oldincludedir='/usr/include'
494
    case "$ac_option" in
495
infodir='${prefix}/info'
495
      *=*) ;;
496
mandir='${prefix}/man'
496
      *) ac_optarg=yes ;;
497
497
    esac
498
ac_prev=
498
    eval "enable_${ac_feature}='$ac_optarg'" ;;
499
for ac_option
499
500
do
500
  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
501
  # If the previous option needs an argument, assign it.
501
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
502
  if test -n "$ac_prev"; then
502
  | --exec | --exe | --ex)
503
    eval "$ac_prev=\$ac_option"
503
    ac_prev=exec_prefix ;;
504
    ac_prev=
504
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
505
    continue
505
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
506
  fi
506
  | --exec=* | --exe=* | --ex=*)
507
507
    exec_prefix="$ac_optarg" ;;
508
  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
508
509
509
  -gas | --gas | --ga | --g)
510
  # Accept the important Cygnus configure options, so we can diagnose typos.
510
    # Obsolete; use --with-gas.
511
511
    with_gas=yes ;;
512
  case $ac_option in
512
513
513
  -help | --help | --hel | --he)
514
  -bindir | --bindir | --bindi | --bind | --bin | --bi)
514
    # Omit some internal or obsolete options to make the list less imposing.
515
    ac_prev=bindir ;;
515
    # This message is too long to be a string in the A/UX 3.1 sh.
516
  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
516
    cat << EOF
517
    bindir=$ac_optarg ;;
517
Usage: configure [options] [host]
518
518
Options: [defaults in brackets after descriptions]
519
  -build | --build | --buil | --bui | --bu)
519
Configuration:
520
    ac_prev=build_alias ;;
520
  --cache-file=FILE       cache test results in FILE
521
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
521
  --help                  print this message
522
    build_alias=$ac_optarg ;;
522
  --no-create             do not create output files
523
523
  --quiet, --silent       do not print \`checking...' messages
524
  -cache-file | --cache-file | --cache-fil | --cache-fi \
524
  --version               print the version of autoconf that created configure
525
  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
525
Directory and file names:
526
    ac_prev=cache_file ;;
526
  --prefix=PREFIX         install architecture-independent files in PREFIX
527
  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
527
                          [$ac_default_prefix]
528
  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
528
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
529
    cache_file=$ac_optarg ;;
529
                          [same as prefix]
530
530
  --bindir=DIR            user executables in DIR [EPREFIX/bin]
531
  --config-cache | -C)
531
  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
532
    cache_file=config.cache ;;
532
  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
533
533
  --datadir=DIR           read-only architecture-independent data in DIR
534
  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
534
                          [PREFIX/share]
535
    ac_prev=datadir ;;
535
  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
536
  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
536
  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
537
  | --da=*)
537
                          [PREFIX/com]
538
    datadir=$ac_optarg ;;
538
  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
539
539
  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
540
  -disable-* | --disable-*)
540
  --includedir=DIR        C header files in DIR [PREFIX/include]
541
    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
541
  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
542
    # Reject names that are not valid shell variable names.
542
  --infodir=DIR           info documentation in DIR [PREFIX/info]
543
    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
543
  --mandir=DIR            man documentation in DIR [PREFIX/man]
544
      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
544
  --srcdir=DIR            find the sources in DIR [configure dir or ..]
545
   { (exit 1); exit 1; }; }
545
  --program-prefix=PREFIX prepend PREFIX to installed program names
546
    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
546
  --program-suffix=SUFFIX append SUFFIX to installed program names
547
    eval "enable_$ac_feature=no" ;;
547
  --program-transform-name=PROGRAM
548
548
                          run sed PROGRAM on installed program names
549
  -enable-* | --enable-*)
549
EOF
550
    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
550
    cat << EOF
551
    # Reject names that are not valid shell variable names.
551
Host type:
552
    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
552
  --build=BUILD           configure for building on BUILD [BUILD=HOST]
553
      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
553
  --host=HOST             configure for HOST [guessed]
554
   { (exit 1); exit 1; }; }
554
  --target=TARGET         configure for TARGET [TARGET=HOST]
555
    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
555
Features and packages:
556
    case $ac_option in
556
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
557
      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
557
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
558
      *) ac_optarg=yes ;;
558
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
559
    esac
559
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
560
    eval "enable_$ac_feature='$ac_optarg'" ;;
560
  --x-includes=DIR        X include files are in DIR
561
561
  --x-libraries=DIR       X library files are in DIR
562
  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
562
EOF
563
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
563
    if test -n "$ac_help"; then
564
  | --exec | --exe | --ex)
564
      echo "--enable and --with options recognized:$ac_help"
565
    ac_prev=exec_prefix ;;
565
    fi
566
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
566
    exit 0 ;;
567
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
567
568
  | --exec=* | --exe=* | --ex=*)
568
  -host | --host | --hos | --ho)
569
    exec_prefix=$ac_optarg ;;
569
    ac_prev=host ;;
570
570
  -host=* | --host=* | --hos=* | --ho=*)
571
  -gas | --gas | --ga | --g)
571
    host="$ac_optarg" ;;
572
    # Obsolete; use --with-gas.
572
573
    with_gas=yes ;;
573
  -includedir | --includedir | --includedi | --included | --include \
574
574
  | --includ | --inclu | --incl | --inc)
575
  -help | --help | --hel | --he | -h)
575
    ac_prev=includedir ;;
576
    ac_init_help=long ;;
576
  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
577
  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
577
  | --includ=* | --inclu=* | --incl=* | --inc=*)
578
    ac_init_help=recursive ;;
578
    includedir="$ac_optarg" ;;
579
  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
579
580
    ac_init_help=short ;;
580
  -infodir | --infodir | --infodi | --infod | --info | --inf)
581
581
    ac_prev=infodir ;;
582
  -host | --host | --hos | --ho)
582
  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
583
    ac_prev=host_alias ;;
583
    infodir="$ac_optarg" ;;
584
  -host=* | --host=* | --hos=* | --ho=*)
584
585
    host_alias=$ac_optarg ;;
585
  -libdir | --libdir | --libdi | --libd)
586
586
    ac_prev=libdir ;;
587
  -includedir | --includedir | --includedi | --included | --include \
587
  -libdir=* | --libdir=* | --libdi=* | --libd=*)
588
  | --includ | --inclu | --incl | --inc)
588
    libdir="$ac_optarg" ;;
589
    ac_prev=includedir ;;
589
590
  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
590
  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
591
  | --includ=* | --inclu=* | --incl=* | --inc=*)
591
  | --libexe | --libex | --libe)
592
    includedir=$ac_optarg ;;
592
    ac_prev=libexecdir ;;
593
593
  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
594
  -infodir | --infodir | --infodi | --infod | --info | --inf)
594
  | --libexe=* | --libex=* | --libe=*)
595
    ac_prev=infodir ;;
595
    libexecdir="$ac_optarg" ;;
596
  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
596
597
    infodir=$ac_optarg ;;
597
  -localstatedir | --localstatedir | --localstatedi | --localstated \
598
598
  | --localstate | --localstat | --localsta | --localst \
599
  -libdir | --libdir | --libdi | --libd)
599
  | --locals | --local | --loca | --loc | --lo)
600
    ac_prev=libdir ;;
600
    ac_prev=localstatedir ;;
601
  -libdir=* | --libdir=* | --libdi=* | --libd=*)
601
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
602
    libdir=$ac_optarg ;;
602
  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
603
603
  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
604
  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
604
    localstatedir="$ac_optarg" ;;
605
  | --libexe | --libex | --libe)
605
606
    ac_prev=libexecdir ;;
606
  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
607
  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
607
    ac_prev=mandir ;;
608
  | --libexe=* | --libex=* | --libe=*)
608
  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
609
    libexecdir=$ac_optarg ;;
609
    mandir="$ac_optarg" ;;
610
610
611
  -localstatedir | --localstatedir | --localstatedi | --localstated \
611
  -nfp | --nfp | --nf)
612
  | --localstate | --localstat | --localsta | --localst \
612
    # Obsolete; use --without-fp.
613
  | --locals | --local | --loca | --loc | --lo)
613
    with_fp=no ;;
614
    ac_prev=localstatedir ;;
614
615
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
615
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
616
  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
616
  | --no-cr | --no-c)
617
  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
617
    no_create=yes ;;
618
    localstatedir=$ac_optarg ;;
618
619
619
  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
620
  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
620
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
621
    ac_prev=mandir ;;
621
    no_recursion=yes ;;
622
  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
622
623
    mandir=$ac_optarg ;;
623
  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
624
624
  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
625
  -nfp | --nfp | --nf)
625
  | --oldin | --oldi | --old | --ol | --o)
626
    # Obsolete; use --without-fp.
626
    ac_prev=oldincludedir ;;
627
    with_fp=no ;;
627
  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
628
628
  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
629
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
629
  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
630
  | --no-cr | --no-c | -n)
630
    oldincludedir="$ac_optarg" ;;
631
    no_create=yes ;;
631
632
632
  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
633
  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
633
    ac_prev=prefix ;;
634
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
634
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
635
    no_recursion=yes ;;
635
    prefix="$ac_optarg" ;;
636
636
637
  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
637
  -program-prefix | --program-prefix | --program-prefi | --program-pref \
638
  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
638
  | --program-pre | --program-pr | --program-p)
639
  | --oldin | --oldi | --old | --ol | --o)
639
    ac_prev=program_prefix ;;
640
    ac_prev=oldincludedir ;;
640
  -program-prefix=* | --program-prefix=* | --program-prefi=* \
641
  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
641
  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
642
  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
642
    program_prefix="$ac_optarg" ;;
643
  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
643
644
    oldincludedir=$ac_optarg ;;
644
  -program-suffix | --program-suffix | --program-suffi | --program-suff \
645
645
  | --program-suf | --program-su | --program-s)
646
  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
646
    ac_prev=program_suffix ;;
647
    ac_prev=prefix ;;
647
  -program-suffix=* | --program-suffix=* | --program-suffi=* \
648
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
648
  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
649
    prefix=$ac_optarg ;;
649
    program_suffix="$ac_optarg" ;;
650
650
651
  -program-prefix | --program-prefix | --program-prefi | --program-pref \
651
  -program-transform-name | --program-transform-name \
652
  | --program-pre | --program-pr | --program-p)
652
  | --program-transform-nam | --program-transform-na \
653
    ac_prev=program_prefix ;;
653
  | --program-transform-n | --program-transform- \
654
  -program-prefix=* | --program-prefix=* | --program-prefi=* \
654
  | --program-transform | --program-transfor \
655
  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
655
  | --program-transfo | --program-transf \
656
    program_prefix=$ac_optarg ;;
656
  | --program-trans | --program-tran \
657
657
  | --progr-tra | --program-tr | --program-t)
658
  -program-suffix | --program-suffix | --program-suffi | --program-suff \
658
    ac_prev=program_transform_name ;;
659
  | --program-suf | --program-su | --program-s)
659
  -program-transform-name=* | --program-transform-name=* \
660
    ac_prev=program_suffix ;;
660
  | --program-transform-nam=* | --program-transform-na=* \
661
  -program-suffix=* | --program-suffix=* | --program-suffi=* \
661
  | --program-transform-n=* | --program-transform-=* \
662
  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
662
  | --program-transform=* | --program-transfor=* \
663
    program_suffix=$ac_optarg ;;
663
  | --program-transfo=* | --program-transf=* \
664
664
  | --program-trans=* | --program-tran=* \
665
  -program-transform-name | --program-transform-name \
665
  | --progr-tra=* | --program-tr=* | --program-t=*)
666
  | --program-transform-nam | --program-transform-na \
666
    program_transform_name="$ac_optarg" ;;
667
  | --program-transform-n | --program-transform- \
667
668
  | --program-transform | --program-transfor \
668
  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
669
  | --program-transfo | --program-transf \
669
  | -silent | --silent | --silen | --sile | --sil)
670
  | --program-trans | --program-tran \
670
    silent=yes ;;
671
  | --progr-tra | --program-tr | --program-t)
671
672
    ac_prev=program_transform_name ;;
672
  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
673
  -program-transform-name=* | --program-transform-name=* \
673
    ac_prev=sbindir ;;
674
  | --program-transform-nam=* | --program-transform-na=* \
674
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
675
  | --program-transform-n=* | --program-transform-=* \
675
  | --sbi=* | --sb=*)
676
  | --program-transform=* | --program-transfor=* \
676
    sbindir="$ac_optarg" ;;
677
  | --program-transfo=* | --program-transf=* \
677
678
  | --program-trans=* | --program-tran=* \
678
  -sharedstatedir | --sharedstatedir | --sharedstatedi \
679
  | --progr-tra=* | --program-tr=* | --program-t=*)
679
  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
680
    program_transform_name=$ac_optarg ;;
680
  | --sharedst | --shareds | --shared | --share | --shar \
681
681
  | --sha | --sh)
682
  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
682
    ac_prev=sharedstatedir ;;
683
  | -silent | --silent | --silen | --sile | --sil)
683
  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
684
    silent=yes ;;
684
  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
685
685
  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
686
  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
686
  | --sha=* | --sh=*)
687
    ac_prev=sbindir ;;
687
    sharedstatedir="$ac_optarg" ;;
688
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
688
689
  | --sbi=* | --sb=*)
689
  -site | --site | --sit)
690
    sbindir=$ac_optarg ;;
690
    ac_prev=site ;;
691
691
  -site=* | --site=* | --sit=*)
692
  -sharedstatedir | --sharedstatedir | --sharedstatedi \
692
    site="$ac_optarg" ;;
693
  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
693
694
  | --sharedst | --shareds | --shared | --share | --shar \
694
  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
695
  | --sha | --sh)
695
    ac_prev=srcdir ;;
696
    ac_prev=sharedstatedir ;;
696
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
697
  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
697
    srcdir="$ac_optarg" ;;
698
  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
698
699
  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
699
  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
700
  | --sha=* | --sh=*)
700
  | --syscon | --sysco | --sysc | --sys | --sy)
701
    sharedstatedir=$ac_optarg ;;
701
    ac_prev=sysconfdir ;;
702
702
  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
703
  -site | --site | --sit)
703
  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
704
    ac_prev=site ;;
704
    sysconfdir="$ac_optarg" ;;
705
  -site=* | --site=* | --sit=*)
705
706
    site=$ac_optarg ;;
706
  -target | --target | --targe | --targ | --tar | --ta | --t)
707
707
    ac_prev=target ;;
708
  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
708
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
709
    ac_prev=srcdir ;;
709
    target="$ac_optarg" ;;
710
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
710
711
    srcdir=$ac_optarg ;;
711
  -v | -verbose | --verbose | --verbos | --verbo | --verb)
712
712
    verbose=yes ;;
713
  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
713
714
  | --syscon | --sysco | --sysc | --sys | --sy)
714
  -version | --version | --versio | --versi | --vers)
715
    ac_prev=sysconfdir ;;
715
    echo "configure generated by autoconf version 2.13"
716
  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
716
    exit 0 ;;
717
  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
717
718
    sysconfdir=$ac_optarg ;;
718
  -with-* | --with-*)
719
719
    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
720
  -target | --target | --targe | --targ | --tar | --ta | --t)
720
    # Reject names that are not valid shell variable names.
721
    ac_prev=target_alias ;;
721
    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
722
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
722
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
723
    target_alias=$ac_optarg ;;
723
    fi
724
724
    ac_package=`echo $ac_package| sed 's/-/_/g'`
725
  -v | -verbose | --verbose | --verbos | --verbo | --verb)
725
    case "$ac_option" in
726
    verbose=yes ;;
726
      *=*) ;;
727
727
      *) ac_optarg=yes ;;
728
  -version | --version | --versio | --versi | --vers | -V)
728
    esac
729
    ac_init_version=: ;;
729
    eval "with_${ac_package}='$ac_optarg'" ;;
730
730
731
  -with-* | --with-*)
731
  -without-* | --without-*)
732
    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
732
    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
733
    # Reject names that are not valid shell variable names.
733
    # Reject names that are not valid shell variable names.
734
    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
734
    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
735
      { echo "$as_me: error: invalid package name: $ac_package" >&2
735
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
736
   { (exit 1); exit 1; }; }
736
    fi
737
    ac_package=`echo $ac_package| sed 's/-/_/g'`
737
    ac_package=`echo $ac_package| sed 's/-/_/g'`
738
    case $ac_option in
738
    eval "with_${ac_package}=no" ;;
739
      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
739
740
      *) ac_optarg=yes ;;
740
  --x)
741
    esac
741
    # Obsolete; use --with-x.
742
    eval "with_$ac_package='$ac_optarg'" ;;
742
    with_x=yes ;;
743
743
744
  -without-* | --without-*)
744
  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
745
    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
745
  | --x-incl | --x-inc | --x-in | --x-i)
746
    # Reject names that are not valid shell variable names.
746
    ac_prev=x_includes ;;
747
    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
747
  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
748
      { echo "$as_me: error: invalid package name: $ac_package" >&2
748
  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
749
   { (exit 1); exit 1; }; }
749
    x_includes="$ac_optarg" ;;
750
    ac_package=`echo $ac_package | sed 's/-/_/g'`
750
751
    eval "with_$ac_package=no" ;;
751
  -x-libraries | --x-libraries | --x-librarie | --x-librari \
752
752
  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
753
  --x)
753
    ac_prev=x_libraries ;;
754
    # Obsolete; use --with-x.
754
  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
755
    with_x=yes ;;
755
  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
756
756
    x_libraries="$ac_optarg" ;;
757
  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
757
758
  | --x-incl | --x-inc | --x-in | --x-i)
758
  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
759
    ac_prev=x_includes ;;
759
    ;;
760
  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
760
761
  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
761
  *)
762
    x_includes=$ac_optarg ;;
762
    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
763
763
      echo "configure: warning: $ac_option: invalid host type" 1>&2
764
  -x-libraries | --x-libraries | --x-librarie | --x-librari \
764
    fi
765
  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
765
    if test "x$nonopt" != xNONE; then
766
    ac_prev=x_libraries ;;
766
      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
767
  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
767
    fi
768
  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
768
    nonopt="$ac_option"
769
    x_libraries=$ac_optarg ;;
769
    ;;
770
770
771
  -*) { echo "$as_me: error: unrecognized option: $ac_option
771
  esac
772
Try \`$0 --help' for more information." >&2
772
done
773
   { (exit 1); exit 1; }; }
773
774
    ;;
774
if test -n "$ac_prev"; then
775
775
  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
776
  *=*)
776
fi
777
    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
777
778
    # Reject names that are not valid shell variable names.
778
trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
779
    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
779
780
      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
780
# File descriptor usage:
781
   { (exit 1); exit 1; }; }
781
# 0 standard input
782
    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
782
# 1 file creation
783
    eval "$ac_envvar='$ac_optarg'"
783
# 2 errors and warnings
784
    export $ac_envvar ;;
784
# 3 some systems may open it to /dev/tty
785
785
# 4 used on the Kubota Titan
786
  *)
786
# 6 checking for... messages and results
787
    # FIXME: should be removed in autoconf 3.0.
787
# 5 compiler messages saved in config.log
788
    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
788
if test "$silent" = yes; then
789
    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
789
  exec 6>/dev/null
790
      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
790
else
791
    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
791
  exec 6>&1
792
    ;;
792
fi
793
793
exec 5>./config.log
794
  esac
794
795
done
795
echo "\
796
796
This file contains any messages produced by compilers while
797
if test -n "$ac_prev"; then
797
running configure, to aid debugging if configure makes a mistake.
798
  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
798
" 1>&5
799
  { echo "$as_me: error: missing argument to $ac_option" >&2
799
800
   { (exit 1); exit 1; }; }
800
# Strip out --no-create and --no-recursion so they do not pile up.
801
fi
801
# Also quote any args containing shell metacharacters.
802
802
ac_configure_args=
803
# Be sure to have absolute paths.
803
for ac_arg
804
for ac_var in exec_prefix prefix
804
do
805
do
805
  case "$ac_arg" in
806
  eval ac_val=$`echo $ac_var`
806
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
807
  case $ac_val in
807
  | --no-cr | --no-c) ;;
808
    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
808
  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
809
    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
809
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
810
   { (exit 1); exit 1; }; };;
810
  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
811
  esac
811
  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
812
done
812
  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
813
813
  esac
814
# Be sure to have absolute paths.
814
done
815
for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
815
816
              localstatedir libdir includedir oldincludedir infodir mandir
816
# NLS nuisances.
817
do
817
# Only set these to C if already set.  These must not be set unconditionally
818
  eval ac_val=$`echo $ac_var`
818
# because not all systems understand e.g. LANG=C (notably SCO).
819
  case $ac_val in
819
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
820
    [\\/$]* | ?:[\\/]* ) ;;
820
# Non-C LC_CTYPE values break the ctype check.
821
    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
821
if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
822
   { (exit 1); exit 1; }; };;
822
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
823
  esac
823
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
824
done
824
if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
825
825
826
# There might be people who depend on the old broken behavior: `$host'
826
# confdefs.h avoids OS command line length limits that DEFS can exceed.
827
# used to hold the argument of --host etc.
827
rm -rf conftest* confdefs.h
828
# FIXME: To remove some day.
828
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
829
build=$build_alias
829
echo > confdefs.h
830
host=$host_alias
830
831
target=$target_alias
831
# A filename unique to this package, relative to the directory that
832
832
# configure is in, which we can look for to find out if srcdir is correct.
833
# FIXME: To remove some day.
833
ac_unique_file=lib/dns/name.c
834
if test "x$host_alias" != x; then
834
835
  if test "x$build_alias" = x; then
835
# Find the source files, if location was not specified.
836
    cross_compiling=maybe
836
if test -z "$srcdir"; then
837
    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
837
  ac_srcdir_defaulted=yes
838
    If a cross compiler is detected then cross compile mode will be used." >&2
838
  # Try the directory containing this script, then its parent.
839
  elif test "x$build_alias" != "x$host_alias"; then
839
  ac_prog=$0
840
    cross_compiling=yes
840
  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
841
  fi
841
  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
842
fi
842
  srcdir=$ac_confdir
843
843
  if test ! -r $srcdir/$ac_unique_file; then
844
ac_tool_prefix=
844
    srcdir=..
845
test -n "$host_alias" && ac_tool_prefix=$host_alias-
845
  fi
846
846
else
847
test "$silent" = yes && exec 6>/dev/null
847
  ac_srcdir_defaulted=no
848
848
fi
849
849
if test ! -r $srcdir/$ac_unique_file; then
850
# Find the source files, if location was not specified.
850
  if test "$ac_srcdir_defaulted" = yes; then
851
if test -z "$srcdir"; then
851
    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
852
  ac_srcdir_defaulted=yes
852
  else
853
  # Try the directory containing this script, then its parent.
853
    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
854
  ac_confdir=`(dirname "$0") 2>/dev/null ||
854
  fi
855
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
855
fi
856
         X"$0" : 'X\(//\)[^/]' \| \
856
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
857
         X"$0" : 'X\(//\)$' \| \
857
858
         X"$0" : 'X\(/\)' \| \
858
# Prefer explicitly selected file to automatically selected ones.
859
         .     : '\(.\)' 2>/dev/null ||
859
if test -z "$CONFIG_SITE"; then
860
echo X"$0" |
860
  if test "x$prefix" != xNONE; then
861
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
861
    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
862
  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
862
  else
863
  	  /^X\(\/\/\)$/{ s//\1/; q; }
863
    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
864
  	  /^X\(\/\).*/{ s//\1/; q; }
864
  fi
865
  	  s/.*/./; q'`
865
fi
866
  srcdir=$ac_confdir
866
for ac_site_file in $CONFIG_SITE; do
867
  if test ! -r $srcdir/$ac_unique_file; then
867
  if test -r "$ac_site_file"; then
868
    srcdir=..
868
    echo "loading site script $ac_site_file"
869
  fi
869
    . "$ac_site_file"
870
else
870
  fi
871
  ac_srcdir_defaulted=no
871
done
872
fi
872
873
if test ! -r $srcdir/$ac_unique_file; then
873
if test -r "$cache_file"; then
874
  if test "$ac_srcdir_defaulted" = yes; then
874
  echo "loading cache $cache_file"
875
    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
875
  . $cache_file
876
   { (exit 1); exit 1; }; }
876
else
877
  else
877
  echo "creating cache $cache_file"
878
    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
878
  > $cache_file
879
   { (exit 1); exit 1; }; }
879
fi
880
  fi
880
881
fi
881
ac_ext=c
882
srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
882
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
883
ac_env_build_alias_set=${build_alias+set}
883
ac_cpp='$CPP $CPPFLAGS'
884
ac_env_build_alias_value=$build_alias
884
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
885
ac_cv_env_build_alias_set=${build_alias+set}
885
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
886
ac_cv_env_build_alias_value=$build_alias
886
cross_compiling=$ac_cv_prog_cc_cross
887
ac_env_host_alias_set=${host_alias+set}
887
888
ac_env_host_alias_value=$host_alias
888
ac_exeext=
889
ac_cv_env_host_alias_set=${host_alias+set}
889
ac_objext=o
890
ac_cv_env_host_alias_value=$host_alias
890
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
891
ac_env_target_alias_set=${target_alias+set}
891
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
892
ac_env_target_alias_value=$target_alias
892
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
893
ac_cv_env_target_alias_set=${target_alias+set}
893
    ac_n= ac_c='
894
ac_cv_env_target_alias_value=$target_alias
894
' ac_t='	'
895
ac_env_CC_set=${CC+set}
895
  else
896
ac_env_CC_value=$CC
896
    ac_n=-n ac_c= ac_t=
897
ac_cv_env_CC_set=${CC+set}
897
  fi
898
ac_cv_env_CC_value=$CC
898
else
899
ac_env_CFLAGS_set=${CFLAGS+set}
899
  ac_n= ac_c='\c' ac_t=
900
ac_env_CFLAGS_value=$CFLAGS
900
fi
901
ac_cv_env_CFLAGS_set=${CFLAGS+set}
901
902
ac_cv_env_CFLAGS_value=$CFLAGS
902
903
ac_env_LDFLAGS_set=${LDFLAGS+set}
903
904
ac_env_LDFLAGS_value=$LDFLAGS
904
905
ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
905
906
ac_cv_env_LDFLAGS_value=$LDFLAGS
906
ac_aux_dir=
907
ac_env_CPPFLAGS_set=${CPPFLAGS+set}
907
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
908
ac_env_CPPFLAGS_value=$CPPFLAGS
908
  if test -f $ac_dir/install-sh; then
909
ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
909
    ac_aux_dir=$ac_dir
910
ac_cv_env_CPPFLAGS_value=$CPPFLAGS
910
    ac_install_sh="$ac_aux_dir/install-sh -c"
911
ac_env_CPP_set=${CPP+set}
911
    break
912
ac_env_CPP_value=$CPP
912
  elif test -f $ac_dir/install.sh; then
913
ac_cv_env_CPP_set=${CPP+set}
913
    ac_aux_dir=$ac_dir
914
ac_cv_env_CPP_value=$CPP
914
    ac_install_sh="$ac_aux_dir/install.sh -c"
915
915
    break
916
#
916
  fi
917
# Report the --help message.
917
done
918
#
918
if test -z "$ac_aux_dir"; then
919
if test "$ac_init_help" = "long"; then
919
  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
920
  # Omit some internal or obsolete options to make the list less imposing.
920
fi
921
  # This message is too long to be a string in the A/UX 3.1 sh.
921
ac_config_guess=$ac_aux_dir/config.guess
922
  cat <<_ACEOF
922
ac_config_sub=$ac_aux_dir/config.sub
923
\`configure' configures this package to adapt to many kinds of systems.
923
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
924
924
925
Usage: $0 [OPTION]... [VAR=VALUE]...
925
subdirs="lib/bind"
926
926
927
To assign environment variables (e.g., CC, CFLAGS...), specify them as
927
928
VAR=VALUE.  See below for descriptions of some of the useful variables.
928
929
929
# Make sure we can run config.sub.
930
Defaults for the options are specified in brackets.
930
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
931
931
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
932
Configuration:
932
fi
933
  -h, --help              display this help and exit
933
934
      --help=short        display options specific to this package
934
echo $ac_n "checking host system type""... $ac_c" 1>&6
935
      --help=recursive    display the short help of all the included packages
935
echo "configure:936: checking host system type" >&5
936
  -V, --version           display version information and exit
936
937
  -q, --quiet, --silent   do not print \`checking...' messages
937
host_alias=$host
938
      --cache-file=FILE   cache test results in FILE [disabled]
938
case "$host_alias" in
939
  -C, --config-cache      alias for \`--cache-file=config.cache'
939
NONE)
940
  -n, --no-create         do not create output files
940
  case $nonopt in
941
      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
941
  NONE)
942
942
    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
943
_ACEOF
943
    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
944
944
    fi ;;
945
  cat <<_ACEOF
945
  *) host_alias=$nonopt ;;
946
Installation directories:
946
  esac ;;
947
  --prefix=PREFIX         install architecture-independent files in PREFIX
947
esac
948
                          [$ac_default_prefix]
948
949
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
949
host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
950
                          [PREFIX]
950
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
951
951
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
952
By default, \`make install' will install all the files in
952
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
953
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
953
echo "$ac_t""$host" 1>&6
954
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
954
955
for instance \`--prefix=\$HOME'.
955
956
956
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
957
For better control, use the options below.
957
echo "configure:958: checking whether ${MAKE-make} sets \${MAKE}" >&5
958
958
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
959
Fine tuning of the installation directories:
959
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
960
  --bindir=DIR           user executables [EPREFIX/bin]
960
  echo $ac_n "(cached) $ac_c" 1>&6
961
  --sbindir=DIR          system admin executables [EPREFIX/sbin]
961
else
962
  --libexecdir=DIR       program executables [EPREFIX/libexec]
962
  cat > conftestmake <<\EOF
963
  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
963
all:
964
  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
964
	@echo 'ac_maketemp="${MAKE}"'
965
  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
965
EOF
966
  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
966
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
967
  --libdir=DIR           object code libraries [EPREFIX/lib]
967
eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
968
  --includedir=DIR       C header files [PREFIX/include]
968
if test -n "$ac_maketemp"; then
969
  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
969
  eval ac_cv_prog_make_${ac_make}_set=yes
970
  --infodir=DIR          info documentation [PREFIX/info]
970
else
971
  --mandir=DIR           man documentation [PREFIX/man]
971
  eval ac_cv_prog_make_${ac_make}_set=no
972
_ACEOF
972
fi
973
973
rm -f conftestmake
974
  cat <<\_ACEOF
974
fi
975
975
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
976
System types:
976
  echo "$ac_t""yes" 1>&6
977
  --build=BUILD     configure for building on BUILD [guessed]
977
  SET_MAKE=
978
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
978
else
979
_ACEOF
979
  echo "$ac_t""no" 1>&6
980
fi
980
  SET_MAKE="MAKE=${MAKE-make}"
981
981
fi
982
if test -n "$ac_init_help"; then
982
983
983
# Extract the first word of "ranlib", so it can be a program name with args.
984
  cat <<\_ACEOF
984
set dummy ranlib; ac_word=$2
985
985
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
986
Optional Features:
986
echo "configure:987: checking for $ac_word" >&5
987
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
987
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
988
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
988
  echo $ac_n "(cached) $ac_c" 1>&6
989
  --enable-threads	enable multithreading
989
else
990
    --enable-shared=PKGS  build shared libraries default=yes
990
  if test -n "$RANLIB"; then
991
    --enable-static=PKGS  build static libraries default=yes
991
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
992
    --enable-fast-install=PKGS  optimize for fast installation default=yes
992
else
993
    --disable-libtool-lock  avoid locking (might break parallel builds)
993
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
994
  --enable-libbind		build libbind default=no
994
  ac_dummy="$PATH"
995
  --enable-ipv6		use IPv6 default=autodetect
995
  for ac_dir in $ac_dummy; do
996
  --disable-linux-caps	disable linux capabilities
996
    test -z "$ac_dir" && ac_dir=.
997
997
    if test -f $ac_dir/$ac_word; then
998
Optional Packages:
998
      ac_cv_prog_RANLIB="ranlib"
999
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
999
      break
1000
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
1000
    fi
1001
  --with-openssl=PATH   Build with OpenSSL yes|no|path.
1001
  done
1002
                          (Required for DNSSEC)
1002
  IFS="$ac_save_ifs"
1003
  --with-randomdev=PATH Specify path for random device
1003
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1004
  --with-ptl2		on NetBSD, use the ptl2 thread library (experimental)
1004
fi
1005
  --with-purify=PATH	use Rational purify
1005
fi
1006
  --with-libtool	use GNU libtool (following indented options supported)
1006
RANLIB="$ac_cv_prog_RANLIB"
1007
    --with-gnu-ld           assume the C compiler uses GNU ld default=no
1007
if test -n "$RANLIB"; then
1008
    --with-pic              try to use only PIC/non-PIC objects default=use both
1008
  echo "$ac_t""$RANLIB" 1>&6
1009
  --with-kame=PATH	use Kame IPv6 default path /usr/local/v6
1009
else
1010
1010
  echo "$ac_t""no" 1>&6
1011
Some influential environment variables:
1011
fi
1012
  CC          C compiler command
1012
1013
  CFLAGS      C compiler flags
1013
# Find a good install program.  We prefer a C program (faster),
1014
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
1014
# so one script is as good as another.  But avoid the broken or
1015
              nonstandard directory <lib dir>
1015
# incompatible versions:
1016
  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
1016
# SysV /etc/install, /usr/sbin/install
1017
              headers in a nonstandard directory <include dir>
1017
# SunOS /usr/etc/install
1018
  CPP         C preprocessor
1018
# IRIX /sbin/install
1019
1019
# AIX /bin/install
1020
Use these variables to override the choices made by `configure' or to help
1020
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1021
it to find libraries and programs with nonstandard names/locations.
1021
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
1022
1022
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1023
_ACEOF
1023
# ./install, which can be erroneously created by make from ./install.sh.
1024
fi
1024
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1025
1025
echo "configure:1026: checking for a BSD compatible install" >&5
1026
if test "$ac_init_help" = "recursive"; then
1026
if test -z "$INSTALL"; then
1027
  # If there are subdirs, report their specific --help.
1027
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1028
  ac_popdir=`pwd`
1028
  echo $ac_n "(cached) $ac_c" 1>&6
1029
  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1029
else
1030
    test -d $ac_dir || continue
1030
    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
1031
    ac_builddir=.
1031
  for ac_dir in $PATH; do
1032
1032
    # Account for people who put trailing slashes in PATH elements.
1033
if test "$ac_dir" != .; then
1033
    case "$ac_dir/" in
1034
  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
1034
    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1035
  # A "../" for each directory in $ac_dir_suffix.
1035
    *)
1036
  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
1036
      # OSF1 and SCO ODT 3.0 have their own names for install.
1037
else
1037
      # Don't use installbsd from OSF since it installs stuff as root
1038
  ac_dir_suffix= ac_top_builddir=
1038
      # by default.
1039
fi
1039
      for ac_prog in ginstall scoinst install; do
1040
1040
        if test -f $ac_dir/$ac_prog; then
1041
case $srcdir in
1041
	  if test $ac_prog = install &&
1042
  .)  # No --srcdir option.  We are building in place.
1042
            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1043
    ac_srcdir=.
1043
	    # AIX install.  It has an incompatible calling convention.
1044
    if test -z "$ac_top_builddir"; then
1044
	    :
1045
       ac_top_srcdir=.
1045
	  else
1046
    else
1046
	    ac_cv_path_install="$ac_dir/$ac_prog -c"
1047
       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
1047
	    break 2
1048
    fi ;;
1048
	  fi
1049
  [\\/]* | ?:[\\/]* )  # Absolute path.
1049
	fi
1050
    ac_srcdir=$srcdir$ac_dir_suffix;
1050
      done
1051
    ac_top_srcdir=$srcdir ;;
1051
      ;;
1052
  *) # Relative path.
1052
    esac
1053
    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
1053
  done
1054
    ac_top_srcdir=$ac_top_builddir$srcdir ;;
1054
  IFS="$ac_save_IFS"
1055
esac
1055
1056
# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
1056
fi
1057
# absolute.
1057
  if test "${ac_cv_path_install+set}" = set; then
1058
ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
1058
    INSTALL="$ac_cv_path_install"
1059
ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
1059
  else
1060
ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
1060
    # As a last resort, use the slow shell script.  We don't cache a
1061
ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
1061
    # path for INSTALL within a source directory, because that will
1062
1062
    # break other packages using the cache if that directory is
1063
    cd $ac_dir
1063
    # removed, or if the path is relative.
1064
    # Check for guested configure; otherwise get Cygnus style configure.
1064
    INSTALL="$ac_install_sh"
1065
    if test -f $ac_srcdir/configure.gnu; then
1065
  fi
1066
      echo
1066
fi
1067
      $SHELL $ac_srcdir/configure.gnu  --help=recursive
1067
echo "$ac_t""$INSTALL" 1>&6
1068
    elif test -f $ac_srcdir/configure; then
1068
1069
      echo
1069
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1070
      $SHELL $ac_srcdir/configure  --help=recursive
1070
# It thinks the first close brace ends the variable substitution.
1071
    elif test -f $ac_srcdir/configure.ac ||
1071
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1072
           test -f $ac_srcdir/configure.in; then
1072
1073
      echo
1073
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1074
      $ac_configure --help
1074
1075
    else
1075
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1076
      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1076
1077
    fi
1077
1078
    cd $ac_popdir
1078
1079
  done
1079
1080
fi
1080
1081
1081
1082
test -n "$ac_init_help" && exit 0
1082
1083
if $ac_init_version; then
1083
# Extract the first word of "ar", so it can be a program name with args.
1084
  cat <<\_ACEOF
1084
set dummy ar; ac_word=$2
1085
1085
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1086
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
1086
echo "configure:1087: checking for $ac_word" >&5
1087
Free Software Foundation, Inc.
1087
if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then
1088
This configure script is free software; the Free Software Foundation
1088
  echo $ac_n "(cached) $ac_c" 1>&6
1089
gives unlimited permission to copy, distribute and modify it.
1089
else
1090
_ACEOF
1090
  case "$AR" in
1091
  exit 0
1091
  /*)
1092
fi
1092
  ac_cv_path_AR="$AR" # Let the user override the test with a path.
1093
exec 5>config.log
1093
  ;;
1094
cat >&5 <<_ACEOF
1094
  ?:/*)			 
1095
This file contains any messages produced by compilers while
1095
  ac_cv_path_AR="$AR" # Let the user override the test with a dos path.
1096
running configure, to aid debugging if configure makes a mistake.
1096
  ;;
1097
1097
  *)
1098
It was created by $as_me, which was
1098
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
1099
generated by GNU Autoconf 2.53.  Invocation command line was
1099
  ac_dummy="$PATH"
1100
1100
  for ac_dir in $ac_dummy; do 
1101
  $ $0 $@
1101
    test -z "$ac_dir" && ac_dir=.
1102
1102
    if test -f $ac_dir/$ac_word; then
1103
_ACEOF
1103
      ac_cv_path_AR="$ac_dir/$ac_word"
1104
{
1104
      break
1105
cat <<_ASUNAME
1105
    fi
1106
## --------- ##
1106
  done
1107
## Platform. ##
1107
  IFS="$ac_save_ifs"
1108
## --------- ##
1108
  ;;
1109
1109
esac
1110
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1110
fi
1111
uname -m = `(uname -m) 2>/dev/null || echo unknown`
1111
AR="$ac_cv_path_AR"
1112
uname -r = `(uname -r) 2>/dev/null || echo unknown`
1112
if test -n "$AR"; then
1113
uname -s = `(uname -s) 2>/dev/null || echo unknown`
1113
  echo "$ac_t""$AR" 1>&6
1114
uname -v = `(uname -v) 2>/dev/null || echo unknown`
1114
else
1115
1115
  echo "$ac_t""no" 1>&6
1116
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1116
fi
1117
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
1117
1118
1118
ARFLAGS="cruv"
1119
/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
1119
1120
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
1120
1121
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1121
1122
hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
1122
# The POSIX ln(1) program.  Non-POSIX systems may substitute
1123
/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
1123
# "copy" or something.
1124
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
1124
LN=ln
1125
/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
1125
1126
1126
1127
_ASUNAME
1127
case "$AR" in
1128
1128
	"")
1129
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1129
		{ echo "configure: error: 
1130
for as_dir in $PATH
1130
ar program not found.  Please fix your PATH to include the directory in
1131
do
1131
which ar resides, or set AR in the environment with the full path to ar.
1132
  IFS=$as_save_IFS
1132
" 1>&2; exit 1; }
1133
  test -z "$as_dir" && as_dir=.
1133
1134
  echo "PATH: $as_dir"
1134
		;;
1135
done
1135
esac
1136
1136
1137
} >&5
1137
#
1138
1138
# Etags.
1139
cat >&5 <<_ACEOF
1139
#
1140
1140
for ac_prog in etags emacs-etags
1141
1141
do
1142
## ----------- ##
1142
# Extract the first word of "$ac_prog", so it can be a program name with args.
1143
## Core tests. ##
1143
set dummy $ac_prog; ac_word=$2
1144
## ----------- ##
1144
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1145
1145
echo "configure:1146: checking for $ac_word" >&5
1146
_ACEOF
1146
if eval "test \"`echo '$''{'ac_cv_path_ETAGS'+set}'`\" = set"; then
1147
1147
  echo $ac_n "(cached) $ac_c" 1>&6
1148
1148
else
1149
# Keep a trace of the command line.
1149
  case "$ETAGS" in
1150
# Strip out --no-create and --no-recursion so they do not pile up.
1150
  /*)
1151
# Also quote any args containing shell meta-characters.
1151
  ac_cv_path_ETAGS="$ETAGS" # Let the user override the test with a path.
1152
ac_configure_args=
1152
  ;;
1153
ac_sep=
1153
  ?:/*)			 
1154
for ac_arg
1154
  ac_cv_path_ETAGS="$ETAGS" # Let the user override the test with a dos path.
1155
do
1155
  ;;
1156
  case $ac_arg in
1156
  *)
1157
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1157
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
1158
  | --no-cr | --no-c | -n ) continue ;;
1158
  ac_dummy="$PATH"
1159
  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1159
  for ac_dir in $ac_dummy; do 
1160
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1160
    test -z "$ac_dir" && ac_dir=.
1161
    continue ;;
1161
    if test -f $ac_dir/$ac_word; then
1162
  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1162
      ac_cv_path_ETAGS="$ac_dir/$ac_word"
1163
    ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
1163
      break
1164
  esac
1164
    fi
1165
  case " $ac_configure_args " in
1165
  done
1166
    *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
1166
  IFS="$ac_save_ifs"
1167
    *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
1167
  ;;
1168
       ac_sep=" " ;;
1168
esac
1169
  esac
1169
fi
1170
  # Get rid of the leading space.
1170
ETAGS="$ac_cv_path_ETAGS"
1171
done
1171
if test -n "$ETAGS"; then
1172
1172
  echo "$ac_t""$ETAGS" 1>&6
1173
# When interrupted or exit'd, cleanup temporary files, and complete
1173
else
1174
# config.log.  We remove comments because anyway the quotes in there
1174
  echo "$ac_t""no" 1>&6
1175
# would cause problems or look ugly.
1175
fi
1176
# WARNING: Be sure not to use single quotes in there, as some shells,
1176
1177
# such as our DU 5.0 friend, will then `close' the trap.
1177
test -n "$ETAGS" && break
1178
trap 'exit_status=$?
1178
done
1179
  # Save into config.log some information that might help in debugging.
1179
1180
  {
1180
1181
    echo
1181
#
1182
    cat <<\_ASBOX
1182
# Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
1183
## ---------------- ##
1183
# GNU emacs etags, and it requires the -L flag.
1184
## Cache variables. ##
1184
#
1185
## ---------------- ##
1185
if test "X$ETAGS" != "X"; then
1186
_ASBOX
1186
	echo $ac_n "checking for Exuberant Ctags etags""... $ac_c" 1>&6
1187
    echo
1187
echo "configure:1188: checking for Exuberant Ctags etags" >&5
1188
    # The following way of writing the cache mishandles newlines in values,
1188
	if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
1189
{
1189
		echo "$ac_t""yes" 1>&6
1190
  (set) 2>&1 |
1190
		ETAGS="$ETAGS -L"
1191
    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
1191
	else
1192
    *ac_space=\ *)
1192
		echo "$ac_t""no" 1>&6
1193
      sed -n \
1193
	fi
1194
        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
1194
fi
1195
    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
1195
1196
      ;;
1196
1197
    *)
1197
#
1198
      sed -n \
1198
# Perl is optional; it is used only by some of the system test scripts.
1199
        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
1199
#
1200
      ;;
1200
for ac_prog in perl5 perl
1201
    esac;
1201
do
1202
}
1202
# Extract the first word of "$ac_prog", so it can be a program name with args.
1203
    echo
1203
set dummy $ac_prog; ac_word=$2
1204
    if test -s confdefs.h; then
1204
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1205
      cat <<\_ASBOX
1205
echo "configure:1206: checking for $ac_word" >&5
1206
## ----------- ##
1206
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
1207
## confdefs.h. ##
1207
  echo $ac_n "(cached) $ac_c" 1>&6
1208
## ----------- ##
1208
else
1209
_ASBOX
1209
  case "$PERL" in
1210
      echo
1210
  /*)
1211
      sed "/^$/d" confdefs.h
1211
  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
1212
      echo
1212
  ;;
1213
    fi
1213
  ?:/*)			 
1214
    test "$ac_signal" != 0 &&
1214
  ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path.
1215
      echo "$as_me: caught signal $ac_signal"
1215
  ;;
1216
    echo "$as_me: exit $exit_status"
1216
  *)
1217
  } >&5
1217
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
1218
  rm -f core core.* *.core &&
1218
  ac_dummy="$PATH"
1219
  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
1219
  for ac_dir in $ac_dummy; do 
1220
    exit $exit_status
1220
    test -z "$ac_dir" && ac_dir=.
1221
     ' 0
1221
    if test -f $ac_dir/$ac_word; then
1222
for ac_signal in 1 2 13 15; do
1222
      ac_cv_path_PERL="$ac_dir/$ac_word"
1223
  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
1223
      break
1224
done
1224
    fi
1225
ac_signal=0
1225
  done
1226
1226
  IFS="$ac_save_ifs"
1227
# confdefs.h avoids OS command line length limits that DEFS can exceed.
1227
  ;;
1228
rm -rf conftest* confdefs.h
1228
esac
1229
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
1229
fi
1230
echo >confdefs.h
1230
PERL="$ac_cv_path_PERL"
1231
1231
if test -n "$PERL"; then
1232
# Predefined preprocessor variables.
1232
  echo "$ac_t""$PERL" 1>&6
1233
1233
else
1234
cat >>confdefs.h <<_ACEOF
1234
  echo "$ac_t""no" 1>&6
1235
#define PACKAGE_NAME "$PACKAGE_NAME"
1235
fi
1236
_ACEOF
1236
1237
1237
test -n "$PERL" && break
1238
1238
done
1239
cat >>confdefs.h <<_ACEOF
1239
1240
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
1240
1241
_ACEOF
1241
1242
1242
#
1243
1243
# Special processing of paths depending on whether --prefix,
1244
cat >>confdefs.h <<_ACEOF
1244
# --sysconfdir or --localstatedir arguments were given.  What's
1245
#define PACKAGE_VERSION "$PACKAGE_VERSION"
1245
# desired is some compatibility with the way previous versions
1246
_ACEOF
1246
# of BIND built; they defaulted to /usr/local for most parts of
1247
1247
# the installation, but named.boot/named.conf was in /etc
1248
1248
# and named.pid was in /var/run.
1249
cat >>confdefs.h <<_ACEOF
1249
#
1250
#define PACKAGE_STRING "$PACKAGE_STRING"
1250
# So ... if none of --prefix, --sysconfdir or --localstatedir are
1251
_ACEOF
1251
# specified, set things up that way.  If --prefix is given, use
1252
1252
# it for sysconfdir and localstatedir the way configure normally
1253
1253
# would.  To change the prefix for everything but leave named.conf
1254
cat >>confdefs.h <<_ACEOF
1254
# in /etc or named.pid in /var/run, then do this the usual configure way:
1255
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
1255
# ./configure --prefix=/somewhere --sysconfdir=/etc
1256
_ACEOF
1256
# ./configure --prefix=/somewhere --localstatedir=/var
1257
1257
#
1258
1258
# To put named.conf and named.pid in /usr/local with everything else,
1259
# Let the site file select an alternate cache file if it wants to.
1259
# set the prefix explicitly to /usr/local even though that's the default:
1260
# Prefer explicitly selected file to automatically selected ones.
1260
# ./configure --prefix=/usr/local
1261
if test -z "$CONFIG_SITE"; then
1261
#
1262
  if test "x$prefix" != xNONE; then
1262
case "$prefix" in
1263
    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
1263
        NONE)
1264
  else
1264
                case "$sysconfdir" in
1265
    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
1265
                        '${prefix}/etc')
1266
  fi
1266
                                sysconfdir=/etc
1267
fi
1267
                                ;;
1268
for ac_site_file in $CONFIG_SITE; do
1268
                esac
1269
  if test -r "$ac_site_file"; then
1269
                case "$localstatedir" in
1270
    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
1270
                        '${prefix}/var')
1271
echo "$as_me: loading site script $ac_site_file" >&6;}
1271
                                localstatedir=/var
1272
    sed 's/^/| /' "$ac_site_file" >&5
1272
                                ;;
1273
    . "$ac_site_file"
1273
                esac
1274
  fi
1274
                ;;
1275
done
1275
esac
1276
1276
1277
if test -r "$cache_file"; then
1277
#
1278
  # Some versions of bash will fail to source /dev/null (special
1278
# Make sure INSTALL uses an absolute path, else it will be wrong in all
1279
  # files actually), so we avoid doing that.
1279
# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
1280
  if test -f "$cache_file"; then
1280
# configure based on the location of the file where it is substituted.
1281
    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
1281
# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
1282
echo "$as_me: loading cache $cache_file" >&6;}
1282
# subdirectory of install-sh, This relative path will be wrong for all
1283
    case $cache_file in
1283
# directories more than one level down from install-sh.
1284
      [\\/]* | ?:[\\/]* ) . $cache_file;;
1284
#
1285
      *)                      . ./$cache_file;;
1285
case "$INSTALL" in
1286
    esac
1286
	/*)
1287
  fi
1287
                ;;
1288
else
1288
        *)
1289
  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
1289
                #
1290
echo "$as_me: creating cache $cache_file" >&6;}
1290
                # Not all systems have dirname.
1291
  >$cache_file
1291
                #
1292
fi
1292
                
1293
1293
                ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
1294
# Check that the precious variables saved in the cache have kept the same
1294
                
1295
# value.
1295
1296
ac_cache_corrupted=false
1296
                ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
1297
for ac_var in `(set) 2>&1 |
1297
                test "$ac_dir" = "$ac_prog" && ac_dir=.
1298
               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
1298
                test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
1299
  eval ac_old_set=\$ac_cv_env_${ac_var}_set
1299
                INSTALL="$ac_dir/$ac_prog"
1300
  eval ac_new_set=\$ac_env_${ac_var}_set
1300
                ;;
1301
  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
1301
esac
1302
  eval ac_new_val="\$ac_env_${ac_var}_value"
1302
1303
  case $ac_old_set,$ac_new_set in
1303
#
1304
    set,)
1304
# On these hosts, we really want to use cc, not gcc, even if it is
1305
      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
1305
# found.  The gcc that these systems have will not correctly handle
1306
echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
1306
# pthreads.
1307
      ac_cache_corrupted=: ;;
1307
#
1308
    ,set)
1308
# However, if the user sets $CC to be something, let that override
1309
      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
1309
# our change.
1310
echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
1310
#
1311
      ac_cache_corrupted=: ;;
1311
if test "X$CC" = "X" ; then
1312
    ,);;
1312
	case "$host" in
1313
    *)
1313
		*-dec-osf*)
1314
      if test "x$ac_old_val" != "x$ac_new_val"; then
1314
			CC="cc"
1315
        { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
1315
			;;
1316
echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
1316
		*-solaris*)
1317
        { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
1317
                        # Use Sun's cc if it is available, but watch
1318
echo "$as_me:   former value:  $ac_old_val" >&2;}
1318
                        # out for /usr/ucb/cc; it will never be the right
1319
        { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
1319
                        # compiler to use.
1320
echo "$as_me:   current value: $ac_new_val" >&2;}
1320
                        #
1321
        ac_cache_corrupted=:
1321
                        # If setting CC here fails, the AC_PROG_CC done
1322
      fi;;
1322
                        # below might still find gcc.
1323
  esac
1323
			IFS="${IFS=	}"; ac_save_ifs="$IFS"; IFS=":"
1324
  # Pass precious variables to config.status.
1324
			for ac_dir in $PATH; do
1325
  if test "$ac_new_set" = set; then
1325
				test -z "$ac_dir" && ac_dir=.
1326
    case $ac_new_val in
1326
				case "$ac_dir" in
1327
    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1327
				/usr/ucb)
1328
      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
1328
					# exclude
1329
    *) ac_arg=$ac_var=$ac_new_val ;;
1329
					;;
1330
    esac
1330
				*)
1331
    case " $ac_configure_args " in
1331
					if test -f "$ac_dir/cc"; then
1332
      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
1332
						CC="$ac_dir/cc"
1333
      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
1333
						break
1334
    esac
1334
					fi
1335
  fi
1335
					;;
1336
done
1336
				esac
1337
if $ac_cache_corrupted; then
1337
			done
1338
  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
1338
			IFS="$ac_save_ifs"
1339
echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1339
			;;
1340
  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1340
		*-hp-hpux*)
1341
echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1341
			CC="cc"
1342
   { (exit 1); exit 1; }; }
1342
			;;
1343
fi
1343
		mips-sgi-irix*)
1344
1344
			CC="cc"
1345
ac_ext=c
1345
			;;
1346
ac_cpp='$CPP $CPPFLAGS'
1346
	esac
1347
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1347
fi
1348
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1348
1349
ac_compiler_gnu=$ac_cv_c_compiler_gnu
1349
# Extract the first word of "gcc", so it can be a program name with args.
1350
1350
set dummy gcc; ac_word=$2
1351
1351
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1352
1352
echo "configure:1353: checking for $ac_word" >&5
1353
1353
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1354
1354
  echo $ac_n "(cached) $ac_c" 1>&6
1355
1355
else
1356
1356
  if test -n "$CC"; then
1357
1357
  ac_cv_prog_CC="$CC" # Let the user override the test.
1358
1358
else
1359
1359
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
1360
1360
  ac_dummy="$PATH"
1361
1361
  for ac_dir in $ac_dummy; do
1362
1362
    test -z "$ac_dir" && ac_dir=.
1363
1363
    if test -f $ac_dir/$ac_word; then
1364
1364
      ac_cv_prog_CC="gcc"
1365
1365
      break
1366
1366
    fi
1367
1367
  done
1368
1368
  IFS="$ac_save_ifs"
1369
1369
fi
1370
ac_config_headers="$ac_config_headers config.h"
1370
fi
1371
1371
CC="$ac_cv_prog_CC"
1372
ac_aux_dir=
1372
if test -n "$CC"; then
1373
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1373
  echo "$ac_t""$CC" 1>&6
1374
  if test -f $ac_dir/install-sh; then
1374
else
1375
    ac_aux_dir=$ac_dir
1375
  echo "$ac_t""no" 1>&6
1376
    ac_install_sh="$ac_aux_dir/install-sh -c"
1376
fi
1377
    break
1377
1378
  elif test -f $ac_dir/install.sh; then
1378
if test -z "$CC"; then
1379
    ac_aux_dir=$ac_dir
1379
  # Extract the first word of "cc", so it can be a program name with args.
1380
    ac_install_sh="$ac_aux_dir/install.sh -c"
1380
set dummy cc; ac_word=$2
1381
    break
1381
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1382
  elif test -f $ac_dir/shtool; then
1382
echo "configure:1383: checking for $ac_word" >&5
1383
    ac_aux_dir=$ac_dir
1383
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1384
    ac_install_sh="$ac_aux_dir/shtool install -c"
1384
  echo $ac_n "(cached) $ac_c" 1>&6
1385
    break
1385
else
1386
  fi
1386
  if test -n "$CC"; then
1387
done
1387
  ac_cv_prog_CC="$CC" # Let the user override the test.
1388
if test -z "$ac_aux_dir"; then
1388
else
1389
  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1389
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
1390
echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1390
  ac_prog_rejected=no
1391
   { (exit 1); exit 1; }; }
1391
  ac_dummy="$PATH"
1392
fi
1392
  for ac_dir in $ac_dummy; do
1393
ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1393
    test -z "$ac_dir" && ac_dir=.
1394
ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1394
    if test -f $ac_dir/$ac_word; then
1395
ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1395
      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1396
1396
        ac_prog_rejected=yes
1397
1397
	continue
1398
1398
      fi
1399
subdirs="$subdirs lib/bind"
1399
      ac_cv_prog_CC="cc"
1400
1400
      break
1401
1401
    fi
1402
# Make sure we can run config.sub.
1402
  done
1403
$ac_config_sub sun4 >/dev/null 2>&1 ||
1403
  IFS="$ac_save_ifs"
1404
  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
1404
if test $ac_prog_rejected = yes; then
1405
echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1405
  # We found a bogon in the path, so make sure we never use it.
1406
   { (exit 1); exit 1; }; }
1406
  set dummy $ac_cv_prog_CC
1407
1407
  shift
1408
echo "$as_me:$LINENO: checking build system type" >&5
1408
  if test $# -gt 0; then
1409
echo $ECHO_N "checking build system type... $ECHO_C" >&6
1409
    # We chose a different compiler from the bogus one.
1410
if test "${ac_cv_build+set}" = set; then
1410
    # However, it has the same basename, so the bogon will be chosen
1411
  echo $ECHO_N "(cached) $ECHO_C" >&6
1411
    # first if we set CC to just the basename; use the full file name.
1412
else
1412
    shift
1413
  ac_cv_build_alias=$build_alias
1413
    set dummy "$ac_dir/$ac_word" "$@"
1414
test -z "$ac_cv_build_alias" &&
1414
    shift
1415
  ac_cv_build_alias=`$ac_config_guess`
1415
    ac_cv_prog_CC="$@"
1416
test -z "$ac_cv_build_alias" &&
1416
  fi
1417
  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
1417
fi
1418
echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1418
fi
1419
   { (exit 1); exit 1; }; }
1419
fi
1420
ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1420
CC="$ac_cv_prog_CC"
1421
  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
1421
if test -n "$CC"; then
1422
echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
1422
  echo "$ac_t""$CC" 1>&6
1423
   { (exit 1); exit 1; }; }
1423
else
1424
1424
  echo "$ac_t""no" 1>&6
1425
fi
1425
fi
1426
echo "$as_me:$LINENO: result: $ac_cv_build" >&5
1426
1427
echo "${ECHO_T}$ac_cv_build" >&6
1427
  if test -z "$CC"; then
1428
build=$ac_cv_build
1428
    case "`uname -s`" in
1429
build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1429
    *win32* | *WIN32*)
1430
build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1430
      # Extract the first word of "cl", so it can be a program name with args.
1431
build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1431
set dummy cl; ac_word=$2
1432
1432
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1433
1433
echo "configure:1434: checking for $ac_word" >&5
1434
echo "$as_me:$LINENO: checking host system type" >&5
1434
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1435
echo $ECHO_N "checking host system type... $ECHO_C" >&6
1435
  echo $ac_n "(cached) $ac_c" 1>&6
1436
if test "${ac_cv_host+set}" = set; then
1436
else
1437
  echo $ECHO_N "(cached) $ECHO_C" >&6
1437
  if test -n "$CC"; then
1438
else
1438
  ac_cv_prog_CC="$CC" # Let the user override the test.
1439
  ac_cv_host_alias=$host_alias
1439
else
1440
test -z "$ac_cv_host_alias" &&
1440
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
1441
  ac_cv_host_alias=$ac_cv_build_alias
1441
  ac_dummy="$PATH"
1442
ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1442
  for ac_dir in $ac_dummy; do
1443
  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1443
    test -z "$ac_dir" && ac_dir=.
1444
echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1444
    if test -f $ac_dir/$ac_word; then
1445
   { (exit 1); exit 1; }; }
1445
      ac_cv_prog_CC="cl"
1446
1446
      break
1447
fi
1447
    fi
1448
echo "$as_me:$LINENO: result: $ac_cv_host" >&5
1448
  done
1449
echo "${ECHO_T}$ac_cv_host" >&6
1449
  IFS="$ac_save_ifs"
1450
host=$ac_cv_host
1450
fi
1451
host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1451
fi
1452
host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1452
CC="$ac_cv_prog_CC"
1453
host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1453
if test -n "$CC"; then
1454
1454
  echo "$ac_t""$CC" 1>&6
1455
1455
else
1456
1456
  echo "$ac_t""no" 1>&6
1457
echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5
1457
fi
1458
echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1458
 ;;
1459
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1459
    esac
1460
if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1460
  fi
1461
  echo $ECHO_N "(cached) $ECHO_C" >&6
1461
  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1462
else
1462
fi
1463
  cat >conftest.make <<\_ACEOF
1463
1464
all:
1464
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1465
	@echo 'ac_maketemp="${MAKE}"'
1465
echo "configure:1466: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1466
_ACEOF
1466
1467
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1467
ac_ext=c
1468
eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1468
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1469
if test -n "$ac_maketemp"; then
1469
ac_cpp='$CPP $CPPFLAGS'
1470
  eval ac_cv_prog_make_${ac_make}_set=yes
1470
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1471
else
1471
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1472
  eval ac_cv_prog_make_${ac_make}_set=no
1472
cross_compiling=$ac_cv_prog_cc_cross
1473
fi
1473
1474
rm -f conftest.make
1474
cat > conftest.$ac_ext << EOF
1475
fi
1475
1476
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1476
#line 1477 "configure"
1477
  echo "$as_me:$LINENO: result: yes" >&5
1477
#include "confdefs.h"
1478
echo "${ECHO_T}yes" >&6
1478
1479
  SET_MAKE=
1479
main(){return(0);}
1480
else
1480
EOF
1481
  echo "$as_me:$LINENO: result: no" >&5
1481
if { (eval echo configure:1482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1482
echo "${ECHO_T}no" >&6
1482
  ac_cv_prog_cc_works=yes
1483
  SET_MAKE="MAKE=${MAKE-make}"
1483
  # If we can't run a trivial program, we are probably using a cross compiler.
1484
fi
1484
  if (./conftest; exit) 2>/dev/null; then
1485
1485
    ac_cv_prog_cc_cross=no
1486
if test -n "$ac_tool_prefix"; then
1486
  else
1487
  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
1487
    ac_cv_prog_cc_cross=yes
1488
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
1488
  fi
1489
echo "$as_me:$LINENO: checking for $ac_word" >&5
1489
else
1490
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1490
  echo "configure: failed program was:" >&5
1491
if test "${ac_cv_prog_RANLIB+set}" = set; then
1491
  cat conftest.$ac_ext >&5
1492
  echo $ECHO_N "(cached) $ECHO_C" >&6
1492
  ac_cv_prog_cc_works=no
1493
else
1493
fi
1494
  if test -n "$RANLIB"; then
1494
rm -fr conftest*
1495
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1495
ac_ext=c
1496
else
1496
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1497
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1497
ac_cpp='$CPP $CPPFLAGS'
1498
for as_dir in $PATH
1498
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1499
do
1499
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1500
  IFS=$as_save_IFS
1500
cross_compiling=$ac_cv_prog_cc_cross
1501
  test -z "$as_dir" && as_dir=.
1501
1502
  for ac_exec_ext in '' $ac_executable_extensions; do
1502
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1503
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
1503
if test $ac_cv_prog_cc_works = no; then
1504
    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
1504
  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1505
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
1505
fi
1506
    break 2
1506
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1507
  fi
1507
echo "configure:1508: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1508
done
1508
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1509
done
1509
cross_compiling=$ac_cv_prog_cc_cross
1510
1510
1511
fi
1511
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1512
fi
1512
echo "configure:1513: checking whether we are using GNU C" >&5
1513
RANLIB=$ac_cv_prog_RANLIB
1513
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1514
if test -n "$RANLIB"; then
1514
  echo $ac_n "(cached) $ac_c" 1>&6
1515
  echo "$as_me:$LINENO: result: $RANLIB" >&5
1515
else
1516
echo "${ECHO_T}$RANLIB" >&6
1516
  cat > conftest.c <<EOF
1517
else
1517
#ifdef __GNUC__
1518
  echo "$as_me:$LINENO: result: no" >&5
1518
  yes;
1519
echo "${ECHO_T}no" >&6
1519
#endif
1520
fi
1520
EOF
1521
1521
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1522
fi
1522
  ac_cv_prog_gcc=yes
1523
if test -z "$ac_cv_prog_RANLIB"; then
1523
else
1524
  ac_ct_RANLIB=$RANLIB
1524
  ac_cv_prog_gcc=no
1525
  # Extract the first word of "ranlib", so it can be a program name with args.
1525
fi
1526
set dummy ranlib; ac_word=$2
1526
fi
1527
echo "$as_me:$LINENO: checking for $ac_word" >&5
1527
1528
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1528
echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1529
if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
1529
1530
  echo $ECHO_N "(cached) $ECHO_C" >&6
1530
if test $ac_cv_prog_gcc = yes; then
1531
else
1531
  GCC=yes
1532
  if test -n "$ac_ct_RANLIB"; then
1532
else
1533
  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
1533
  GCC=
1534
else
1534
fi
1535
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1535
1536
for as_dir in $PATH
1536
ac_test_CFLAGS="${CFLAGS+set}"
1537
do
1537
ac_save_CFLAGS="$CFLAGS"
1538
  IFS=$as_save_IFS
1538
CFLAGS=
1539
  test -z "$as_dir" && as_dir=.
1539
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1540
  for ac_exec_ext in '' $ac_executable_extensions; do
1540
echo "configure:1541: checking whether ${CC-cc} accepts -g" >&5
1541
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
1541
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1542
    ac_cv_prog_ac_ct_RANLIB="ranlib"
1542
  echo $ac_n "(cached) $ac_c" 1>&6
1543
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
1543
else
1544
    break 2
1544
  echo 'void f(){}' > conftest.c
1545
  fi
1545
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1546
done
1546
  ac_cv_prog_cc_g=yes
1547
done
1547
else
1548
1548
  ac_cv_prog_cc_g=no
1549
  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
1549
fi
1550
fi
1550
rm -f conftest*
1551
fi
1551
1552
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
1552
fi
1553
if test -n "$ac_ct_RANLIB"; then
1553
1554
  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
1554
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1555
echo "${ECHO_T}$ac_ct_RANLIB" >&6
1555
if test "$ac_test_CFLAGS" = set; then
1556
else
1556
  CFLAGS="$ac_save_CFLAGS"
1557
  echo "$as_me:$LINENO: result: no" >&5
1557
elif test $ac_cv_prog_cc_g = yes; then
1558
echo "${ECHO_T}no" >&6
1558
  if test "$GCC" = yes; then
1559
fi
1559
    CFLAGS="-g -O2"
1560
1560
  else
1561
  RANLIB=$ac_ct_RANLIB
1561
    CFLAGS="-g"
1562
else
1562
  fi
1563
  RANLIB="$ac_cv_prog_RANLIB"
1563
else
1564
fi
1564
  if test "$GCC" = yes; then
1565
1565
    CFLAGS="-O2"
1566
# Find a good install program.  We prefer a C program (faster),
1566
  else
1567
# so one script is as good as another.  But avoid the broken or
1567
    CFLAGS=
1568
# incompatible versions:
1568
  fi
1569
# SysV /etc/install, /usr/sbin/install
1569
fi
1570
# SunOS /usr/etc/install
1570
1571
# IRIX /sbin/install
1571
1572
# AIX /bin/install
1572
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1573
# AmigaOS /C/install, which installs bootblocks on floppy discs
1573
echo "configure:1574: checking how to run the C preprocessor" >&5
1574
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1574
# On Suns, sometimes $CPP names a directory.
1575
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
1575
if test -n "$CPP" && test -d "$CPP"; then
1576
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1576
  CPP=
1577
# ./install, which can be erroneously created by make from ./install.sh.
1577
fi
1578
echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
1578
if test -z "$CPP"; then
1579
echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
1579
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1580
if test -z "$INSTALL"; then
1580
  echo $ac_n "(cached) $ac_c" 1>&6
1581
if test "${ac_cv_path_install+set}" = set; then
1581
else
1582
  echo $ECHO_N "(cached) $ECHO_C" >&6
1582
    # This must be in double quotes, not single quotes, because CPP may get
1583
else
1583
  # substituted into the Makefile and "${CC-cc}" will confuse make.
1584
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1584
  CPP="${CC-cc} -E"
1585
for as_dir in $PATH
1585
  # On the NeXT, cc -E runs the code through the compiler's parser,
1586
do
1586
  # not just through cpp.
1587
  IFS=$as_save_IFS
1587
  cat > conftest.$ac_ext <<EOF
1588
  test -z "$as_dir" && as_dir=.
1588
#line 1589 "configure"
1589
  # Account for people who put trailing slashes in PATH elements.
1589
#include "confdefs.h"
1590
case $as_dir/ in
1590
#include <assert.h>
1591
  ./ | .// | /cC/* | \
1591
Syntax Error
1592
  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
1592
EOF
1593
  /usr/ucb/* ) ;;
1593
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1594
  *)
1594
{ (eval echo configure:1595: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1595
    # OSF1 and SCO ODT 3.0 have their own names for install.
1595
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1596
    # Don't use installbsd from OSF since it installs stuff as root
1596
if test -z "$ac_err"; then
1597
    # by default.
1597
  :
1598
    for ac_prog in ginstall scoinst install; do
1598
else
1599
      for ac_exec_ext in '' $ac_executable_extensions; do
1599
  echo "$ac_err" >&5
1600
        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
1600
  echo "configure: failed program was:" >&5
1601
          if test $ac_prog = install &&
1601
  cat conftest.$ac_ext >&5
1602
            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
1602
  rm -rf conftest*
1603
            # AIX install.  It has an incompatible calling convention.
1603
  CPP="${CC-cc} -E -traditional-cpp"
1604
            :
1604
  cat > conftest.$ac_ext <<EOF
1605
          elif test $ac_prog = install &&
1605
#line 1606 "configure"
1606
            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
1606
#include "confdefs.h"
1607
            # program-specific install script used by HP pwplus--don't use.
1607
#include <assert.h>
1608
            :
1608
Syntax Error
1609
          else
1609
EOF
1610
            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
1610
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1611
            break 3
1611
{ (eval echo configure:1612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1612
          fi
1612
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1613
        fi
1613
if test -z "$ac_err"; then
1614
      done
1614
  :
1615
    done
1615
else
1616
    ;;
1616
  echo "$ac_err" >&5
1617
esac
1617
  echo "configure: failed program was:" >&5
1618
done
1618
  cat conftest.$ac_ext >&5
1619
1619
  rm -rf conftest*
1620
1620
  CPP="${CC-cc} -nologo -E"
1621
fi
1621
  cat > conftest.$ac_ext <<EOF
1622
  if test "${ac_cv_path_install+set}" = set; then
1622
#line 1623 "configure"
1623
    INSTALL=$ac_cv_path_install
1623
#include "confdefs.h"
1624
  else
1624
#include <assert.h>
1625
    # As a last resort, use the slow shell script.  We don't cache a
1625
Syntax Error
1626
    # path for INSTALL within a source directory, because that will
1626
EOF
1627
    # break other packages using the cache if that directory is
1627
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1628
    # removed, or if the path is relative.
1628
{ (eval echo configure:1629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1629
    INSTALL=$ac_install_sh
1629
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1630
  fi
1630
if test -z "$ac_err"; then
1631
fi
1631
  :
1632
echo "$as_me:$LINENO: result: $INSTALL" >&5
1632
else
1633
echo "${ECHO_T}$INSTALL" >&6
1633
  echo "$ac_err" >&5
1634
1634
  echo "configure: failed program was:" >&5
1635
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1635
  cat conftest.$ac_ext >&5
1636
# It thinks the first close brace ends the variable substitution.
1636
  rm -rf conftest*
1637
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1637
  CPP=/lib/cpp
1638
1638
fi
1639
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
1639
rm -f conftest*
1640
1640
fi
1641
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1641
rm -f conftest*
1642
1642
fi
1643
1643
rm -f conftest*
1644
1644
  ac_cv_prog_CPP="$CPP"
1645
1645
fi
1646
1646
  CPP="$ac_cv_prog_CPP"
1647
1647
else
1648
1648
  ac_cv_prog_CPP="$CPP"
1649
# Extract the first word of "ar", so it can be a program name with args.
1649
fi
1650
set dummy ar; ac_word=$2
1650
echo "$ac_t""$CPP" 1>&6
1651
echo "$as_me:$LINENO: checking for $ac_word" >&5
1651
1652
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1652
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1653
if test "${ac_cv_path_AR+set}" = set; then
1653
echo "configure:1654: checking for ANSI C header files" >&5
1654
  echo $ECHO_N "(cached) $ECHO_C" >&6
1654
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1655
else
1655
  echo $ac_n "(cached) $ac_c" 1>&6
1656
  case $AR in
1656
else
1657
  [\\/]* | ?:[\\/]*)
1657
  cat > conftest.$ac_ext <<EOF
1658
  ac_cv_path_AR="$AR" # Let the user override the test with a path.
1658
#line 1659 "configure"
1659
  ;;
1659
#include "confdefs.h"
1660
  *)
1660
#include <stdlib.h>
1661
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1661
#include <stdarg.h>
1662
for as_dir in $PATH
1662
#include <string.h>
1663
do
1663
#include <float.h>
1664
  IFS=$as_save_IFS
1664
EOF
1665
  test -z "$as_dir" && as_dir=.
1665
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1666
  for ac_exec_ext in '' $ac_executable_extensions; do
1666
{ (eval echo configure:1667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1667
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
1667
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1668
    ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext"
1668
if test -z "$ac_err"; then
1669
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
1669
  rm -rf conftest*
1670
    break 2
1670
  ac_cv_header_stdc=yes
1671
  fi
1671
else
1672
done
1672
  echo "$ac_err" >&5
1673
done
1673
  echo "configure: failed program was:" >&5
1674
1674
  cat conftest.$ac_ext >&5
1675
  ;;
1675
  rm -rf conftest*
1676
esac
1676
  ac_cv_header_stdc=no
1677
fi
1677
fi
1678
AR=$ac_cv_path_AR
1678
rm -f conftest*
1679
1679
1680
if test -n "$AR"; then
1680
if test $ac_cv_header_stdc = yes; then
1681
  echo "$as_me:$LINENO: result: $AR" >&5
1681
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1682
echo "${ECHO_T}$AR" >&6
1682
cat > conftest.$ac_ext <<EOF
1683
else
1683
#line 1684 "configure"
1684
  echo "$as_me:$LINENO: result: no" >&5
1684
#include "confdefs.h"
1685
echo "${ECHO_T}no" >&6
1685
#include <string.h>
1686
fi
1686
EOF
1687
1687
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1688
ARFLAGS="cruv"
1688
  egrep "memchr" >/dev/null 2>&1; then
1689
1689
  :
1690
1690
else
1691
1691
  rm -rf conftest*
1692
# The POSIX ln(1) program.  Non-POSIX systems may substitute
1692
  ac_cv_header_stdc=no
1693
# "copy" or something.
1693
fi
1694
LN=ln
1694
rm -f conftest*
1695
1695
1696
1696
fi
1697
case "$AR" in
1697
1698
	"")
1698
if test $ac_cv_header_stdc = yes; then
1699
		{ { echo "$as_me:$LINENO: error:
1699
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1700
ar program not found.  Please fix your PATH to include the directory in
1700
cat > conftest.$ac_ext <<EOF
1701
which ar resides, or set AR in the environment with the full path to ar.
1701
#line 1702 "configure"
1702
" >&5
1702
#include "confdefs.h"
1703
echo "$as_me: error:
1703
#include <stdlib.h>
1704
ar program not found.  Please fix your PATH to include the directory in
1704
EOF
1705
which ar resides, or set AR in the environment with the full path to ar.
1705
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1706
" >&2;}
1706
  egrep "free" >/dev/null 2>&1; then
1707
   { (exit 1); exit 1; }; }
1707
  :
1708
1708
else
1709
		;;
1709
  rm -rf conftest*
1710
esac
1710
  ac_cv_header_stdc=no
1711
1711
fi
1712
#
1712
rm -f conftest*
1713
# Etags.
1713
1714
#
1714
fi
1715
for ac_prog in etags emacs-etags
1715
1716
do
1716
if test $ac_cv_header_stdc = yes; then
1717
  # Extract the first word of "$ac_prog", so it can be a program name with args.
1717
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1718
set dummy $ac_prog; ac_word=$2
1718
if test "$cross_compiling" = yes; then
1719
echo "$as_me:$LINENO: checking for $ac_word" >&5
1719
  :
1720
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1720
else
1721
if test "${ac_cv_path_ETAGS+set}" = set; then
1721
  cat > conftest.$ac_ext <<EOF
1722
  echo $ECHO_N "(cached) $ECHO_C" >&6
1722
#line 1723 "configure"
1723
else
1723
#include "confdefs.h"
1724
  case $ETAGS in
1724
#include <ctype.h>
1725
  [\\/]* | ?:[\\/]*)
1725
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1726
  ac_cv_path_ETAGS="$ETAGS" # Let the user override the test with a path.
1726
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1727
  ;;
1727
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1728
  *)
1728
int main () { int i; for (i = 0; i < 256; i++)
1729
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1729
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1730
for as_dir in $PATH
1730
exit (0); }
1731
do
1731
1732
  IFS=$as_save_IFS
1732
EOF
1733
  test -z "$as_dir" && as_dir=.
1733
if { (eval echo configure:1734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1734
  for ac_exec_ext in '' $ac_executable_extensions; do
1734
then
1735
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
1735
  :
1736
    ac_cv_path_ETAGS="$as_dir/$ac_word$ac_exec_ext"
1736
else
1737
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
1737
  echo "configure: failed program was:" >&5
1738
    break 2
1738
  cat conftest.$ac_ext >&5
1739
  fi
1739
  rm -fr conftest*
1740
done
1740
  ac_cv_header_stdc=no
1741
done
1741
fi
1742
1742
rm -fr conftest*
1743
  ;;
1743
fi
1744
esac
1744
1745
fi
1745
fi
1746
ETAGS=$ac_cv_path_ETAGS
1746
fi
1747
1747
1748
if test -n "$ETAGS"; then
1748
echo "$ac_t""$ac_cv_header_stdc" 1>&6
1749
  echo "$as_me:$LINENO: result: $ETAGS" >&5
1749
if test $ac_cv_header_stdc = yes; then
1750
echo "${ECHO_T}$ETAGS" >&6
1750
  cat >> confdefs.h <<\EOF
1751
else
1751
#define STDC_HEADERS 1
1752
  echo "$as_me:$LINENO: result: no" >&5
1752
EOF
1753
echo "${ECHO_T}no" >&6
1753
1754
fi
1754
fi
1755
1755
1756
  test -n "$ETAGS" && break
1756
1757
done
1757
for ac_hdr in fcntl.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/sysctl.h
1758
1758
do
1759
1759
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1760
#
1760
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1761
# Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
1761
echo "configure:1762: checking for $ac_hdr" >&5
1762
# GNU emacs etags, and it requires the -L flag.
1762
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1763
#
1763
  echo $ac_n "(cached) $ac_c" 1>&6
1764
if test "X$ETAGS" != "X"; then
1764
else
1765
	echo "$as_me:$LINENO: checking for Exuberant Ctags etags" >&5
1765
  cat > conftest.$ac_ext <<EOF
1766
echo $ECHO_N "checking for Exuberant Ctags etags... $ECHO_C" >&6
1766
#line 1767 "configure"
1767
	if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
1767
#include "confdefs.h"
1768
		echo "$as_me:$LINENO: result: yes" >&5
1768
#include <$ac_hdr>
1769
echo "${ECHO_T}yes" >&6
1769
EOF
1770
		ETAGS="$ETAGS -L"
1770
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1771
	else
1771
{ (eval echo configure:1772: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1772
		echo "$as_me:$LINENO: result: no" >&5
1772
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1773
echo "${ECHO_T}no" >&6
1773
if test -z "$ac_err"; then
1774
	fi
1774
  rm -rf conftest*
1775
fi
1775
  eval "ac_cv_header_$ac_safe=yes"
1776
1776
else
1777
1777
  echo "$ac_err" >&5
1778
#
1778
  echo "configure: failed program was:" >&5
1779
# Perl is optional; it is used only by some of the system test scripts.
1779
  cat conftest.$ac_ext >&5
1780
#
1780
  rm -rf conftest*
1781
for ac_prog in perl5 perl
1781
  eval "ac_cv_header_$ac_safe=no"
1782
do
1782
fi
1783
  # Extract the first word of "$ac_prog", so it can be a program name with args.
1783
rm -f conftest*
1784
set dummy $ac_prog; ac_word=$2
1784
fi
1785
echo "$as_me:$LINENO: checking for $ac_word" >&5
1785
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1786
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1786
  echo "$ac_t""yes" 1>&6
1787
if test "${ac_cv_path_PERL+set}" = set; then
1787
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1788
  echo $ECHO_N "(cached) $ECHO_C" >&6
1788
  cat >> confdefs.h <<EOF
1789
else
1789
#define $ac_tr_hdr 1
1790
  case $PERL in
1790
EOF
1791
  [\\/]* | ?:[\\/]*)
1791
 
1792
  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
1792
else
1793
  ;;
1793
  echo "$ac_t""no" 1>&6
1794
  *)
1794
fi
1795
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1795
done
1796
for as_dir in $PATH
1796
1797
do
1797
1798
  IFS=$as_save_IFS
1798
echo $ac_n "checking for working const""... $ac_c" 1>&6
1799
  test -z "$as_dir" && as_dir=.
1799
echo "configure:1800: checking for working const" >&5
1800
  for ac_exec_ext in '' $ac_executable_extensions; do
1800
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1801
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
1801
  echo $ac_n "(cached) $ac_c" 1>&6
1802
    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
1802
else
1803
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
1803
  cat > conftest.$ac_ext <<EOF
1804
    break 2
1804
#line 1805 "configure"
1805
  fi
1805
#include "confdefs.h"
1806
done
1806
1807
done
1807
int main() {
1808
1808
1809
  ;;
1809
/* Ultrix mips cc rejects this.  */
1810
esac
1810
typedef int charset[2]; const charset x;
1811
fi
1811
/* SunOS 4.1.1 cc rejects this.  */
1812
PERL=$ac_cv_path_PERL
1812
char const *const *ccp;
1813
1813
char **p;
1814
if test -n "$PERL"; then
1814
/* NEC SVR4.0.2 mips cc rejects this.  */
1815
  echo "$as_me:$LINENO: result: $PERL" >&5
1815
struct point {int x, y;};
1816
echo "${ECHO_T}$PERL" >&6
1816
static struct point const zero = {0,0};
1817
else
1817
/* AIX XL C 1.02.0.0 rejects this.
1818
  echo "$as_me:$LINENO: result: no" >&5
1818
   It does not let you subtract one const X* pointer from another in an arm
1819
echo "${ECHO_T}no" >&6
1819
   of an if-expression whose if-part is not a constant expression */
1820
fi
1820
const char *g = "string";
1821
1821
ccp = &g + (g ? g-g : 0);
1822
  test -n "$PERL" && break
1822
/* HPUX 7.0 cc rejects these. */
1823
done
1823
++ccp;
1824
1824
p = (char**) ccp;
1825
1825
ccp = (char const *const *) p;
1826
1826
{ /* SCO 3.2v4 cc rejects this.  */
1827
#
1827
  char *t;
1828
# Special processing of paths depending on whether --prefix,
1828
  char const *s = 0 ? (char *) 0 : (char const *) 0;
1829
# --sysconfdir or --localstatedir arguments were given.  What's
1829
1830
# desired is some compatibility with the way previous versions
1830
  *t++ = 0;
1831
# of BIND built; they defaulted to /usr/local for most parts of
1831
}
1832
# the installation, but named.boot/named.conf was in /etc
1832
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
1833
# and named.pid was in /var/run.
1833
  int x[] = {25, 17};
1834
#
1834
  const int *foo = &x[0];
1835
# So ... if none of --prefix, --sysconfdir or --localstatedir are
1835
  ++foo;
1836
# specified, set things up that way.  If --prefix is given, use
1836
}
1837
# it for sysconfdir and localstatedir the way configure normally
1837
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1838
# would.  To change the prefix for everything but leave named.conf
1838
  typedef const int *iptr;
1839
# in /etc or named.pid in /var/run, then do this the usual configure way:
1839
  iptr p = 0;
1840
# ./configure --prefix=/somewhere --sysconfdir=/etc
1840
  ++p;
1841
# ./configure --prefix=/somewhere --localstatedir=/var
1841
}
1842
#
1842
{ /* AIX XL C 1.02.0.0 rejects this saying
1843
# To put named.conf and named.pid in /usr/local with everything else,
1843
     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1844
# set the prefix explicitly to /usr/local even though that's the default:
1844
  struct s { int j; const int *ap[3]; };
1845
# ./configure --prefix=/usr/local
1845
  struct s *b; b->j = 5;
1846
#
1846
}
1847
case "$prefix" in
1847
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1848
        NONE)
1848
  const int foo = 10;
1849
                case "$sysconfdir" in
1849
}
1850
                        '${prefix}/etc')
1850
1851
                                sysconfdir=/etc
1851
; return 0; }
1852
                                ;;
1852
EOF
1853
                esac
1853
if { (eval echo configure:1854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1854
                case "$localstatedir" in
1854
  rm -rf conftest*
1855
                        '${prefix}/var')
1855
  ac_cv_c_const=yes
1856
                                localstatedir=/var
1856
else
1857
                                ;;
1857
  echo "configure: failed program was:" >&5
1858
                esac
1858
  cat conftest.$ac_ext >&5
1859
                ;;
1859
  rm -rf conftest*
1860
esac
1860
  ac_cv_c_const=no
1861
1861
fi
1862
#
1862
rm -f conftest*
1863
# Make sure INSTALL uses an absolute path, else it will be wrong in all
1863
fi
1864
# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
1864
1865
# configure based on the location of the file where it is substituted.
1865
echo "$ac_t""$ac_cv_c_const" 1>&6
1866
# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
1866
if test $ac_cv_c_const = no; then
1867
# subdirectory of install-sh, This relative path will be wrong for all
1867
  cat >> confdefs.h <<\EOF
1868
# directories more than one level down from install-sh.
1868
#define const 
1869
#
1869
EOF
1870
case "$INSTALL" in
1870
1871
	/*)
1871
fi
1872
                ;;
1872
1873
        *)
1873
echo $ac_n "checking for inline""... $ac_c" 1>&6
1874
                #
1874
echo "configure:1875: checking for inline" >&5
1875
                # Not all systems have dirname.
1875
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1876
                #
1876
  echo $ac_n "(cached) $ac_c" 1>&6
1877
1877
else
1878
                ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
1878
  ac_cv_c_inline=no
1879
1879
for ac_kw in inline __inline__ __inline; do
1880
1880
  cat > conftest.$ac_ext <<EOF
1881
                ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
1881
#line 1882 "configure"
1882
                test "$ac_dir" = "$ac_prog" && ac_dir=.
1882
#include "confdefs.h"
1883
                test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
1883
1884
                INSTALL="$ac_dir/$ac_prog"
1884
int main() {
1885
                ;;
1885
} $ac_kw foo() {
1886
esac
1886
; return 0; }
1887
1887
EOF
1888
#
1888
if { (eval echo configure:1889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1889
# On these hosts, we really want to use cc, not gcc, even if it is
1889
  rm -rf conftest*
1890
# found.  The gcc that these systems have will not correctly handle
1890
  ac_cv_c_inline=$ac_kw; break
1891
# pthreads.
1891
else
1892
#
1892
  echo "configure: failed program was:" >&5
1893
# However, if the user sets $CC to be something, let that override
1893
  cat conftest.$ac_ext >&5
1894
# our change.
1894
fi
1895
#
1895
rm -f conftest*
1896
if test "X$CC" = "X" ; then
1896
done
1897
	case "$host" in
1897
1898
		*-dec-osf*)
1898
fi
1899
			CC="cc"
1899
1900
			;;
1900
echo "$ac_t""$ac_cv_c_inline" 1>&6
1901
		*-solaris*)
1901
case "$ac_cv_c_inline" in
1902
                        # Use Sun's cc if it is available, but watch
1902
  inline | yes) ;;
1903
                        # out for /usr/ucb/cc; it will never be the right
1903
  no) cat >> confdefs.h <<\EOF
1904
                        # compiler to use.
1904
#define inline 
1905
                        #
1905
EOF
1906
                        # If setting CC here fails, the AC_PROG_CC done
1906
 ;;
1907
                        # below might still find gcc.
1907
  *)  cat >> confdefs.h <<EOF
1908
			IFS="${IFS=	}"; ac_save_ifs="$IFS"; IFS=":"
1908
#define inline $ac_cv_c_inline
1909
			for ac_dir in $PATH; do
1909
EOF
1910
				test -z "$ac_dir" && ac_dir=.
1910
 ;;
1911
				case "$ac_dir" in
1911
esac
1912
				/usr/ucb)
1912
1913
					# exclude
1913
echo $ac_n "checking for sysctlbyname""... $ac_c" 1>&6
1914
					;;
1914
echo "configure:1915: checking for sysctlbyname" >&5
1915
				*)
1915
if eval "test \"`echo '$''{'ac_cv_func_sysctlbyname'+set}'`\" = set"; then
1916
					if test -f "$ac_dir/cc"; then
1916
  echo $ac_n "(cached) $ac_c" 1>&6
1917
						CC="$ac_dir/cc"
1917
else
1918
						break
1918
  cat > conftest.$ac_ext <<EOF
1919
					fi
1919
#line 1920 "configure"
1920
					;;
1920
#include "confdefs.h"
1921
				esac
1921
/* System header to define __stub macros and hopefully few prototypes,
1922
			done
1922
    which can conflict with char sysctlbyname(); below.  */
1923
			IFS="$ac_save_ifs"
1923
#include <assert.h>
1924
			;;
1924
/* Override any gcc2 internal prototype to avoid an error.  */
1925
		*-hp-hpux*)
1925
/* We use char because int might match the return type of a gcc2
1926
			CC="cc"
1926
    builtin and then its argument prototype would still apply.  */
1927
			;;
1927
char sysctlbyname();
1928
		mips-sgi-irix*)
1928
1929
			CC="cc"
1929
int main() {
1930
			;;
1930
1931
	esac
1931
/* The GNU C library defines this for functions which it implements
1932
fi
1932
    to always fail with ENOSYS.  Some functions are actually named
1933
1933
    something starting with __ and the normal name is an alias.  */
1934
ac_ext=c
1934
#if defined (__stub_sysctlbyname) || defined (__stub___sysctlbyname)
1935
ac_cpp='$CPP $CPPFLAGS'
1935
choke me
1936
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1936
#else
1937
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1937
sysctlbyname();
1938
ac_compiler_gnu=$ac_cv_c_compiler_gnu
1938
#endif
1939
if test -n "$ac_tool_prefix"; then
1939
1940
  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1940
; return 0; }
1941
set dummy ${ac_tool_prefix}gcc; ac_word=$2
1941
EOF
1942
echo "$as_me:$LINENO: checking for $ac_word" >&5
1942
if { (eval echo configure:1943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1943
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1943
  rm -rf conftest*
1944
if test "${ac_cv_prog_CC+set}" = set; then
1944
  eval "ac_cv_func_sysctlbyname=yes"
1945
  echo $ECHO_N "(cached) $ECHO_C" >&6
1945
else
1946
else
1946
  echo "configure: failed program was:" >&5
1947
  if test -n "$CC"; then
1947
  cat conftest.$ac_ext >&5
1948
  ac_cv_prog_CC="$CC" # Let the user override the test.
1948
  rm -rf conftest*
1949
else
1949
  eval "ac_cv_func_sysctlbyname=no"
1950
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1950
fi
1951
for as_dir in $PATH
1951
rm -f conftest*
1952
do
1952
fi
1953
  IFS=$as_save_IFS
1953
1954
  test -z "$as_dir" && as_dir=.
1954
if eval "test \"`echo '$ac_cv_func_'sysctlbyname`\" = yes"; then
1955
  for ac_exec_ext in '' $ac_executable_extensions; do
1955
  echo "$ac_t""yes" 1>&6
1956
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
1956
  cat >> confdefs.h <<\EOF
1957
    ac_cv_prog_CC="${ac_tool_prefix}gcc"
1957
#define HAVE_SYSCTLBYNAME 1
1958
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
1958
EOF
1959
    break 2
1959
1960
  fi
1960
else
1961
done
1961
  echo "$ac_t""no" 1>&6
1962
done
1962
fi
1963
1963
1964
fi
1964
1965
fi
1965
#
1966
CC=$ac_cv_prog_CC
1966
# UnixWare 7.1.1 with the feature supplement to the UDK compiler
1967
if test -n "$CC"; then
1967
# is reported to not support "static inline" (RT #1212).
1968
  echo "$as_me:$LINENO: result: $CC" >&5
1968
#
1969
echo "${ECHO_T}$CC" >&6
1969
echo $ac_n "checking for static inline breakage""... $ac_c" 1>&6
1970
else
1970
echo "configure:1971: checking for static inline breakage" >&5
1971
  echo "$as_me:$LINENO: result: no" >&5
1971
cat > conftest.$ac_ext <<EOF
1972
echo "${ECHO_T}no" >&6
1972
#line 1973 "configure"
1973
fi
1973
#include "confdefs.h"
1974
1974
1975
fi
1975
int main() {
1976
if test -z "$ac_cv_prog_CC"; then
1976
1977
  ac_ct_CC=$CC
1977
		foo1();
1978
  # Extract the first word of "gcc", so it can be a program name with args.
1978
	}
1979
set dummy gcc; ac_word=$2
1979
1980
echo "$as_me:$LINENO: checking for $ac_word" >&5
1980
	static inline int foo1() {
1981
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1981
		return 0;
1982
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1982
	}
1983
  echo $ECHO_N "(cached) $ECHO_C" >&6
1983
1984
else
1984
	static inline int foo2() {
1985
  if test -n "$ac_ct_CC"; then
1985
		return foo1();
1986
  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1986
	
1987
else
1987
; return 0; }
1988
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1988
EOF
1989
for as_dir in $PATH
1989
if { (eval echo configure:1990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1990
do
1990
  rm -rf conftest*
1991
  IFS=$as_save_IFS
1991
  echo "$ac_t""no" 1>&6
1992
  test -z "$as_dir" && as_dir=.
1992
else
1993
  for ac_exec_ext in '' $ac_executable_extensions; do
1993
  echo "configure: failed program was:" >&5
1994
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
1994
  cat conftest.$ac_ext >&5
1995
    ac_cv_prog_ac_ct_CC="gcc"
1995
  rm -rf conftest*
1996
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
1996
  echo "$ac_t""yes" 1>&6
1997
    break 2
1997
         cat >> confdefs.h <<\EOF
1998
  fi
1998
#define inline 
1999
done
1999
EOF
2000
done
2000
2001
2001
fi
2002
fi
2002
rm -f conftest*
2003
fi
2003
2004
ac_ct_CC=$ac_cv_prog_ac_ct_CC
2004
echo $ac_n "checking for size_t""... $ac_c" 1>&6
2005
if test -n "$ac_ct_CC"; then
2005
echo "configure:2006: checking for size_t" >&5
2006
  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
2006
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
2007
echo "${ECHO_T}$ac_ct_CC" >&6
2007
  echo $ac_n "(cached) $ac_c" 1>&6
2008
else
2008
else
2009
  echo "$as_me:$LINENO: result: no" >&5
2009
  cat > conftest.$ac_ext <<EOF
2010
echo "${ECHO_T}no" >&6
2010
#line 2011 "configure"
2011
fi
2011
#include "confdefs.h"
2012
2012
#include <sys/types.h>
2013
  CC=$ac_ct_CC
2013
#if STDC_HEADERS
2014
else
2014
#include <stdlib.h>
2015
  CC="$ac_cv_prog_CC"
2015
#include <stddef.h>
2016
fi
2016
#endif
2017
2017
EOF
2018
if test -z "$CC"; then
2018
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2019
  if test -n "$ac_tool_prefix"; then
2019
  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
2020
  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
2020
  rm -rf conftest*
2021
set dummy ${ac_tool_prefix}cc; ac_word=$2
2021
  ac_cv_type_size_t=yes
2022
echo "$as_me:$LINENO: checking for $ac_word" >&5
2022
else
2023
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2023
  rm -rf conftest*
2024
if test "${ac_cv_prog_CC+set}" = set; then
2024
  ac_cv_type_size_t=no
2025
  echo $ECHO_N "(cached) $ECHO_C" >&6
2025
fi
2026
else
2026
rm -f conftest*
2027
  if test -n "$CC"; then
2027
2028
  ac_cv_prog_CC="$CC" # Let the user override the test.
2028
fi
2029
else
2029
echo "$ac_t""$ac_cv_type_size_t" 1>&6
2030
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2030
if test $ac_cv_type_size_t = no; then
2031
for as_dir in $PATH
2031
  cat >> confdefs.h <<\EOF
2032
do
2032
#define size_t unsigned
2033
  IFS=$as_save_IFS
2033
EOF
2034
  test -z "$as_dir" && as_dir=.
2034
2035
  for ac_exec_ext in '' $ac_executable_extensions; do
2035
fi
2036
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2036
2037
    ac_cv_prog_CC="${ac_tool_prefix}cc"
2037
echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
2038
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2038
echo "configure:2039: checking for ssize_t" >&5
2039
    break 2
2039
if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
2040
  fi
2040
  echo $ac_n "(cached) $ac_c" 1>&6
2041
done
2041
else
2042
done
2042
  cat > conftest.$ac_ext <<EOF
2043
2043
#line 2044 "configure"
2044
fi
2044
#include "confdefs.h"
2045
fi
2045
#include <sys/types.h>
2046
CC=$ac_cv_prog_CC
2046
#if STDC_HEADERS
2047
if test -n "$CC"; then
2047
#include <stdlib.h>
2048
  echo "$as_me:$LINENO: result: $CC" >&5
2048
#include <stddef.h>
2049
echo "${ECHO_T}$CC" >&6
2049
#endif
2050
else
2050
EOF
2051
  echo "$as_me:$LINENO: result: no" >&5
2051
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2052
echo "${ECHO_T}no" >&6
2052
  egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
2053
fi
2053
  rm -rf conftest*
2054
2054
  ac_cv_type_ssize_t=yes
2055
fi
2055
else
2056
if test -z "$ac_cv_prog_CC"; then
2056
  rm -rf conftest*
2057
  ac_ct_CC=$CC
2057
  ac_cv_type_ssize_t=no
2058
  # Extract the first word of "cc", so it can be a program name with args.
2058
fi
2059
set dummy cc; ac_word=$2
2059
rm -f conftest*
2060
echo "$as_me:$LINENO: checking for $ac_word" >&5
2060
2061
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2061
fi
2062
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
2062
echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
2063
  echo $ECHO_N "(cached) $ECHO_C" >&6
2063
if test $ac_cv_type_ssize_t = no; then
2064
else
2064
  cat >> confdefs.h <<\EOF
2065
  if test -n "$ac_ct_CC"; then
2065
#define ssize_t int
2066
  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2066
EOF
2067
else
2067
2068
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2068
fi
2069
for as_dir in $PATH
2069
2070
do
2070
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
2071
  IFS=$as_save_IFS
2071
echo "configure:2072: checking whether time.h and sys/time.h may both be included" >&5
2072
  test -z "$as_dir" && as_dir=.
2072
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
2073
  for ac_exec_ext in '' $ac_executable_extensions; do
2073
  echo $ac_n "(cached) $ac_c" 1>&6
2074
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2074
else
2075
    ac_cv_prog_ac_ct_CC="cc"
2075
  cat > conftest.$ac_ext <<EOF
2076
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2076
#line 2077 "configure"
2077
    break 2
2077
#include "confdefs.h"
2078
  fi
2078
#include <sys/types.h>
2079
done
2079
#include <sys/time.h>
2080
done
2080
#include <time.h>
2081
2081
int main() {
2082
fi
2082
struct tm *tp;
2083
fi
2083
; return 0; }
2084
ac_ct_CC=$ac_cv_prog_ac_ct_CC
2084
EOF
2085
if test -n "$ac_ct_CC"; then
2085
if { (eval echo configure:2086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2086
  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
2086
  rm -rf conftest*
2087
echo "${ECHO_T}$ac_ct_CC" >&6
2087
  ac_cv_header_time=yes
2088
else
2088
else
2089
  echo "$as_me:$LINENO: result: no" >&5
2089
  echo "configure: failed program was:" >&5
2090
echo "${ECHO_T}no" >&6
2090
  cat conftest.$ac_ext >&5
2091
fi
2091
  rm -rf conftest*
2092
2092
  ac_cv_header_time=no
2093
  CC=$ac_ct_CC
2093
fi
2094
else
2094
rm -f conftest*
2095
  CC="$ac_cv_prog_CC"
2095
fi
2096
fi
2096
2097
2097
echo "$ac_t""$ac_cv_header_time" 1>&6
2098
fi
2098
if test $ac_cv_header_time = yes; then
2099
if test -z "$CC"; then
2099
  cat >> confdefs.h <<\EOF
2100
  # Extract the first word of "cc", so it can be a program name with args.
2100
#define TIME_WITH_SYS_TIME 1
2101
set dummy cc; ac_word=$2
2101
EOF
2102
echo "$as_me:$LINENO: checking for $ac_word" >&5
2102
2103
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2103
fi
2104
if test "${ac_cv_prog_CC+set}" = set; then
2104
2105
  echo $ECHO_N "(cached) $ECHO_C" >&6
2105
echo $ac_n "checking for long long""... $ac_c" 1>&6
2106
else
2106
echo "configure:2107: checking for long long" >&5
2107
  if test -n "$CC"; then
2107
cat > conftest.$ac_ext <<EOF
2108
  ac_cv_prog_CC="$CC" # Let the user override the test.
2108
#line 2109 "configure"
2109
else
2109
#include "confdefs.h"
2110
  ac_prog_rejected=no
2110
2111
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2111
int main() {
2112
for as_dir in $PATH
2112
long long i = 0; return (0);
2113
do
2113
; return 0; }
2114
  IFS=$as_save_IFS
2114
EOF
2115
  test -z "$as_dir" && as_dir=.
2115
if { (eval echo configure:2116: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2116
  for ac_exec_ext in '' $ac_executable_extensions; do
2116
  rm -rf conftest*
2117
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2117
  echo "$ac_t""yes" 1>&6
2118
    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
2118
		ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"
2119
       ac_prog_rejected=yes
2119
else
2120
       continue
2120
  echo "configure: failed program was:" >&5
2121
     fi
2121
  cat conftest.$ac_ext >&5
2122
    ac_cv_prog_CC="cc"
2122
  rm -rf conftest*
2123
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2123
  echo "$ac_t""no" 1>&6
2124
    break 2
2124
		ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"
2125
  fi
2125
fi
2126
done
2126
rm -f conftest*
2127
done
2127
2128
2128
2129
if test $ac_prog_rejected = yes; then
2129
#
2130
  # We found a bogon in the path, so make sure we never use it.
2130
# check if we need to #include sys/select.h explicitly
2131
  set dummy $ac_cv_prog_CC
2131
#
2132
  shift
2132
case $ac_cv_header_unistd_h in
2133
  if test $# != 0; then
2133
yes)
2134
    # We chose a different compiler from the bogus one.
2134
echo $ac_n "checking if unistd.h or sys/types.h defines fd_set""... $ac_c" 1>&6
2135
    # However, it has the same basename, so the bogon will be chosen
2135
echo "configure:2136: checking if unistd.h or sys/types.h defines fd_set" >&5
2136
    # first if we set CC to just the basename; use the full file name.
2136
cat > conftest.$ac_ext <<EOF
2137
    shift
2137
#line 2138 "configure"
2138
    set dummy "$as_dir/$ac_word" ${1+"$@"}
2138
#include "confdefs.h"
2139
    shift
2139
2140
    ac_cv_prog_CC="$@"
2140
#include <sys/types.h> /* Ultrix */
2141
  fi
2141
#include <unistd.h>
2142
fi
2142
int main() {
2143
fi
2143
fd_set read_set; return (0);
2144
fi
2144
; return 0; }
2145
CC=$ac_cv_prog_CC
2145
EOF
2146
if test -n "$CC"; then
2146
if { (eval echo configure:2147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2147
  echo "$as_me:$LINENO: result: $CC" >&5
2147
  rm -rf conftest*
2148
echo "${ECHO_T}$CC" >&6
2148
  echo "$ac_t""yes" 1>&6
2149
else
2149
	 ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
2150
  echo "$as_me:$LINENO: result: no" >&5
2150
	 LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"
2151
echo "${ECHO_T}no" >&6
2151
else
2152
fi
2152
  echo "configure: failed program was:" >&5
2153
2153
  cat conftest.$ac_ext >&5
2154
fi
2154
  rm -rf conftest*
2155
if test -z "$CC"; then
2155
  echo "$ac_t""no" 1>&6
2156
  if test -n "$ac_tool_prefix"; then
2156
	case $ac_cv_header_sys_select_h in
2157
  for ac_prog in cl
2157
	yes)
2158
  do
2158
         ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
2159
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
2159
	 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
2160
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
2160
		;;
2161
echo "$as_me:$LINENO: checking for $ac_word" >&5
2161
	no)
2162
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2162
		{ echo "configure: error: need either working unistd.h or sys/select.h" 1>&2; exit 1; }
2163
if test "${ac_cv_prog_CC+set}" = set; then
2163
		;;
2164
  echo $ECHO_N "(cached) $ECHO_C" >&6
2164
	esac
2165
else
2165
	
2166
  if test -n "$CC"; then
2166
fi
2167
  ac_cv_prog_CC="$CC" # Let the user override the test.
2167
rm -f conftest*
2168
else
2168
	;;
2169
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2169
no)
2170
for as_dir in $PATH
2170
	case $ac_cv_header_sys_select_h in
2171
do
2171
	yes)
2172
  IFS=$as_save_IFS
2172
             ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
2173
  test -z "$as_dir" && as_dir=.
2173
	     LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
2174
  for ac_exec_ext in '' $ac_executable_extensions; do
2174
		;;
2175
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2175
	no)
2176
    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
2176
		{ echo "configure: error: need either unistd.h or sys/select.h" 1>&2; exit 1; }
2177
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2177
		;;
2178
    break 2
2178
	esac
2179
  fi
2179
	;;
2180
done
2180
esac
2181
done
2181
2182
2182
2183
fi
2183
2184
fi
2184
#
2185
CC=$ac_cv_prog_CC
2185
# Find the machine's endian flavor.
2186
if test -n "$CC"; then
2186
#
2187
  echo "$as_me:$LINENO: result: $CC" >&5
2187
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
2188
echo "${ECHO_T}$CC" >&6
2188
echo "configure:2189: checking whether byte ordering is bigendian" >&5
2189
else
2189
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
2190
  echo "$as_me:$LINENO: result: no" >&5
2190
  echo $ac_n "(cached) $ac_c" 1>&6
2191
echo "${ECHO_T}no" >&6
2191
else
2192
fi
2192
  ac_cv_c_bigendian=unknown
2193
2193
# See if sys/param.h defines the BYTE_ORDER macro.
2194
    test -n "$CC" && break
2194
cat > conftest.$ac_ext <<EOF
2195
  done
2195
#line 2196 "configure"
2196
fi
2196
#include "confdefs.h"
2197
if test -z "$CC"; then
2197
#include <sys/types.h>
2198
  ac_ct_CC=$CC
2198
#include <sys/param.h>
2199
  for ac_prog in cl
2199
int main() {
2200
do
2200
2201
  # Extract the first word of "$ac_prog", so it can be a program name with args.
2201
#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
2202
set dummy $ac_prog; ac_word=$2
2202
 bogus endian macros
2203
echo "$as_me:$LINENO: checking for $ac_word" >&5
2203
#endif
2204
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2204
; return 0; }
2205
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
2205
EOF
2206
  echo $ECHO_N "(cached) $ECHO_C" >&6
2206
if { (eval echo configure:2207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2207
else
2207
  rm -rf conftest*
2208
  if test -n "$ac_ct_CC"; then
2208
  # It does; now see whether it defined to BIG_ENDIAN or not.
2209
  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2209
cat > conftest.$ac_ext <<EOF
2210
else
2210
#line 2211 "configure"
2211
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2211
#include "confdefs.h"
2212
for as_dir in $PATH
2212
#include <sys/types.h>
2213
do
2213
#include <sys/param.h>
2214
  IFS=$as_save_IFS
2214
int main() {
2215
  test -z "$as_dir" && as_dir=.
2215
2216
  for ac_exec_ext in '' $ac_executable_extensions; do
2216
#if BYTE_ORDER != BIG_ENDIAN
2217
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2217
 not big endian
2218
    ac_cv_prog_ac_ct_CC="$ac_prog"
2218
#endif
2219
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2219
; return 0; }
2220
    break 2
2220
EOF
2221
  fi
2221
if { (eval echo configure:2222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2222
done
2222
  rm -rf conftest*
2223
done
2223
  ac_cv_c_bigendian=yes
2224
2224
else
2225
fi
2225
  echo "configure: failed program was:" >&5
2226
fi
2226
  cat conftest.$ac_ext >&5
2227
ac_ct_CC=$ac_cv_prog_ac_ct_CC
2227
  rm -rf conftest*
2228
if test -n "$ac_ct_CC"; then
2228
  ac_cv_c_bigendian=no
2229
  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
2229
fi
2230
echo "${ECHO_T}$ac_ct_CC" >&6
2230
rm -f conftest*
2231
else
2231
else
2232
  echo "$as_me:$LINENO: result: no" >&5
2232
  echo "configure: failed program was:" >&5
2233
echo "${ECHO_T}no" >&6
2233
  cat conftest.$ac_ext >&5
2234
fi
2234
fi
2235
2235
rm -f conftest*
2236
  test -n "$ac_ct_CC" && break
2236
if test $ac_cv_c_bigendian = unknown; then
2237
done
2237
if test "$cross_compiling" = yes; then
2238
2238
    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2239
  CC=$ac_ct_CC
2239
else
2240
fi
2240
  cat > conftest.$ac_ext <<EOF
2241
2241
#line 2242 "configure"
2242
fi
2242
#include "confdefs.h"
2243
2243
main () {
2244
2244
  /* Are we little or big endian?  From Harbison&Steele.  */
2245
test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5
2245
  union
2246
echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;}
2246
  {
2247
   { (exit 1); exit 1; }; }
2247
    long l;
2248
2248
    char c[sizeof (long)];
2249
# Provide some information about the compiler.
2249
  } u;
2250
echo "$as_me:$LINENO:" \
2250
  u.l = 1;
2251
     "checking for C compiler version" >&5
2251
  exit (u.c[sizeof (long) - 1] == 1);
2252
ac_compiler=`set X $ac_compile; echo $2`
2252
}
2253
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
2253
EOF
2254
  (eval $ac_compiler --version </dev/null >&5) 2>&5
2254
if { (eval echo configure:2255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2255
  ac_status=$?
2255
then
2256
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2256
  ac_cv_c_bigendian=no
2257
  (exit $ac_status); }
2257
else
2258
{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
2258
  echo "configure: failed program was:" >&5
2259
  (eval $ac_compiler -v </dev/null >&5) 2>&5
2259
  cat conftest.$ac_ext >&5
2260
  ac_status=$?
2260
  rm -fr conftest*
2261
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2261
  ac_cv_c_bigendian=yes
2262
  (exit $ac_status); }
2262
fi
2263
{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
2263
rm -fr conftest*
2264
  (eval $ac_compiler -V </dev/null >&5) 2>&5
2264
fi
2265
  ac_status=$?
2265
2266
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2266
fi
2267
  (exit $ac_status); }
2267
fi
2268
2268
2269
cat >conftest.$ac_ext <<_ACEOF
2269
echo "$ac_t""$ac_cv_c_bigendian" 1>&6
2270
#line $LINENO "configure"
2270
if test $ac_cv_c_bigendian = yes; then
2271
#include "confdefs.h"
2271
  cat >> confdefs.h <<\EOF
2272
2272
#define WORDS_BIGENDIAN 1
2273
#ifdef F77_DUMMY_MAIN
2273
EOF
2274
#  ifdef __cplusplus
2274
2275
     extern "C"
2275
fi
2276
#  endif
2276
2277
   int F77_DUMMY_MAIN() { return 1; }
2277
2278
#endif
2278
#
2279
int
2279
# Build DLZ support?
2280
main ()
2280
#
2281
{
2281
# The use_dlz flag is set to no.  If one of the DLZ drivers is selected
2282
2282
# for build the use_dlz flag will be set to yes
2283
  ;
2283
#
2284
  return 0;
2284
2285
}
2285
use_dlz=no
2286
_ACEOF
2286
2287
ac_clean_files_save=$ac_clean_files
2287
#
2288
ac_clean_files="$ac_clean_files a.out a.exe"
2288
# was --with-dlz-postgres specified?
2289
# Try to create an executable without -o first, disregard a.out.
2289
#
2290
# It will help us diagnose broken compilers, and finding out an intuition
2290
2291
# of exeext.
2291
echo $ac_n "checking for Postgres DLZ driver""... $ac_c" 1>&6
2292
echo "$as_me:$LINENO: checking for C compiler default output" >&5
2292
echo "configure:2293: checking for Postgres DLZ driver" >&5
2293
echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
2293
# Check whether --with-dlz_postgres or --without-dlz_postgres was given.
2294
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
2294
if test "${with_dlz_postgres+set}" = set; then
2295
if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
2295
  withval="$with_dlz_postgres"
2296
  (eval $ac_link_default) 2>&5
2296
  use_dlz_postgres="$withval"
2297
  ac_status=$?
2297
else
2298
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2298
  use_dlz_postgres="no"
2299
  (exit $ac_status); }; then
2299
fi
2300
  # Find the output, starting from the most likely.  This scheme is
2300
2301
# not robust to junk in `.', hence go to wildcards (a.*) only as a last
2301
2302
# resort.
2302
case "$use_dlz_postgres" in
2303
2303
	no)
2304
# Be careful to initialize this variable, since it used to be cached.
2304
		echo "$ac_t""no" 1>&6
2305
# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
2305
		;;
2306
ac_cv_exeext=
2306
	*)
2307
for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null;
2307
		#set use_dlz = "yes" so the DLZ core will be built
2308
                ls a.out conftest 2>/dev/null;
2308
		use_dlz=yes
2309
                ls a.* conftest.* 2>/dev/null`; do
2309
		if test "$use_dlz_postgres" = "yes"
2310
  case $ac_file in
2310
		then
2311
    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;;
2311
			# User did not specify a path - guess it
2312
    a.out ) # We found the default executable, but exeext='' is most
2312
			pgdirs="/usr /usr/local /usr/local/pgsql /usr/pkg"
2313
            # certainly right.
2313
			for d in $pgdirs
2314
            break;;
2314
			do
2315
    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
2315
				if test -f $d/include/libpq-fe.h
2316
          # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
2316
				then
2317
          export ac_cv_exeext
2317
					use_dlz_postgres=$d
2318
          break;;
2318
					break
2319
    * ) break;;
2319
				fi
2320
  esac
2320
			done
2321
done
2321
			if test "$use_dlz_postgres" = "yes"
2322
else
2322
			then
2323
  echo "$as_me: failed program was:" >&5
2323
				echo "$ac_t""not found" 1>&6
2324
cat conftest.$ac_ext >&5
2324
				{ echo "configure: error: PostgreSQL was not found in any of $pgdirs; use --with-dlz-postgres=/path" 1>&2; exit 1; }
2325
{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5
2325
			fi
2326
echo "$as_me: error: C compiler cannot create executables" >&2;}
2326
		fi
2327
   { (exit 77); exit 77; }; }
2327
		USE_DLZ_POSTGRES='-DDLZ_POSTGRES'
2328
fi
2328
		DLZ_POSTGRES_INC="-I$use_dlz_postgres/include"
2329
2329
		DLZ_POSTGRES_LIBS="-L$use_dlz_postgres/lib  -lpq"
2330
ac_exeext=$ac_cv_exeext
2330
		echo "$ac_t""using PostgreSQL from $use_dlz_postgres/lib and $use_dlz_postgres/include" 1>&6
2331
echo "$as_me:$LINENO: result: $ac_file" >&5
2331
		;;
2332
echo "${ECHO_T}$ac_file" >&6
2332
esac
2333
2333
2334
# Check the compiler produces executables we can run.  If not, either
2334
2335
# the compiler is broken, or we cross compile.
2335
2336
echo "$as_me:$LINENO: checking whether the C compiler works" >&5
2336
2337
echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
2337
2338
# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
2338
2339
# If not cross compiling, check that we can run a simple program.
2339
2340
if test "$cross_compiling" != yes; then
2340
#
2341
  if { ac_try='./$ac_file'
2341
# was --with-dlz-mysql specified?
2342
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2342
#
2343
  (eval $ac_try) 2>&5
2343
2344
  ac_status=$?
2344
echo $ac_n "checking for MySQL DLZ driver""... $ac_c" 1>&6
2345
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2345
echo "configure:2346: checking for MySQL DLZ driver" >&5
2346
  (exit $ac_status); }; }; then
2346
# Check whether --with-dlz_mysql or --without-dlz_mysql was given.
2347
    cross_compiling=no
2347
if test "${with_dlz_mysql+set}" = set; then
2348
  else
2348
  withval="$with_dlz_mysql"
2349
    if test "$cross_compiling" = maybe; then
2349
  use_dlz_mysql="$withval"
2350
	cross_compiling=yes
2350
else
2351
    else
2351
  use_dlz_mysql="no"
2352
	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
2352
fi
2353
If you meant to cross compile, use \`--host'." >&5
2353
2354
echo "$as_me: error: cannot run C compiled programs.
2354
2355
If you meant to cross compile, use \`--host'." >&2;}
2355
case "$use_dlz_mysql" in
2356
   { (exit 1); exit 1; }; }
2356
	no)
2357
    fi
2357
		echo "$ac_t""no" 1>&6
2358
  fi
2358
		;;
2359
fi
2359
	*)
2360
echo "$as_me:$LINENO: result: yes" >&5
2360
		#set use_dlz = "yes" so the DLZ core will be built
2361
echo "${ECHO_T}yes" >&6
2361
		use_dlz=yes
2362
2362
		if test "$use_dlz_mysql" = "yes"
2363
rm -f a.out a.exe conftest$ac_cv_exeext
2363
		then
2364
ac_clean_files=$ac_clean_files_save
2364
			# User did not specify a path - guess it
2365
# Check the compiler produces executables we can run.  If not, either
2365
			mysqldirs="/usr /usr/local /usr/local/mysql /usr/pkg"
2366
# the compiler is broken, or we cross compile.
2366
			for d in $mysqldirs
2367
echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
2367
			do
2368
echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
2368
				if test -f $d/include/mysql/mysql.h
2369
echo "$as_me:$LINENO: result: $cross_compiling" >&5
2369
				then
2370
echo "${ECHO_T}$cross_compiling" >&6
2370
					use_dlz_mysql=$d
2371
2371
					break
2372
echo "$as_me:$LINENO: checking for suffix of executables" >&5
2372
				fi
2373
echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
2373
			done
2374
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
2374
			if test "$use_dlz_mysql" = "yes"
2375
  (eval $ac_link) 2>&5
2375
			then
2376
  ac_status=$?
2376
				echo "$ac_t""not found" 1>&6
2377
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2377
				{ echo "configure: error: MySQL was not found in any of $mysqldirs; use --with-dlz-mysql=/path" 1>&2; exit 1; }
2378
  (exit $ac_status); }; then
2378
			fi
2379
  # If both `conftest.exe' and `conftest' are `present' (well, observable)
2379
		fi
2380
# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
2380
                USE_DLZ_MYSQL='-DDLZ_MYSQL'
2381
# work properly (i.e., refer to `conftest.exe'), while it won't with
2381
                DLZ_MYSQL_INC="-I$use_dlz_mysql/include/mysql"
2382
# `rm'.
2382
                DLZ_MYSQL_LIBS="-L$use_dlz_mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm"
2383
for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
2383
                echo "$ac_t""using mysql from $use_dlz_mysql/lib/mysql and $use_dlz_mysql/include/mysql" 1>&6                
2384
  case $ac_file in
2384
		;;
2385
    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
2385
esac
2386
    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
2386
2387
          export ac_cv_exeext
2387
2388
          break;;
2388
2389
    * ) break;;
2389
2390
  esac
2390
2391
done
2391
2392
else
2392
#
2393
  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5
2393
# was --with-dlz-bdb specified?
2394
echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;}
2394
#
2395
   { (exit 1); exit 1; }; }
2395
2396
fi
2396
echo $ac_n "checking for Berkeley DB DLZ driver""... $ac_c" 1>&6
2397
2397
echo "configure:2398: checking for Berkeley DB DLZ driver" >&5
2398
rm -f conftest$ac_cv_exeext
2398
# Check whether --with-dlz_bdb or --without-dlz_bdb was given.
2399
echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
2399
if test "${with_dlz_bdb+set}" = set; then
2400
echo "${ECHO_T}$ac_cv_exeext" >&6
2400
  withval="$with_dlz_bdb"
2401
2401
  use_dlz_bdb="$withval"
2402
rm -f conftest.$ac_ext
2402
else
2403
EXEEXT=$ac_cv_exeext
2403
  use_dlz_bdb="no"
2404
ac_exeext=$EXEEXT
2404
fi
2405
echo "$as_me:$LINENO: checking for suffix of object files" >&5
2405
2406
echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
2406
2407
if test "${ac_cv_objext+set}" = set; then
2407
case "$use_dlz_bdb" in
2408
  echo $ECHO_N "(cached) $ECHO_C" >&6
2408
	no)
2409
else
2409
		echo "$ac_t""no" 1>&6
2410
  cat >conftest.$ac_ext <<_ACEOF
2410
		;;
2411
#line $LINENO "configure"
2411
	*)
2412
#include "confdefs.h"
2412
		#set use_dlz = "yes" so the DLZ core will be built
2413
2413
		use_dlz=yes
2414
#ifdef F77_DUMMY_MAIN
2414
		#set DLZ_BDB_UTIL to "dlzbdb" so that it is built too
2415
#  ifdef __cplusplus
2415
		DLZ_BDB_UTIL="dlzbdb"
2416
     extern "C"
2416
		if test "$use_dlz_bdb" = "yes"
2417
#  endif
2417
		then
2418
   int F77_DUMMY_MAIN() { return 1; }
2418
			# User did not specify a path - guess it
2419
#endif
2419
			bdbdirs="/usr /usr/local /usr/pkg"
2420
int
2420
			for d in $bdbdirs
2421
main ()
2421
			do
2422
{
2422
				if test -f $d/include/db.h
2423
2423
				then
2424
  ;
2424
                                        use_dlz_bdb=$d
2425
  return 0;
2425
					DLZ_BDB_INCDIR=$use_dlz_bdb/include
2426
}
2426
                                        DLB_BDB_LIB="-ldb"                                        
2427
_ACEOF
2427
                                        break                                  
2428
rm -f conftest.o conftest.obj
2428
				fi
2429
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2429
			done
2430
  (eval $ac_compile) 2>&5
2430
			if test "$use_dlz_bdb" = "yes"
2431
  ac_status=$?
2431
			then
2432
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2432
				echo "$ac_t""not found" 1>&6
2433
  (exit $ac_status); }; then
2433
				{ echo "configure: error: Berkeley DB was not found in any of $bdbdirs; use --with-dlz-bdb=/path" 1>&2; exit 1; }
2434
  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
2434
			fi
2435
  case $ac_file in
2435
                # if the user specified a path try a few variations of the path
2436
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
2436
                # for the include and library dirs
2437
    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
2437
		elif test -d "$use_dlz_bdb"
2438
       break;;
2438
                then
2439
  esac
2439
                        # set both to yes, so we can check them later
2440
done
2440
		        DLZ_BDB_INCDIR="yes"
2441
else
2441
                        DLZ_BDB_LIB="yes"
2442
  echo "$as_me: failed program was:" >&5
2442
                        
2443
cat conftest.$ac_ext >&5
2443
                        # check other locations for includes.
2444
{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5
2444
                        bdb_incdirs="/ /db41/ /db4/ /db/"
2445
echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;}
2445
			for d in $bdb_incdirs
2446
   { (exit 1); exit 1; }; }
2446
                        do
2447
fi
2447
				if test -f $use_dlz_bdb/include${d}db.h
2448
2448
                                then
2449
rm -f conftest.$ac_cv_objext conftest.$ac_ext
2449
					DLZ_BDB_INCDIR=$use_dlz_bdb/include${d}
2450
fi
2450
                                        break
2451
echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
2451
				fi
2452
echo "${ECHO_T}$ac_cv_objext" >&6
2452
			done
2453
OBJEXT=$ac_cv_objext
2453
                        
2454
ac_objext=$OBJEXT
2454
                        if test "$DLZ_BDB_INCDIR" = "yes"
2455
echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
2455
                        then
2456
echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
2456
                                echo "$ac_t""not found" 1>&6
2457
if test "${ac_cv_c_compiler_gnu+set}" = set; then
2457
                                { echo "configure: error: Berkeley DB header was not found in $use_dlz_bdb/include, \
2458
  echo $ECHO_N "(cached) $ECHO_C" >&6
2458
$use_dlz_bdb/include/db41, $use_dlz_bdb/include/db4 or $use_dlz_bdb/include/db" 1>&2; exit 1; }
2459
else
2459
                        fi
2460
  cat >conftest.$ac_ext <<_ACEOF
2460
                        
2461
#line $LINENO "configure"
2461
			# look for libname other than libdb.so
2462
#include "confdefs.h"
2462
                        bdb_libnames="db41 db-4.1 db"
2463
2463
			for d in $bdb_libnames
2464
#ifdef F77_DUMMY_MAIN
2464
                        do
2465
#  ifdef __cplusplus
2465
				if test -f $use_dlz_bdb/lib/lib${d}.so
2466
     extern "C"
2466
                                then
2467
#  endif
2467
					DLZ_BDB_LIB="-l${d}"
2468
   int F77_DUMMY_MAIN() { return 1; }
2468
				fi
2469
#endif
2469
			done
2470
int
2470
                        
2471
main ()
2471
                        if test "$DLZ_BDB_LIB" = "yes"
2472
{
2472
                        then
2473
#ifndef __GNUC__
2473
                                echo "$ac_t""not found" 1>&6
2474
       choke me
2474
                                { echo "configure: error: Berkeley DB library libdb41.so, libdb-4.1.so or libdb.so could not be found \
2475
#endif
2475
in $use_dlz_bdb/lib" 1>&2; exit 1; }
2476
2476
                        fi                        
2477
  ;
2477
2478
  return 0;
2478
2479
}
2479
                else
2480
_ACEOF
2480
                        echo "$ac_t""not found" 1>&6
2481
rm -f conftest.$ac_objext
2481
                        { echo "configure: error: Path $use_dlz_bdb does not exist" 1>&2; exit 1; }
2482
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2482
2483
  (eval $ac_compile) 2>&5
2483
		fi
2484
  ac_status=$?
2484
                
2485
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2485
                USE_DLZ_BDB='-DDLZ_BDB'
2486
  (exit $ac_status); } &&
2486
                DLZ_BDB_INC="-I$DLZ_BDB_INCDIR"
2487
         { ac_try='test -s conftest.$ac_objext'
2487
                DLZ_BDB_LIBS="-L${use_dlz_bdb}/lib ${DLZ_BDB_LIB}"
2488
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2488
                echo "$ac_t""using Berkeley DB from $use_dlz_bdb/lib and $DLZ_BDB_INCDIR" 1>&6                
2489
  (eval $ac_try) 2>&5
2489
		;;
2490
  ac_status=$?
2490
esac
2491
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2491
2492
  (exit $ac_status); }; }; then
2492
2493
  ac_compiler_gnu=yes
2493
2494
else
2494
2495
  echo "$as_me: failed program was:" >&5
2495
2496
cat conftest.$ac_ext >&5
2496
2497
ac_compiler_gnu=no
2497
2498
fi
2498
#
2499
rm -f conftest.$ac_objext conftest.$ac_ext
2499
# was --with-dlz-filesystem specified?
2500
ac_cv_c_compiler_gnu=$ac_compiler_gnu
2500
#
2501
2501
2502
fi
2502
echo $ac_n "checking for file system DLZ driver""... $ac_c" 1>&6
2503
echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
2503
echo "configure:2504: checking for file system DLZ driver" >&5
2504
echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
2504
# Check whether --with-dlz_filesystem or --without-dlz_filesystem was given.
2505
GCC=`test $ac_compiler_gnu = yes && echo yes`
2505
if test "${with_dlz_filesystem+set}" = set; then
2506
ac_test_CFLAGS=${CFLAGS+set}
2506
  withval="$with_dlz_filesystem"
2507
ac_save_CFLAGS=$CFLAGS
2507
  use_dlz_filesystem="$withval"
2508
CFLAGS="-g"
2508
else
2509
echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
2509
  use_dlz_filesystem="no"
2510
echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
2510
fi
2511
if test "${ac_cv_prog_cc_g+set}" = set; then
2511
2512
  echo $ECHO_N "(cached) $ECHO_C" >&6
2512
2513
else
2513
case "$use_dlz_filesystem" in
2514
  cat >conftest.$ac_ext <<_ACEOF
2514
	no)
2515
#line $LINENO "configure"
2515
		echo "$ac_t""no" 1>&6
2516
#include "confdefs.h"
2516
		;;
2517
2517
	*)
2518
#ifdef F77_DUMMY_MAIN
2518
		#set use_dlz = "yes" so the DLZ core will be built
2519
#  ifdef __cplusplus
2519
		use_dlz=yes
2520
     extern "C"
2520
                USE_DLZ_FILESYSTEM='-DDLZ_FILESYSTEM'
2521
#  endif
2521
                echo "$ac_t""yes" 1>&6
2522
   int F77_DUMMY_MAIN() { return 1; }
2522
		;;
2523
#endif
2523
esac
2524
int
2524
2525
main ()
2525
2526
{
2526
2527
2527
2528
  ;
2528
#
2529
  return 0;
2529
# was --with-dlz-ldap specified?
2530
}
2530
#
2531
_ACEOF
2531
2532
rm -f conftest.$ac_objext
2532
echo $ac_n "checking for LDAP DLZ driver""... $ac_c" 1>&6
2533
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2533
echo "configure:2534: checking for LDAP DLZ driver" >&5
2534
  (eval $ac_compile) 2>&5
2534
# Check whether --with-dlz_ldap or --without-dlz_ldap was given.
2535
  ac_status=$?
2535
if test "${with_dlz_ldap+set}" = set; then
2536
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2536
  withval="$with_dlz_ldap"
2537
  (exit $ac_status); } &&
2537
  use_dlz_ldap="$withval"
2538
         { ac_try='test -s conftest.$ac_objext'
2538
else
2539
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2539
  use_dlz_ldap="no"
2540
  (eval $ac_try) 2>&5
2540
fi
2541
  ac_status=$?
2541
2542
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2542
2543
  (exit $ac_status); }; }; then
2543
case "$use_dlz_ldap" in
2544
  ac_cv_prog_cc_g=yes
2544
	no)
2545
else
2545
		echo "$ac_t""no" 1>&6
2546
  echo "$as_me: failed program was:" >&5
2546
		;;
2547
cat conftest.$ac_ext >&5
2547
	*)
2548
ac_cv_prog_cc_g=no
2548
		#set use_dlz = "yes" so the DLZ core will be built
2549
fi
2549
		use_dlz=yes
2550
rm -f conftest.$ac_objext conftest.$ac_ext
2550
		if test "$use_dlz_ldap" = "yes"
2551
fi
2551
		then
2552
echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
2552
			# User did not specify a path - guess it
2553
echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
2553
			ldapdirs="/usr /usr/local /usr/pkg"
2554
if test "$ac_test_CFLAGS" = set; then
2554
			for d in $ldapdirs
2555
  CFLAGS=$ac_save_CFLAGS
2555
			do
2556
elif test $ac_cv_prog_cc_g = yes; then
2556
				if test -f $d/include/ldap.h
2557
  if test "$GCC" = yes; then
2557
				then
2558
    CFLAGS="-g -O2"
2558
					use_dlz_ldap=$d
2559
  else
2559
					break
2560
    CFLAGS="-g"
2560
				fi
2561
  fi
2561
			done
2562
else
2562
			if test "$use_dlz_ldap" = "yes"
2563
  if test "$GCC" = yes; then
2563
			then
2564
    CFLAGS="-O2"
2564
				echo "$ac_t""not found" 1>&6
2565
  else
2565
				{ echo "configure: error: LDAP headers were not found in any of $ldapdirs; use --with-dlz-ldap=/path" 1>&2; exit 1; }
2566
    CFLAGS=
2566
			fi
2567
  fi
2567
		fi
2568
fi
2568
		USE_DLZ_LDAP='-DDLZ_LDAP'
2569
# Some people use a C++ compiler to compile C.  Since we use `exit',
2569
		DLZ_LDAP_INC="-I$use_dlz_ldap/include"
2570
# in C++ we need to declare it.  In case someone uses the same compiler
2570
		DLZ_LDAP_LIBS="-L$use_dlz_ldap/lib -lldap -llber"
2571
# for both compiling C and C++ we need to have the C++ compiler decide
2571
		echo "$ac_t""using LDAP from $use_dlz_ldap/lib and $use_dlz_ldap/include" 1>&6
2572
# the declaration of exit, since it's the most demanding environment.
2572
		;;
2573
cat >conftest.$ac_ext <<_ACEOF
2573
esac
2574
#ifndef __cplusplus
2574
2575
  choke me
2575
2576
#endif
2576
2577
_ACEOF
2577
2578
rm -f conftest.$ac_objext
2578
2579
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2579
2580
  (eval $ac_compile) 2>&5
2580
2581
  ac_status=$?
2581
#
2582
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2582
# was --with-dlz-odbc specified?
2583
  (exit $ac_status); } &&
2583
#
2584
         { ac_try='test -s conftest.$ac_objext'
2584
2585
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2585
echo $ac_n "checking for ODBC DLZ driver""... $ac_c" 1>&6
2586
  (eval $ac_try) 2>&5
2586
echo "configure:2587: checking for ODBC DLZ driver" >&5
2587
  ac_status=$?
2587
# Check whether --with-dlz_odbc or --without-dlz_odbc was given.
2588
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2588
if test "${with_dlz_odbc+set}" = set; then
2589
  (exit $ac_status); }; }; then
2589
  withval="$with_dlz_odbc"
2590
  for ac_declaration in \
2590
  use_dlz_odbc="$withval"
2591
   ''\
2591
else
2592
   '#include <stdlib.h>' \
2592
  use_dlz_odbc="no"
2593
   'extern "C" void std::exit (int) throw (); using std::exit;' \
2593
fi
2594
   'extern "C" void std::exit (int); using std::exit;' \
2594
2595
   'extern "C" void exit (int) throw ();' \
2595
2596
   'extern "C" void exit (int);' \
2596
case "$use_dlz_odbc" in
2597
   'void exit (int);'
2597
	no)
2598
do
2598
		echo "$ac_t""no" 1>&6
2599
  cat >conftest.$ac_ext <<_ACEOF
2599
		;;
2600
#line $LINENO "configure"
2600
	*)
2601
#include "confdefs.h"
2601
		#set use_dlz = "yes" so the DLZ core will be built
2602
#include <stdlib.h>
2602
		use_dlz=yes
2603
$ac_declaration
2603
		if test "$use_dlz_odbc" = "yes"
2604
#ifdef F77_DUMMY_MAIN
2604
		then
2605
#  ifdef __cplusplus
2605
			# User did not specify a path - guess it
2606
     extern "C"
2606
			odbcdirs="/usr /usr/local /usr/pkg"
2607
#  endif
2607
			for d in $odbcdirs
2608
   int F77_DUMMY_MAIN() { return 1; }
2608
			do
2609
#endif
2609
				if test -f $d/include/sql.h
2610
int
2610
				then
2611
main ()
2611
					use_dlz_odbc=$d
2612
{
2612
					break
2613
exit (42);
2613
				fi
2614
  ;
2614
			done
2615
  return 0;
2615
			if test "$use_dlz_odbc" = "yes"
2616
}
2616
			then
2617
_ACEOF
2617
				echo "$ac_t""not found" 1>&6
2618
rm -f conftest.$ac_objext
2618
				{ echo "configure: error: ODBC headers were not found in any of $odbcdirs; use --with-dlz-odbc=/path" 1>&2; exit 1; }
2619
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2619
			fi
2620
  (eval $ac_compile) 2>&5
2620
		fi
2621
  ac_status=$?
2621
		USE_DLZ_ODBC='-DDLZ_ODBC'
2622
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2622
		DLZ_ODBC_INC="-I$use_dlz_odbc/include"
2623
  (exit $ac_status); } &&
2623
		DLZ_ODBC_LIBS="-L$use_dlz_odbc/lib -lodbc"
2624
         { ac_try='test -s conftest.$ac_objext'
2624
		echo "$ac_t""using ODBC from $use_dlz_odbc/lib and $use_dlz_odbc/include" 1>&6
2625
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2625
		;;
2626
  (eval $ac_try) 2>&5
2626
esac
2627
  ac_status=$?
2627
2628
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2628
2629
  (exit $ac_status); }; }; then
2629
2630
  :
2630
2631
else
2631
2632
  echo "$as_me: failed program was:" >&5
2632
2633
cat conftest.$ac_ext >&5
2633
                                                                                     
2634
continue
2634
#
2635
fi
2635
# was --with-dlz-stub specified?
2636
rm -f conftest.$ac_objext conftest.$ac_ext
2636
#
2637
  cat >conftest.$ac_ext <<_ACEOF
2637
2638
#line $LINENO "configure"
2638
echo $ac_n "checking for stub DLZ driver""... $ac_c" 1>&6
2639
#include "confdefs.h"
2639
echo "configure:2640: checking for stub DLZ driver" >&5
2640
$ac_declaration
2640
# Check whether --with-dlz_stub or --without-dlz_stub was given.
2641
#ifdef F77_DUMMY_MAIN
2641
if test "${with_dlz_stub+set}" = set; then
2642
#  ifdef __cplusplus
2642
  withval="$with_dlz_stub"
2643
     extern "C"
2643
  use_dlz_stub="$withval"
2644
#  endif
2644
else
2645
   int F77_DUMMY_MAIN() { return 1; }
2645
  use_dlz_stub="no"
2646
#endif
2646
fi
2647
int
2647
2648
main ()
2648
2649
{
2649
case "$use_dlz_stub" in
2650
exit (42);
2650
	no)
2651
  ;
2651
		echo "$ac_t""no" 1>&6
2652
  return 0;
2652
		;;
2653
}
2653
	*)
2654
_ACEOF
2654
		#set use_dlz = "yes" so the DLZ core will be built
2655
rm -f conftest.$ac_objext
2655
		use_dlz=yes
2656
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2656
                USE_DLZ_STUB='-DDLZ_STUB'
2657
  (eval $ac_compile) 2>&5
2657
                echo "$ac_t""yes" 1>&6
2658
  ac_status=$?
2658
		;;
2659
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2659
esac
2660
  (exit $ac_status); } &&
2660
2661
         { ac_try='test -s conftest.$ac_objext'
2661
2662
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2662
2663
  (eval $ac_try) 2>&5
2663
2664
  ac_status=$?
2664
#
2665
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2665
# If any DLZ driver is built, the DLZ core is built too.
2666
  (exit $ac_status); }; }; then
2666
#
2667
  break
2667
2668
else
2668
echo $ac_n "checking for DLZ""... $ac_c" 1>&6
2669
  echo "$as_me: failed program was:" >&5
2669
echo "configure:2670: checking for DLZ" >&5
2670
cat conftest.$ac_ext >&5
2670
2671
fi
2671
# check if any DLZ driver was built
2672
rm -f conftest.$ac_objext conftest.$ac_ext
2672
if test "$use_dlz" = "yes"
2673
done
2673
then
2674
rm -f conftest*
2674
	echo "$ac_t""yes" 1>&6
2675
if test -n "$ac_declaration"; then
2675
	USE_DLZ="-DDLZ"
2676
  echo '#ifdef __cplusplus' >>confdefs.h
2676
else
2677
  echo $ac_declaration      >>confdefs.h
2677
	echo "$ac_t""no" 1>&6
2678
  echo '#endif'             >>confdefs.h
2678
fi
2679
fi
2679
2680
2680
2681
else
2681
2682
  echo "$as_me: failed program was:" >&5
2682
2683
cat conftest.$ac_ext >&5
2683
#
2684
fi
2684
# was --with-openssl specified?
2685
rm -f conftest.$ac_objext conftest.$ac_ext
2685
#
2686
ac_ext=c
2686
echo $ac_n "checking for OpenSSL library""... $ac_c" 1>&6
2687
ac_cpp='$CPP $CPPFLAGS'
2687
echo "configure:2688: checking for OpenSSL library" >&5
2688
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2688
# Check whether --with-openssl or --without-openssl was given.
2689
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2689
if test "${with_openssl+set}" = set; then
2690
ac_compiler_gnu=$ac_cv_c_compiler_gnu
2690
  withval="$with_openssl"
2691
2691
  use_openssl="$withval"
2692
2692
else
2693
2693
  use_openssl="no"
2694
ac_ext=c
2694
fi
2695
ac_cpp='$CPP $CPPFLAGS'
2695
2696
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2696
2697
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2697
case "$use_openssl" in
2698
ac_compiler_gnu=$ac_cv_c_compiler_gnu
2698
	no)
2699
echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
2699
		echo "$ac_t""no" 1>&6
2700
echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2700
		DST_OPENSSL_INC=""
2701
# On Suns, sometimes $CPP names a directory.
2701
		USE_OPENSSL=""
2702
if test -n "$CPP" && test -d "$CPP"; then
2702
		;;
2703
  CPP=
2703
	*)
2704
fi
2704
		if test "$use_openssl" = "yes"
2705
if test -z "$CPP"; then
2705
		then
2706
  if test "${ac_cv_prog_CPP+set}" = set; then
2706
		    	# User did not specify a path - guess it
2707
  echo $ECHO_N "(cached) $ECHO_C" >&6
2707
			openssldirs="/usr /usr/local /usr/local/ssl /usr/pkg"
2708
else
2708
			for d in $openssldirs
2709
      # Double quotes because CPP needs to be expanded
2709
			do
2710
    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2710
				if test -f $d/include/openssl/opensslv.h
2711
    do
2711
				then
2712
      ac_preproc_ok=false
2712
				 	use_openssl=$d
2713
for ac_c_preproc_warn_flag in '' yes
2713
					break
2714
do
2714
				fi
2715
  # Use a header file that comes with gcc, so configuring glibc
2715
			done
2716
  # with a fresh cross-compiler works.
2716
			if test "$use_openssl" = "yes"
2717
  # On the NeXT, cc -E runs the code through the compiler's parser,
2717
			then
2718
  # not just through cpp. "Syntax error" is here to catch this case.
2718
			    	echo "$ac_t""not found" 1>&6
2719
  cat >conftest.$ac_ext <<_ACEOF
2719
				{ echo "configure: error: OpenSSL was not found in any of $openssldirs; use --with-openssl=/path" 1>&2; exit 1; }
2720
#line $LINENO "configure"
2720
			fi
2721
#include "confdefs.h"
2721
		fi
2722
#include <assert.h>
2722
		USE_OPENSSL='-DOPENSSL'
2723
                     Syntax error
2723
		DST_OPENSSL_INC="-I$use_openssl/include"
2724
_ACEOF
2724
		DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
2725
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
2725
		echo "$ac_t""using openssl from $use_openssl/lib and $use_openssl/include" 1>&6
2726
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2726
2727
  ac_status=$?
2727
		saved_cflags="$CFLAGS"
2728
  egrep -v '^ *\+' conftest.er1 >conftest.err
2728
		saved_libs="$LIBS"
2729
  rm -f conftest.er1
2729
		CFLAGS="$CFLAGS $DST_OPENSSL_INC"
2730
  cat conftest.err >&5
2730
		LIBS="$LIBS $DNS_OPENSSL_LIBS"
2731
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2731
		echo $ac_n "checking whether linking with OpenSSL works""... $ac_c" 1>&6
2732
  (exit $ac_status); } >/dev/null; then
2732
echo "configure:2733: checking whether linking with OpenSSL works" >&5
2733
  if test -s conftest.err; then
2733
		if test "$cross_compiling" = yes; then
2734
    ac_cpp_err=$ac_c_preproc_warn_flag
2734
  echo "$ac_t""assuming it does work on target platform" 1>&6
2735
  else
2735
else
2736
    ac_cpp_err=
2736
  cat > conftest.$ac_ext <<EOF
2737
  fi
2737
#line 2738 "configure"
2738
else
2738
#include "confdefs.h"
2739
  ac_cpp_err=yes
2739
2740
fi
2740
#include <openssl/err.h>
2741
if test -z "$ac_cpp_err"; then
2741
int main() {
2742
  :
2742
	ERR_clear_error();
2743
else
2743
	return (0);
2744
  echo "$as_me: failed program was:" >&5
2744
}
2745
  cat conftest.$ac_ext >&5
2745
2746
  # Broken: fails on valid input.
2746
EOF
2747
continue
2747
if { (eval echo configure:2748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2748
fi
2748
then
2749
rm -f conftest.err conftest.$ac_ext
2749
  echo "$ac_t""yes" 1>&6
2750
2750
else
2751
  # OK, works on sane cases.  Now check whether non-existent headers
2751
  echo "configure: failed program was:" >&5
2752
  # can be detected and how.
2752
  cat conftest.$ac_ext >&5
2753
  cat >conftest.$ac_ext <<_ACEOF
2753
  rm -fr conftest*
2754
#line $LINENO "configure"
2754
  echo "$ac_t""no" 1>&6
2755
#include "confdefs.h"
2755
		 { echo "configure: error: Could not run test program using OpenSSL from
2756
#include <ac_nonexistent.h>
2756
$use_openssl/lib and $use_openssl/include.
2757
_ACEOF
2757
Please check the argument to --with-openssl and your
2758
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
2758
shared library configuration (e.g., LD_LIBRARY_PATH)." 1>&2; exit 1; }
2759
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2759
fi
2760
  ac_status=$?
2760
rm -fr conftest*
2761
  egrep -v '^ *\+' conftest.er1 >conftest.err
2761
fi
2762
  rm -f conftest.er1
2762
2763
  cat conftest.err >&5
2763
2764
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2764
		echo $ac_n "checking whether linking with OpenSSL requires -ldl""... $ac_c" 1>&6
2765
  (exit $ac_status); } >/dev/null; then
2765
echo "configure:2766: checking whether linking with OpenSSL requires -ldl" >&5
2766
  if test -s conftest.err; then
2766
		cat > conftest.$ac_ext <<EOF
2767
    ac_cpp_err=$ac_c_preproc_warn_flag
2767
#line 2768 "configure"
2768
  else
2768
#include "confdefs.h"
2769
    ac_cpp_err=
2769
2770
  fi
2770
#include <openssl/err.h>
2771
else
2771
int main() {
2772
  ac_cpp_err=yes
2772
 DSO_METHOD_dlfcn(); 
2773
fi
2773
; return 0; }
2774
if test -z "$ac_cpp_err"; then
2774
EOF
2775
  # Broken: success on invalid input.
2775
if { (eval echo configure:2776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2776
continue
2776
  rm -rf conftest*
2777
else
2777
  echo "$ac_t""no" 1>&6
2778
  echo "$as_me: failed program was:" >&5
2778
else
2779
  cat conftest.$ac_ext >&5
2779
  echo "configure: failed program was:" >&5
2780
  # Passes both tests.
2780
  cat conftest.$ac_ext >&5
2781
ac_preproc_ok=:
2781
  rm -rf conftest*
2782
break
2782
  LIBS="$LIBS -ldl"
2783
fi
2783
		cat > conftest.$ac_ext <<EOF
2784
rm -f conftest.err conftest.$ac_ext
2784
#line 2785 "configure"
2785
2785
#include "confdefs.h"
2786
done
2786
2787
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2787
#include <openssl/err.h>
2788
rm -f conftest.err conftest.$ac_ext
2788
2789
if $ac_preproc_ok; then
2789
int main() {
2790
  break
2790
 DSO_METHOD_dlfcn(); 
2791
fi
2791
; return 0; }
2792
2792
EOF
2793
    done
2793
if { (eval echo configure:2794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2794
    ac_cv_prog_CPP=$CPP
2794
  rm -rf conftest*
2795
2795
  echo "$ac_t""yes" 1>&6
2796
fi
2796
		DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
2797
  CPP=$ac_cv_prog_CPP
2797
		
2798
else
2798
else
2799
  ac_cv_prog_CPP=$CPP
2799
  echo "configure: failed program was:" >&5
2800
fi
2800
  cat conftest.$ac_ext >&5
2801
echo "$as_me:$LINENO: result: $CPP" >&5
2801
  rm -rf conftest*
2802
echo "${ECHO_T}$CPP" >&6
2802
  echo "$ac_t""unknown" 1>&6
2803
ac_preproc_ok=false
2803
		 { echo "configure: error: OpenSSL has unsupported dynamic loading" 1>&2; exit 1; }
2804
for ac_c_preproc_warn_flag in '' yes
2804
fi
2805
do
2805
rm -f conftest*
2806
  # Use a header file that comes with gcc, so configuring glibc
2806
		
2807
  # with a fresh cross-compiler works.
2807
fi
2808
  # On the NeXT, cc -E runs the code through the compiler's parser,
2808
rm -f conftest*
2809
  # not just through cpp. "Syntax error" is here to catch this case.
2809
		 
2810
  cat >conftest.$ac_ext <<_ACEOF
2810
#
2811
#line $LINENO "configure"
2811
#	OpenSSLDie is new with CERT CS-2002-23.  If we see it we have may
2812
#include "confdefs.h"
2812
#	have a patched library otherwise check that we are greater than
2813
#include <assert.h>
2813
#	the fixed versions
2814
                     Syntax error
2814
#
2815
_ACEOF
2815
		echo $ac_n "checking for OpenSSLDie""... $ac_c" 1>&6
2816
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
2816
echo "configure:2817: checking for OpenSSLDie" >&5
2817
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2817
if eval "test \"`echo '$''{'ac_cv_func_OpenSSLDie'+set}'`\" = set"; then
2818
  ac_status=$?
2818
  echo $ac_n "(cached) $ac_c" 1>&6
2819
  egrep -v '^ *\+' conftest.er1 >conftest.err
2819
else
2820
  rm -f conftest.er1
2820
  cat > conftest.$ac_ext <<EOF
2821
  cat conftest.err >&5
2821
#line 2822 "configure"
2822
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2822
#include "confdefs.h"
2823
  (exit $ac_status); } >/dev/null; then
2823
/* System header to define __stub macros and hopefully few prototypes,
2824
  if test -s conftest.err; then
2824
    which can conflict with char OpenSSLDie(); below.  */
2825
    ac_cpp_err=$ac_c_preproc_warn_flag
2825
#include <assert.h>
2826
  else
2826
/* Override any gcc2 internal prototype to avoid an error.  */
2827
    ac_cpp_err=
2827
/* We use char because int might match the return type of a gcc2
2828
  fi
2828
    builtin and then its argument prototype would still apply.  */
2829
else
2829
char OpenSSLDie();
2830
  ac_cpp_err=yes
2830
2831
fi
2831
int main() {
2832
if test -z "$ac_cpp_err"; then
2832
2833
  :
2833
/* The GNU C library defines this for functions which it implements
2834
else
2834
    to always fail with ENOSYS.  Some functions are actually named
2835
  echo "$as_me: failed program was:" >&5
2835
    something starting with __ and the normal name is an alias.  */
2836
  cat conftest.$ac_ext >&5
2836
#if defined (__stub_OpenSSLDie) || defined (__stub___OpenSSLDie)
2837
  # Broken: fails on valid input.
2837
choke me
2838
continue
2838
#else
2839
fi
2839
OpenSSLDie();
2840
rm -f conftest.err conftest.$ac_ext
2840
#endif
2841
2841
2842
  # OK, works on sane cases.  Now check whether non-existent headers
2842
; return 0; }
2843
  # can be detected and how.
2843
EOF
2844
  cat >conftest.$ac_ext <<_ACEOF
2844
if { (eval echo configure:2845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2845
#line $LINENO "configure"
2845
  rm -rf conftest*
2846
#include "confdefs.h"
2846
  eval "ac_cv_func_OpenSSLDie=yes"
2847
#include <ac_nonexistent.h>
2847
else
2848
_ACEOF
2848
  echo "configure: failed program was:" >&5
2849
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
2849
  cat conftest.$ac_ext >&5
2850
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2850
  rm -rf conftest*
2851
  ac_status=$?
2851
  eval "ac_cv_func_OpenSSLDie=no"
2852
  egrep -v '^ *\+' conftest.er1 >conftest.err
2852
fi
2853
  rm -f conftest.er1
2853
rm -f conftest*
2854
  cat conftest.err >&5
2854
fi
2855
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2855
2856
  (exit $ac_status); } >/dev/null; then
2856
if eval "test \"`echo '$ac_cv_func_'OpenSSLDie`\" = yes"; then
2857
  if test -s conftest.err; then
2857
  echo "$ac_t""yes" 1>&6
2858
    ac_cpp_err=$ac_c_preproc_warn_flag
2858
  echo $ac_n "checking OpenSSL library version""... $ac_c" 1>&6
2859
  else
2859
echo "configure:2860: checking OpenSSL library version" >&5
2860
    ac_cpp_err=
2860
		if test "$cross_compiling" = yes; then
2861
  fi
2861
  echo "$ac_t""assuming target platform has compatible version" 1>&6
2862
else
2862
else
2863
  ac_cpp_err=yes
2863
  cat > conftest.$ac_ext <<EOF
2864
fi
2864
#line 2865 "configure"
2865
if test -z "$ac_cpp_err"; then
2865
#include "confdefs.h"
2866
  # Broken: success on invalid input.
2866
2867
continue
2867
#include <stdio.h>
2868
else
2868
#include <openssl/opensslv.h>
2869
  echo "$as_me: failed program was:" >&5
2869
int main() {
2870
  cat conftest.$ac_ext >&5
2870
        if (OPENSSL_VERSION_NUMBER >= 0x0090581fL)
2871
  # Passes both tests.
2871
                return (0);
2872
ac_preproc_ok=:
2872
	printf("\n\nFound   OPENSSL_VERSION_NUMBER %#010x\n",
2873
break
2873
		OPENSSL_VERSION_NUMBER);
2874
fi
2874
	printf("Require OPENSSL_VERSION_NUMBER 0x0090581f or greater\n\n");
2875
rm -f conftest.err conftest.$ac_ext
2875
        return (1);
2876
2876
}
2877
done
2877
2878
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2878
EOF
2879
rm -f conftest.err conftest.$ac_ext
2879
if { (eval echo configure:2880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2880
if $ac_preproc_ok; then
2880
then
2881
  :
2881
  echo "$ac_t""ok" 1>&6
2882
else
2882
else
2883
  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5
2883
  echo "configure: failed program was:" >&5
2884
echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2884
  cat conftest.$ac_ext >&5
2885
   { (exit 1); exit 1; }; }
2885
  rm -fr conftest*
2886
fi
2886
  echo "$ac_t""not compatible" 1>&6
2887
2887
		 { echo "configure: error: you need OpenSSL 0.9.5a or newer" 1>&2; exit 1; }
2888
ac_ext=c
2888
fi
2889
ac_cpp='$CPP $CPPFLAGS'
2889
rm -fr conftest*
2890
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2890
fi
2891
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2891
2892
ac_compiler_gnu=$ac_cv_c_compiler_gnu
2892
		
2893
2893
else
2894
2894
  echo "$ac_t""no" 1>&6
2895
echo "$as_me:$LINENO: checking for ANSI C header files" >&5
2895
echo "$ac_t""did not find fixes for CERT CA-2002-23" 1>&6
2896
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
2896
		echo $ac_n "checking OpenSSL library version""... $ac_c" 1>&6
2897
if test "${ac_cv_header_stdc+set}" = set; then
2897
echo "configure:2898: checking OpenSSL library version" >&5
2898
  echo $ECHO_N "(cached) $ECHO_C" >&6
2898
		if test "$cross_compiling" = yes; then
2899
else
2899
  echo "$ac_t""assuming target platform has compatible version" 1>&6
2900
  cat >conftest.$ac_ext <<_ACEOF
2900
else
2901
#line $LINENO "configure"
2901
  cat > conftest.$ac_ext <<EOF
2902
#include "confdefs.h"
2902
#line 2903 "configure"
2903
#include <stdlib.h>
2903
#include "confdefs.h"
2904
#include <stdarg.h>
2904
2905
#include <string.h>
2905
#include <stdio.h>
2906
#include <float.h>
2906
#include <openssl/opensslv.h>
2907
2907
int main() {
2908
_ACEOF
2908
        if ((OPENSSL_VERSION_NUMBER >= 0x0090605fL &&
2909
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
2909
	     OPENSSL_VERSION_NUMBER < 0x009070000L) ||
2910
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2910
	     OPENSSL_VERSION_NUMBER >= 0x00907003L)
2911
  ac_status=$?
2911
                return (0);
2912
  egrep -v '^ *\+' conftest.er1 >conftest.err
2912
	printf("\n\nFound   OPENSSL_VERSION_NUMBER %#010x\n",
2913
  rm -f conftest.er1
2913
		OPENSSL_VERSION_NUMBER);
2914
  cat conftest.err >&5
2914
	printf("Require OPENSSL_VERSION_NUMBER 0x0090605f or greater (0.9.6e)\n"
2915
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2915
	       "Require OPENSSL_VERSION_NUMBER 0x00907003 or greater (0.9.7-beta2)\n\n");
2916
  (exit $ac_status); } >/dev/null; then
2916
        return (1);
2917
  if test -s conftest.err; then
2917
}
2918
    ac_cpp_err=$ac_c_preproc_warn_flag
2918
2919
  else
2919
EOF
2920
    ac_cpp_err=
2920
if { (eval echo configure:2921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2921
  fi
2921
then
2922
else
2922
  echo "$ac_t""ok" 1>&6
2923
  ac_cpp_err=yes
2923
else
2924
fi
2924
  echo "configure: failed program was:" >&5
2925
if test -z "$ac_cpp_err"; then
2925
  cat conftest.$ac_ext >&5
2926
  ac_cv_header_stdc=yes
2926
  rm -fr conftest*
2927
else
2927
  echo "$ac_t""not compatible" 1>&6
2928
  echo "$as_me: failed program was:" >&5
2928
		 { echo "configure: error: you need OpenSSL 0.9.6e/0.9.7-beta2 (or newer): CERT CA-2002-23" 1>&2; exit 1; }
2929
  cat conftest.$ac_ext >&5
2929
fi
2930
  ac_cv_header_stdc=no
2930
rm -fr conftest*
2931
fi
2931
fi
2932
rm -f conftest.err conftest.$ac_ext
2932
2933
2933
fi
2934
if test $ac_cv_header_stdc = yes; then
2934
2935
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
2935
		CFLAGS="$saved_cflags"
2936
  cat >conftest.$ac_ext <<_ACEOF
2936
		LIBS="$saved_libs"
2937
#line $LINENO "configure"
2937
		;;
2938
#include "confdefs.h"
2938
esac
2939
#include <string.h>
2939
2940
2940
#
2941
_ACEOF
2941
# This would include the system openssl path (and linker options to use
2942
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2942
# it as needed) if it is found.
2943
  egrep "memchr" >/dev/null 2>&1; then
2943
#
2944
  :
2944
2945
else
2945
2946
  ac_cv_header_stdc=no
2946
2947
fi
2947
2948
rm -f conftest*
2948
2949
2949
#
2950
fi
2950
# was --with-gssapi specified?
2951
2951
#
2952
if test $ac_cv_header_stdc = yes; then
2952
#AC_MSG_CHECKING(for GSSAPI library)
2953
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
2953
#AC_ARG_WITH(gssapi,
2954
  cat >conftest.$ac_ext <<_ACEOF
2954
#[  --with-gssapi=PATH   Specify path for system-supplied GSSAPI],
2955
#line $LINENO "configure"
2955
#    use_gssapi="$withval", use_gssapi="no")
2956
#include "confdefs.h"
2956
#
2957
#include <stdlib.h>
2957
#case "$use_gssapi" in
2958
2958
#	no)
2959
_ACEOF
2959
#		USE_GSSAPI=''
2960
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2960
#		DST_GSSAPI_INC=''
2961
  egrep "free" >/dev/null 2>&1; then
2961
#		DNS_GSSAPI_LIBS=''
2962
  :
2962
#		AC_MSG_RESULT(not specified)
2963
else
2963
#		;;
2964
  ac_cv_header_stdc=no
2964
#	yes)
2965
fi
2965
#		AC_MSG_ERROR([--with-gssapi must specify a path])
2966
rm -f conftest*
2966
#		;;
2967
2967
#	*)
2968
fi
2968
#		USE_GSSAPI='-DGSSAPI'
2969
2969
#		DST_GSSAPI_INC="-I$use_gssapi/include"
2970
if test $ac_cv_header_stdc = yes; then
2970
#		DNS_GSSAPI_LIBS="-L$use_gssapi/lib -lgssapi_krb5"
2971
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
2971
#		AC_MSG_RESULT(using gssapi from $use_gssapi/lib and $use_gssapi/include)
2972
  if test "$cross_compiling" = yes; then
2972
#		;;
2973
  :
2973
#esac
2974
else
2974
2975
  cat >conftest.$ac_ext <<_ACEOF
2975
USE_GSSAPI=''
2976
#line $LINENO "configure"
2976
DST_GSSAPI_INC=''
2977
#include "confdefs.h"
2977
DNS_GSSAPI_LIBS=''
2978
#include <ctype.h>
2978
2979
#if ((' ' & 0x0FF) == 0x020)
2979
2980
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
2980
2981
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
2981
2982
#else
2982
2983
# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
2983
#
2984
                     || ('j' <= (c) && (c) <= 'r') \
2984
# was --with-randomdev specified?
2985
                     || ('s' <= (c) && (c) <= 'z'))
2985
#
2986
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
2986
echo $ac_n "checking for random device""... $ac_c" 1>&6
2987
#endif
2987
echo "configure:2988: checking for random device" >&5
2988
2988
# Check whether --with-randomdev or --without-randomdev was given.
2989
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
2989
if test "${with_randomdev+set}" = set; then
2990
int
2990
  withval="$with_randomdev"
2991
main ()
2991
  use_randomdev="$withval"
2992
{
2992
else
2993
  int i;
2993
  use_randomdev="unspec"
2994
  for (i = 0; i < 256; i++)
2994
fi
2995
    if (XOR (islower (i), ISLOWER (i))
2995
2996
        || toupper (i) != TOUPPER (i))
2996
2997
      exit(2);
2997
case "$use_randomdev" in
2998
  exit (0);
2998
	unspec)
2999
}
2999
		case "$host" in
3000
_ACEOF
3000
			*-openbsd*)
3001
rm -f conftest$ac_exeext
3001
				devrandom=/dev/srandom
3002
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
3002
				;;
3003
  (eval $ac_link) 2>&5
3003
			*)
3004
  ac_status=$?
3004
				devrandom=/dev/random
3005
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3005
				;;
3006
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
3006
		esac
3007
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3007
		echo "$ac_t""$devrandom" 1>&6
3008
  (eval $ac_try) 2>&5
3008
		
3009
  ac_status=$?
3009
ac_safe=`echo "$devrandom" | sed 'y%./+-%__p_%'`
3010
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3010
echo $ac_n "checking for $devrandom""... $ac_c" 1>&6
3011
  (exit $ac_status); }; }; then
3011
echo "configure:3012: checking for $devrandom" >&5
3012
  :
3012
if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
3013
else
3013
  echo $ac_n "(cached) $ac_c" 1>&6
3014
  echo "$as_me: program exited with status $ac_status" >&5
3014
else
3015
echo "$as_me: failed program was:" >&5
3015
  if test "$cross_compiling" = yes; then
3016
cat conftest.$ac_ext >&5
3016
    { echo "configure: error: Cannot check for file existence when cross compiling" 1>&2; exit 1; }
3017
( exit $ac_status )
3017
else
3018
ac_cv_header_stdc=no
3018
  if test -r $devrandom; then
3019
fi
3019
    eval "ac_cv_file_$ac_safe=yes"
3020
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
3020
  else
3021
fi
3021
    eval "ac_cv_file_$ac_safe=no"
3022
fi
3022
  fi
3023
fi
3023
fi
3024
echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
3024
fi
3025
echo "${ECHO_T}$ac_cv_header_stdc" >&6
3025
if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
3026
if test $ac_cv_header_stdc = yes; then
3026
  echo "$ac_t""yes" 1>&6
3027
3027
  cat >> confdefs.h <<EOF
3028
cat >>confdefs.h <<\_ACEOF
3028
#define PATH_RANDOMDEV "$devrandom"
3029
#define STDC_HEADERS 1
3029
EOF
3030
_ACEOF
3030
3031
3031
else
3032
fi
3032
  echo "$ac_t""no" 1>&6
3033
3033
3034
3034
fi
3035
# On IRIX 5.3, sys/types and inttypes.h are conflicting.
3035
3036
3036
		;;
3037
3037
	yes)
3038
3038
		{ echo "configure: error: --with-randomdev must specify a path" 1>&2; exit 1; }
3039
3039
		;;
3040
3040
	no)
3041
3041
		echo "$ac_t""disabled" 1>&6
3042
3042
		;;
3043
3043
	*)
3044
3044
		cat >> confdefs.h <<EOF
3045
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
3045
#define PATH_RANDOMDEV "$use_randomdev"
3046
                  inttypes.h stdint.h unistd.h
3046
EOF
3047
do
3047
3048
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3048
		echo "$ac_t""using "$use_randomdev"" 1>&6
3049
echo "$as_me:$LINENO: checking for $ac_header" >&5
3049
		;;
3050
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3050
esac
3051
if eval "test \"\${$as_ac_Header+set}\" = set"; then
3051
3052
  echo $ECHO_N "(cached) $ECHO_C" >&6
3052
#
3053
else
3053
# Begin pthreads checking.
3054
  cat >conftest.$ac_ext <<_ACEOF
3054
#
3055
#line $LINENO "configure"
3055
# First, decide whether to use multithreading or not.
3056
#include "confdefs.h"
3056
#
3057
$ac_includes_default
3057
# Enable multithreading by default on systems where it is known
3058
3058
# to work well, and where debugging of multithreaded programs
3059
#include <$ac_header>
3059
# is supported.
3060
_ACEOF
3060
#
3061
rm -f conftest.$ac_objext
3061
3062
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3062
echo $ac_n "checking whether to build with thread support""... $ac_c" 1>&6
3063
  (eval $ac_compile) 2>&5
3063
echo "configure:3064: checking whether to build with thread support" >&5
3064
  ac_status=$?
3064
3065
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3065
case $host in
3066
  (exit $ac_status); } &&
3066
*-dec-osf*)
3067
         { ac_try='test -s conftest.$ac_objext'
3067
	use_threads=true ;;
3068
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3068
*-solaris2.[0-6])
3069
  (eval $ac_try) 2>&5
3069
	# Thread signals are broken on Solaris 2.6; they are sometimes
3070
  ac_status=$?
3070
	# delivered to the wrong thread.
3071
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3071
	use_threads=false ;;
3072
  (exit $ac_status); }; }; then
3072
*-solaris*)
3073
  eval "$as_ac_Header=yes"
3073
	use_threads=true ;;
3074
else
3074
*-ibm-aix*)
3075
  echo "$as_me: failed program was:" >&5
3075
	use_threads=true ;;
3076
cat conftest.$ac_ext >&5
3076
*-hp-hpux10*)
3077
eval "$as_ac_Header=no"
3077
	use_threads=false ;;
3078
fi
3078
*-hp-hpux11*)
3079
rm -f conftest.$ac_objext conftest.$ac_ext
3079
	use_threads=true ;;
3080
fi
3080
*-sgi-irix*)
3081
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
3081
	use_threads=true ;;
3082
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3082
*-sco-sysv*uw*)
3083
if test `eval echo '${'$as_ac_Header'}'` = yes; then
3083
        # UnixWare
3084
  cat >>confdefs.h <<_ACEOF
3084
	use_threads=false ;;
3085
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3085
*-netbsd*)
3086
_ACEOF
3086
	# Socket I/O optimizations introduced in 9.2 expose a
3087
3087
	# bug in unproven-pthreads; see PR #12650
3088
fi
3088
	use_threads=false ;;
3089
3089
*-openbsd*)
3090
done
3090
	# OpenBSD users have reported that named dumps core on
3091
3091
	# startup when built with threads.
3092
3092
	use_threads=false ;;
3093
3093
*-freebsd*)
3094
3094
	use_threads=false ;;
3095
3095
*-bsdi*)
3096
3096
	# Thread signals do not appear to work reliably on BSDI.
3097
3097
	use_threads=false ;;
3098
3098
*-linux*)
3099
for ac_header in fcntl.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/sysctl.h
3099
   	# Threads are disabled on Linux by default because most
3100
do
3100
	# Linux kernels produce unusable core dumps from multithreaded
3101
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3101
	# programs, and because of limitations in setuid().
3102
if eval "test \"\${$as_ac_Header+set}\" = set"; then
3102
	use_threads=false ;;	
3103
  echo "$as_me:$LINENO: checking for $ac_header" >&5
3103
*)
3104
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3104
	use_threads=false ;;
3105
if eval "test \"\${$as_ac_Header+set}\" = set"; then
3105
esac
3106
  echo $ECHO_N "(cached) $ECHO_C" >&6
3106
3107
fi
3107
# Check whether --enable-threads or --disable-threads was given.
3108
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
3108
if test "${enable_threads+set}" = set; then
3109
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3109
  enableval="$enable_threads"
3110
else
3110
  :
3111
  # Is the header compilable?
3111
fi
3112
echo "$as_me:$LINENO: checking $ac_header usability" >&5
3112
3113
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
3113
case "$enable_threads" in
3114
cat >conftest.$ac_ext <<_ACEOF
3114
	yes)
3115
#line $LINENO "configure"
3115
		use_threads=true
3116
#include "confdefs.h"
3116
		;;
3117
$ac_includes_default
3117
	no)
3118
#include <$ac_header>
3118
		use_threads=false
3119
_ACEOF
3119
		;;
3120
rm -f conftest.$ac_objext
3120
	'')
3121
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3121
		# Use system-dependent default
3122
  (eval $ac_compile) 2>&5
3122
		;;
3123
  ac_status=$?
3123
	*)
3124
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3124
	    	{ echo "configure: error: --enable-threads takes yes or no" 1>&2; exit 1; }
3125
  (exit $ac_status); } &&
3125
		;;
3126
         { ac_try='test -s conftest.$ac_objext'
3126
esac
3127
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3127
3128
  (eval $ac_try) 2>&5
3128
if $use_threads
3129
  ac_status=$?
3129
then
3130
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3130
	echo "$ac_t""yes" 1>&6
3131
  (exit $ac_status); }; }; then
3131
else
3132
  ac_header_compiler=yes
3132
	echo "$ac_t""no" 1>&6	
3133
else
3133
fi
3134
  echo "$as_me: failed program was:" >&5
3134
3135
cat conftest.$ac_ext >&5
3135
if $use_threads
3136
ac_header_compiler=no
3136
then
3137
fi
3137
	#
3138
rm -f conftest.$ac_objext conftest.$ac_ext
3138
	# Search for / configure pthreads in a system-dependent fashion.
3139
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
3139
	#
3140
echo "${ECHO_T}$ac_header_compiler" >&6
3140
	case "$host" in
3141
3141
	  *-netbsd*)
3142
# Is the header present?
3142
		# NetBSD has multiple pthreads implementations.	 The
3143
echo "$as_me:$LINENO: checking $ac_header presence" >&5
3143
		# recommended one to use is "unproven-pthreads".  The
3144
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
3144
		# older "mit-pthreads" may also work on some NetBSD
3145
cat >conftest.$ac_ext <<_ACEOF
3145
		# versions.  The PTL2 thread library does not
3146
#line $LINENO "configure"
3146
		# currently work with bind9, but can be chosen with
3147
#include "confdefs.h"
3147
		# the --with-ptl2 option for those who wish to
3148
#include <$ac_header>
3148
		# experiment with it.
3149
_ACEOF
3149
		CC="gcc"
3150
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
3150
		echo $ac_n "checking which NetBSD thread library to use""... $ac_c" 1>&6
3151
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3151
echo "configure:3152: checking which NetBSD thread library to use" >&5
3152
  ac_status=$?
3152
3153
  egrep -v '^ *\+' conftest.er1 >conftest.err
3153
		# Check whether --with-ptl2 or --without-ptl2 was given.
3154
  rm -f conftest.er1
3154
if test "${with_ptl2+set}" = set; then
3155
  cat conftest.err >&5
3155
  withval="$with_ptl2"
3156
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3156
  use_ptl2="$withval"
3157
  (exit $ac_status); } >/dev/null; then
3157
else
3158
  if test -s conftest.err; then
3158
  use_ptl2="no"
3159
    ac_cpp_err=$ac_c_preproc_warn_flag
3159
fi
3160
  else
3160
3161
    ac_cpp_err=
3161
3162
  fi
3162
		: ${LOCALBASE:=/usr/pkg}
3163
else
3163
3164
  ac_cpp_err=yes
3164
		if test "X$use_ptl2" = "Xyes"
3165
fi
3165
		then
3166
if test -z "$ac_cpp_err"; then
3166
			echo "$ac_t""PTL2" 1>&6
3167
  ac_header_preproc=yes
3167
			echo "configure: warning: linking with PTL2 is highly experimental and not expected to work" 1>&2
3168
else
3168
			CC=ptlgcc
3169
  echo "$as_me: failed program was:" >&5
3169
		else
3170
  cat conftest.$ac_ext >&5
3170
			if test ! -d $LOCALBASE/pthreads
3171
  ac_header_preproc=no
3171
			then
3172
fi
3172
				echo "$ac_t""none" 1>&6
3173
rm -f conftest.err conftest.$ac_ext
3173
				{ echo "configure: error: "could not find thread libraries"" 1>&2; exit 1; }
3174
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
3174
			fi
3175
echo "${ECHO_T}$ac_header_preproc" >&6
3175
3176
3176
			if $use_threads
3177
# So?  What about this header?
3177
			then
3178
case $ac_header_compiler:$ac_header_preproc in
3178
				echo "$ac_t""mit-pthreads/unproven-pthreads" 1>&6
3179
  yes:no )
3179
				pkg="$LOCALBASE/pthreads"
3180
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
3180
				lib1="-L$pkg/lib -Wl,-R$pkg/lib"
3181
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
3181
				lib2="-lpthread -lm -lgcc -lpthread"
3182
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
3182
				LIBS="$lib1 $lib2 $LIBS"
3183
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
3183
				CPPFLAGS="$CPPFLAGS -I$pkg/include"
3184
  no:yes )
3184
				STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include"
3185
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
3185
			fi
3186
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
3186
		fi
3187
    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
3187
		;;
3188
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
3188
		*)
3189
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
3189
			echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
3190
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
3190
echo "configure:3191: checking for pthread_create in -lpthread" >&5
3191
esac
3191
ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
3192
echo "$as_me:$LINENO: checking for $ac_header" >&5
3192
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3193
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3193
  echo $ac_n "(cached) $ac_c" 1>&6
3194
if eval "test \"\${$as_ac_Header+set}\" = set"; then
3194
else
3195
  echo $ECHO_N "(cached) $ECHO_C" >&6
3195
  ac_save_LIBS="$LIBS"
3196
else
3196
LIBS="-lpthread  $LIBS"
3197
  eval "$as_ac_Header=$ac_header_preproc"
3197
cat > conftest.$ac_ext <<EOF
3198
fi
3198
#line 3199 "configure"
3199
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
3199
#include "confdefs.h"
3200
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3200
/* Override any gcc2 internal prototype to avoid an error.  */
3201
3201
/* We use char because int might match the return type of a gcc2
3202
fi
3202
    builtin and then its argument prototype would still apply.  */
3203
if test `eval echo '${'$as_ac_Header'}'` = yes; then
3203
char pthread_create();
3204
  cat >>confdefs.h <<_ACEOF
3204
3205
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3205
int main() {
3206
_ACEOF
3206
pthread_create()
3207
3207
; return 0; }
3208
fi
3208
EOF
3209
3209
if { (eval echo configure:3210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3210
done
3210
  rm -rf conftest*
3211
3211
  eval "ac_cv_lib_$ac_lib_var=yes"
3212
3212
else
3213
echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
3213
  echo "configure: failed program was:" >&5
3214
echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
3214
  cat conftest.$ac_ext >&5
3215
if test "${ac_cv_prog_cc_stdc+set}" = set; then
3215
  rm -rf conftest*
3216
  echo $ECHO_N "(cached) $ECHO_C" >&6
3216
  eval "ac_cv_lib_$ac_lib_var=no"
3217
else
3217
fi
3218
  ac_cv_prog_cc_stdc=no
3218
rm -f conftest*
3219
ac_save_CC=$CC
3219
LIBS="$ac_save_LIBS"
3220
cat >conftest.$ac_ext <<_ACEOF
3220
3221
#line $LINENO "configure"
3221
fi
3222
#include "confdefs.h"
3222
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3223
#include <stdarg.h>
3223
  echo "$ac_t""yes" 1>&6
3224
#include <stdio.h>
3224
    ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3225
#include <sys/types.h>
3225
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3226
#include <sys/stat.h>
3226
  cat >> confdefs.h <<EOF
3227
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3227
#define $ac_tr_lib 1
3228
struct buf { int x; };
3228
EOF
3229
FILE * (*rcsopen) (struct buf *, struct stat *, int);
3229
3230
static char *e (p, i)
3230
  LIBS="-lpthread $LIBS"
3231
     char **p;
3231
3232
     int i;
3232
else
3233
{
3233
  echo "$ac_t""no" 1>&6
3234
  return p[i];
3234
echo $ac_n "checking for __pthread_create in -lpthread""... $ac_c" 1>&6
3235
}
3235
echo "configure:3236: checking for __pthread_create in -lpthread" >&5
3236
static char *f (char * (*g) (char **, int), char **p, ...)
3236
ac_lib_var=`echo pthread'_'__pthread_create | sed 'y%./+-%__p_%'`
3237
{
3237
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3238
  char *s;
3238
  echo $ac_n "(cached) $ac_c" 1>&6
3239
  va_list v;
3239
else
3240
  va_start (v,p);
3240
  ac_save_LIBS="$LIBS"
3241
  s = g (p, va_arg (v,int));
3241
LIBS="-lpthread  $LIBS"
3242
  va_end (v);
3242
cat > conftest.$ac_ext <<EOF
3243
  return s;
3243
#line 3244 "configure"
3244
}
3244
#include "confdefs.h"
3245
int test (int i, double x);
3245
/* Override any gcc2 internal prototype to avoid an error.  */
3246
struct s1 {int (*f) (int a);};
3246
/* We use char because int might match the return type of a gcc2
3247
struct s2 {int (*f) (double a);};
3247
    builtin and then its argument prototype would still apply.  */
3248
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3248
char __pthread_create();
3249
int argc;
3249
3250
char **argv;
3250
int main() {
3251
#ifdef F77_DUMMY_MAIN
3251
__pthread_create()
3252
#  ifdef __cplusplus
3252
; return 0; }
3253
     extern "C"
3253
EOF
3254
#  endif
3254
if { (eval echo configure:3255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3255
   int F77_DUMMY_MAIN() { return 1; }
3255
  rm -rf conftest*
3256
#endif
3256
  eval "ac_cv_lib_$ac_lib_var=yes"
3257
int
3257
else
3258
main ()
3258
  echo "configure: failed program was:" >&5
3259
{
3259
  cat conftest.$ac_ext >&5
3260
return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3260
  rm -rf conftest*
3261
  ;
3261
  eval "ac_cv_lib_$ac_lib_var=no"
3262
  return 0;
3262
fi
3263
}
3263
rm -f conftest*
3264
_ACEOF
3264
LIBS="$ac_save_LIBS"
3265
# Don't try gcc -ansi; that turns off useful extensions and
3265
3266
# breaks some systems' header files.
3266
fi
3267
# AIX			-qlanglvl=ansi
3267
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3268
# Ultrix and OSF/1	-std1
3268
  echo "$ac_t""yes" 1>&6
3269
# HP-UX 10.20 and later	-Ae
3269
    ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/^a-zA-Z0-9_/_/g' \
3270
# HP-UX older versions	-Aa -D_HPUX_SOURCE
3270
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3271
# SVR4			-Xc -D__EXTENSIONS__
3271
  cat >> confdefs.h <<EOF
3272
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3272
#define $ac_tr_lib 1
3273
do
3273
EOF
3274
  CC="$ac_save_CC $ac_arg"
3274
3275
  rm -f conftest.$ac_objext
3275
  LIBS="-lpthread $LIBS"
3276
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3276
3277
  (eval $ac_compile) 2>&5
3277
else
3278
  ac_status=$?
3278
  echo "$ac_t""no" 1>&6
3279
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3279
echo $ac_n "checking for __pthread_create_system in -lpthread""... $ac_c" 1>&6
3280
  (exit $ac_status); } &&
3280
echo "configure:3281: checking for __pthread_create_system in -lpthread" >&5
3281
         { ac_try='test -s conftest.$ac_objext'
3281
ac_lib_var=`echo pthread'_'__pthread_create_system | sed 'y%./+-%__p_%'`
3282
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3282
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3283
  (eval $ac_try) 2>&5
3283
  echo $ac_n "(cached) $ac_c" 1>&6
3284
  ac_status=$?
3284
else
3285
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3285
  ac_save_LIBS="$LIBS"
3286
  (exit $ac_status); }; }; then
3286
LIBS="-lpthread  $LIBS"
3287
  ac_cv_prog_cc_stdc=$ac_arg
3287
cat > conftest.$ac_ext <<EOF
3288
break
3288
#line 3289 "configure"
3289
else
3289
#include "confdefs.h"
3290
  echo "$as_me: failed program was:" >&5
3290
/* Override any gcc2 internal prototype to avoid an error.  */
3291
cat conftest.$ac_ext >&5
3291
/* We use char because int might match the return type of a gcc2
3292
fi
3292
    builtin and then its argument prototype would still apply.  */
3293
rm -f conftest.$ac_objext
3293
char __pthread_create_system();
3294
done
3294
3295
rm -f conftest.$ac_ext conftest.$ac_objext
3295
int main() {
3296
CC=$ac_save_CC
3296
__pthread_create_system()
3297
3297
; return 0; }
3298
fi
3298
EOF
3299
3299
if { (eval echo configure:3300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3300
case "x$ac_cv_prog_cc_stdc" in
3300
  rm -rf conftest*
3301
  x|xno)
3301
  eval "ac_cv_lib_$ac_lib_var=yes"
3302
    echo "$as_me:$LINENO: result: none needed" >&5
3302
else
3303
echo "${ECHO_T}none needed" >&6 ;;
3303
  echo "configure: failed program was:" >&5
3304
  *)
3304
  cat conftest.$ac_ext >&5
3305
    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
3305
  rm -rf conftest*
3306
echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
3306
  eval "ac_cv_lib_$ac_lib_var=no"
3307
    CC="$CC $ac_cv_prog_cc_stdc" ;;
3307
fi
3308
esac
3308
rm -f conftest*
3309
3309
LIBS="$ac_save_LIBS"
3310
echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
3310
3311
echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
3311
fi
3312
if test "${ac_cv_c_const+set}" = set; then
3312
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3313
  echo $ECHO_N "(cached) $ECHO_C" >&6
3313
  echo "$ac_t""yes" 1>&6
3314
else
3314
    ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/^a-zA-Z0-9_/_/g' \
3315
  cat >conftest.$ac_ext <<_ACEOF
3315
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3316
#line $LINENO "configure"
3316
  cat >> confdefs.h <<EOF
3317
#include "confdefs.h"
3317
#define $ac_tr_lib 1
3318
3318
EOF
3319
#ifdef F77_DUMMY_MAIN
3319
3320
#  ifdef __cplusplus
3320
  LIBS="-lpthread $LIBS"
3321
     extern "C"
3321
3322
#  endif
3322
else
3323
   int F77_DUMMY_MAIN() { return 1; }
3323
  echo "$ac_t""no" 1>&6
3324
#endif
3324
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
3325
int
3325
echo "configure:3326: checking for pthread_create in -lc_r" >&5
3326
main ()
3326
ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
3327
{
3327
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3328
/* FIXME: Include the comments suggested by Paul. */
3328
  echo $ac_n "(cached) $ac_c" 1>&6
3329
#ifndef __cplusplus
3329
else
3330
  /* Ultrix mips cc rejects this.  */
3330
  ac_save_LIBS="$LIBS"
3331
  typedef int charset[2];
3331
LIBS="-lc_r  $LIBS"
3332
  const charset x;
3332
cat > conftest.$ac_ext <<EOF
3333
  /* SunOS 4.1.1 cc rejects this.  */
3333
#line 3334 "configure"
3334
  char const *const *ccp;
3334
#include "confdefs.h"
3335
  char **p;
3335
/* Override any gcc2 internal prototype to avoid an error.  */
3336
  /* NEC SVR4.0.2 mips cc rejects this.  */
3336
/* We use char because int might match the return type of a gcc2
3337
  struct point {int x, y;};
3337
    builtin and then its argument prototype would still apply.  */
3338
  static struct point const zero = {0,0};
3338
char pthread_create();
3339
  /* AIX XL C 1.02.0.0 rejects this.
3339
3340
     It does not let you subtract one const X* pointer from another in
3340
int main() {
3341
     an arm of an if-expression whose if-part is not a constant
3341
pthread_create()
3342
     expression */
3342
; return 0; }
3343
  const char *g = "string";
3343
EOF
3344
  ccp = &g + (g ? g-g : 0);
3344
if { (eval echo configure:3345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3345
  /* HPUX 7.0 cc rejects these. */
3345
  rm -rf conftest*
3346
  ++ccp;
3346
  eval "ac_cv_lib_$ac_lib_var=yes"
3347
  p = (char**) ccp;
3347
else
3348
  ccp = (char const *const *) p;
3348
  echo "configure: failed program was:" >&5
3349
  { /* SCO 3.2v4 cc rejects this.  */
3349
  cat conftest.$ac_ext >&5
3350
    char *t;
3350
  rm -rf conftest*
3351
    char const *s = 0 ? (char *) 0 : (char const *) 0;
3351
  eval "ac_cv_lib_$ac_lib_var=no"
3352
3352
fi
3353
    *t++ = 0;
3353
rm -f conftest*
3354
  }
3354
LIBS="$ac_save_LIBS"
3355
  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3355
3356
    int x[] = {25, 17};
3356
fi
3357
    const int *foo = &x[0];
3357
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3358
    ++foo;
3358
  echo "$ac_t""yes" 1>&6
3359
  }
3359
    ac_tr_lib=HAVE_LIB`echo c_r | sed -e 's/^a-zA-Z0-9_/_/g' \
3360
  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3360
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3361
    typedef const int *iptr;
3361
  cat >> confdefs.h <<EOF
3362
    iptr p = 0;
3362
#define $ac_tr_lib 1
3363
    ++p;
3363
EOF
3364
  }
3364
3365
  { /* AIX XL C 1.02.0.0 rejects this saying
3365
  LIBS="-lc_r $LIBS"
3366
       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3366
3367
    struct s { int j; const int *ap[3]; };
3367
else
3368
    struct s *b; b->j = 5;
3368
  echo "$ac_t""no" 1>&6
3369
  }
3369
echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
3370
  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3370
echo "configure:3371: checking for pthread_create in -lc" >&5
3371
    const int foo = 10;
3371
ac_lib_var=`echo c'_'pthread_create | sed 'y%./+-%__p_%'`
3372
  }
3372
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3373
#endif
3373
  echo $ac_n "(cached) $ac_c" 1>&6
3374
3374
else
3375
  ;
3375
  ac_save_LIBS="$LIBS"
3376
  return 0;
3376
LIBS="-lc  $LIBS"
3377
}
3377
cat > conftest.$ac_ext <<EOF
3378
_ACEOF
3378
#line 3379 "configure"
3379
rm -f conftest.$ac_objext
3379
#include "confdefs.h"
3380
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3380
/* Override any gcc2 internal prototype to avoid an error.  */
3381
  (eval $ac_compile) 2>&5
3381
/* We use char because int might match the return type of a gcc2
3382
  ac_status=$?
3382
    builtin and then its argument prototype would still apply.  */
3383
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3383
char pthread_create();
3384
  (exit $ac_status); } &&
3384
3385
         { ac_try='test -s conftest.$ac_objext'
3385
int main() {
3386
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3386
pthread_create()
3387
  (eval $ac_try) 2>&5
3387
; return 0; }
3388
  ac_status=$?
3388
EOF
3389
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3389
if { (eval echo configure:3390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3390
  (exit $ac_status); }; }; then
3390
  rm -rf conftest*
3391
  ac_cv_c_const=yes
3391
  eval "ac_cv_lib_$ac_lib_var=yes"
3392
else
3392
else
3393
  echo "$as_me: failed program was:" >&5
3393
  echo "configure: failed program was:" >&5
3394
cat conftest.$ac_ext >&5
3394
  cat conftest.$ac_ext >&5
3395
ac_cv_c_const=no
3395
  rm -rf conftest*
3396
fi
3396
  eval "ac_cv_lib_$ac_lib_var=no"
3397
rm -f conftest.$ac_objext conftest.$ac_ext
3397
fi
3398
fi
3398
rm -f conftest*
3399
echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
3399
LIBS="$ac_save_LIBS"
3400
echo "${ECHO_T}$ac_cv_c_const" >&6
3400
3401
if test $ac_cv_c_const = no; then
3401
fi
3402
3402
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3403
cat >>confdefs.h <<\_ACEOF
3403
  echo "$ac_t""yes" 1>&6
3404
#define const
3404
    ac_tr_lib=HAVE_LIB`echo c | sed -e 's/^a-zA-Z0-9_/_/g' \
3405
_ACEOF
3405
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3406
3406
  cat >> confdefs.h <<EOF
3407
fi
3407
#define $ac_tr_lib 1
3408
3408
EOF
3409
echo "$as_me:$LINENO: checking for inline" >&5
3409
3410
echo $ECHO_N "checking for inline... $ECHO_C" >&6
3410
  LIBS="-lc $LIBS"
3411
if test "${ac_cv_c_inline+set}" = set; then
3411
3412
  echo $ECHO_N "(cached) $ECHO_C" >&6
3412
else
3413
else
3413
  echo "$ac_t""no" 1>&6
3414
  ac_cv_c_inline=no
3414
{ echo "configure: error: "could not find thread libraries"" 1>&2; exit 1; }
3415
for ac_kw in inline __inline__ __inline; do
3415
fi
3416
  cat >conftest.$ac_ext <<_ACEOF
3416
3417
#line $LINENO "configure"
3417
fi
3418
#include "confdefs.h"
3418
3419
#ifndef __cplusplus
3419
fi
3420
static $ac_kw int static_foo () {return 0; }
3420
3421
$ac_kw int foo () {return 0; }
3421
fi
3422
#endif
3422
3423
3423
fi
3424
_ACEOF
3424
3425
rm -f conftest.$ac_objext
3425
		;;
3426
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3426
	esac
3427
  (eval $ac_compile) 2>&5
3427
fi
3428
  ac_status=$?
3428
3429
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3429
if $use_threads
3430
  (exit $ac_status); } &&
3430
then
3431
         { ac_try='test -s conftest.$ac_objext'
3431
	#
3432
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3432
	# We'd like to use sigwait() too
3433
  (eval $ac_try) 2>&5
3433
	#
3434
  ac_status=$?
3434
	echo $ac_n "checking for sigwait in -lc""... $ac_c" 1>&6
3435
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3435
echo "configure:3436: checking for sigwait in -lc" >&5
3436
  (exit $ac_status); }; }; then
3436
ac_lib_var=`echo c'_'sigwait | sed 'y%./+-%__p_%'`
3437
  ac_cv_c_inline=$ac_kw; break
3437
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3438
else
3438
  echo $ac_n "(cached) $ac_c" 1>&6
3439
  echo "$as_me: failed program was:" >&5
3439
else
3440
cat conftest.$ac_ext >&5
3440
  ac_save_LIBS="$LIBS"
3441
fi
3441
LIBS="-lc  $LIBS"
3442
rm -f conftest.$ac_objext conftest.$ac_ext
3442
cat > conftest.$ac_ext <<EOF
3443
done
3443
#line 3444 "configure"
3444
3444
#include "confdefs.h"
3445
fi
3445
/* Override any gcc2 internal prototype to avoid an error.  */
3446
echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
3446
/* We use char because int might match the return type of a gcc2
3447
echo "${ECHO_T}$ac_cv_c_inline" >&6
3447
    builtin and then its argument prototype would still apply.  */
3448
case $ac_cv_c_inline in
3448
char sigwait();
3449
  inline | yes) ;;
3449
3450
  no)
3450
int main() {
3451
cat >>confdefs.h <<\_ACEOF
3451
sigwait()
3452
#define inline
3452
; return 0; }
3453
_ACEOF
3453
EOF
3454
 ;;
3454
if { (eval echo configure:3455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3455
  *)  cat >>confdefs.h <<_ACEOF
3455
  rm -rf conftest*
3456
#define inline $ac_cv_c_inline
3456
  eval "ac_cv_lib_$ac_lib_var=yes"
3457
_ACEOF
3457
else
3458
 ;;
3458
  echo "configure: failed program was:" >&5
3459
esac
3459
  cat conftest.$ac_ext >&5
3460
3460
  rm -rf conftest*
3461
echo "$as_me:$LINENO: checking for sysctlbyname" >&5
3461
  eval "ac_cv_lib_$ac_lib_var=no"
3462
echo $ECHO_N "checking for sysctlbyname... $ECHO_C" >&6
3462
fi
3463
if test "${ac_cv_func_sysctlbyname+set}" = set; then
3463
rm -f conftest*
3464
  echo $ECHO_N "(cached) $ECHO_C" >&6
3464
LIBS="$ac_save_LIBS"
3465
else
3465
3466
  cat >conftest.$ac_ext <<_ACEOF
3466
fi
3467
#line $LINENO "configure"
3467
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3468
#include "confdefs.h"
3468
  echo "$ac_t""yes" 1>&6
3469
/* From autoconf 2.57 */
3469
  cat >> confdefs.h <<\EOF
3470
/* Define sysctlbyname to an innocuous variant, in case <limits.h> declares sysctlbyname.
3470
#define HAVE_SIGWAIT 1
3471
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
3471
EOF
3472
#define sysctlbyname innocuous_sysctlbyname
3472
3473
3473
else
3474
/* System header to define __stub macros and hopefully few prototypes,
3474
  echo "$ac_t""no" 1>&6
3475
    which can conflict with char sysctlbyname (); below.
3475
echo $ac_n "checking for sigwait in -lpthread""... $ac_c" 1>&6
3476
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3476
echo "configure:3477: checking for sigwait in -lpthread" >&5
3477
    <limits.h> exists even on freestanding compilers.  */
3477
ac_lib_var=`echo pthread'_'sigwait | sed 'y%./+-%__p_%'`
3478
3478
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3479
#ifdef __STDC__
3479
  echo $ac_n "(cached) $ac_c" 1>&6
3480
# include <limits.h>
3480
else
3481
#else
3481
  ac_save_LIBS="$LIBS"
3482
# include <assert.h>
3482
LIBS="-lpthread  $LIBS"
3483
#endif
3483
cat > conftest.$ac_ext <<EOF
3484
3484
#line 3485 "configure"
3485
#undef sysctlbyname
3485
#include "confdefs.h"
3486
3486
/* Override any gcc2 internal prototype to avoid an error.  */
3487
/* Override any gcc2 internal prototype to avoid an error.  */
3487
/* We use char because int might match the return type of a gcc2
3488
#ifdef __cplusplus
3488
    builtin and then its argument prototype would still apply.  */
3489
extern "C"
3489
char sigwait();
3490
{
3490
3491
#endif
3491
int main() {
3492
/* We use char because int might match the return type of a gcc2
3492
sigwait()
3493
   builtin and then its argument prototype would still apply.  */
3493
; return 0; }
3494
char sysctlbyname ();
3494
EOF
3495
/* The GNU C library defines this for functions which it implements
3495
if { (eval echo configure:3496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3496
    to always fail with ENOSYS.  Some functions are actually named
3496
  rm -rf conftest*
3497
    something starting with __ and the normal name is an alias.  */
3497
  eval "ac_cv_lib_$ac_lib_var=yes"
3498
#if defined (__stub_sysctlbyname) || defined (__stub___sysctlbyname)
3498
else
3499
choke me
3499
  echo "configure: failed program was:" >&5
3500
#else
3500
  cat conftest.$ac_ext >&5
3501
char (*f) () = sysctlbyname;
3501
  rm -rf conftest*
3502
#endif
3502
  eval "ac_cv_lib_$ac_lib_var=no"
3503
#ifdef __cplusplus
3503
fi
3504
}
3504
rm -f conftest*
3505
#endif
3505
LIBS="$ac_save_LIBS"
3506
3506
3507
#ifdef F77_DUMMY_MAIN
3507
fi
3508
#  ifdef __cplusplus
3508
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3509
     extern "C"
3509
  echo "$ac_t""yes" 1>&6
3510
#  endif
3510
  cat >> confdefs.h <<\EOF
3511
   int F77_DUMMY_MAIN() { return 1; }
3511
#define HAVE_SIGWAIT 1
3512
#endif
3512
EOF
3513
int
3513
3514
main ()
3514
else
3515
{
3515
  echo "$ac_t""no" 1>&6
3516
return f != sysctlbyname;
3516
echo $ac_n "checking for _Psigwait in -lpthread""... $ac_c" 1>&6
3517
  ;
3517
echo "configure:3518: checking for _Psigwait in -lpthread" >&5
3518
  return 0;
3518
ac_lib_var=`echo pthread'_'_Psigwait | sed 'y%./+-%__p_%'`
3519
}
3519
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3520
_ACEOF
3520
  echo $ac_n "(cached) $ac_c" 1>&6
3521
rm -f conftest.$ac_objext conftest$ac_exeext
3521
else
3522
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
3522
  ac_save_LIBS="$LIBS"
3523
  (eval $ac_link) 2>&5
3523
LIBS="-lpthread  $LIBS"
3524
  ac_status=$?
3524
cat > conftest.$ac_ext <<EOF
3525
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3525
#line 3526 "configure"
3526
  (exit $ac_status); } &&
3526
#include "confdefs.h"
3527
         { ac_try='test -s conftest$ac_exeext'
3527
/* Override any gcc2 internal prototype to avoid an error.  */
3528
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3528
/* We use char because int might match the return type of a gcc2
3529
  (eval $ac_try) 2>&5
3529
    builtin and then its argument prototype would still apply.  */
3530
  ac_status=$?
3530
char _Psigwait();
3531
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3531
3532
  (exit $ac_status); }; }; then
3532
int main() {
3533
  ac_cv_func_sysctlbyname=yes
3533
_Psigwait()
3534
else
3534
; return 0; }
3535
  echo "$as_me: failed program was:" >&5
3535
EOF
3536
cat conftest.$ac_ext >&5
3536
if { (eval echo configure:3537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3537
ac_cv_func_sysctlbyname=no
3537
  rm -rf conftest*
3538
fi
3538
  eval "ac_cv_lib_$ac_lib_var=yes"
3539
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3539
else
3540
fi
3540
  echo "configure: failed program was:" >&5
3541
echo "$as_me:$LINENO: result: $ac_cv_func_sysctlbyname" >&5
3541
  cat conftest.$ac_ext >&5
3542
echo "${ECHO_T}$ac_cv_func_sysctlbyname" >&6
3542
  rm -rf conftest*
3543
if test $ac_cv_func_sysctlbyname = yes; then
3543
  eval "ac_cv_lib_$ac_lib_var=no"
3544
  cat >>confdefs.h <<\_ACEOF
3544
fi
3545
#define HAVE_SYSCTLBYNAME 1
3545
rm -f conftest*
3546
_ACEOF
3546
LIBS="$ac_save_LIBS"
3547
3547
3548
fi
3548
fi
3549
3549
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3550
3550
  echo "$ac_t""yes" 1>&6
3551
#
3551
  cat >> confdefs.h <<\EOF
3552
# UnixWare 7.1.1 with the feature supplement to the UDK compiler
3552
#define HAVE_SIGWAIT 1
3553
# is reported to not support "static inline" (RT #1212).
3553
EOF
3554
#
3554
3555
echo "$as_me:$LINENO: checking for static inline breakage" >&5
3555
else
3556
echo $ECHO_N "checking for static inline breakage... $ECHO_C" >&6
3556
  echo "$ac_t""no" 1>&6
3557
cat >conftest.$ac_ext <<_ACEOF
3557
fi
3558
#line $LINENO "configure"
3558
3559
#include "confdefs.h"
3559
fi
3560
3560
3561
#ifdef F77_DUMMY_MAIN
3561
	
3562
#  ifdef __cplusplus
3562
fi
3563
     extern "C"
3563
3564
#  endif
3564
3565
   int F77_DUMMY_MAIN() { return 1; }
3565
	echo $ac_n "checking for pthread_attr_getstacksize""... $ac_c" 1>&6
3566
#endif
3566
echo "configure:3567: checking for pthread_attr_getstacksize" >&5
3567
int
3567
if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_getstacksize'+set}'`\" = set"; then
3568
main ()
3568
  echo $ac_n "(cached) $ac_c" 1>&6
3569
{
3569
else
3570
3570
  cat > conftest.$ac_ext <<EOF
3571
		foo1();
3571
#line 3572 "configure"
3572
	}
3572
#include "confdefs.h"
3573
3573
/* System header to define __stub macros and hopefully few prototypes,
3574
	static inline int foo1() {
3574
    which can conflict with char pthread_attr_getstacksize(); below.  */
3575
		return 0;
3575
#include <assert.h>
3576
	}
3576
/* Override any gcc2 internal prototype to avoid an error.  */
3577
3577
/* We use char because int might match the return type of a gcc2
3578
	static inline int foo2() {
3578
    builtin and then its argument prototype would still apply.  */
3579
		return foo1();
3579
char pthread_attr_getstacksize();
3580
3580
3581
  ;
3581
int main() {
3582
  return 0;
3582
3583
}
3583
/* The GNU C library defines this for functions which it implements
3584
_ACEOF
3584
    to always fail with ENOSYS.  Some functions are actually named
3585
rm -f conftest.$ac_objext
3585
    something starting with __ and the normal name is an alias.  */
3586
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3586
#if defined (__stub_pthread_attr_getstacksize) || defined (__stub___pthread_attr_getstacksize)
3587
  (eval $ac_compile) 2>&5
3587
choke me
3588
  ac_status=$?
3588
#else
3589
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3589
pthread_attr_getstacksize();
3590
  (exit $ac_status); } &&
3590
#endif
3591
         { ac_try='test -s conftest.$ac_objext'
3591
3592
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3592
; return 0; }
3593
  (eval $ac_try) 2>&5
3593
EOF
3594
  ac_status=$?
3594
if { (eval echo configure:3595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3595
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3595
  rm -rf conftest*
3596
  (exit $ac_status); }; }; then
3596
  eval "ac_cv_func_pthread_attr_getstacksize=yes"
3597
  echo "$as_me:$LINENO: result: no" >&5
3597
else
3598
echo "${ECHO_T}no" >&6
3598
  echo "configure: failed program was:" >&5
3599
else
3599
  cat conftest.$ac_ext >&5
3600
  echo "$as_me: failed program was:" >&5
3600
  rm -rf conftest*
3601
cat conftest.$ac_ext >&5
3601
  eval "ac_cv_func_pthread_attr_getstacksize=no"
3602
echo "$as_me:$LINENO: result: yes" >&5
3602
fi
3603
echo "${ECHO_T}yes" >&6
3603
rm -f conftest*
3604
         cat >>confdefs.h <<\_ACEOF
3604
fi
3605
#define inline
3605
3606
_ACEOF
3606
if eval "test \"`echo '$ac_cv_func_'pthread_attr_getstacksize`\" = yes"; then
3607
3607
  echo "$ac_t""yes" 1>&6
3608
fi
3608
  cat >> confdefs.h <<\EOF
3609
rm -f conftest.$ac_objext conftest.$ac_ext
3609
#define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
3610
3610
EOF
3611
echo "$as_me:$LINENO: checking for size_t" >&5
3611
3612
echo $ECHO_N "checking for size_t... $ECHO_C" >&6
3612
else
3613
if test "${ac_cv_type_size_t+set}" = set; then
3613
  echo "$ac_t""no" 1>&6
3614
  echo $ECHO_N "(cached) $ECHO_C" >&6
3614
fi
3615
else
3615
3616
  cat >conftest.$ac_ext <<_ACEOF
3616
3617
#line $LINENO "configure"
3617
	#
3618
#include "confdefs.h"
3618
	# Additional OS-specific issues related to pthreads and sigwait.
3619
$ac_includes_default
3619
	#
3620
#ifdef F77_DUMMY_MAIN
3620
	case "$host" in
3621
#  ifdef __cplusplus
3621
		#
3622
     extern "C"
3622
		# One more place to look for sigwait.
3623
#  endif
3623
		#
3624
   int F77_DUMMY_MAIN() { return 1; }
3624
		*-freebsd*)
3625
#endif
3625
			echo $ac_n "checking for sigwait in -lc_r""... $ac_c" 1>&6
3626
int
3626
echo "configure:3627: checking for sigwait in -lc_r" >&5
3627
main ()
3627
ac_lib_var=`echo c_r'_'sigwait | sed 'y%./+-%__p_%'`
3628
{
3628
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3629
if ((size_t *) 0)
3629
  echo $ac_n "(cached) $ac_c" 1>&6
3630
  return 0;
3630
else
3631
if (sizeof (size_t))
3631
  ac_save_LIBS="$LIBS"
3632
  return 0;
3632
LIBS="-lc_r  $LIBS"
3633
  ;
3633
cat > conftest.$ac_ext <<EOF
3634
  return 0;
3634
#line 3635 "configure"
3635
}
3635
#include "confdefs.h"
3636
_ACEOF
3636
/* Override any gcc2 internal prototype to avoid an error.  */
3637
rm -f conftest.$ac_objext
3637
/* We use char because int might match the return type of a gcc2
3638
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3638
    builtin and then its argument prototype would still apply.  */
3639
  (eval $ac_compile) 2>&5
3639
char sigwait();
3640
  ac_status=$?
3640
3641
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3641
int main() {
3642
  (exit $ac_status); } &&
3642
sigwait()
3643
         { ac_try='test -s conftest.$ac_objext'
3643
; return 0; }
3644
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3644
EOF
3645
  (eval $ac_try) 2>&5
3645
if { (eval echo configure:3646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3646
  ac_status=$?
3646
  rm -rf conftest*
3647
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3647
  eval "ac_cv_lib_$ac_lib_var=yes"
3648
  (exit $ac_status); }; }; then
3648
else
3649
  ac_cv_type_size_t=yes
3649
  echo "configure: failed program was:" >&5
3650
else
3650
  cat conftest.$ac_ext >&5
3651
  echo "$as_me: failed program was:" >&5
3651
  rm -rf conftest*
3652
cat conftest.$ac_ext >&5
3652
  eval "ac_cv_lib_$ac_lib_var=no"
3653
ac_cv_type_size_t=no
3653
fi
3654
fi
3654
rm -f conftest*
3655
rm -f conftest.$ac_objext conftest.$ac_ext
3655
LIBS="$ac_save_LIBS"
3656
fi
3656
3657
echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
3657
fi
3658
echo "${ECHO_T}$ac_cv_type_size_t" >&6
3658
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3659
if test $ac_cv_type_size_t = yes; then
3659
  echo "$ac_t""yes" 1>&6
3660
  :
3660
  cat >> confdefs.h <<\EOF
3661
else
3661
#define HAVE_SIGWAIT 1
3662
3662
EOF
3663
cat >>confdefs.h <<_ACEOF
3663
3664
#define size_t unsigned
3664
else
3665
_ACEOF
3665
  echo "$ac_t""no" 1>&6
3666
3666
fi
3667
fi
3667
3668
3668
			;;
3669
echo "$as_me:$LINENO: checking for ssize_t" >&5
3669
		#
3670
echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6
3670
		# BSDI 3.0 through 4.0.1 needs pthread_init() to be
3671
if test "${ac_cv_type_ssize_t+set}" = set; then
3671
		# called before certain pthreads calls.	 This is deprecated
3672
  echo $ECHO_N "(cached) $ECHO_C" >&6
3672
		# in BSD/OS 4.1.
3673
else
3673
		#
3674
  cat >conftest.$ac_ext <<_ACEOF
3674
		*-bsdi3.*|*-bsdi4.0*)
3675
#line $LINENO "configure"
3675
			cat >> confdefs.h <<\EOF
3676
#include "confdefs.h"
3676
#define NEED_PTHREAD_INIT 1
3677
$ac_includes_default
3677
EOF
3678
#ifdef F77_DUMMY_MAIN
3678
3679
#  ifdef __cplusplus
3679
			;;
3680
     extern "C"
3680
		#
3681
#  endif
3681
		# LinuxThreads requires some changes to the way we
3682
   int F77_DUMMY_MAIN() { return 1; }
3682
		# deal with signals.
3683
#endif
3683
		#
3684
int
3684
		*-linux*)
3685
main ()
3685
			cat >> confdefs.h <<\EOF
3686
{
3686
#define HAVE_LINUXTHREADS 1
3687
if ((ssize_t *) 0)
3687
EOF
3688
  return 0;
3688
3689
if (sizeof (ssize_t))
3689
			;;
3690
  return 0;
3690
		#
3691
  ;
3691
		# Ensure the right sigwait() semantics on Solaris and make
3692
  return 0;
3692
		# sure we call pthread_setconcurrency.
3693
}
3693
		#
3694
_ACEOF
3694
		*-solaris*)
3695
rm -f conftest.$ac_objext
3695
			cat >> confdefs.h <<\EOF
3696
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3696
#define _POSIX_PTHREAD_SEMANTICS 1
3697
  (eval $ac_compile) 2>&5
3697
EOF
3698
  ac_status=$?
3698
3699
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3699
			echo $ac_n "checking for pthread_setconcurrency""... $ac_c" 1>&6
3700
  (exit $ac_status); } &&
3700
echo "configure:3701: checking for pthread_setconcurrency" >&5
3701
         { ac_try='test -s conftest.$ac_objext'
3701
if eval "test \"`echo '$''{'ac_cv_func_pthread_setconcurrency'+set}'`\" = set"; then
3702
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3702
  echo $ac_n "(cached) $ac_c" 1>&6
3703
  (eval $ac_try) 2>&5
3703
else
3704
  ac_status=$?
3704
  cat > conftest.$ac_ext <<EOF
3705
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3705
#line 3706 "configure"
3706
  (exit $ac_status); }; }; then
3706
#include "confdefs.h"
3707
  ac_cv_type_ssize_t=yes
3707
/* System header to define __stub macros and hopefully few prototypes,
3708
else
3708
    which can conflict with char pthread_setconcurrency(); below.  */
3709
  echo "$as_me: failed program was:" >&5
3709
#include <assert.h>
3710
cat conftest.$ac_ext >&5
3710
/* Override any gcc2 internal prototype to avoid an error.  */
3711
ac_cv_type_ssize_t=no
3711
/* We use char because int might match the return type of a gcc2
3712
fi
3712
    builtin and then its argument prototype would still apply.  */
3713
rm -f conftest.$ac_objext conftest.$ac_ext
3713
char pthread_setconcurrency();
3714
fi
3714
3715
echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
3715
int main() {
3716
echo "${ECHO_T}$ac_cv_type_ssize_t" >&6
3716
3717
if test $ac_cv_type_ssize_t = yes; then
3717
/* The GNU C library defines this for functions which it implements
3718
  :
3718
    to always fail with ENOSYS.  Some functions are actually named
3719
else
3719
    something starting with __ and the normal name is an alias.  */
3720
3720
#if defined (__stub_pthread_setconcurrency) || defined (__stub___pthread_setconcurrency)
3721
cat >>confdefs.h <<_ACEOF
3721
choke me
3722
#define ssize_t int
3722
#else
3723
_ACEOF
3723
pthread_setconcurrency();
3724
3724
#endif
3725
fi
3725
3726
3726
; return 0; }
3727
echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
3727
EOF
3728
echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
3728
if { (eval echo configure:3729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3729
if test "${ac_cv_header_time+set}" = set; then
3729
  rm -rf conftest*
3730
  echo $ECHO_N "(cached) $ECHO_C" >&6
3730
  eval "ac_cv_func_pthread_setconcurrency=yes"
3731
else
3731
else
3732
  cat >conftest.$ac_ext <<_ACEOF
3732
  echo "configure: failed program was:" >&5
3733
#line $LINENO "configure"
3733
  cat conftest.$ac_ext >&5
3734
#include "confdefs.h"
3734
  rm -rf conftest*
3735
#include <sys/types.h>
3735
  eval "ac_cv_func_pthread_setconcurrency=no"
3736
#include <sys/time.h>
3736
fi
3737
#include <time.h>
3737
rm -f conftest*
3738
3738
fi
3739
#ifdef F77_DUMMY_MAIN
3739
3740
#  ifdef __cplusplus
3740
if eval "test \"`echo '$ac_cv_func_'pthread_setconcurrency`\" = yes"; then
3741
     extern "C"
3741
  echo "$ac_t""yes" 1>&6
3742
#  endif
3742
  cat >> confdefs.h <<\EOF
3743
   int F77_DUMMY_MAIN() { return 1; }
3743
#define CALL_PTHREAD_SETCONCURRENCY 1
3744
#endif
3744
EOF
3745
int
3745
3746
main ()
3746
else
3747
{
3747
  echo "$ac_t""no" 1>&6
3748
if ((struct tm *) 0)
3748
fi
3749
return 0;
3749
3750
  ;
3750
			;;
3751
  return 0;
3751
		#
3752
}
3752
		# UnixWare does things its own way.
3753
_ACEOF
3753
		#
3754
rm -f conftest.$ac_objext
3754
		*-sco-sysv*uw*)
3755
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3755
			cat >> confdefs.h <<\EOF
3756
  (eval $ac_compile) 2>&5
3756
#define HAVE_UNIXWARE_SIGWAIT 1
3757
  ac_status=$?
3757
EOF
3758
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3758
3759
  (exit $ac_status); } &&
3759
			;;
3760
         { ac_try='test -s conftest.$ac_objext'
3760
	esac
3761
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3761
3762
  (eval $ac_try) 2>&5
3762
	#
3763
  ac_status=$?
3763
	# Look for sysconf to allow detection of the number of processors.
3764
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3764
	#
3765
  (exit $ac_status); }; }; then
3765
	echo $ac_n "checking for sysconf""... $ac_c" 1>&6
3766
  ac_cv_header_time=yes
3766
echo "configure:3767: checking for sysconf" >&5
3767
else
3767
if eval "test \"`echo '$''{'ac_cv_func_sysconf'+set}'`\" = set"; then
3768
  echo "$as_me: failed program was:" >&5
3768
  echo $ac_n "(cached) $ac_c" 1>&6
3769
cat conftest.$ac_ext >&5
3769
else
3770
ac_cv_header_time=no
3770
  cat > conftest.$ac_ext <<EOF
3771
fi
3771
#line 3772 "configure"
3772
rm -f conftest.$ac_objext conftest.$ac_ext
3772
#include "confdefs.h"
3773
fi
3773
/* System header to define __stub macros and hopefully few prototypes,
3774
echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
3774
    which can conflict with char sysconf(); below.  */
3775
echo "${ECHO_T}$ac_cv_header_time" >&6
3775
#include <assert.h>
3776
if test $ac_cv_header_time = yes; then
3776
/* Override any gcc2 internal prototype to avoid an error.  */
3777
3777
/* We use char because int might match the return type of a gcc2
3778
cat >>confdefs.h <<\_ACEOF
3778
    builtin and then its argument prototype would still apply.  */
3779
#define TIME_WITH_SYS_TIME 1
3779
char sysconf();
3780
_ACEOF
3780
3781
3781
int main() {
3782
fi
3782
3783
3783
/* The GNU C library defines this for functions which it implements
3784
echo "$as_me:$LINENO: checking for long long" >&5
3784
    to always fail with ENOSYS.  Some functions are actually named
3785
echo $ECHO_N "checking for long long... $ECHO_C" >&6
3785
    something starting with __ and the normal name is an alias.  */
3786
cat >conftest.$ac_ext <<_ACEOF
3786
#if defined (__stub_sysconf) || defined (__stub___sysconf)
3787
#line $LINENO "configure"
3787
choke me
3788
#include "confdefs.h"
3788
#else
3789
3789
sysconf();
3790
#ifdef F77_DUMMY_MAIN
3790
#endif
3791
#  ifdef __cplusplus
3791
3792
     extern "C"
3792
; return 0; }
3793
#  endif
3793
EOF
3794
   int F77_DUMMY_MAIN() { return 1; }
3794
if { (eval echo configure:3795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3795
#endif
3795
  rm -rf conftest*
3796
int
3796
  eval "ac_cv_func_sysconf=yes"
3797
main ()
3797
else
3798
{
3798
  echo "configure: failed program was:" >&5
3799
long long i = 0; return (0);
3799
  cat conftest.$ac_ext >&5
3800
  ;
3800
  rm -rf conftest*
3801
  return 0;
3801
  eval "ac_cv_func_sysconf=no"
3802
}
3802
fi
3803
_ACEOF
3803
rm -f conftest*
3804
rm -f conftest.$ac_objext
3804
fi
3805
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3805
3806
  (eval $ac_compile) 2>&5
3806
if eval "test \"`echo '$ac_cv_func_'sysconf`\" = yes"; then
3807
  ac_status=$?
3807
  echo "$ac_t""yes" 1>&6
3808
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3808
  cat >> confdefs.h <<\EOF
3809
  (exit $ac_status); } &&
3809
#define HAVE_SYSCONF 1
3810
         { ac_try='test -s conftest.$ac_objext'
3810
EOF
3811
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3811
3812
  (eval $ac_try) 2>&5
3812
else
3813
  ac_status=$?
3813
  echo "$ac_t""no" 1>&6
3814
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3814
fi
3815
  (exit $ac_status); }; }; then
3815
3816
  echo "$as_me:$LINENO: result: yes" >&5
3816
3817
echo "${ECHO_T}yes" >&6
3817
	if test "X$GCC" = "Xyes"; then
3818
		ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"
3818
		case "$host" in
3819
else
3819
		*-freebsd*)
3820
  echo "$as_me: failed program was:" >&5
3820
			CC="$CC -pthread"
3821
cat conftest.$ac_ext >&5
3821
			CCOPT="$CCOPT -pthread"
3822
echo "$as_me:$LINENO: result: no" >&5
3822
			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
3823
echo "${ECHO_T}no" >&6
3823
			;;
3824
		ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"
3824
		*-openbsd*)
3825
fi
3825
			CC="$CC -pthread"
3826
rm -f conftest.$ac_objext conftest.$ac_ext
3826
			CCOPT="$CCOPT -pthread"
3827
3827
			;;
3828
3828
		*-solaris*)
3829
#
3829
			LIBS="$LIBS -lthread"
3830
# check if we need to #include sys/select.h explicitly
3830
			;;
3831
#
3831
		*-ibm-aix*)
3832
case $ac_cv_header_unistd_h in
3832
			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
3833
yes)
3833
			;;
3834
echo "$as_me:$LINENO: checking if unistd.h or sys/types.h defines fd_set" >&5
3834
		esac
3835
echo $ECHO_N "checking if unistd.h or sys/types.h defines fd_set... $ECHO_C" >&6
3835
	else
3836
cat >conftest.$ac_ext <<_ACEOF
3836
		case $host in
3837
#line $LINENO "configure"
3837
		*-dec-osf*)
3838
#include "confdefs.h"
3838
			CC="$CC -pthread"
3839
3839
			CCOPT="$CCOPT -pthread"
3840
#include <sys/types.h> /* Ultrix */
3840
			;;
3841
#include <unistd.h>
3841
		*-solaris*)
3842
#ifdef F77_DUMMY_MAIN
3842
			CC="$CC -mt"
3843
#  ifdef __cplusplus
3843
			CCOPT="$CCOPT -mt"
3844
     extern "C"
3844
			;;
3845
#  endif
3845
		*-ibm-aix*)
3846
   int F77_DUMMY_MAIN() { return 1; }
3846
			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
3847
#endif
3847
			;;
3848
int
3848
		*-sco-sysv*uw*)
3849
main ()
3849
			CC="$CC -Kthread"
3850
{
3850
			CCOPT="$CCOPT -Kthread"
3851
fd_set read_set; return (0);
3851
			;;
3852
  ;
3852
		esac
3853
  return 0;
3853
	fi
3854
}
3854
	ALWAYS_DEFINES="-D_REENTRANT"
3855
_ACEOF
3855
	ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
3856
rm -f conftest.$ac_objext
3856
	thread_dir=pthreads
3857
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3857
else
3858
  (eval $ac_compile) 2>&5
3858
	ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
3859
  ac_status=$?
3859
	thread_dir=nothreads
3860
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3860
	ALWAYS_DEFINES=""
3861
  (exit $ac_status); } &&
3861
fi
3862
         { ac_try='test -s conftest.$ac_objext'
3862
3863
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3863
3864
  (eval $ac_try) 2>&5
3864
3865
  ac_status=$?
3865
3866
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3866
ISC_THREAD_DIR=$thread_dir
3867
  (exit $ac_status); }; }; then
3867
3868
  echo "$as_me:$LINENO: result: yes" >&5
3868
3869
echo "${ECHO_T}yes" >&6
3869
#
3870
	 ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
3870
# flockfile is usually provided by pthreads, but we may want to use it
3871
	 LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"
3871
# even if compiled with --disable-threads.  getc_unlocked might also not
3872
else
3872
# be defined.
3873
  echo "$as_me: failed program was:" >&5
3873
#
3874
cat conftest.$ac_ext >&5
3874
echo $ac_n "checking for flockfile""... $ac_c" 1>&6
3875
echo "$as_me:$LINENO: result: no" >&5
3875
echo "configure:3876: checking for flockfile" >&5
3876
echo "${ECHO_T}no" >&6
3876
if eval "test \"`echo '$''{'ac_cv_func_flockfile'+set}'`\" = set"; then
3877
	case $ac_cv_header_sys_select_h in
3877
  echo $ac_n "(cached) $ac_c" 1>&6
3878
	yes)
3878
else
3879
         ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
3879
  cat > conftest.$ac_ext <<EOF
3880
	 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
3880
#line 3881 "configure"
3881
		;;
3881
#include "confdefs.h"
3882
	no)
3882
/* System header to define __stub macros and hopefully few prototypes,
3883
		{ { echo "$as_me:$LINENO: error: need either working unistd.h or sys/select.h" >&5
3883
    which can conflict with char flockfile(); below.  */
3884
echo "$as_me: error: need either working unistd.h or sys/select.h" >&2;}
3884
#include <assert.h>
3885
   { (exit 1); exit 1; }; }
3885
/* Override any gcc2 internal prototype to avoid an error.  */
3886
		;;
3886
/* We use char because int might match the return type of a gcc2
3887
	esac
3887
    builtin and then its argument prototype would still apply.  */
3888
3888
char flockfile();
3889
fi
3889
3890
rm -f conftest.$ac_objext conftest.$ac_ext
3890
int main() {
3891
	;;
3891
3892
no)
3892
/* The GNU C library defines this for functions which it implements
3893
	case $ac_cv_header_sys_select_h in
3893
    to always fail with ENOSYS.  Some functions are actually named
3894
	yes)
3894
    something starting with __ and the normal name is an alias.  */
3895
             ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
3895
#if defined (__stub_flockfile) || defined (__stub___flockfile)
3896
	     LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
3896
choke me
3897
		;;
3897
#else
3898
	no)
3898
flockfile();
3899
		{ { echo "$as_me:$LINENO: error: need either unistd.h or sys/select.h" >&5
3899
#endif
3900
echo "$as_me: error: need either unistd.h or sys/select.h" >&2;}
3900
3901
   { (exit 1); exit 1; }; }
3901
; return 0; }
3902
		;;
3902
EOF
3903
	esac
3903
if { (eval echo configure:3904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3904
	;;
3904
  rm -rf conftest*
3905
esac
3905
  eval "ac_cv_func_flockfile=yes"
3906
3906
else
3907
3907
  echo "configure: failed program was:" >&5
3908
3908
  cat conftest.$ac_ext >&5
3909
#
3909
  rm -rf conftest*
3910
# Find the machine's endian flavor.
3910
  eval "ac_cv_func_flockfile=no"
3911
#
3911
fi
3912
echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
3912
rm -f conftest*
3913
echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
3913
fi
3914
if test "${ac_cv_c_bigendian+set}" = set; then
3914
3915
  echo $ECHO_N "(cached) $ECHO_C" >&6
3915
if eval "test \"`echo '$ac_cv_func_'flockfile`\" = yes"; then
3916
else
3916
  echo "$ac_t""yes" 1>&6
3917
  # See if sys/param.h defines the BYTE_ORDER macro.
3917
  cat >> confdefs.h <<\EOF
3918
cat >conftest.$ac_ext <<_ACEOF
3918
#define HAVE_FLOCKFILE 1
3919
#line $LINENO "configure"
3919
EOF
3920
#include "confdefs.h"
3920
3921
#include <sys/types.h>
3921
else
3922
#include <sys/param.h>
3922
  echo "$ac_t""no" 1>&6
3923
3923
fi
3924
#ifdef F77_DUMMY_MAIN
3924
3925
#  ifdef __cplusplus
3925
echo $ac_n "checking for getc_unlocked""... $ac_c" 1>&6
3926
     extern "C"
3926
echo "configure:3927: checking for getc_unlocked" >&5
3927
#  endif
3927
if eval "test \"`echo '$''{'ac_cv_func_getc_unlocked'+set}'`\" = set"; then
3928
   int F77_DUMMY_MAIN() { return 1; }
3928
  echo $ac_n "(cached) $ac_c" 1>&6
3929
#endif
3929
else
3930
int
3930
  cat > conftest.$ac_ext <<EOF
3931
main ()
3931
#line 3932 "configure"
3932
{
3932
#include "confdefs.h"
3933
#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
3933
/* System header to define __stub macros and hopefully few prototypes,
3934
 bogus endian macros
3934
    which can conflict with char getc_unlocked(); below.  */
3935
#endif
3935
#include <assert.h>
3936
3936
/* Override any gcc2 internal prototype to avoid an error.  */
3937
  ;
3937
/* We use char because int might match the return type of a gcc2
3938
  return 0;
3938
    builtin and then its argument prototype would still apply.  */
3939
}
3939
char getc_unlocked();
3940
_ACEOF
3940
3941
rm -f conftest.$ac_objext
3941
int main() {
3942
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3942
3943
  (eval $ac_compile) 2>&5
3943
/* The GNU C library defines this for functions which it implements
3944
  ac_status=$?
3944
    to always fail with ENOSYS.  Some functions are actually named
3945
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3945
    something starting with __ and the normal name is an alias.  */
3946
  (exit $ac_status); } &&
3946
#if defined (__stub_getc_unlocked) || defined (__stub___getc_unlocked)
3947
         { ac_try='test -s conftest.$ac_objext'
3947
choke me
3948
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3948
#else
3949
  (eval $ac_try) 2>&5
3949
getc_unlocked();
3950
  ac_status=$?
3950
#endif
3951
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3951
3952
  (exit $ac_status); }; }; then
3952
; return 0; }
3953
  # It does; now see whether it defined to BIG_ENDIAN or not.
3953
EOF
3954
cat >conftest.$ac_ext <<_ACEOF
3954
if { (eval echo configure:3955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3955
#line $LINENO "configure"
3955
  rm -rf conftest*
3956
#include "confdefs.h"
3956
  eval "ac_cv_func_getc_unlocked=yes"
3957
#include <sys/types.h>
3957
else
3958
#include <sys/param.h>
3958
  echo "configure: failed program was:" >&5
3959
3959
  cat conftest.$ac_ext >&5
3960
#ifdef F77_DUMMY_MAIN
3960
  rm -rf conftest*
3961
#  ifdef __cplusplus
3961
  eval "ac_cv_func_getc_unlocked=no"
3962
     extern "C"
3962
fi
3963
#  endif
3963
rm -f conftest*
3964
   int F77_DUMMY_MAIN() { return 1; }
3964
fi
3965
#endif
3965
3966
int
3966
if eval "test \"`echo '$ac_cv_func_'getc_unlocked`\" = yes"; then
3967
main ()
3967
  echo "$ac_t""yes" 1>&6
3968
{
3968
  cat >> confdefs.h <<\EOF
3969
#if BYTE_ORDER != BIG_ENDIAN
3969
#define HAVE_GETCUNLOCKED 1
3970
 not big endian
3970
EOF
3971
#endif
3971
3972
3972
else
3973
  ;
3973
  echo "$ac_t""no" 1>&6
3974
  return 0;
3974
fi
3975
}
3975
3976
_ACEOF
3976
3977
rm -f conftest.$ac_objext
3977
# 
3978
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3978
# Indicate what the final decision was regarding threads.
3979
  (eval $ac_compile) 2>&5
3979
#
3980
  ac_status=$?
3980
echo $ac_n "checking whether to build with threads""... $ac_c" 1>&6
3981
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3981
echo "configure:3982: checking whether to build with threads" >&5
3982
  (exit $ac_status); } &&
3982
if $use_threads; then
3983
         { ac_try='test -s conftest.$ac_objext'
3983
	echo "$ac_t""yes" 1>&6
3984
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3984
else
3985
  (eval $ac_try) 2>&5
3985
	echo "$ac_t""no" 1>&6
3986
  ac_status=$?
3986
fi
3987
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3987
3988
  (exit $ac_status); }; }; then
3988
# 
3989
  ac_cv_c_bigendian=yes
3989
# End of pthreads stuff.
3990
else
3990
#
3991
  echo "$as_me: failed program was:" >&5
3991
3992
cat conftest.$ac_ext >&5
3992
#
3993
ac_cv_c_bigendian=no
3993
# Additional compiler settings.
3994
fi
3994
#
3995
rm -f conftest.$ac_objext conftest.$ac_ext
3995
MKDEPCC="$CC"
3996
else
3996
MKDEPCFLAGS="-M"
3997
  echo "$as_me: failed program was:" >&5
3997
IRIX_DNSSEC_WARNINGS_HACK=""
3998
cat conftest.$ac_ext >&5
3998
3999
# It does not; compile a test program.
3999
if test "X$GCC" = "Xyes"; then
4000
if test "$cross_compiling" = yes; then
4000
	STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat"
4001
  # try to guess the endianess by grep'ing values into an object file
4001
else
4002
  ac_cv_c_bigendian=unknown
4002
	case $host in
4003
  cat >conftest.$ac_ext <<_ACEOF
4003
	*-dec-osf*)
4004
#line $LINENO "configure"
4004
		CC="$CC -std"
4005
#include "confdefs.h"
4005
		CCOPT="$CCOPT -std"
4006
short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
4006
		MKDEPCC="$CC"
4007
short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
4007
		;;
4008
void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
4008
	*-hp-hpux*)
4009
short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
4009
		CC="$CC -Ae -z"
4010
short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
4010
		# The version of the C compiler that constantly warns about
4011
void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
4011
                # 'const' as well as alignment issues is unfortunately not
4012
#ifdef F77_DUMMY_MAIN
4012
                # able to be discerned via the version of the operating
4013
#  ifdef __cplusplus
4013
                # system, nor does cc have a version flag.
4014
     extern "C"
4014
		case "`$CC +W 123 2>&1`" in
4015
#  endif
4015
		*Unknown?option*)
4016
   int F77_DUMMY_MAIN() { return 1; }
4016
			STD_CWARNINGS="+w1"
4017
#endif
4017
			;;
4018
int
4018
		*)
4019
main ()
4019
			# Turn off the pointlessly noisy warnings.
4020
{
4020
			STD_CWARNINGS="+w1 +W 474,530"
4021
 _ascii (); _ebcdic ();
4021
			;;
4022
  ;
4022
		esac
4023
  return 0;
4023
		CCOPT="$CCOPT -Ae -z"
4024
}
4024
		LIBS="-Wl,+vnocompatwarnings $LIBS"
4025
_ACEOF
4025
		MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
4026
rm -f conftest.$ac_objext
4026
		;;
4027
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
4027
	*-sgi-irix*)
4028
  (eval $ac_compile) 2>&5
4028
		STD_CWARNINGS="-fullwarn -woff 1209"
4029
  ac_status=$?
4029
		#
4030
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4030
		# Silence more than 250 instances of
4031
  (exit $ac_status); } &&
4031
		#   "prototyped function redeclared without prototype"
4032
         { ac_try='test -s conftest.$ac_objext'
4032
		# and 11 instances of
4033
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4033
		#   "variable ... was set but never used"
4034
  (eval $ac_try) 2>&5
4034
		# from lib/dns/sec/openssl.
4035
  ac_status=$?
4035
		#
4036
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4036
		IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
4037
  (exit $ac_status); }; }; then
4037
		;;
4038
  if fgrep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
4038
	*-solaris*)
4039
  ac_cv_c_bigendian=yes
4039
		MKDEPCFLAGS="-xM"
4040
fi
4040
		;;
4041
if fgrep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
4041
	*-sco-sysv*uw*)
4042
  if test "$ac_cv_c_bigendian" = unknown; then
4042
                # UnixWare
4043
    ac_cv_c_bigendian=no
4043
		CC="$CC -w"
4044
  else
4044
		;;
4045
    # finding both strings is unlikely to happen, but who knows?
4045
	esac
4046
    ac_cv_c_bigendian=unknown
4046
fi
4047
  fi
4047
4048
fi
4048
4049
else
4049
4050
  echo "$as_me: failed program was:" >&5
4050
4051
cat conftest.$ac_ext >&5
4051
4052
fi
4052
4053
rm -f conftest.$ac_objext conftest.$ac_ext
4053
#
4054
else
4054
# NLS
4055
  cat >conftest.$ac_ext <<_ACEOF
4055
#
4056
#line $LINENO "configure"
4056
echo $ac_n "checking for catgets""... $ac_c" 1>&6
4057
#include "confdefs.h"
4057
echo "configure:4058: checking for catgets" >&5
4058
int
4058
if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then
4059
main ()
4059
  echo $ac_n "(cached) $ac_c" 1>&6
4060
{
4060
else
4061
  /* Are we little or big endian?  From Harbison&Steele.  */
4061
  cat > conftest.$ac_ext <<EOF
4062
  union
4062
#line 4063 "configure"
4063
  {
4063
#include "confdefs.h"
4064
    long l;
4064
/* System header to define __stub macros and hopefully few prototypes,
4065
    char c[sizeof (long)];
4065
    which can conflict with char catgets(); below.  */
4066
  } u;
4066
#include <assert.h>
4067
  u.l = 1;
4067
/* Override any gcc2 internal prototype to avoid an error.  */
4068
  exit (u.c[sizeof (long) - 1] == 1);
4068
/* We use char because int might match the return type of a gcc2
4069
}
4069
    builtin and then its argument prototype would still apply.  */
4070
_ACEOF
4070
char catgets();
4071
rm -f conftest$ac_exeext
4071
4072
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
4072
int main() {
4073
  (eval $ac_link) 2>&5
4073
4074
  ac_status=$?
4074
/* The GNU C library defines this for functions which it implements
4075
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4075
    to always fail with ENOSYS.  Some functions are actually named
4076
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4076
    something starting with __ and the normal name is an alias.  */
4077
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4077
#if defined (__stub_catgets) || defined (__stub___catgets)
4078
  (eval $ac_try) 2>&5
4078
choke me
4079
  ac_status=$?
4079
#else
4080
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4080
catgets();
4081
  (exit $ac_status); }; }; then
4081
#endif
4082
  ac_cv_c_bigendian=no
4082
4083
else
4083
; return 0; }
4084
  echo "$as_me: program exited with status $ac_status" >&5
4084
EOF
4085
echo "$as_me: failed program was:" >&5
4085
if { (eval echo configure:4086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4086
cat conftest.$ac_ext >&5
4086
  rm -rf conftest*
4087
( exit $ac_status )
4087
  eval "ac_cv_func_catgets=yes"
4088
ac_cv_c_bigendian=yes
4088
else
4089
fi
4089
  echo "configure: failed program was:" >&5
4090
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4090
  cat conftest.$ac_ext >&5
4091
fi
4091
  rm -rf conftest*
4092
fi
4092
  eval "ac_cv_func_catgets=no"
4093
rm -f conftest.$ac_objext conftest.$ac_ext
4093
fi
4094
fi
4094
rm -f conftest*
4095
echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
4095
fi
4096
echo "${ECHO_T}$ac_cv_c_bigendian" >&6
4096
4097
case $ac_cv_c_bigendian in
4097
if eval "test \"`echo '$ac_cv_func_'catgets`\" = yes"; then
4098
  yes)
4098
  echo "$ac_t""yes" 1>&6
4099
4099
  cat >> confdefs.h <<\EOF
4100
cat >>confdefs.h <<\_ACEOF
4100
#define HAVE_CATGETS 1
4101
#define WORDS_BIGENDIAN 1
4101
EOF
4102
_ACEOF
4102
4103
 ;;
4103
else
4104
  no)
4104
  echo "$ac_t""no" 1>&6
4105
     ;;
4105
fi
4106
  *)
4106
4107
    { { echo "$as_me:$LINENO: error: unknown endianess
4107
4108
presetting ac_cv_c_bigendian=no (or yes) will help" >&5
4108
#
4109
echo "$as_me: error: unknown endianess
4109
# -lxnet buys us one big porting headache...  standards, gotta love 'em.
4110
presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
4110
#
4111
   { (exit 1); exit 1; }; } ;;
4111
# AC_CHECK_LIB(xnet, socket, ,
4112
esac
4112
#    AC_CHECK_LIB(socket, socket)
4113
4113
#    AC_CHECK_LIB(nsl, inet_ntoa)
4114
4114
# )
4115
#
4115
#
4116
# was --with-openssl specified?
4116
# Use this for now, instead:
4117
#
4117
#
4118
echo "$as_me:$LINENO: checking for OpenSSL library" >&5
4118
case "$host" in
4119
echo $ECHO_N "checking for OpenSSL library... $ECHO_C" >&6
4119
	mips-sgi-irix*)
4120
4120
		;;
4121
# Check whether --with-openssl or --without-openssl was given.
4121
	*)
4122
if test "${with_openssl+set}" = set; then
4122
		echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
4123
  withval="$with_openssl"
4123
echo "configure:4124: checking for socket in -lsocket" >&5
4124
  use_openssl="$withval"
4124
ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
4125
else
4125
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4126
  use_openssl="no"
4126
  echo $ac_n "(cached) $ac_c" 1>&6
4127
fi;
4127
else
4128
4128
  ac_save_LIBS="$LIBS"
4129
case "$use_openssl" in
4129
LIBS="-lsocket  $LIBS"
4130
	no)
4130
cat > conftest.$ac_ext <<EOF
4131
		echo "$as_me:$LINENO: result: no" >&5
4131
#line 4132 "configure"
4132
echo "${ECHO_T}no" >&6
4132
#include "confdefs.h"
4133
		DST_OPENSSL_INC=""
4133
/* Override any gcc2 internal prototype to avoid an error.  */
4134
		USE_OPENSSL=""
4134
/* We use char because int might match the return type of a gcc2
4135
		;;
4135
    builtin and then its argument prototype would still apply.  */
4136
	*)
4136
char socket();
4137
		if test "$use_openssl" = "yes"
4137
4138
		then
4138
int main() {
4139
		    	# User did not specify a path - guess it
4139
socket()
4140
			openssldirs="/usr /usr/local /usr/local/ssl /usr/pkg"
4140
; return 0; }
4141
			for d in $openssldirs
4141
EOF
4142
			do
4142
if { (eval echo configure:4143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4143
				if test -f $d/include/openssl/opensslv.h
4143
  rm -rf conftest*
4144
				then
4144
  eval "ac_cv_lib_$ac_lib_var=yes"
4145
				 	use_openssl=$d
4145
else
4146
					break
4146
  echo "configure: failed program was:" >&5
4147
				fi
4147
  cat conftest.$ac_ext >&5
4148
			done
4148
  rm -rf conftest*
4149
			if test "$use_openssl" = "yes"
4149
  eval "ac_cv_lib_$ac_lib_var=no"
4150
			then
4150
fi
4151
			    	echo "$as_me:$LINENO: result: not found" >&5
4151
rm -f conftest*
4152
echo "${ECHO_T}not found" >&6
4152
LIBS="$ac_save_LIBS"
4153
				{ { echo "$as_me:$LINENO: error: OpenSSL was not found in any of $openssldirs; use --with-openssl=/path" >&5
4153
4154
echo "$as_me: error: OpenSSL was not found in any of $openssldirs; use --with-openssl=/path" >&2;}
4154
fi
4155
   { (exit 1); exit 1; }; }
4155
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4156
			fi
4156
  echo "$ac_t""yes" 1>&6
4157
		fi
4157
    ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4158
		USE_OPENSSL='-DOPENSSL'
4158
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4159
		DST_OPENSSL_INC="-I$use_openssl/include"
4159
  cat >> confdefs.h <<EOF
4160
		DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
4160
#define $ac_tr_lib 1
4161
		echo "$as_me:$LINENO: result: using openssl from $use_openssl/lib and $use_openssl/include" >&5
4161
EOF
4162
echo "${ECHO_T}using openssl from $use_openssl/lib and $use_openssl/include" >&6
4162
4163
4163
  LIBS="-lsocket $LIBS"
4164
		saved_cflags="$CFLAGS"
4164
4165
		saved_libs="$LIBS"
4165
else
4166
		CFLAGS="$CFLAGS $DST_OPENSSL_INC"
4166
  echo "$ac_t""no" 1>&6
4167
		LIBS="$LIBS $DNS_OPENSSL_LIBS"
4167
fi
4168
		echo "$as_me:$LINENO: checking whether linking with OpenSSL works" >&5
4168
4169
echo $ECHO_N "checking whether linking with OpenSSL works... $ECHO_C" >&6
4169
		echo $ac_n "checking for inet_ntoa in -lnsl""... $ac_c" 1>&6
4170
		if test "$cross_compiling" = yes; then
4170
echo "configure:4171: checking for inet_ntoa in -lnsl" >&5
4171
  echo "$as_me:$LINENO: result: assuming it does work on target platform" >&5
4171
ac_lib_var=`echo nsl'_'inet_ntoa | sed 'y%./+-%__p_%'`
4172
echo "${ECHO_T}assuming it does work on target platform" >&6
4172
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4173
else
4173
  echo $ac_n "(cached) $ac_c" 1>&6
4174
  cat >conftest.$ac_ext <<_ACEOF
4174
else
4175
#line $LINENO "configure"
4175
  ac_save_LIBS="$LIBS"
4176
#include "confdefs.h"
4176
LIBS="-lnsl  $LIBS"
4177
4177
cat > conftest.$ac_ext <<EOF
4178
#include <openssl/err.h>
4178
#line 4179 "configure"
4179
int main() {
4179
#include "confdefs.h"
4180
	ERR_clear_error();
4180
/* Override any gcc2 internal prototype to avoid an error.  */
4181
	return (0);
4181
/* We use char because int might match the return type of a gcc2
4182
}
4182
    builtin and then its argument prototype would still apply.  */
4183
4183
char inet_ntoa();
4184
_ACEOF
4184
4185
rm -f conftest$ac_exeext
4185
int main() {
4186
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
4186
inet_ntoa()
4187
  (eval $ac_link) 2>&5
4187
; return 0; }
4188
  ac_status=$?
4188
EOF
4189
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4189
if { (eval echo configure:4190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4190
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4190
  rm -rf conftest*
4191
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4191
  eval "ac_cv_lib_$ac_lib_var=yes"
4192
  (eval $ac_try) 2>&5
4192
else
4193
  ac_status=$?
4193
  echo "configure: failed program was:" >&5
4194
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4194
  cat conftest.$ac_ext >&5
4195
  (exit $ac_status); }; }; then
4195
  rm -rf conftest*
4196
  echo "$as_me:$LINENO: result: yes" >&5
4196
  eval "ac_cv_lib_$ac_lib_var=no"
4197
echo "${ECHO_T}yes" >&6
4197
fi
4198
else
4198
rm -f conftest*
4199
  echo "$as_me: program exited with status $ac_status" >&5
4199
LIBS="$ac_save_LIBS"
4200
echo "$as_me: failed program was:" >&5
4200
4201
cat conftest.$ac_ext >&5
4201
fi
4202
( exit $ac_status )
4202
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4203
echo "$as_me:$LINENO: result: no" >&5
4203
  echo "$ac_t""yes" 1>&6
4204
echo "${ECHO_T}no" >&6
4204
    ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4205
		 { { echo "$as_me:$LINENO: error: Could not run test program using OpenSSL from
4205
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4206
$use_openssl/lib and $use_openssl/include.
4206
  cat >> confdefs.h <<EOF
4207
Please check the argument to --with-openssl and your
4207
#define $ac_tr_lib 1
4208
shared library configuration (e.g., LD_LIBRARY_PATH)." >&5
4208
EOF
4209
echo "$as_me: error: Could not run test program using OpenSSL from
4209
4210
$use_openssl/lib and $use_openssl/include.
4210
  LIBS="-lnsl $LIBS"
4211
Please check the argument to --with-openssl and your
4211
4212
shared library configuration (e.g., LD_LIBRARY_PATH)." >&2;}
4212
else
4213
   { (exit 1); exit 1; }; }
4213
  echo "$ac_t""no" 1>&6
4214
fi
4214
fi
4215
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4215
4216
fi
4216
		;;
4217
4217
esac
4218
		echo "$as_me:$LINENO: checking whether linking with OpenSSL requires -ldl" >&5
4218
4219
echo $ECHO_N "checking whether linking with OpenSSL requires -ldl... $ECHO_C" >&6
4219
#
4220
		cat >conftest.$ac_ext <<_ACEOF
4220
# Purify support
4221
#line $LINENO "configure"
4221
#
4222
#include "confdefs.h"
4222
echo $ac_n "checking whether to use purify""... $ac_c" 1>&6
4223
4223
echo "configure:4224: checking whether to use purify" >&5
4224
#include <openssl/err.h>
4224
# Check whether --with-purify or --without-purify was given.
4225
#ifdef F77_DUMMY_MAIN
4225
if test "${with_purify+set}" = set; then
4226
#  ifdef __cplusplus
4226
  withval="$with_purify"
4227
     extern "C"
4227
  use_purify="$withval"
4228
#  endif
4228
else
4229
   int F77_DUMMY_MAIN() { return 1; }
4229
  use_purify="no"
4230
#endif
4230
fi
4231
int
4231
4232
main ()
4232
4233
{
4233
case "$use_purify" in
4234
 DSO_METHOD_dlfcn();
4234
	no)
4235
  ;
4235
		;;
4236
  return 0;
4236
	yes)
4237
}
4237
		# Extract the first word of "purify", so it can be a program name with args.
4238
_ACEOF
4238
set dummy purify; ac_word=$2
4239
rm -f conftest.$ac_objext conftest$ac_exeext
4239
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4240
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
4240
echo "configure:4241: checking for $ac_word" >&5
4241
  (eval $ac_link) 2>&5
4241
if eval "test \"`echo '$''{'ac_cv_path_purify_path'+set}'`\" = set"; then
4242
  ac_status=$?
4242
  echo $ac_n "(cached) $ac_c" 1>&6
4243
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4243
else
4244
  (exit $ac_status); } &&
4244
  case "$purify_path" in
4245
         { ac_try='test -s conftest$ac_exeext'
4245
  /*)
4246
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4246
  ac_cv_path_purify_path="$purify_path" # Let the user override the test with a path.
4247
  (eval $ac_try) 2>&5
4247
  ;;
4248
  ac_status=$?
4248
  ?:/*)			 
4249
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4249
  ac_cv_path_purify_path="$purify_path" # Let the user override the test with a dos path.
4250
  (exit $ac_status); }; }; then
4250
  ;;
4251
  echo "$as_me:$LINENO: result: no" >&5
4251
  *)
4252
echo "${ECHO_T}no" >&6
4252
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
4253
else
4253
  ac_dummy="$PATH"
4254
  echo "$as_me: failed program was:" >&5
4254
  for ac_dir in $ac_dummy; do 
4255
cat conftest.$ac_ext >&5
4255
    test -z "$ac_dir" && ac_dir=.
4256
LIBS="$LIBS -ldl"
4256
    if test -f $ac_dir/$ac_word; then
4257
		cat >conftest.$ac_ext <<_ACEOF
4257
      ac_cv_path_purify_path="$ac_dir/$ac_word"
4258
#line $LINENO "configure"
4258
      break
4259
#include "confdefs.h"
4259
    fi
4260
4260
  done
4261
#include <openssl/err.h>
4261
  IFS="$ac_save_ifs"
4262
4262
  test -z "$ac_cv_path_purify_path" && ac_cv_path_purify_path="purify"
4263
#ifdef F77_DUMMY_MAIN
4263
  ;;
4264
#  ifdef __cplusplus
4264
esac
4265
     extern "C"
4265
fi
4266
#  endif
4266
purify_path="$ac_cv_path_purify_path"
4267
   int F77_DUMMY_MAIN() { return 1; }
4267
if test -n "$purify_path"; then
4268
#endif
4268
  echo "$ac_t""$purify_path" 1>&6
4269
int
4269
else
4270
main ()
4270
  echo "$ac_t""no" 1>&6
4271
{
4271
fi
4272
 DSO_METHOD_dlfcn();
4272
4273
  ;
4273
		;;
4274
  return 0;
4274
	*)
4275
}
4275
		purify_path="$use_purify"
4276
_ACEOF
4276
		;;
4277
rm -f conftest.$ac_objext conftest$ac_exeext
4277
esac
4278
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
4278
4279
  (eval $ac_link) 2>&5
4279
case "$use_purify" in
4280
  ac_status=$?
4280
	no)
4281
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4281
		echo "$ac_t""no" 1>&6
4282
  (exit $ac_status); } &&
4282
		PURIFY=""
4283
         { ac_try='test -s conftest$ac_exeext'
4283
		;;
4284
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4284
	*)
4285
  (eval $ac_try) 2>&5
4285
		if test -f $purify_path || test $purify_path = purify; then
4286
  ac_status=$?
4286
			echo "$ac_t""$purify_path" 1>&6
4287
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4287
			PURIFYFLAGS="`echo $PURIFYOPTIONS`"
4288
  (exit $ac_status); }; }; then
4288
			PURIFY="$purify_path $PURIFYFLAGS"
4289
  echo "$as_me:$LINENO: result: yes" >&5
4289
		else
4290
echo "${ECHO_T}yes" >&6
4290
			{ echo "configure: error: $purify_path not found.
4291
		DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
4291
4292
4292
Please choose the proper path with the following command:
4293
else
4293
4294
  echo "$as_me: failed program was:" >&5
4294
    configure --with-purify=PATH
4295
cat conftest.$ac_ext >&5
4295
" 1>&2; exit 1; }
4296
echo "$as_me:$LINENO: result: unknown" >&5
4296
		fi
4297
echo "${ECHO_T}unknown" >&6
4297
		;;
4298
		 { { echo "$as_me:$LINENO: error: OpenSSL has unsupported dynamic loading" >&5
4298
esac
4299
echo "$as_me: error: OpenSSL has unsupported dynamic loading" >&2;}
4299
4300
   { (exit 1); exit 1; }; }
4300
4301
fi
4301
4302
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4302
#
4303
4303
# GNU libtool support
4304
fi
4304
#
4305
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4305
# Check whether --with-libtool or --without-libtool was given.
4306
4306
if test "${with_libtool+set}" = set; then
4307
#
4307
  withval="$with_libtool"
4308
#	OpenSSLDie is new with CERT CS-2002-23.  If we see it we have may
4308
  use_libtool="$withval"
4309
#	have a patched library otherwise check that we are greater than
4309
else
4310
#	the fixed versions
4310
  use_libtool="no"
4311
#
4311
fi
4312
		echo "$as_me:$LINENO: checking for OpenSSLDie" >&5
4312
4313
echo $ECHO_N "checking for OpenSSLDie... $ECHO_C" >&6
4313
4314
if test "${ac_cv_func_OpenSSLDie+set}" = set; then
4314
case $use_libtool in
4315
  echo $ECHO_N "(cached) $ECHO_C" >&6
4315
	yes)
4316
else
4316
		echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
4317
  cat >conftest.$ac_ext <<_ACEOF
4317
echo "configure:4318: checking for Cygwin environment" >&5
4318
#line $LINENO "configure"
4318
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
4319
#include "confdefs.h"
4319
  echo $ac_n "(cached) $ac_c" 1>&6
4320
/* From autoconf 2.57 */
4320
else
4321
/* Define OpenSSLDie to an innocuous variant, in case <limits.h> declares OpenSSLDie.
4321
  cat > conftest.$ac_ext <<EOF
4322
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
4322
#line 4323 "configure"
4323
#define OpenSSLDie innocuous_OpenSSLDie
4323
#include "confdefs.h"
4324
4324
4325
/* System header to define __stub macros and hopefully few prototypes,
4325
int main() {
4326
    which can conflict with char OpenSSLDie (); below.
4326
4327
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
4327
#ifndef __CYGWIN__
4328
    <limits.h> exists even on freestanding compilers.  */
4328
#define __CYGWIN__ __CYGWIN32__
4329
4329
#endif
4330
#ifdef __STDC__
4330
return __CYGWIN__;
4331
# include <limits.h>
4331
; return 0; }
4332
#else
4332
EOF
4333
# include <assert.h>
4333
if { (eval echo configure:4334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4334
#endif
4334
  rm -rf conftest*
4335
4335
  ac_cv_cygwin=yes
4336
#undef OpenSSLDie
4336
else
4337
4337
  echo "configure: failed program was:" >&5
4338
/* Override any gcc2 internal prototype to avoid an error.  */
4338
  cat conftest.$ac_ext >&5
4339
#ifdef __cplusplus
4339
  rm -rf conftest*
4340
extern "C"
4340
  ac_cv_cygwin=no
4341
{
4341
fi
4342
#endif
4342
rm -f conftest*
4343
/* We use char because int might match the return type of a gcc2
4343
rm -f conftest*
4344
   builtin and then its argument prototype would still apply.  */
4344
fi
4345
char OpenSSLDie ();
4345
4346
/* The GNU C library defines this for functions which it implements
4346
echo "$ac_t""$ac_cv_cygwin" 1>&6
4347
    to always fail with ENOSYS.  Some functions are actually named
4347
CYGWIN=
4348
    something starting with __ and the normal name is an alias.  */
4348
test "$ac_cv_cygwin" = yes && CYGWIN=yes
4349
#if defined (__stub_OpenSSLDie) || defined (__stub___OpenSSLDie)
4349
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
4350
choke me
4350
echo "configure:4351: checking for mingw32 environment" >&5
4351
#else
4351
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
4352
char (*f) () = OpenSSLDie;
4352
  echo $ac_n "(cached) $ac_c" 1>&6
4353
#endif
4353
else
4354
#ifdef __cplusplus
4354
  cat > conftest.$ac_ext <<EOF
4355
}
4355
#line 4356 "configure"
4356
#endif
4356
#include "confdefs.h"
4357
4357
4358
#ifdef F77_DUMMY_MAIN
4358
int main() {
4359
#  ifdef __cplusplus
4359
return __MINGW32__;
4360
     extern "C"
4360
; return 0; }
4361
#  endif
4361
EOF
4362
   int F77_DUMMY_MAIN() { return 1; }
4362
if { (eval echo configure:4363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4363
#endif
4363
  rm -rf conftest*
4364
int
4364
  ac_cv_mingw32=yes
4365
main ()
4365
else
4366
{
4366
  echo "configure: failed program was:" >&5
4367
return f != OpenSSLDie;
4367
  cat conftest.$ac_ext >&5
4368
  ;
4368
  rm -rf conftest*
4369
  return 0;
4369
  ac_cv_mingw32=no
4370
}
4370
fi
4371
_ACEOF
4371
rm -f conftest*
4372
rm -f conftest.$ac_objext conftest$ac_exeext
4372
rm -f conftest*
4373
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
4373
fi
4374
  (eval $ac_link) 2>&5
4374
4375
  ac_status=$?
4375
echo "$ac_t""$ac_cv_mingw32" 1>&6
4376
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4376
MINGW32=
4377
  (exit $ac_status); } &&
4377
test "$ac_cv_mingw32" = yes && MINGW32=yes
4378
         { ac_try='test -s conftest$ac_exeext'
4378
# Check whether --enable-shared or --disable-shared was given.
4379
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4379
if test "${enable_shared+set}" = set; then
4380
  (eval $ac_try) 2>&5
4380
  enableval="$enable_shared"
4381
  ac_status=$?
4381
  p=${PACKAGE-default}
4382
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4382
case $enableval in
4383
  (exit $ac_status); }; }; then
4383
yes) enable_shared=yes ;;
4384
  ac_cv_func_OpenSSLDie=yes
4384
no) enable_shared=no ;;
4385
else
4385
*)
4386
  echo "$as_me: failed program was:" >&5
4386
  enable_shared=no
4387
cat conftest.$ac_ext >&5
4387
  # Look at the argument we got.  We use all the common list separators.
4388
ac_cv_func_OpenSSLDie=no
4388
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
4389
fi
4389
  for pkg in $enableval; do
4390
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4390
    if test "X$pkg" = "X$p"; then
4391
fi
4391
      enable_shared=yes
4392
echo "$as_me:$LINENO: result: $ac_cv_func_OpenSSLDie" >&5
4392
    fi
4393
echo "${ECHO_T}$ac_cv_func_OpenSSLDie" >&6
4393
  done
4394
if test $ac_cv_func_OpenSSLDie = yes; then
4394
  IFS="$ac_save_ifs"
4395
  echo "$as_me:$LINENO: checking OpenSSL library version" >&5
4395
  ;;
4396
echo $ECHO_N "checking OpenSSL library version... $ECHO_C" >&6
4396
esac
4397
		if test "$cross_compiling" = yes; then
4397
else
4398
  echo "$as_me:$LINENO: result: assuming target platform has compatible version" >&5
4398
  enable_shared=yes
4399
echo "${ECHO_T}assuming target platform has compatible version" >&6
4399
fi
4400
else
4400
4401
  cat >conftest.$ac_ext <<_ACEOF
4401
# Check whether --enable-static or --disable-static was given.
4402
#line $LINENO "configure"
4402
if test "${enable_static+set}" = set; then
4403
#include "confdefs.h"
4403
  enableval="$enable_static"
4404
4404
  p=${PACKAGE-default}
4405
#include <stdio.h>
4405
case $enableval in
4406
#include <openssl/opensslv.h>
4406
yes) enable_static=yes ;;
4407
int main() {
4407
no) enable_static=no ;;
4408
        if (OPENSSL_VERSION_NUMBER >= 0x0090581fL)
4408
*)
4409
                return (0);
4409
  enable_static=no
4410
	printf("\n\nFound   OPENSSL_VERSION_NUMBER %#010x\n",
4410
  # Look at the argument we got.  We use all the common list separators.
4411
		OPENSSL_VERSION_NUMBER);
4411
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
4412
	printf("Require OPENSSL_VERSION_NUMBER 0x0090581f or greater\n\n");
4412
  for pkg in $enableval; do
4413
        return (1);
4413
    if test "X$pkg" = "X$p"; then
4414
}
4414
      enable_static=yes
4415
4415
    fi
4416
_ACEOF
4416
  done
4417
rm -f conftest$ac_exeext
4417
  IFS="$ac_save_ifs"
4418
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
4418
  ;;
4419
  (eval $ac_link) 2>&5
4419
esac
4420
  ac_status=$?
4420
else
4421
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4421
  enable_static=yes
4422
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4422
fi
4423
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4423
4424
  (eval $ac_try) 2>&5
4424
# Check whether --enable-fast-install or --disable-fast-install was given.
4425
  ac_status=$?
4425
if test "${enable_fast_install+set}" = set; then
4426
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4426
  enableval="$enable_fast_install"
4427
  (exit $ac_status); }; }; then
4427
  p=${PACKAGE-default}
4428
  echo "$as_me:$LINENO: result: ok" >&5
4428
case $enableval in
4429
echo "${ECHO_T}ok" >&6
4429
yes) enable_fast_install=yes ;;
4430
else
4430
no) enable_fast_install=no ;;
4431
  echo "$as_me: program exited with status $ac_status" >&5
4431
*)
4432
echo "$as_me: failed program was:" >&5
4432
  enable_fast_install=no
4433
cat conftest.$ac_ext >&5
4433
  # Look at the argument we got.  We use all the common list separators.
4434
( exit $ac_status )
4434
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
4435
echo "$as_me:$LINENO: result: not compatible" >&5
4435
  for pkg in $enableval; do
4436
echo "${ECHO_T}not compatible" >&6
4436
    if test "X$pkg" = "X$p"; then
4437
		 { { echo "$as_me:$LINENO: error: you need OpenSSL 0.9.5a or newer" >&5
4437
      enable_fast_install=yes
4438
echo "$as_me: error: you need OpenSSL 0.9.5a or newer" >&2;}
4438
    fi
4439
   { (exit 1); exit 1; }; }
4439
  done
4440
fi
4440
  IFS="$ac_save_ifs"
4441
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4441
  ;;
4442
fi
4442
esac
4443
4443
else
4444
else
4444
  enable_fast_install=yes
4445
  echo "$as_me:$LINENO: result: did not find fixes for CERT CA-2002-23" >&5
4445
fi
4446
echo "${ECHO_T}did not find fixes for CERT CA-2002-23" >&6
4446
4447
		echo "$as_me:$LINENO: checking OpenSSL library version" >&5
4447
echo $ac_n "checking build system type""... $ac_c" 1>&6
4448
echo $ECHO_N "checking OpenSSL library version... $ECHO_C" >&6
4448
echo "configure:4449: checking build system type" >&5
4449
		if test "$cross_compiling" = yes; then
4449
4450
  echo "$as_me:$LINENO: result: assuming target platform has compatible version" >&5
4450
build_alias=$build
4451
echo "${ECHO_T}assuming target platform has compatible version" >&6
4451
case "$build_alias" in
4452
else
4452
NONE)
4453
  cat >conftest.$ac_ext <<_ACEOF
4453
  case $nonopt in
4454
#line $LINENO "configure"
4454
  NONE) build_alias=$host_alias ;;
4455
#include "confdefs.h"
4455
  *) build_alias=$nonopt ;;
4456
4456
  esac ;;
4457
#include <stdio.h>
4457
esac
4458
#include <openssl/opensslv.h>
4458
4459
int main() {
4459
build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
4460
        if ((OPENSSL_VERSION_NUMBER >= 0x0090605fL &&
4460
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
4461
	     OPENSSL_VERSION_NUMBER < 0x009070000L) ||
4461
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
4462
	     OPENSSL_VERSION_NUMBER >= 0x00907003L)
4462
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
4463
                return (0);
4463
echo "$ac_t""$build" 1>&6
4464
	printf("\n\nFound   OPENSSL_VERSION_NUMBER %#010x\n",
4464
4465
		OPENSSL_VERSION_NUMBER);
4465
# Check whether --with-gnu-ld or --without-gnu-ld was given.
4466
	printf("Require OPENSSL_VERSION_NUMBER 0x0090605f or greater (0.9.6e)\n"
4466
if test "${with_gnu_ld+set}" = set; then
4467
	       "Require OPENSSL_VERSION_NUMBER 0x00907003 or greater (0.9.7-beta2)\n\n");
4467
  withval="$with_gnu_ld"
4468
        return (1);
4468
  test "$withval" = no || with_gnu_ld=yes
4469
}
4469
else
4470
4470
  with_gnu_ld=no
4471
_ACEOF
4471
fi
4472
rm -f conftest$ac_exeext
4472
4473
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
4473
ac_prog=ld
4474
  (eval $ac_link) 2>&5
4474
if test "$GCC" = yes; then
4475
  ac_status=$?
4475
  # Check if gcc -print-prog-name=ld gives a path.
4476
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4476
  echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
4477
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4477
echo "configure:4478: checking for ld used by GCC" >&5
4478
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4478
  case $host in
4479
  (eval $ac_try) 2>&5
4479
  *-*-mingw*)
4480
  ac_status=$?
4480
    # gcc leaves a trailing carriage return which upsets mingw
4481
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4481
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4482
  (exit $ac_status); }; }; then
4482
  *)
4483
  echo "$as_me:$LINENO: result: ok" >&5
4483
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4484
echo "${ECHO_T}ok" >&6
4484
  esac
4485
else
4485
  case $ac_prog in
4486
  echo "$as_me: program exited with status $ac_status" >&5
4486
    # Accept absolute paths.
4487
echo "$as_me: failed program was:" >&5
4487
    [\\/]* | [A-Za-z]:[\\/]*)
4488
cat conftest.$ac_ext >&5
4488
      re_direlt='/[^/][^/]*/\.\./'
4489
( exit $ac_status )
4489
      # Canonicalize the path of ld
4490
echo "$as_me:$LINENO: result: not compatible" >&5
4490
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4491
echo "${ECHO_T}not compatible" >&6
4491
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4492
		 { { echo "$as_me:$LINENO: error: you need OpenSSL 0.9.6e/0.9.7-beta2 (or newer): CERT CA-2002-23" >&5
4492
	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4493
echo "$as_me: error: you need OpenSSL 0.9.6e/0.9.7-beta2 (or newer): CERT CA-2002-23" >&2;}
4493
      done
4494
   { (exit 1); exit 1; }; }
4494
      test -z "$LD" && LD="$ac_prog"
4495
fi
4495
      ;;
4496
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4496
  "")
4497
fi
4497
    # If it fails, then pretend we aren't using GCC.
4498
fi
4498
    ac_prog=ld
4499
4499
    ;;
4500
		CFLAGS="$saved_cflags"
4500
  *)
4501
		LIBS="$saved_libs"
4501
    # If it is relative, then search for the first ld in PATH.
4502
		;;
4502
    with_gnu_ld=unknown
4503
esac
4503
    ;;
4504
4504
  esac
4505
#
4505
elif test "$with_gnu_ld" = yes; then
4506
# This would include the system openssl path (and linker options to use
4506
  echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
4507
# it as needed) if it is found.
4507
echo "configure:4508: checking for GNU ld" >&5
4508
#
4508
else
4509
4509
  echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
4510
4510
echo "configure:4511: checking for non-GNU ld" >&5
4511
4511
fi
4512
4512
if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
4513
4513
  echo $ac_n "(cached) $ac_c" 1>&6
4514
#
4514
else
4515
# was --with-gssapi specified?
4515
  if test -z "$LD"; then
4516
#
4516
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
4517
#AC_MSG_CHECKING(for GSSAPI library)
4517
  for ac_dir in $PATH; do
4518
#AC_ARG_WITH(gssapi,
4518
    test -z "$ac_dir" && ac_dir=.
4519
#[  --with-gssapi=PATH   Specify path for system-supplied GSSAPI],
4519
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4520
#    use_gssapi="$withval", use_gssapi="no")
4520
      lt_cv_path_LD="$ac_dir/$ac_prog"
4521
#
4521
      # Check to see if the program is GNU ld.  I'd rather use --version,
4522
#case "$use_gssapi" in
4522
      # but apparently some GNU ld's only accept -v.
4523
#	no)
4523
      # Break only if it was the GNU/non-GNU ld that we prefer.
4524
#		USE_GSSAPI=''
4524
      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
4525
#		DST_GSSAPI_INC=''
4525
	test "$with_gnu_ld" != no && break
4526
#		DNS_GSSAPI_LIBS=''
4526
      else
4527
#		AC_MSG_RESULT(not specified)
4527
	test "$with_gnu_ld" != yes && break
4528
#		;;
4528
      fi
4529
#	yes)
4529
    fi
4530
#		AC_MSG_ERROR([--with-gssapi must specify a path])
4530
  done
4531
#		;;
4531
  IFS="$ac_save_ifs"
4532
#	*)
4532
else
4533
#		USE_GSSAPI='-DGSSAPI'
4533
  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4534
#		DST_GSSAPI_INC="-I$use_gssapi/include"
4534
fi
4535
#		DNS_GSSAPI_LIBS="-L$use_gssapi/lib -lgssapi_krb5"
4535
fi
4536
#		AC_MSG_RESULT(using gssapi from $use_gssapi/lib and $use_gssapi/include)
4536
4537
#		;;
4537
LD="$lt_cv_path_LD"
4538
#esac
4538
if test -n "$LD"; then
4539
4539
  echo "$ac_t""$LD" 1>&6
4540
USE_GSSAPI=''
4540
else
4541
DST_GSSAPI_INC=''
4541
  echo "$ac_t""no" 1>&6
4542
DNS_GSSAPI_LIBS=''
4542
fi
4543
4543
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
4544
4544
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
4545
4545
echo "configure:4546: checking if the linker ($LD) is GNU ld" >&5
4546
4546
if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
4547
4547
  echo $ac_n "(cached) $ac_c" 1>&6
4548
#
4548
else
4549
# was --with-randomdev specified?
4549
  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
4550
#
4550
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
4551
echo "$as_me:$LINENO: checking for random device" >&5
4551
  lt_cv_prog_gnu_ld=yes
4552
echo $ECHO_N "checking for random device... $ECHO_C" >&6
4552
else
4553
4553
  lt_cv_prog_gnu_ld=no
4554
# Check whether --with-randomdev or --without-randomdev was given.
4554
fi
4555
if test "${with_randomdev+set}" = set; then
4555
fi
4556
  withval="$with_randomdev"
4556
4557
  use_randomdev="$withval"
4557
echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
4558
else
4558
with_gnu_ld=$lt_cv_prog_gnu_ld
4559
  use_randomdev="unspec"
4559
4560
fi;
4560
4561
4561
echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
4562
case "$use_randomdev" in
4562
echo "configure:4563: checking for $LD option to reload object files" >&5
4563
	unspec)
4563
if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
4564
		case "$host" in
4564
  echo $ac_n "(cached) $ac_c" 1>&6
4565
			*-openbsd*)
4565
else
4566
				devrandom=/dev/srandom
4566
  lt_cv_ld_reload_flag='-r'
4567
				;;
4567
fi
4568
			*)
4568
4569
				devrandom=/dev/random
4569
echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
4570
				;;
4570
reload_flag=$lt_cv_ld_reload_flag
4571
		esac
4571
test -n "$reload_flag" && reload_flag=" $reload_flag"
4572
		echo "$as_me:$LINENO: result: $devrandom" >&5
4572
4573
echo "${ECHO_T}$devrandom" >&6
4573
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
4574
		as_ac_File=`echo "ac_cv_file_$devrandom" | $as_tr_sh`
4574
echo "configure:4575: checking for BSD-compatible nm" >&5
4575
echo "$as_me:$LINENO: checking for $devrandom" >&5
4575
if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
4576
echo $ECHO_N "checking for $devrandom... $ECHO_C" >&6
4576
  echo $ac_n "(cached) $ac_c" 1>&6
4577
if eval "test \"\${$as_ac_File+set}\" = set"; then
4577
else
4578
  echo $ECHO_N "(cached) $ECHO_C" >&6
4578
  if test -n "$NM"; then
4579
else
4579
  # Let the user override the test.
4580
  test "$cross_compiling" = yes &&
4580
  lt_cv_path_NM="$NM"
4581
  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
4581
else
4582
echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
4582
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
4583
   { (exit 1); exit 1; }; }
4583
  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
4584
if test -r "$devrandom"; then
4584
    test -z "$ac_dir" && ac_dir=.
4585
  eval "$as_ac_File=yes"
4585
    tmp_nm=$ac_dir/${ac_tool_prefix}nm
4586
else
4586
    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
4587
  eval "$as_ac_File=no"
4587
      # Check to see if the nm accepts a BSD-compat flag.
4588
fi
4588
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
4589
fi
4589
      #   nm: unknown option "B" ignored
4590
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
4590
      # Tru64's nm complains that /dev/null is an invalid object file
4591
echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
4591
      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
4592
if test `eval echo '${'$as_ac_File'}'` = yes; then
4592
	lt_cv_path_NM="$tmp_nm -B"
4593
  cat >>confdefs.h <<_ACEOF
4593
	break
4594
#define PATH_RANDOMDEV "$devrandom"
4594
      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
4595
_ACEOF
4595
	lt_cv_path_NM="$tmp_nm -p"
4596
4596
	break
4597
fi
4597
      else
4598
4598
	lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4599
		;;
4599
	continue # so that we can try to find one that supports BSD flags
4600
	yes)
4600
      fi
4601
		{ { echo "$as_me:$LINENO: error: --with-randomdev must specify a path" >&5
4601
    fi
4602
echo "$as_me: error: --with-randomdev must specify a path" >&2;}
4602
  done
4603
   { (exit 1); exit 1; }; }
4603
  IFS="$ac_save_ifs"
4604
		;;
4604
  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
4605
	no)
4605
fi
4606
		echo "$as_me:$LINENO: result: disabled" >&5
4606
fi
4607
echo "${ECHO_T}disabled" >&6
4607
4608
		;;
4608
NM="$lt_cv_path_NM"
4609
	*)
4609
echo "$ac_t""$NM" 1>&6
4610
		cat >>confdefs.h <<_ACEOF
4610
4611
#define PATH_RANDOMDEV "$use_randomdev"
4611
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
4612
_ACEOF
4612
echo "configure:4613: checking whether ln -s works" >&5
4613
4613
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
4614
		echo "$as_me:$LINENO: result: using \"$use_randomdev\"" >&5
4614
  echo $ac_n "(cached) $ac_c" 1>&6
4615
echo "${ECHO_T}using \"$use_randomdev\"" >&6
4615
else
4616
		;;
4616
  rm -f conftestdata
4617
esac
4617
if ln -s X conftestdata 2>/dev/null
4618
4618
then
4619
#
4619
  rm -f conftestdata
4620
# Begin pthreads checking.
4620
  ac_cv_prog_LN_S="ln -s"
4621
#
4621
else
4622
# First, decide whether to use multithreading or not.
4622
  ac_cv_prog_LN_S=ln
4623
#
4623
fi
4624
# Enable multithreading by default on systems where it is known
4624
fi
4625
# to work well, and where debugging of multithreaded programs
4625
LN_S="$ac_cv_prog_LN_S"
4626
# is supported.
4626
if test "$ac_cv_prog_LN_S" = "ln -s"; then
4627
#
4627
  echo "$ac_t""yes" 1>&6
4628
4628
else
4629
echo "$as_me:$LINENO: checking whether to build with thread support" >&5
4629
  echo "$ac_t""no" 1>&6
4630
echo $ECHO_N "checking whether to build with thread support... $ECHO_C" >&6
4630
fi
4631
4631
4632
case $host in
4632
echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
4633
*-dec-osf*)
4633
echo "configure:4634: checking how to recognise dependant libraries" >&5
4634
	use_threads=true ;;
4634
if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
4635
*-solaris2.[0-6])
4635
  echo $ac_n "(cached) $ac_c" 1>&6
4636
	# Thread signals are broken on Solaris 2.6; they are sometimes
4636
else
4637
	# delivered to the wrong thread.
4637
  lt_cv_file_magic_cmd='$MAGIC_CMD'
4638
	use_threads=false ;;
4638
lt_cv_file_magic_test_file=
4639
*-solaris*)
4639
lt_cv_deplibs_check_method='unknown'
4640
	use_threads=true ;;
4640
# Need to set the preceding variable on all platforms that support
4641
*-ibm-aix*)
4641
# interlibrary dependencies.
4642
	use_threads=true ;;
4642
# 'none' -- dependencies not supported.
4643
*-hp-hpux10*)
4643
# `unknown' -- same as none, but documents that we really don't know.
4644
	use_threads=false ;;
4644
# 'pass_all' -- all dependencies passed with no checks.
4645
*-hp-hpux11*)
4645
# 'test_compile' -- check by making test program.
4646
	use_threads=true ;;
4646
# ['file_magic [regex]'] -- check by looking for files in library path
4647
*-sgi-irix*)
4647
# which responds to the $file_magic_cmd with a given egrep regex.
4648
	use_threads=true ;;
4648
# If you have `file' or equivalent on your system and you're not sure
4649
*-sco-sysv*uw*)
4649
# whether `pass_all' will *always* work, you probably want this one.
4650
        # UnixWare
4650
4651
	use_threads=false ;;
4651
case $host_os in
4652
*-netbsd*)
4652
aix4* | aix5*)
4653
	# Socket I/O optimizations introduced in 9.2 expose a
4653
  lt_cv_deplibs_check_method=pass_all
4654
	# bug in unproven-pthreads; see PR #12650
4654
  ;;
4655
	use_threads=false ;;
4655
4656
*-openbsd*)
4656
beos*)
4657
	# OpenBSD users have reported that named dumps core on
4657
  lt_cv_deplibs_check_method=pass_all
4658
	# startup when built with threads.
4658
  ;;
4659
	use_threads=false ;;
4659
4660
*-freebsd*)
4660
bsdi4*)
4661
	use_threads=false ;;
4661
  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
4662
*-bsdi*)
4662
  lt_cv_file_magic_cmd='/usr/bin/file -L'
4663
	# Thread signals do not appear to work reliably on BSDI.
4663
  lt_cv_file_magic_test_file=/shlib/libc.so
4664
	use_threads=false ;;
4664
  ;;
4665
*-linux*)
4665
4666
   	# Threads are disabled on Linux by default because most
4666
cygwin* | mingw* | pw32*)
4667
	# Linux kernels produce unusable core dumps from multithreaded
4667
  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
4668
	# programs, and because of limitations in setuid().
4668
  lt_cv_file_magic_cmd='$OBJDUMP -f'
4669
	use_threads=false ;;
4669
  ;;
4670
*)
4670
4671
	use_threads=false ;;
4671
darwin* | rhapsody*)
4672
esac
4672
  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
4673
4673
  lt_cv_file_magic_cmd='/usr/bin/file -L'
4674
# Check whether --enable-threads or --disable-threads was given.
4674
  case "$host_os" in
4675
if test "${enable_threads+set}" = set; then
4675
  rhapsody* | darwin1.012)
4676
  enableval="$enable_threads"
4676
    lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
4677
4677
    ;;
4678
fi;
4678
  *) # Darwin 1.3 on
4679
case "$enable_threads" in
4679
    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
4680
	yes)
4680
    ;;
4681
		use_threads=true
4681
  esac
4682
		;;
4682
  ;;
4683
	no)
4683
4684
		use_threads=false
4684
freebsd*)
4685
		;;
4685
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
4686
	'')
4686
    case $host_cpu in
4687
		# Use system-dependent default
4687
    i*86 )
4688
		;;
4688
      # Not sure whether the presence of OpenBSD here was a mistake.
4689
	*)
4689
      # Let's accept both of them until this is cleared up.
4690
	    	{ { echo "$as_me:$LINENO: error: --enable-threads takes yes or no" >&5
4690
      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
4691
echo "$as_me: error: --enable-threads takes yes or no" >&2;}
4691
      lt_cv_file_magic_cmd=/usr/bin/file
4692
   { (exit 1); exit 1; }; }
4692
      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4693
		;;
4693
      ;;
4694
esac
4694
    esac
4695
4695
  else
4696
if $use_threads
4696
    lt_cv_deplibs_check_method=pass_all
4697
then
4697
  fi
4698
	echo "$as_me:$LINENO: result: yes" >&5
4698
  ;;
4699
echo "${ECHO_T}yes" >&6
4699
4700
else
4700
gnu*)
4701
	echo "$as_me:$LINENO: result: no" >&5
4701
  lt_cv_deplibs_check_method=pass_all
4702
echo "${ECHO_T}no" >&6
4702
  ;;
4703
fi
4703
4704
4704
hpux10.20*|hpux11*)
4705
if $use_threads
4705
  lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
4706
then
4706
  lt_cv_file_magic_cmd=/usr/bin/file
4707
	#
4707
  lt_cv_file_magic_test_file=/usr/lib/libc.sl
4708
	# Search for / configure pthreads in a system-dependent fashion.
4708
  ;;
4709
	#
4709
4710
	case "$host" in
4710
irix5* | irix6*)
4711
	  *-netbsd*)
4711
  case $host_os in
4712
		# NetBSD has multiple pthreads implementations.	 The
4712
  irix5*)
4713
		# recommended one to use is "unproven-pthreads".  The
4713
    # this will be overridden with pass_all, but let us keep it just in case
4714
		# older "mit-pthreads" may also work on some NetBSD
4714
    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
4715
		# versions.  The PTL2 thread library does not
4715
    ;;
4716
		# currently work with bind9, but can be chosen with
4716
  *)
4717
		# the --with-ptl2 option for those who wish to
4717
    case $LD in
4718
		# experiment with it.
4718
    *-32|*"-32 ") libmagic=32-bit;;
4719
		CC="gcc"
4719
    *-n32|*"-n32 ") libmagic=N32;;
4720
		echo "$as_me:$LINENO: checking which NetBSD thread library to use" >&5
4720
    *-64|*"-64 ") libmagic=64-bit;;
4721
echo $ECHO_N "checking which NetBSD thread library to use... $ECHO_C" >&6
4721
    *) libmagic=never-match;;
4722
4722
    esac
4723
4723
    # this will be overridden with pass_all, but let us keep it just in case
4724
# Check whether --with-ptl2 or --without-ptl2 was given.
4724
    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
4725
if test "${with_ptl2+set}" = set; then
4725
    ;;
4726
  withval="$with_ptl2"
4726
  esac
4727
  use_ptl2="$withval"
4727
  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
4728
else
4728
  lt_cv_deplibs_check_method=pass_all
4729
  use_ptl2="no"
4729
  ;;
4730
fi;
4730
4731
4731
# This must be Linux ELF.
4732
		: ${LOCALBASE:=/usr/pkg}
4732
linux-gnu*)
4733
4733
  case $host_cpu in
4734
		if test "X$use_ptl2" = "Xyes"
4734
  alpha* | i*86 | powerpc* | sparc* | ia64* )
4735
		then
4735
    lt_cv_deplibs_check_method=pass_all ;;
4736
			echo "$as_me:$LINENO: result: PTL2" >&5
4736
  *)
4737
echo "${ECHO_T}PTL2" >&6
4737
    # glibc up to 2.1.1 does not perform some relocations on ARM
4738
			{ echo "$as_me:$LINENO: WARNING: linking with PTL2 is highly experimental and not expected to work" >&5
4738
    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
4739
echo "$as_me: WARNING: linking with PTL2 is highly experimental and not expected to work" >&2;}
4739
  esac
4740
			CC=ptlgcc
4740
  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
4741
		else
4741
  ;;
4742
			if test ! -d $LOCALBASE/pthreads
4742
4743
			then
4743
netbsd*)
4744
				echo "$as_me:$LINENO: result: none" >&5
4744
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
4745
echo "${ECHO_T}none" >&6
4745
    lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
4746
				{ { echo "$as_me:$LINENO: error: \"could not find thread libraries\"" >&5
4746
  else
4747
echo "$as_me: error: \"could not find thread libraries\"" >&2;}
4747
    lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
4748
   { (exit 1); exit 1; }; }
4748
  fi
4749
			fi
4749
  ;;
4750
4750
4751
			if $use_threads
4751
newos6*)
4752
			then
4752
  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
4753
				echo "$as_me:$LINENO: result: mit-pthreads/unproven-pthreads" >&5
4753
  lt_cv_file_magic_cmd=/usr/bin/file
4754
echo "${ECHO_T}mit-pthreads/unproven-pthreads" >&6
4754
  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4755
				pkg="$LOCALBASE/pthreads"
4755
  ;;
4756
				lib1="-L$pkg/lib -Wl,-R$pkg/lib"
4756
4757
				lib2="-lpthread -lm -lgcc -lpthread"
4757
osf3* | osf4* | osf5*)
4758
				LIBS="$lib1 $lib2 $LIBS"
4758
  # this will be overridden with pass_all, but let us keep it just in case
4759
				CPPFLAGS="$CPPFLAGS -I$pkg/include"
4759
  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
4760
				STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include"
4760
  lt_cv_file_magic_test_file=/shlib/libc.so
4761
			fi
4761
  lt_cv_deplibs_check_method=pass_all
4762
		fi
4762
  ;;
4763
		;;
4763
4764
		*)
4764
sco3.2v5*)
4765
4765
  lt_cv_deplibs_check_method=pass_all
4766
echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
4766
  ;;
4767
echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
4767
4768
if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
4768
solaris*)
4769
  echo $ECHO_N "(cached) $ECHO_C" >&6
4769
  lt_cv_deplibs_check_method=pass_all
4770
else
4770
  lt_cv_file_magic_test_file=/lib/libc.so
4771
  ac_check_lib_save_LIBS=$LIBS
4771
  ;;
4772
LIBS="-lpthread  $LIBS"
4772
4773
cat >conftest.$ac_ext <<_ACEOF
4773
sysv5uw[78]* | sysv4*uw2*)
4774
#line $LINENO "configure"
4774
  lt_cv_deplibs_check_method=pass_all
4775
#include "confdefs.h"
4775
  ;;
4776
4776
4777
/* Override any gcc2 internal prototype to avoid an error.  */
4777
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
4778
#ifdef __cplusplus
4778
  case $host_vendor in
4779
extern "C"
4779
  motorola)
4780
#endif
4780
    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
4781
/* We use char because int might match the return type of a gcc2
4781
    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4782
   builtin and then its argument prototype would still apply.  */
4782
    ;;
4783
char pthread_create ();
4783
  ncr)
4784
#ifdef F77_DUMMY_MAIN
4784
    lt_cv_deplibs_check_method=pass_all
4785
#  ifdef __cplusplus
4785
    ;;
4786
     extern "C"
4786
  sequent)
4787
#  endif
4787
    lt_cv_file_magic_cmd='/bin/file'
4788
   int F77_DUMMY_MAIN() { return 1; }
4788
    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
4789
#endif
4789
    ;;
4790
int
4790
  sni)
4791
main ()
4791
    lt_cv_file_magic_cmd='/bin/file'
4792
{
4792
    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
4793
pthread_create ();
4793
    lt_cv_file_magic_test_file=/lib/libc.so
4794
  ;
4794
    ;;
4795
  return 0;
4795
  esac
4796
}
4796
  ;;
4797
_ACEOF
4797
esac
4798
rm -f conftest.$ac_objext conftest$ac_exeext
4798
4799
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
4799
fi
4800
  (eval $ac_link) 2>&5
4800
4801
  ac_status=$?
4801
echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
4802
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4802
file_magic_cmd=$lt_cv_file_magic_cmd
4803
  (exit $ac_status); } &&
4803
deplibs_check_method=$lt_cv_deplibs_check_method
4804
         { ac_try='test -s conftest$ac_exeext'
4804
4805
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4805
echo $ac_n "checking for object suffix""... $ac_c" 1>&6
4806
  (eval $ac_try) 2>&5
4806
echo "configure:4807: checking for object suffix" >&5
4807
  ac_status=$?
4807
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
4808
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4808
  echo $ac_n "(cached) $ac_c" 1>&6
4809
  (exit $ac_status); }; }; then
4809
else
4810
  ac_cv_lib_pthread_pthread_create=yes
4810
  rm -f conftest*
4811
else
4811
echo 'int i = 1;' > conftest.$ac_ext
4812
  echo "$as_me: failed program was:" >&5
4812
if { (eval echo configure:4813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4813
cat conftest.$ac_ext >&5
4813
  for ac_file in conftest.*; do
4814
ac_cv_lib_pthread_pthread_create=no
4814
    case $ac_file in
4815
fi
4815
    *.c) ;;
4816
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4816
    *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4817
LIBS=$ac_check_lib_save_LIBS
4817
    esac
4818
fi
4818
  done
4819
echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
4819
else
4820
echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6
4820
  { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4821
if test $ac_cv_lib_pthread_pthread_create = yes; then
4821
fi
4822
  cat >>confdefs.h <<_ACEOF
4822
rm -f conftest*
4823
#define HAVE_LIBPTHREAD 1
4823
fi
4824
_ACEOF
4824
4825
4825
echo "$ac_t""$ac_cv_objext" 1>&6
4826
  LIBS="-lpthread $LIBS"
4826
OBJEXT=$ac_cv_objext
4827
4827
ac_objext=$ac_cv_objext
4828
else
4828
4829
4829
4830
echo "$as_me:$LINENO: checking for __pthread_create in -lpthread" >&5
4830
4831
echo $ECHO_N "checking for __pthread_create in -lpthread... $ECHO_C" >&6
4831
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
4832
if test "${ac_cv_lib_pthread___pthread_create+set}" = set; then
4832
echo "configure:4833: checking for executable suffix" >&5
4833
  echo $ECHO_N "(cached) $ECHO_C" >&6
4833
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
4834
else
4834
  echo $ac_n "(cached) $ac_c" 1>&6
4835
  ac_check_lib_save_LIBS=$LIBS
4835
else
4836
LIBS="-lpthread  $LIBS"
4836
  if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
4837
cat >conftest.$ac_ext <<_ACEOF
4837
  ac_cv_exeext=.exe
4838
#line $LINENO "configure"
4838
else
4839
#include "confdefs.h"
4839
  rm -f conftest*
4840
4840
  echo 'int main () { return 0; }' > conftest.$ac_ext
4841
/* Override any gcc2 internal prototype to avoid an error.  */
4841
  ac_cv_exeext=
4842
#ifdef __cplusplus
4842
  if { (eval echo configure:4843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4843
extern "C"
4843
    for file in conftest.*; do
4844
#endif
4844
      case $file in
4845
/* We use char because int might match the return type of a gcc2
4845
      *.c | *.o | *.obj) ;;
4846
   builtin and then its argument prototype would still apply.  */
4846
      *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4847
char __pthread_create ();
4847
      esac
4848
#ifdef F77_DUMMY_MAIN
4848
    done
4849
#  ifdef __cplusplus
4849
  else
4850
     extern "C"
4850
    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4851
#  endif
4851
  fi
4852
   int F77_DUMMY_MAIN() { return 1; }
4852
  rm -f conftest*
4853
#endif
4853
  test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4854
int
4854
fi
4855
main ()
4855
fi
4856
{
4856
4857
__pthread_create ();
4857
EXEEXT=""
4858
  ;
4858
test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4859
  return 0;
4859
echo "$ac_t""${ac_cv_exeext}" 1>&6
4860
}
4860
ac_exeext=$EXEEXT
4861
_ACEOF
4861
4862
rm -f conftest.$ac_objext conftest$ac_exeext
4862
if test $host != $build; then
4863
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
4863
  ac_tool_prefix=${host_alias}-
4864
  (eval $ac_link) 2>&5
4864
else
4865
  ac_status=$?
4865
  ac_tool_prefix=
4866
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4866
fi
4867
  (exit $ac_status); } &&
4867
4868
         { ac_try='test -s conftest$ac_exeext'
4868
4869
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4869
4870
  (eval $ac_try) 2>&5
4870
4871
  ac_status=$?
4871
# Check for command to grab the raw symbol name followed by C symbol from nm.
4872
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4872
echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
4873
  (exit $ac_status); }; }; then
4873
echo "configure:4874: checking command to parse $NM output" >&5
4874
  ac_cv_lib_pthread___pthread_create=yes
4874
if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
4875
else
4875
  echo $ac_n "(cached) $ac_c" 1>&6
4876
  echo "$as_me: failed program was:" >&5
4876
else
4877
cat conftest.$ac_ext >&5
4877
  
4878
ac_cv_lib_pthread___pthread_create=no
4878
# These are sane defaults that work on at least a few old systems.
4879
fi
4879
# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4880
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4880
4881
LIBS=$ac_check_lib_save_LIBS
4881
# Character class describing NM global symbol codes.
4882
fi
4882
symcode='[BCDEGRST]'
4883
echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create" >&5
4883
4884
echo "${ECHO_T}$ac_cv_lib_pthread___pthread_create" >&6
4884
# Regexp to match symbols that can be accessed directly from C.
4885
if test $ac_cv_lib_pthread___pthread_create = yes; then
4885
sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
4886
  cat >>confdefs.h <<_ACEOF
4886
4887
#define HAVE_LIBPTHREAD 1
4887
# Transform the above into a raw symbol and a C symbol.
4888
_ACEOF
4888
symxfrm='\1 \2\3 \3'
4889
4889
4890
  LIBS="-lpthread $LIBS"
4890
# Transform an extracted symbol line into a proper C declaration
4891
4891
lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
4892
else
4892
4893
4893
# Define system-specific variables.
4894
echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5
4894
case $host_os in
4895
echo $ECHO_N "checking for __pthread_create_system in -lpthread... $ECHO_C" >&6
4895
aix*)
4896
if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then
4896
  symcode='[BCDT]'
4897
  echo $ECHO_N "(cached) $ECHO_C" >&6
4897
  ;;
4898
else
4898
cygwin* | mingw* | pw32*)
4899
  ac_check_lib_save_LIBS=$LIBS
4899
  symcode='[ABCDGISTW]'
4900
LIBS="-lpthread  $LIBS"
4900
  ;;
4901
cat >conftest.$ac_ext <<_ACEOF
4901
hpux*) # Its linker distinguishes data from code symbols
4902
#line $LINENO "configure"
4902
  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4903
#include "confdefs.h"
4903
  ;;
4904
4904
irix*)
4905
/* Override any gcc2 internal prototype to avoid an error.  */
4905
  symcode='[BCDEGRST]'
4906
#ifdef __cplusplus
4906
  ;;
4907
extern "C"
4907
solaris* | sysv5*)
4908
#endif
4908
  symcode='[BDT]'
4909
/* We use char because int might match the return type of a gcc2
4909
  ;;
4910
   builtin and then its argument prototype would still apply.  */
4910
sysv4)
4911
char __pthread_create_system ();
4911
  symcode='[DFNSTU]'
4912
#ifdef F77_DUMMY_MAIN
4912
  ;;
4913
#  ifdef __cplusplus
4913
esac
4914
     extern "C"
4914
4915
#  endif
4915
# Handle CRLF in mingw tool chain
4916
   int F77_DUMMY_MAIN() { return 1; }
4916
opt_cr=
4917
#endif
4917
case $host_os in
4918
int
4918
mingw*)
4919
main ()
4919
  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4920
{
4920
  ;;
4921
__pthread_create_system ();
4921
esac
4922
  ;
4922
4923
  return 0;
4923
# If we're using GNU nm, then use its standard symbol codes.
4924
}
4924
if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
4925
_ACEOF
4925
  symcode='[ABCDGISTW]'
4926
rm -f conftest.$ac_objext conftest$ac_exeext
4926
fi
4927
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
4927
4928
  (eval $ac_link) 2>&5
4928
# Try without a prefix undercore, then with it.
4929
  ac_status=$?
4929
for ac_symprfx in "" "_"; do
4930
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4930
4931
  (exit $ac_status); } &&
4931
  # Write the raw and C identifiers.
4932
         { ac_try='test -s conftest$ac_exeext'
4932
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
4933
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4933
4934
  (eval $ac_try) 2>&5
4934
  # Check to see that the pipe works correctly.
4935
  ac_status=$?
4935
  pipe_works=no
4936
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4936
  rm -f conftest*
4937
  (exit $ac_status); }; }; then
4937
  cat > conftest.$ac_ext <<EOF
4938
  ac_cv_lib_pthread___pthread_create_system=yes
4938
#ifdef __cplusplus
4939
else
4939
extern "C" {
4940
  echo "$as_me: failed program was:" >&5
4940
#endif
4941
cat conftest.$ac_ext >&5
4941
char nm_test_var;
4942
ac_cv_lib_pthread___pthread_create_system=no
4942
void nm_test_func(){}
4943
fi
4943
#ifdef __cplusplus
4944
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4944
}
4945
LIBS=$ac_check_lib_save_LIBS
4945
#endif
4946
fi
4946
int main(){nm_test_var='a';nm_test_func();return(0);}
4947
echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5
4947
EOF
4948
echo "${ECHO_T}$ac_cv_lib_pthread___pthread_create_system" >&6
4948
4949
if test $ac_cv_lib_pthread___pthread_create_system = yes; then
4949
  if { (eval echo configure:4950: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4950
  cat >>confdefs.h <<_ACEOF
4950
    # Now try to grab the symbols.
4951
#define HAVE_LIBPTHREAD 1
4951
    nlist=conftest.nm
4952
_ACEOF
4952
    if { (eval echo configure:4953: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then
4953
4953
      # Try sorting and uniquifying the output.
4954
  LIBS="-lpthread $LIBS"
4954
      if sort "$nlist" | uniq > "$nlist"T; then
4955
4955
	mv -f "$nlist"T "$nlist"
4956
else
4956
      else
4957
4957
	rm -f "$nlist"T
4958
echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5
4958
      fi
4959
echo $ECHO_N "checking for pthread_create in -lc_r... $ECHO_C" >&6
4959
4960
if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then
4960
      # Make sure that we snagged all the symbols we need.
4961
  echo $ECHO_N "(cached) $ECHO_C" >&6
4961
      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
4962
else
4962
	if egrep ' nm_test_func$' "$nlist" >/dev/null; then
4963
  ac_check_lib_save_LIBS=$LIBS
4963
	  cat <<EOF > conftest.$ac_ext
4964
LIBS="-lc_r  $LIBS"
4964
#ifdef __cplusplus
4965
cat >conftest.$ac_ext <<_ACEOF
4965
extern "C" {
4966
#line $LINENO "configure"
4966
#endif
4967
#include "confdefs.h"
4967
4968
4968
EOF
4969
/* Override any gcc2 internal prototype to avoid an error.  */
4969
	  # Now generate the symbol file.
4970
#ifdef __cplusplus
4970
	  eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
4971
extern "C"
4971
4972
#endif
4972
	  cat <<EOF >> conftest.$ac_ext
4973
/* We use char because int might match the return type of a gcc2
4973
#if defined (__STDC__) && __STDC__
4974
   builtin and then its argument prototype would still apply.  */
4974
# define lt_ptr_t void *
4975
char pthread_create ();
4975
#else
4976
#ifdef F77_DUMMY_MAIN
4976
# define lt_ptr_t char *
4977
#  ifdef __cplusplus
4977
# define const
4978
     extern "C"
4978
#endif
4979
#  endif
4979
4980
   int F77_DUMMY_MAIN() { return 1; }
4980
/* The mapping between symbol names and symbols. */
4981
#endif
4981
const struct {
4982
int
4982
  const char *name;
4983
main ()
4983
  lt_ptr_t address;
4984
{
4984
}
4985
pthread_create ();
4985
lt_preloaded_symbols[] =
4986
  ;
4986
{
4987
  return 0;
4987
EOF
4988
}
4988
	  sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext
4989
_ACEOF
4989
	  cat <<\EOF >> conftest.$ac_ext
4990
rm -f conftest.$ac_objext conftest$ac_exeext
4990
  {0, (lt_ptr_t) 0}
4991
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
4991
};
4992
  (eval $ac_link) 2>&5
4992
4993
  ac_status=$?
4993
#ifdef __cplusplus
4994
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4994
}
4995
  (exit $ac_status); } &&
4995
#endif
4996
         { ac_try='test -s conftest$ac_exeext'
4996
EOF
4997
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4997
	  # Now try linking the two files.
4998
  (eval $ac_try) 2>&5
4998
	  mv conftest.$ac_objext conftstm.$ac_objext
4999
  ac_status=$?
4999
	  save_LIBS="$LIBS"
5000
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5000
	  save_CFLAGS="$CFLAGS"
5001
  (exit $ac_status); }; }; then
5001
	  LIBS="conftstm.$ac_objext"
5002
  ac_cv_lib_c_r_pthread_create=yes
5002
	  CFLAGS="$CFLAGS$no_builtin_flag"
5003
else
5003
	  if { (eval echo configure:5004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5004
  echo "$as_me: failed program was:" >&5
5004
	    pipe_works=yes
5005
cat conftest.$ac_ext >&5
5005
	  fi
5006
ac_cv_lib_c_r_pthread_create=no
5006
	  LIBS="$save_LIBS"
5007
fi
5007
	  CFLAGS="$save_CFLAGS"
5008
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5008
	else
5009
LIBS=$ac_check_lib_save_LIBS
5009
	  echo "cannot find nm_test_func in $nlist" >&5
5010
fi
5010
	fi
5011
echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5
5011
      else
5012
echo "${ECHO_T}$ac_cv_lib_c_r_pthread_create" >&6
5012
	echo "cannot find nm_test_var in $nlist" >&5
5013
if test $ac_cv_lib_c_r_pthread_create = yes; then
5013
      fi
5014
  cat >>confdefs.h <<_ACEOF
5014
    else
5015
#define HAVE_LIBC_R 1
5015
      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
5016
_ACEOF
5016
    fi
5017
5017
  else
5018
  LIBS="-lc_r $LIBS"
5018
    echo "$progname: failed program was:" >&5
5019
5019
    cat conftest.$ac_ext >&5
5020
else
5020
  fi
5021
5021
  rm -f conftest* conftst*
5022
echo "$as_me:$LINENO: checking for pthread_create in -lc" >&5
5022
5023
echo $ECHO_N "checking for pthread_create in -lc... $ECHO_C" >&6
5023
  # Do not use the global_symbol_pipe unless it works.
5024
if test "${ac_cv_lib_c_pthread_create+set}" = set; then
5024
  if test "$pipe_works" = yes; then
5025
  echo $ECHO_N "(cached) $ECHO_C" >&6
5025
    break
5026
else
5026
  else
5027
  ac_check_lib_save_LIBS=$LIBS
5027
    lt_cv_sys_global_symbol_pipe=
5028
LIBS="-lc  $LIBS"
5028
  fi
5029
cat >conftest.$ac_ext <<_ACEOF
5029
done
5030
#line $LINENO "configure"
5030
5031
#include "confdefs.h"
5031
fi
5032
5032
5033
/* Override any gcc2 internal prototype to avoid an error.  */
5033
global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
5034
#ifdef __cplusplus
5034
if test -z "$lt_cv_sys_global_symbol_pipe"; then
5035
extern "C"
5035
  global_symbol_to_cdecl=
5036
#endif
5036
else
5037
/* We use char because int might match the return type of a gcc2
5037
  global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
5038
   builtin and then its argument prototype would still apply.  */
5038
fi
5039
char pthread_create ();
5039
if test -z "$global_symbol_pipe$global_symbol_to_cdecl"; then
5040
#ifdef F77_DUMMY_MAIN
5040
  echo "$ac_t""failed" 1>&6
5041
#  ifdef __cplusplus
5041
else
5042
     extern "C"
5042
  echo "$ac_t""ok" 1>&6
5043
#  endif
5043
fi
5044
   int F77_DUMMY_MAIN() { return 1; }
5044
5045
#endif
5045
for ac_hdr in dlfcn.h
5046
int
5046
do
5047
main ()
5047
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5048
{
5048
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5049
pthread_create ();
5049
echo "configure:5050: checking for $ac_hdr" >&5
5050
  ;
5050
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5051
  return 0;
5051
  echo $ac_n "(cached) $ac_c" 1>&6
5052
}
5052
else
5053
_ACEOF
5053
  cat > conftest.$ac_ext <<EOF
5054
rm -f conftest.$ac_objext conftest$ac_exeext
5054
#line 5055 "configure"
5055
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5055
#include "confdefs.h"
5056
  (eval $ac_link) 2>&5
5056
#include <$ac_hdr>
5057
  ac_status=$?
5057
EOF
5058
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5058
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5059
  (exit $ac_status); } &&
5059
{ (eval echo configure:5060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5060
         { ac_try='test -s conftest$ac_exeext'
5060
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5061
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5061
if test -z "$ac_err"; then
5062
  (eval $ac_try) 2>&5
5062
  rm -rf conftest*
5063
  ac_status=$?
5063
  eval "ac_cv_header_$ac_safe=yes"
5064
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5064
else
5065
  (exit $ac_status); }; }; then
5065
  echo "$ac_err" >&5
5066
  ac_cv_lib_c_pthread_create=yes
5066
  echo "configure: failed program was:" >&5
5067
else
5067
  cat conftest.$ac_ext >&5
5068
  echo "$as_me: failed program was:" >&5
5068
  rm -rf conftest*
5069
cat conftest.$ac_ext >&5
5069
  eval "ac_cv_header_$ac_safe=no"
5070
ac_cv_lib_c_pthread_create=no
5070
fi
5071
fi
5071
rm -f conftest*
5072
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5072
fi
5073
LIBS=$ac_check_lib_save_LIBS
5073
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5074
fi
5074
  echo "$ac_t""yes" 1>&6
5075
echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_create" >&5
5075
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5076
echo "${ECHO_T}$ac_cv_lib_c_pthread_create" >&6
5076
  cat >> confdefs.h <<EOF
5077
if test $ac_cv_lib_c_pthread_create = yes; then
5077
#define $ac_tr_hdr 1
5078
  cat >>confdefs.h <<_ACEOF
5078
EOF
5079
#define HAVE_LIBC 1
5079
 
5080
_ACEOF
5080
else
5081
5081
  echo "$ac_t""no" 1>&6
5082
  LIBS="-lc $LIBS"
5082
fi
5083
5083
done
5084
else
5084
5085
  { { echo "$as_me:$LINENO: error: \"could not find thread libraries\"" >&5
5085
5086
echo "$as_me: error: \"could not find thread libraries\"" >&2;}
5086
5087
   { (exit 1); exit 1; }; }
5087
5088
fi
5088
5089
5089
# Only perform the check for file, if the check method requires it
5090
fi
5090
case $deplibs_check_method in
5091
5091
file_magic*)
5092
fi
5092
  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
5093
5093
    echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
5094
fi
5094
echo "configure:5095: checking for ${ac_tool_prefix}file" >&5
5095
5095
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
5096
fi
5096
  echo $ac_n "(cached) $ac_c" 1>&6
5097
5097
else
5098
		;;
5098
  case $MAGIC_CMD in
5099
	esac
5099
  /*)
5100
fi
5100
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
5101
5101
  ;;
5102
if $use_threads
5102
  ?:/*)
5103
then
5103
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
5104
	#
5104
  ;;
5105
	# We'd like to use sigwait() too
5105
  *)
5106
	#
5106
  ac_save_MAGIC_CMD="$MAGIC_CMD"
5107
	echo "$as_me:$LINENO: checking for sigwait in -lc" >&5
5107
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5108
echo $ECHO_N "checking for sigwait in -lc... $ECHO_C" >&6
5108
  ac_dummy="/usr/bin:$PATH"
5109
if test "${ac_cv_lib_c_sigwait+set}" = set; then
5109
  for ac_dir in $ac_dummy; do
5110
  echo $ECHO_N "(cached) $ECHO_C" >&6
5110
    test -z "$ac_dir" && ac_dir=.
5111
else
5111
    if test -f $ac_dir/${ac_tool_prefix}file; then
5112
  ac_check_lib_save_LIBS=$LIBS
5112
      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
5113
LIBS="-lc  $LIBS"
5113
      if test -n "$file_magic_test_file"; then
5114
cat >conftest.$ac_ext <<_ACEOF
5114
	case $deplibs_check_method in
5115
#line $LINENO "configure"
5115
	"file_magic "*)
5116
#include "confdefs.h"
5116
	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
5117
5117
	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
5118
/* Override any gcc2 internal prototype to avoid an error.  */
5118
	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
5119
#ifdef __cplusplus
5119
	    egrep "$file_magic_regex" > /dev/null; then
5120
extern "C"
5120
	    :
5121
#endif
5121
	  else
5122
/* We use char because int might match the return type of a gcc2
5122
	    cat <<EOF 1>&2
5123
   builtin and then its argument prototype would still apply.  */
5123
5124
char sigwait ();
5124
*** Warning: the command libtool uses to detect shared libraries,
5125
#ifdef F77_DUMMY_MAIN
5125
*** $file_magic_cmd, produces output that libtool cannot recognize.
5126
#  ifdef __cplusplus
5126
*** The result is that libtool may fail to recognize shared libraries
5127
     extern "C"
5127
*** as such.  This will affect the creation of libtool libraries that
5128
#  endif
5128
*** depend on shared libraries, but programs linked with such libtool
5129
   int F77_DUMMY_MAIN() { return 1; }
5129
*** libraries will work regardless of this problem.  Nevertheless, you
5130
#endif
5130
*** may want to report the problem to your system manager and/or to
5131
int
5131
*** bug-libtool@gnu.org
5132
main ()
5132
5133
{
5133
EOF
5134
sigwait ();
5134
	  fi ;;
5135
  ;
5135
	esac
5136
  return 0;
5136
      fi
5137
}
5137
      break
5138
_ACEOF
5138
    fi
5139
rm -f conftest.$ac_objext conftest$ac_exeext
5139
  done
5140
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5140
  IFS="$ac_save_ifs"
5141
  (eval $ac_link) 2>&5
5141
  MAGIC_CMD="$ac_save_MAGIC_CMD"
5142
  ac_status=$?
5142
  ;;
5143
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5143
esac
5144
  (exit $ac_status); } &&
5144
fi
5145
         { ac_try='test -s conftest$ac_exeext'
5145
5146
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5146
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
5147
  (eval $ac_try) 2>&5
5147
if test -n "$MAGIC_CMD"; then
5148
  ac_status=$?
5148
  echo "$ac_t""$MAGIC_CMD" 1>&6
5149
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5149
else
5150
  (exit $ac_status); }; }; then
5150
  echo "$ac_t""no" 1>&6
5151
  ac_cv_lib_c_sigwait=yes
5151
fi
5152
else
5152
5153
  echo "$as_me: failed program was:" >&5
5153
if test -z "$lt_cv_path_MAGIC_CMD"; then
5154
cat conftest.$ac_ext >&5
5154
  if test -n "$ac_tool_prefix"; then
5155
ac_cv_lib_c_sigwait=no
5155
    echo $ac_n "checking for file""... $ac_c" 1>&6
5156
fi
5156
echo "configure:5157: checking for file" >&5
5157
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5157
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
5158
LIBS=$ac_check_lib_save_LIBS
5158
  echo $ac_n "(cached) $ac_c" 1>&6
5159
fi
5159
else
5160
echo "$as_me:$LINENO: result: $ac_cv_lib_c_sigwait" >&5
5160
  case $MAGIC_CMD in
5161
echo "${ECHO_T}$ac_cv_lib_c_sigwait" >&6
5161
  /*)
5162
if test $ac_cv_lib_c_sigwait = yes; then
5162
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
5163
  cat >>confdefs.h <<\_ACEOF
5163
  ;;
5164
#define HAVE_SIGWAIT 1
5164
  ?:/*)
5165
_ACEOF
5165
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
5166
5166
  ;;
5167
else
5167
  *)
5168
  echo "$as_me:$LINENO: checking for sigwait in -lpthread" >&5
5168
  ac_save_MAGIC_CMD="$MAGIC_CMD"
5169
echo $ECHO_N "checking for sigwait in -lpthread... $ECHO_C" >&6
5169
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5170
if test "${ac_cv_lib_pthread_sigwait+set}" = set; then
5170
  ac_dummy="/usr/bin:$PATH"
5171
  echo $ECHO_N "(cached) $ECHO_C" >&6
5171
  for ac_dir in $ac_dummy; do
5172
else
5172
    test -z "$ac_dir" && ac_dir=.
5173
  ac_check_lib_save_LIBS=$LIBS
5173
    if test -f $ac_dir/file; then
5174
LIBS="-lpthread  $LIBS"
5174
      lt_cv_path_MAGIC_CMD="$ac_dir/file"
5175
cat >conftest.$ac_ext <<_ACEOF
5175
      if test -n "$file_magic_test_file"; then
5176
#line $LINENO "configure"
5176
	case $deplibs_check_method in
5177
#include "confdefs.h"
5177
	"file_magic "*)
5178
5178
	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
5179
/* Override any gcc2 internal prototype to avoid an error.  */
5179
	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
5180
#ifdef __cplusplus
5180
	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
5181
extern "C"
5181
	    egrep "$file_magic_regex" > /dev/null; then
5182
#endif
5182
	    :
5183
/* We use char because int might match the return type of a gcc2
5183
	  else
5184
   builtin and then its argument prototype would still apply.  */
5184
	    cat <<EOF 1>&2
5185
char sigwait ();
5185
5186
#ifdef F77_DUMMY_MAIN
5186
*** Warning: the command libtool uses to detect shared libraries,
5187
#  ifdef __cplusplus
5187
*** $file_magic_cmd, produces output that libtool cannot recognize.
5188
     extern "C"
5188
*** The result is that libtool may fail to recognize shared libraries
5189
#  endif
5189
*** as such.  This will affect the creation of libtool libraries that
5190
   int F77_DUMMY_MAIN() { return 1; }
5190
*** depend on shared libraries, but programs linked with such libtool
5191
#endif
5191
*** libraries will work regardless of this problem.  Nevertheless, you
5192
int
5192
*** may want to report the problem to your system manager and/or to
5193
main ()
5193
*** bug-libtool@gnu.org
5194
{
5194
5195
sigwait ();
5195
EOF
5196
  ;
5196
	  fi ;;
5197
  return 0;
5197
	esac
5198
}
5198
      fi
5199
_ACEOF
5199
      break
5200
rm -f conftest.$ac_objext conftest$ac_exeext
5200
    fi
5201
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5201
  done
5202
  (eval $ac_link) 2>&5
5202
  IFS="$ac_save_ifs"
5203
  ac_status=$?
5203
  MAGIC_CMD="$ac_save_MAGIC_CMD"
5204
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5204
  ;;
5205
  (exit $ac_status); } &&
5205
esac
5206
         { ac_try='test -s conftest$ac_exeext'
5206
fi
5207
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5207
5208
  (eval $ac_try) 2>&5
5208
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
5209
  ac_status=$?
5209
if test -n "$MAGIC_CMD"; then
5210
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5210
  echo "$ac_t""$MAGIC_CMD" 1>&6
5211
  (exit $ac_status); }; }; then
5211
else
5212
  ac_cv_lib_pthread_sigwait=yes
5212
  echo "$ac_t""no" 1>&6
5213
else
5213
fi
5214
  echo "$as_me: failed program was:" >&5
5214
5215
cat conftest.$ac_ext >&5
5215
  else
5216
ac_cv_lib_pthread_sigwait=no
5216
    MAGIC_CMD=:
5217
fi
5217
  fi
5218
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5218
fi
5219
LIBS=$ac_check_lib_save_LIBS
5219
5220
fi
5220
  fi
5221
echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_sigwait" >&5
5221
  ;;
5222
echo "${ECHO_T}$ac_cv_lib_pthread_sigwait" >&6
5222
esac
5223
if test $ac_cv_lib_pthread_sigwait = yes; then
5223
5224
  cat >>confdefs.h <<\_ACEOF
5224
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
5225
#define HAVE_SIGWAIT 1
5225
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
5226
_ACEOF
5226
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5227
5227
echo "configure:5228: checking for $ac_word" >&5
5228
else
5228
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
5229
  echo "$as_me:$LINENO: checking for _Psigwait in -lpthread" >&5
5229
  echo $ac_n "(cached) $ac_c" 1>&6
5230
echo $ECHO_N "checking for _Psigwait in -lpthread... $ECHO_C" >&6
5230
else
5231
if test "${ac_cv_lib_pthread__Psigwait+set}" = set; then
5231
  if test -n "$RANLIB"; then
5232
  echo $ECHO_N "(cached) $ECHO_C" >&6
5232
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
5233
else
5233
else
5234
  ac_check_lib_save_LIBS=$LIBS
5234
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
5235
LIBS="-lpthread  $LIBS"
5235
  ac_dummy="$PATH"
5236
cat >conftest.$ac_ext <<_ACEOF
5236
  for ac_dir in $ac_dummy; do
5237
#line $LINENO "configure"
5237
    test -z "$ac_dir" && ac_dir=.
5238
#include "confdefs.h"
5238
    if test -f $ac_dir/$ac_word; then
5239
5239
      ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
5240
/* Override any gcc2 internal prototype to avoid an error.  */
5240
      break
5241
#ifdef __cplusplus
5241
    fi
5242
extern "C"
5242
  done
5243
#endif
5243
  IFS="$ac_save_ifs"
5244
/* We use char because int might match the return type of a gcc2
5244
fi
5245
   builtin and then its argument prototype would still apply.  */
5245
fi
5246
char _Psigwait ();
5246
RANLIB="$ac_cv_prog_RANLIB"
5247
#ifdef F77_DUMMY_MAIN
5247
if test -n "$RANLIB"; then
5248
#  ifdef __cplusplus
5248
  echo "$ac_t""$RANLIB" 1>&6
5249
     extern "C"
5249
else
5250
#  endif
5250
  echo "$ac_t""no" 1>&6
5251
   int F77_DUMMY_MAIN() { return 1; }
5251
fi
5252
#endif
5252
5253
int
5253
5254
main ()
5254
if test -z "$ac_cv_prog_RANLIB"; then
5255
{
5255
if test -n "$ac_tool_prefix"; then
5256
_Psigwait ();
5256
  # Extract the first word of "ranlib", so it can be a program name with args.
5257
  ;
5257
set dummy ranlib; ac_word=$2
5258
  return 0;
5258
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5259
}
5259
echo "configure:5260: checking for $ac_word" >&5
5260
_ACEOF
5260
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
5261
rm -f conftest.$ac_objext conftest$ac_exeext
5261
  echo $ac_n "(cached) $ac_c" 1>&6
5262
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5262
else
5263
  (eval $ac_link) 2>&5
5263
  if test -n "$RANLIB"; then
5264
  ac_status=$?
5264
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
5265
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5265
else
5266
  (exit $ac_status); } &&
5266
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
5267
         { ac_try='test -s conftest$ac_exeext'
5267
  ac_dummy="$PATH"
5268
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5268
  for ac_dir in $ac_dummy; do
5269
  (eval $ac_try) 2>&5
5269
    test -z "$ac_dir" && ac_dir=.
5270
  ac_status=$?
5270
    if test -f $ac_dir/$ac_word; then
5271
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5271
      ac_cv_prog_RANLIB="ranlib"
5272
  (exit $ac_status); }; }; then
5272
      break
5273
  ac_cv_lib_pthread__Psigwait=yes
5273
    fi
5274
else
5274
  done
5275
  echo "$as_me: failed program was:" >&5
5275
  IFS="$ac_save_ifs"
5276
cat conftest.$ac_ext >&5
5276
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
5277
ac_cv_lib_pthread__Psigwait=no
5277
fi
5278
fi
5278
fi
5279
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5279
RANLIB="$ac_cv_prog_RANLIB"
5280
LIBS=$ac_check_lib_save_LIBS
5280
if test -n "$RANLIB"; then
5281
fi
5281
  echo "$ac_t""$RANLIB" 1>&6
5282
echo "$as_me:$LINENO: result: $ac_cv_lib_pthread__Psigwait" >&5
5282
else
5283
echo "${ECHO_T}$ac_cv_lib_pthread__Psigwait" >&6
5283
  echo "$ac_t""no" 1>&6
5284
if test $ac_cv_lib_pthread__Psigwait = yes; then
5284
fi
5285
  cat >>confdefs.h <<\_ACEOF
5285
5286
#define HAVE_SIGWAIT 1
5286
else
5287
_ACEOF
5287
  RANLIB=":"
5288
5288
fi
5289
fi
5289
fi
5290
5290
5291
fi
5291
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
5292
5292
set dummy ${ac_tool_prefix}strip; ac_word=$2
5293
5293
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5294
fi
5294
echo "configure:5295: checking for $ac_word" >&5
5295
5295
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
5296
5296
  echo $ac_n "(cached) $ac_c" 1>&6
5297
	echo "$as_me:$LINENO: checking for pthread_attr_getstacksize" >&5
5297
else
5298
echo $ECHO_N "checking for pthread_attr_getstacksize... $ECHO_C" >&6
5298
  if test -n "$STRIP"; then
5299
if test "${ac_cv_func_pthread_attr_getstacksize+set}" = set; then
5299
  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
5300
  echo $ECHO_N "(cached) $ECHO_C" >&6
5300
else
5301
else
5301
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
5302
  cat >conftest.$ac_ext <<_ACEOF
5302
  ac_dummy="$PATH"
5303
#line $LINENO "configure"
5303
  for ac_dir in $ac_dummy; do
5304
#include "confdefs.h"
5304
    test -z "$ac_dir" && ac_dir=.
5305
/* From autoconf 2.57 */
5305
    if test -f $ac_dir/$ac_word; then
5306
/* Define pthread_attr_getstacksize to an innocuous variant, in case <limits.h> declares pthread_attr_getstacksize.
5306
      ac_cv_prog_STRIP="${ac_tool_prefix}strip"
5307
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
5307
      break
5308
#define pthread_attr_getstacksize innocuous_pthread_attr_getstacksize
5308
    fi
5309
5309
  done
5310
/* System header to define __stub macros and hopefully few prototypes,
5310
  IFS="$ac_save_ifs"
5311
    which can conflict with char pthread_attr_getstacksize (); below.
5311
fi
5312
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5312
fi
5313
    <limits.h> exists even on freestanding compilers.  */
5313
STRIP="$ac_cv_prog_STRIP"
5314
5314
if test -n "$STRIP"; then
5315
#ifdef __STDC__
5315
  echo "$ac_t""$STRIP" 1>&6
5316
# include <limits.h>
5316
else
5317
#else
5317
  echo "$ac_t""no" 1>&6
5318
# include <assert.h>
5318
fi
5319
#endif
5319
5320
5320
5321
#undef pthread_attr_getstacksize
5321
if test -z "$ac_cv_prog_STRIP"; then
5322
5322
if test -n "$ac_tool_prefix"; then
5323
/* Override any gcc2 internal prototype to avoid an error.  */
5323
  # Extract the first word of "strip", so it can be a program name with args.
5324
#ifdef __cplusplus
5324
set dummy strip; ac_word=$2
5325
extern "C"
5325
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5326
{
5326
echo "configure:5327: checking for $ac_word" >&5
5327
#endif
5327
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
5328
/* We use char because int might match the return type of a gcc2
5328
  echo $ac_n "(cached) $ac_c" 1>&6
5329
   builtin and then its argument prototype would still apply.  */
5329
else
5330
char pthread_attr_getstacksize ();
5330
  if test -n "$STRIP"; then
5331
/* The GNU C library defines this for functions which it implements
5331
  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
5332
    to always fail with ENOSYS.  Some functions are actually named
5332
else
5333
    something starting with __ and the normal name is an alias.  */
5333
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
5334
#if defined (__stub_pthread_attr_getstacksize) || defined (__stub___pthread_attr_getstacksize)
5334
  ac_dummy="$PATH"
5335
choke me
5335
  for ac_dir in $ac_dummy; do
5336
#else
5336
    test -z "$ac_dir" && ac_dir=.
5337
char (*f) () = pthread_attr_getstacksize;
5337
    if test -f $ac_dir/$ac_word; then
5338
#endif
5338
      ac_cv_prog_STRIP="strip"
5339
#ifdef __cplusplus
5339
      break
5340
}
5340
    fi
5341
#endif
5341
  done
5342
5342
  IFS="$ac_save_ifs"
5343
#ifdef F77_DUMMY_MAIN
5343
  test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
5344
#  ifdef __cplusplus
5344
fi
5345
     extern "C"
5345
fi
5346
#  endif
5346
STRIP="$ac_cv_prog_STRIP"
5347
   int F77_DUMMY_MAIN() { return 1; }
5347
if test -n "$STRIP"; then
5348
#endif
5348
  echo "$ac_t""$STRIP" 1>&6
5349
int
5349
else
5350
main ()
5350
  echo "$ac_t""no" 1>&6
5351
{
5351
fi
5352
return f != pthread_attr_getstacksize;
5352
5353
  ;
5353
else
5354
  return 0;
5354
  STRIP=":"
5355
}
5355
fi
5356
_ACEOF
5356
fi
5357
rm -f conftest.$ac_objext conftest$ac_exeext
5357
5358
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5358
5359
  (eval $ac_link) 2>&5
5359
enable_dlopen=no
5360
  ac_status=$?
5360
enable_win32_dll=no
5361
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5361
5362
  (exit $ac_status); } &&
5362
# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
5363
         { ac_try='test -s conftest$ac_exeext'
5363
if test "${enable_libtool_lock+set}" = set; then
5364
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5364
  enableval="$enable_libtool_lock"
5365
  (eval $ac_try) 2>&5
5365
  :
5366
  ac_status=$?
5366
fi
5367
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5367
5368
  (exit $ac_status); }; }; then
5368
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
5369
  ac_cv_func_pthread_attr_getstacksize=yes
5369
5370
else
5370
# Some flags need to be propagated to the compiler or linker for good
5371
  echo "$as_me: failed program was:" >&5
5371
# libtool support.
5372
cat conftest.$ac_ext >&5
5372
case $host in
5373
ac_cv_func_pthread_attr_getstacksize=no
5373
*-*-irix6*)
5374
fi
5374
  # Find out which ABI we are using.
5375
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5375
  echo '#line 5376 "configure"' > conftest.$ac_ext
5376
fi
5376
  if { (eval echo configure:5377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5377
echo "$as_me:$LINENO: result: $ac_cv_func_pthread_attr_getstacksize" >&5
5377
    case `/usr/bin/file conftest.$ac_objext` in
5378
echo "${ECHO_T}$ac_cv_func_pthread_attr_getstacksize" >&6
5378
    *32-bit*)
5379
if test $ac_cv_func_pthread_attr_getstacksize = yes; then
5379
      LD="${LD-ld} -32"
5380
  cat >>confdefs.h <<\_ACEOF
5380
      ;;
5381
#define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
5381
    *N32*)
5382
_ACEOF
5382
      LD="${LD-ld} -n32"
5383
5383
      ;;
5384
fi
5384
    *64-bit*)
5385
5385
      LD="${LD-ld} -64"
5386
5386
      ;;
5387
	#
5387
    esac
5388
	# Additional OS-specific issues related to pthreads and sigwait.
5388
  fi
5389
	#
5389
  rm -rf conftest*
5390
	case "$host" in
5390
  ;;
5391
		#
5391
5392
		# One more place to look for sigwait.
5392
*-*-sco3.2v5*)
5393
		#
5393
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
5394
		*-freebsd*)
5394
  SAVE_CFLAGS="$CFLAGS"
5395
			echo "$as_me:$LINENO: checking for sigwait in -lc_r" >&5
5395
  CFLAGS="$CFLAGS -belf"
5396
echo $ECHO_N "checking for sigwait in -lc_r... $ECHO_C" >&6
5396
  echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
5397
if test "${ac_cv_lib_c_r_sigwait+set}" = set; then
5397
echo "configure:5398: checking whether the C compiler needs -belf" >&5
5398
  echo $ECHO_N "(cached) $ECHO_C" >&6
5398
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
5399
else
5399
  echo $ac_n "(cached) $ac_c" 1>&6
5400
  ac_check_lib_save_LIBS=$LIBS
5400
else
5401
LIBS="-lc_r  $LIBS"
5401
  
5402
cat >conftest.$ac_ext <<_ACEOF
5402
     ac_ext=c
5403
#line $LINENO "configure"
5403
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
5404
#include "confdefs.h"
5404
ac_cpp='$CPP $CPPFLAGS'
5405
5405
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
5406
/* Override any gcc2 internal prototype to avoid an error.  */
5406
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
5407
#ifdef __cplusplus
5407
cross_compiling=$ac_cv_prog_cc_cross
5408
extern "C"
5408
5409
#endif
5409
     cat > conftest.$ac_ext <<EOF
5410
/* We use char because int might match the return type of a gcc2
5410
#line 5411 "configure"
5411
   builtin and then its argument prototype would still apply.  */
5411
#include "confdefs.h"
5412
char sigwait ();
5412
5413
#ifdef F77_DUMMY_MAIN
5413
int main() {
5414
#  ifdef __cplusplus
5414
5415
     extern "C"
5415
; return 0; }
5416
#  endif
5416
EOF
5417
   int F77_DUMMY_MAIN() { return 1; }
5417
if { (eval echo configure:5418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5418
#endif
5418
  rm -rf conftest*
5419
int
5419
  lt_cv_cc_needs_belf=yes
5420
main ()
5420
else
5421
{
5421
  echo "configure: failed program was:" >&5
5422
sigwait ();
5422
  cat conftest.$ac_ext >&5
5423
  ;
5423
  rm -rf conftest*
5424
  return 0;
5424
  lt_cv_cc_needs_belf=no
5425
}
5425
fi
5426
_ACEOF
5426
rm -f conftest*
5427
rm -f conftest.$ac_objext conftest$ac_exeext
5427
     ac_ext=c
5428
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5428
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
5429
  (eval $ac_link) 2>&5
5429
ac_cpp='$CPP $CPPFLAGS'
5430
  ac_status=$?
5430
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
5431
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5431
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
5432
  (exit $ac_status); } &&
5432
cross_compiling=$ac_cv_prog_cc_cross
5433
         { ac_try='test -s conftest$ac_exeext'
5433
5434
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5434
fi
5435
  (eval $ac_try) 2>&5
5435
5436
  ac_status=$?
5436
echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
5437
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5437
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
5438
  (exit $ac_status); }; }; then
5438
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
5439
  ac_cv_lib_c_r_sigwait=yes
5439
    CFLAGS="$SAVE_CFLAGS"
5440
else
5440
  fi
5441
  echo "$as_me: failed program was:" >&5
5441
  ;;
5442
cat conftest.$ac_ext >&5
5442
5443
ac_cv_lib_c_r_sigwait=no
5443
5444
fi
5444
esac
5445
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5445
5446
LIBS=$ac_check_lib_save_LIBS
5446
# Sed substitution that helps us do robust quoting.  It backslashifies
5447
fi
5447
# metacharacters that are still active within double-quoted strings.
5448
echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_sigwait" >&5
5448
Xsed='sed -e s/^X//'
5449
echo "${ECHO_T}$ac_cv_lib_c_r_sigwait" >&6
5449
sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
5450
if test $ac_cv_lib_c_r_sigwait = yes; then
5450
5451
  cat >>confdefs.h <<\_ACEOF
5451
# Same as above, but do not quote variable references.
5452
#define HAVE_SIGWAIT 1
5452
double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
5453
_ACEOF
5453
5454
5454
# Sed substitution to delay expansion of an escaped shell variable in a
5455
fi
5455
# double_quote_subst'ed string.
5456
5456
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
5457
			;;
5457
5458
		#
5458
# Constants:
5459
		# BSDI 3.0 through 4.0.1 needs pthread_init() to be
5459
rm="rm -f"
5460
		# called before certain pthreads calls.	 This is deprecated
5460
5461
		# in BSD/OS 4.1.
5461
# Global variables:
5462
		#
5462
default_ofile=libtool
5463
		*-bsdi3.*|*-bsdi4.0*)
5463
can_build_shared=yes
5464
			cat >>confdefs.h <<\_ACEOF
5464
5465
#define NEED_PTHREAD_INIT 1
5465
# All known linkers require a `.a' archive for static linking (except M$VC,
5466
_ACEOF
5466
# which needs '.lib').
5467
5467
libext=a
5468
			;;
5468
ltmain="$ac_aux_dir/ltmain.sh"
5469
		#
5469
ofile="$default_ofile"
5470
		# LinuxThreads requires some changes to the way we
5470
with_gnu_ld="$lt_cv_prog_gnu_ld"
5471
		# deal with signals.
5471
need_locks="$enable_libtool_lock"
5472
		#
5472
5473
		*-linux*)
5473
old_CC="$CC"
5474
			cat >>confdefs.h <<\_ACEOF
5474
old_CFLAGS="$CFLAGS"
5475
#define HAVE_LINUXTHREADS 1
5475
5476
_ACEOF
5476
# Set sane defaults for various variables
5477
5477
test -z "$AR" && AR=ar
5478
			;;
5478
test -z "$AR_FLAGS" && AR_FLAGS=cru
5479
		#
5479
test -z "$AS" && AS=as
5480
		# Ensure the right sigwait() semantics on Solaris and make
5480
test -z "$CC" && CC=cc
5481
		# sure we call pthread_setconcurrency.
5481
test -z "$DLLTOOL" && DLLTOOL=dlltool
5482
		#
5482
test -z "$LD" && LD=ld
5483
		*-solaris*)
5483
test -z "$LN_S" && LN_S="ln -s"
5484
			cat >>confdefs.h <<\_ACEOF
5484
test -z "$MAGIC_CMD" && MAGIC_CMD=file
5485
#define _POSIX_PTHREAD_SEMANTICS 1
5485
test -z "$NM" && NM=nm
5486
_ACEOF
5486
test -z "$OBJDUMP" && OBJDUMP=objdump
5487
5487
test -z "$RANLIB" && RANLIB=:
5488
			echo "$as_me:$LINENO: checking for pthread_setconcurrency" >&5
5488
test -z "$STRIP" && STRIP=:
5489
echo $ECHO_N "checking for pthread_setconcurrency... $ECHO_C" >&6
5489
test -z "$ac_objext" && ac_objext=o
5490
if test "${ac_cv_func_pthread_setconcurrency+set}" = set; then
5490
5491
  echo $ECHO_N "(cached) $ECHO_C" >&6
5491
if test x"$host" != x"$build"; then
5492
else
5492
  ac_tool_prefix=${host_alias}-
5493
  cat >conftest.$ac_ext <<_ACEOF
5493
else
5494
#line $LINENO "configure"
5494
  ac_tool_prefix=
5495
#include "confdefs.h"
5495
fi
5496
/* From autoconf 2.57 */
5496
5497
/* Define pthread_setconcurrency to an innocuous variant, in case <limits.h> declares pthread_setconcurrency.
5497
# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
5498
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
5498
case $host_os in
5499
#define pthread_setconcurrency innocuous_pthread_setconcurrency
5499
linux-gnu*) ;;
5500
5500
linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
5501
/* System header to define __stub macros and hopefully few prototypes,
5501
esac
5502
    which can conflict with char pthread_setconcurrency (); below.
5502
5503
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5503
case $host_os in
5504
    <limits.h> exists even on freestanding compilers.  */
5504
aix3*)
5505
5505
  # AIX sometimes has problems with the GCC collect2 program.  For some
5506
#ifdef __STDC__
5506
  # reason, if we set the COLLECT_NAMES environment variable, the problems
5507
# include <limits.h>
5507
  # vanish in a puff of smoke.
5508
#else
5508
  if test "X${COLLECT_NAMES+set}" != Xset; then
5509
# include <assert.h>
5509
    COLLECT_NAMES=
5510
#endif
5510
    export COLLECT_NAMES
5511
5511
  fi
5512
#undef pthread_setconcurrency
5512
  ;;
5513
5513
esac
5514
/* Override any gcc2 internal prototype to avoid an error.  */
5514
5515
#ifdef __cplusplus
5515
# Determine commands to create old-style static archives.
5516
extern "C"
5516
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
5517
{
5517
old_postinstall_cmds='chmod 644 $oldlib'
5518
#endif
5518
old_postuninstall_cmds=
5519
/* We use char because int might match the return type of a gcc2
5519
5520
   builtin and then its argument prototype would still apply.  */
5520
if test -n "$RANLIB"; then
5521
char pthread_setconcurrency ();
5521
  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
5522
/* The GNU C library defines this for functions which it implements
5522
  old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
5523
    to always fail with ENOSYS.  Some functions are actually named
5523
fi
5524
    something starting with __ and the normal name is an alias.  */
5524
5525
#if defined (__stub_pthread_setconcurrency) || defined (__stub___pthread_setconcurrency)
5525
# Allow CC to be a program name with arguments.
5526
choke me
5526
set dummy $CC
5527
#else
5527
compiler="$2"
5528
char (*f) () = pthread_setconcurrency;
5528
5529
#endif
5529
## FIXME: this should be a separate macro
5530
#ifdef __cplusplus
5530
##
5531
}
5531
echo $ac_n "checking for objdir""... $ac_c" 1>&6
5532
#endif
5532
echo "configure:5533: checking for objdir" >&5
5533
5533
rm -f .libs 2>/dev/null
5534
#ifdef F77_DUMMY_MAIN
5534
mkdir .libs 2>/dev/null
5535
#  ifdef __cplusplus
5535
if test -d .libs; then
5536
     extern "C"
5536
  objdir=.libs
5537
#  endif
5537
else
5538
   int F77_DUMMY_MAIN() { return 1; }
5538
  # MS-DOS does not allow filenames that begin with a dot.
5539
#endif
5539
  objdir=_libs
5540
int
5540
fi
5541
main ()
5541
rmdir .libs 2>/dev/null
5542
{
5542
echo "$ac_t""$objdir" 1>&6
5543
return f != pthread_setconcurrency;
5543
##
5544
  ;
5544
## END FIXME
5545
  return 0;
5545
5546
}
5546
5547
_ACEOF
5547
## FIXME: this should be a separate macro
5548
rm -f conftest.$ac_objext conftest$ac_exeext
5548
##
5549
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5549
# Check whether --with-pic or --without-pic was given.
5550
  (eval $ac_link) 2>&5
5550
if test "${with_pic+set}" = set; then
5551
  ac_status=$?
5551
  withval="$with_pic"
5552
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5552
  pic_mode="$withval"
5553
  (exit $ac_status); } &&
5553
else
5554
         { ac_try='test -s conftest$ac_exeext'
5554
  pic_mode=default
5555
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5555
fi
5556
  (eval $ac_try) 2>&5
5556
5557
  ac_status=$?
5557
test -z "$pic_mode" && pic_mode=default
5558
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5558
5559
  (exit $ac_status); }; }; then
5559
# We assume here that the value for lt_cv_prog_cc_pic will not be cached
5560
  ac_cv_func_pthread_setconcurrency=yes
5560
# in isolation, and that seeing it set (from the cache) indicates that
5561
else
5561
# the associated values are set (in the cache) correctly too.
5562
  echo "$as_me: failed program was:" >&5
5562
echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
5563
cat conftest.$ac_ext >&5
5563
echo "configure:5564: checking for $compiler option to produce PIC" >&5
5564
ac_cv_func_pthread_setconcurrency=no
5564
if eval "test \"`echo '$''{'lt_cv_prog_cc_pic'+set}'`\" = set"; then
5565
fi
5565
  echo $ac_n "(cached) $ac_c" 1>&6
5566
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5566
else
5567
fi
5567
   lt_cv_prog_cc_pic=
5568
echo "$as_me:$LINENO: result: $ac_cv_func_pthread_setconcurrency" >&5
5568
  lt_cv_prog_cc_shlib=
5569
echo "${ECHO_T}$ac_cv_func_pthread_setconcurrency" >&6
5569
  lt_cv_prog_cc_wl=
5570
if test $ac_cv_func_pthread_setconcurrency = yes; then
5570
  lt_cv_prog_cc_static=
5571
  cat >>confdefs.h <<\_ACEOF
5571
  lt_cv_prog_cc_no_builtin=
5572
#define CALL_PTHREAD_SETCONCURRENCY 1
5572
  lt_cv_prog_cc_can_build_shared=$can_build_shared
5573
_ACEOF
5573
5574
5574
  if test "$GCC" = yes; then
5575
fi
5575
    lt_cv_prog_cc_wl='-Wl,'
5576
5576
    lt_cv_prog_cc_static='-static'
5577
			;;
5577
5578
		#
5578
    case $host_os in
5579
		# UnixWare does things its own way.
5579
    aix*)
5580
		#
5580
      # Below there is a dirty hack to force normal static linking with -ldl
5581
		*-sco-sysv*uw*)
5581
      # The problem is because libdl dynamically linked with both libc and
5582
			cat >>confdefs.h <<\_ACEOF
5582
      # libC (AIX C++ library), which obviously doesn't included in libraries
5583
#define HAVE_UNIXWARE_SIGWAIT 1
5583
      # list by gcc. This cause undefined symbols with -static flags.
5584
_ACEOF
5584
      # This hack allows C programs to be linked with "-static -ldl", but
5585
5585
      # we not sure about C++ programs.
5586
			;;
5586
      lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
5587
	esac
5587
      ;;
5588
5588
    amigaos*)
5589
	#
5589
      # FIXME: we need at least 68020 code to build shared libraries, but
5590
	# Look for sysconf to allow detection of the number of processors.
5590
      # adding the `-m68020' flag to GCC prevents building anything better,
5591
	#
5591
      # like `-m68040'.
5592
	echo "$as_me:$LINENO: checking for sysconf" >&5
5592
      lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
5593
echo $ECHO_N "checking for sysconf... $ECHO_C" >&6
5593
      ;;
5594
if test "${ac_cv_func_sysconf+set}" = set; then
5594
    beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
5595
  echo $ECHO_N "(cached) $ECHO_C" >&6
5595
      # PIC is the default for these OSes.
5596
else
5596
      ;;
5597
  cat >conftest.$ac_ext <<_ACEOF
5597
    darwin* | rhapsody*)
5598
#line $LINENO "configure"
5598
      # PIC is the default on this platform
5599
#include "confdefs.h"
5599
      # Common symbols not allowed in MH_DYLIB files
5600
/* From autoconf 2.57 */
5600
      lt_cv_prog_cc_pic='-fno-common'
5601
/* Define sysconf to an innocuous variant, in case <limits.h> declares sysconf.
5601
      ;;
5602
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
5602
    cygwin* | mingw* | pw32* | os2*)
5603
#define sysconf innocuous_sysconf
5603
      # This hack is so that the source file can tell whether it is being
5604
5604
      # built for inclusion in a dll (and should export symbols for example).
5605
/* System header to define __stub macros and hopefully few prototypes,
5605
      lt_cv_prog_cc_pic='-DDLL_EXPORT'
5606
    which can conflict with char sysconf (); below.
5606
      ;;
5607
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5607
    sysv4*MP*)
5608
    <limits.h> exists even on freestanding compilers.  */
5608
      if test -d /usr/nec; then
5609
5609
	 lt_cv_prog_cc_pic=-Kconform_pic
5610
#ifdef __STDC__
5610
      fi
5611
# include <limits.h>
5611
      ;;
5612
#else
5612
    *)
5613
# include <assert.h>
5613
      lt_cv_prog_cc_pic='-fPIC'
5614
#endif
5614
      ;;
5615
5615
    esac
5616
#undef sysconf
5616
  else
5617
5617
    # PORTME Check for PIC flags for the system compiler.
5618
/* Override any gcc2 internal prototype to avoid an error.  */
5618
    case $host_os in
5619
#ifdef __cplusplus
5619
    aix3* | aix4* | aix5*)
5620
extern "C"
5620
      # All AIX code is PIC.
5621
{
5621
      if test "$host_cpu" = ia64; then
5622
#endif
5622
        # AIX 5 now supports IA64 processor
5623
/* We use char because int might match the return type of a gcc2
5623
        lt_cv_prog_cc_static='-Bstatic'
5624
   builtin and then its argument prototype would still apply.  */
5624
        lt_cv_prog_cc_wl='-Wl,'
5625
char sysconf ();
5625
      else
5626
/* The GNU C library defines this for functions which it implements
5626
        lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
5627
    to always fail with ENOSYS.  Some functions are actually named
5627
      fi
5628
    something starting with __ and the normal name is an alias.  */
5628
      ;;
5629
#if defined (__stub_sysconf) || defined (__stub___sysconf)
5629
5630
choke me
5630
    hpux9* | hpux10* | hpux11*)
5631
#else
5631
      # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
5632
char (*f) () = sysconf;
5632
      lt_cv_prog_cc_wl='-Wl,'
5633
#endif
5633
      lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
5634
#ifdef __cplusplus
5634
      lt_cv_prog_cc_pic='+Z'
5635
}
5635
      ;;
5636
#endif
5636
5637
5637
    irix5* | irix6*)
5638
#ifdef F77_DUMMY_MAIN
5638
      lt_cv_prog_cc_wl='-Wl,'
5639
#  ifdef __cplusplus
5639
      lt_cv_prog_cc_static='-non_shared'
5640
     extern "C"
5640
      # PIC (with -KPIC) is the default.
5641
#  endif
5641
      ;;
5642
   int F77_DUMMY_MAIN() { return 1; }
5642
5643
#endif
5643
    cygwin* | mingw* | pw32* | os2*)
5644
int
5644
      # This hack is so that the source file can tell whether it is being
5645
main ()
5645
      # built for inclusion in a dll (and should export symbols for example).
5646
{
5646
      lt_cv_prog_cc_pic='-DDLL_EXPORT'
5647
return f != sysconf;
5647
      ;;
5648
  ;
5648
5649
  return 0;
5649
    newsos6)
5650
}
5650
      lt_cv_prog_cc_pic='-KPIC'
5651
_ACEOF
5651
      lt_cv_prog_cc_static='-Bstatic'
5652
rm -f conftest.$ac_objext conftest$ac_exeext
5652
      ;;
5653
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5653
5654
  (eval $ac_link) 2>&5
5654
    osf3* | osf4* | osf5*)
5655
  ac_status=$?
5655
      # All OSF/1 code is PIC.
5656
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5656
      lt_cv_prog_cc_wl='-Wl,'
5657
  (exit $ac_status); } &&
5657
      lt_cv_prog_cc_static='-non_shared'
5658
         { ac_try='test -s conftest$ac_exeext'
5658
      ;;
5659
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5659
5660
  (eval $ac_try) 2>&5
5660
    sco3.2v5*)
5661
  ac_status=$?
5661
      lt_cv_prog_cc_pic='-Kpic'
5662
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5662
      lt_cv_prog_cc_static='-dn'
5663
  (exit $ac_status); }; }; then
5663
      lt_cv_prog_cc_shlib='-belf'
5664
  ac_cv_func_sysconf=yes
5664
      ;;
5665
else
5665
5666
  echo "$as_me: failed program was:" >&5
5666
    solaris*)
5667
cat conftest.$ac_ext >&5
5667
      lt_cv_prog_cc_pic='-KPIC'
5668
ac_cv_func_sysconf=no
5668
      lt_cv_prog_cc_static='-Bstatic'
5669
fi
5669
      lt_cv_prog_cc_wl='-Wl,'
5670
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5670
      ;;
5671
fi
5671
5672
echo "$as_me:$LINENO: result: $ac_cv_func_sysconf" >&5
5672
    sunos4*)
5673
echo "${ECHO_T}$ac_cv_func_sysconf" >&6
5673
      lt_cv_prog_cc_pic='-PIC'
5674
if test $ac_cv_func_sysconf = yes; then
5674
      lt_cv_prog_cc_static='-Bstatic'
5675
  cat >>confdefs.h <<\_ACEOF
5675
      lt_cv_prog_cc_wl='-Qoption ld '
5676
#define HAVE_SYSCONF 1
5676
      ;;
5677
_ACEOF
5677
5678
5678
    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5679
fi
5679
      lt_cv_prog_cc_pic='-KPIC'
5680
5680
      lt_cv_prog_cc_static='-Bstatic'
5681
5681
      if test "x$host_vendor" = xsni; then
5682
	if test "X$GCC" = "Xyes"; then
5682
        lt_cv_prog_cc_wl='-LD'
5683
		case "$host" in
5683
      else
5684
		*-freebsd*)
5684
        lt_cv_prog_cc_wl='-Wl,'
5685
			CC="$CC -pthread"
5685
      fi
5686
			CCOPT="$CCOPT -pthread"
5686
      ;;
5687
			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
5687
5688
			;;
5688
    uts4*)
5689
		*-openbsd*)
5689
      lt_cv_prog_cc_pic='-pic'
5690
			CC="$CC -pthread"
5690
      lt_cv_prog_cc_static='-Bstatic'
5691
			CCOPT="$CCOPT -pthread"
5691
      ;;
5692
			;;
5692
5693
		*-solaris*)
5693
    sysv4*MP*)
5694
			LIBS="$LIBS -lthread"
5694
      if test -d /usr/nec ;then
5695
			;;
5695
	lt_cv_prog_cc_pic='-Kconform_pic'
5696
		*-ibm-aix*)
5696
	lt_cv_prog_cc_static='-Bstatic'
5697
			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
5697
      fi
5698
			;;
5698
      ;;
5699
		esac
5699
5700
	else
5700
    *)
5701
		case $host in
5701
      lt_cv_prog_cc_can_build_shared=no
5702
		*-dec-osf*)
5702
      ;;
5703
			CC="$CC -pthread"
5703
    esac
5704
			CCOPT="$CCOPT -pthread"
5704
  fi
5705
			;;
5705
5706
		*-solaris*)
5706
fi
5707
			CC="$CC -mt"
5707
5708
			CCOPT="$CCOPT -mt"
5708
if test -z "$lt_cv_prog_cc_pic"; then
5709
			;;
5709
  echo "$ac_t""none" 1>&6
5710
		*-ibm-aix*)
5710
else
5711
			STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
5711
  echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6
5712
			;;
5712
5713
		*-sco-sysv*uw*)
5713
  # Check to make sure the pic_flag actually works.
5714
			CC="$CC -Kthread"
5714
  echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
5715
			CCOPT="$CCOPT -Kthread"
5715
echo "configure:5716: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
5716
			;;
5716
  if eval "test \"`echo '$''{'lt_cv_prog_cc_pic_works'+set}'`\" = set"; then
5717
		esac
5717
  echo $ac_n "(cached) $ac_c" 1>&6
5718
	fi
5718
else
5719
	ALWAYS_DEFINES="-D_REENTRANT"
5719
      save_CFLAGS="$CFLAGS"
5720
	ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
5720
    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
5721
	thread_dir=pthreads
5721
    cat > conftest.$ac_ext <<EOF
5722
else
5722
#line 5723 "configure"
5723
	ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
5723
#include "confdefs.h"
5724
	thread_dir=nothreads
5724
5725
	ALWAYS_DEFINES=""
5725
int main() {
5726
fi
5726
5727
5727
; return 0; }
5728
5728
EOF
5729
5729
if { (eval echo configure:5730: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5730
5730
  rm -rf conftest*
5731
ISC_THREAD_DIR=$thread_dir
5731
        case $host_os in
5732
5732
      hpux9* | hpux10* | hpux11*)
5733
5733
	# On HP-UX, both CC and GCC only warn that PIC is supported... then
5734
#
5734
	# they create non-PIC objects.  So, if there were any warnings, we
5735
# flockfile is usually provided by pthreads, but we may want to use it
5735
	# assume that PIC is not supported.
5736
# even if compiled with --disable-threads.  getc_unlocked might also not
5736
	if test -s conftest.err; then
5737
# be defined.
5737
	  lt_cv_prog_cc_pic_works=no
5738
#
5738
	else
5739
echo "$as_me:$LINENO: checking for flockfile" >&5
5739
	  lt_cv_prog_cc_pic_works=yes
5740
echo $ECHO_N "checking for flockfile... $ECHO_C" >&6
5740
	fi
5741
if test "${ac_cv_func_flockfile+set}" = set; then
5741
	;;
5742
  echo $ECHO_N "(cached) $ECHO_C" >&6
5742
      *)
5743
else
5743
	lt_cv_prog_cc_pic_works=yes
5744
  cat >conftest.$ac_ext <<_ACEOF
5744
	;;
5745
#line $LINENO "configure"
5745
      esac
5746
#include "confdefs.h"
5746
    
5747
/* From autoconf 2.57 */
5747
else
5748
/* Define flockfile to an innocuous variant, in case <limits.h> declares flockfile.
5748
  echo "configure: failed program was:" >&5
5749
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
5749
  cat conftest.$ac_ext >&5
5750
#define flockfile innocuous_flockfile
5750
  rm -rf conftest*
5751
5751
        lt_cv_prog_cc_pic_works=no
5752
/* System header to define __stub macros and hopefully few prototypes,
5752
    
5753
    which can conflict with char flockfile (); below.
5753
fi
5754
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5754
rm -f conftest*
5755
    <limits.h> exists even on freestanding compilers.  */
5755
    CFLAGS="$save_CFLAGS"
5756
5756
  
5757
#ifdef __STDC__
5757
fi
5758
# include <limits.h>
5758
5759
#else
5759
5760
# include <assert.h>
5760
  if test "X$lt_cv_prog_cc_pic_works" = Xno; then
5761
#endif
5761
    lt_cv_prog_cc_pic=
5762
5762
    lt_cv_prog_cc_can_build_shared=no
5763
#undef flockfile
5763
  else
5764
5764
    lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
5765
/* Override any gcc2 internal prototype to avoid an error.  */
5765
  fi
5766
#ifdef __cplusplus
5766
5767
extern "C"
5767
  echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
5768
{
5768
fi
5769
#endif
5769
##
5770
/* We use char because int might match the return type of a gcc2
5770
## END FIXME
5771
   builtin and then its argument prototype would still apply.  */
5771
5772
char flockfile ();
5772
# Check for any special shared library compilation flags.
5773
/* The GNU C library defines this for functions which it implements
5773
if test -n "$lt_cv_prog_cc_shlib"; then
5774
    to always fail with ENOSYS.  Some functions are actually named
5774
  echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
5775
    something starting with __ and the normal name is an alias.  */
5775
  if echo "$old_CC $old_CFLAGS " | egrep -e "[ 	]$lt_cv_prog_cc_shlib[ 	]" >/dev/null; then :
5776
#if defined (__stub_flockfile) || defined (__stub___flockfile)
5776
  else
5777
choke me
5777
   echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
5778
#else
5778
    lt_cv_prog_cc_can_build_shared=no
5779
char (*f) () = flockfile;
5779
  fi
5780
#endif
5780
fi
5781
#ifdef __cplusplus
5781
5782
}
5782
## FIXME: this should be a separate macro
5783
#endif
5783
##
5784
5784
echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
5785
#ifdef F77_DUMMY_MAIN
5785
echo "configure:5786: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
5786
#  ifdef __cplusplus
5786
if eval "test \"`echo '$''{'lt_cv_prog_cc_static_works'+set}'`\" = set"; then
5787
     extern "C"
5787
  echo $ac_n "(cached) $ac_c" 1>&6
5788
#  endif
5788
else
5789
   int F77_DUMMY_MAIN() { return 1; }
5789
    lt_cv_prog_cc_static_works=no
5790
#endif
5790
  save_LDFLAGS="$LDFLAGS"
5791
int
5791
  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
5792
main ()
5792
  cat > conftest.$ac_ext <<EOF
5793
{
5793
#line 5794 "configure"
5794
return f != flockfile;
5794
#include "confdefs.h"
5795
  ;
5795
5796
  return 0;
5796
int main() {
5797
}
5797
5798
_ACEOF
5798
; return 0; }
5799
rm -f conftest.$ac_objext conftest$ac_exeext
5799
EOF
5800
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5800
if { (eval echo configure:5801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5801
  (eval $ac_link) 2>&5
5801
  rm -rf conftest*
5802
  ac_status=$?
5802
  lt_cv_prog_cc_static_works=yes
5803
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5803
else
5804
  (exit $ac_status); } &&
5804
  echo "configure: failed program was:" >&5
5805
         { ac_try='test -s conftest$ac_exeext'
5805
  cat conftest.$ac_ext >&5
5806
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5806
fi
5807
  (eval $ac_try) 2>&5
5807
rm -f conftest*
5808
  ac_status=$?
5808
  LDFLAGS="$save_LDFLAGS"
5809
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5809
5810
  (exit $ac_status); }; }; then
5810
fi
5811
  ac_cv_func_flockfile=yes
5811
5812
else
5812
5813
  echo "$as_me: failed program was:" >&5
5813
# Belt *and* braces to stop my trousers falling down:
5814
cat conftest.$ac_ext >&5
5814
test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
5815
ac_cv_func_flockfile=no
5815
echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6
5816
fi
5816
5817
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5817
pic_flag="$lt_cv_prog_cc_pic"
5818
fi
5818
special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
5819
echo "$as_me:$LINENO: result: $ac_cv_func_flockfile" >&5
5819
wl="$lt_cv_prog_cc_wl"
5820
echo "${ECHO_T}$ac_cv_func_flockfile" >&6
5820
link_static_flag="$lt_cv_prog_cc_static"
5821
if test $ac_cv_func_flockfile = yes; then
5821
no_builtin_flag="$lt_cv_prog_cc_no_builtin"
5822
  cat >>confdefs.h <<\_ACEOF
5822
can_build_shared="$lt_cv_prog_cc_can_build_shared"
5823
#define HAVE_FLOCKFILE 1
5823
##
5824
_ACEOF
5824
## END FIXME
5825
5825
5826
fi
5826
5827
5827
## FIXME: this should be a separate macro
5828
echo "$as_me:$LINENO: checking for getc_unlocked" >&5
5828
##
5829
echo $ECHO_N "checking for getc_unlocked... $ECHO_C" >&6
5829
# Check to see if options -o and -c are simultaneously supported by compiler
5830
if test "${ac_cv_func_getc_unlocked+set}" = set; then
5830
echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
5831
  echo $ECHO_N "(cached) $ECHO_C" >&6
5831
echo "configure:5832: checking if $compiler supports -c -o file.$ac_objext" >&5
5832
else
5832
if eval "test \"`echo '$''{'lt_cv_compiler_c_o'+set}'`\" = set"; then
5833
  cat >conftest.$ac_ext <<_ACEOF
5833
  echo $ac_n "(cached) $ac_c" 1>&6
5834
#line $LINENO "configure"
5834
else
5835
#include "confdefs.h"
5835
  
5836
/* From autoconf 2.57 */
5836
$rm -r conftest 2>/dev/null
5837
/* Define getc_unlocked to an innocuous variant, in case <limits.h> declares getc_unlocked.
5837
mkdir conftest
5838
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
5838
cd conftest
5839
#define getc_unlocked innocuous_getc_unlocked
5839
echo "int some_variable = 0;" > conftest.$ac_ext
5840
5840
mkdir out
5841
/* System header to define __stub macros and hopefully few prototypes,
5841
# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
5842
    which can conflict with char getc_unlocked (); below.
5842
# that will create temporary files in the current directory regardless of
5843
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5843
# the output directory.  Thus, making CWD read-only will cause this test
5844
    <limits.h> exists even on freestanding compilers.  */
5844
# to fail, enabling locking or at least warning the user not to do parallel
5845
5845
# builds.
5846
#ifdef __STDC__
5846
chmod -w .
5847
# include <limits.h>
5847
save_CFLAGS="$CFLAGS"
5848
#else
5848
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
5849
# include <assert.h>
5849
compiler_c_o=no
5850
#endif
5850
if { (eval echo configure:5851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
5851
5851
  # The compiler can only warn and ignore the option if not recognized
5852
#undef getc_unlocked
5852
  # So say no if there are warnings
5853
5853
  if test -s out/conftest.err; then
5854
/* Override any gcc2 internal prototype to avoid an error.  */
5854
    lt_cv_compiler_c_o=no
5855
#ifdef __cplusplus
5855
  else
5856
extern "C"
5856
    lt_cv_compiler_c_o=yes
5857
{
5857
  fi
5858
#endif
5858
else
5859
/* We use char because int might match the return type of a gcc2
5859
  # Append any errors to the config.log.
5860
   builtin and then its argument prototype would still apply.  */
5860
  cat out/conftest.err 1>&5
5861
char getc_unlocked ();
5861
  lt_cv_compiler_c_o=no
5862
/* The GNU C library defines this for functions which it implements
5862
fi
5863
    to always fail with ENOSYS.  Some functions are actually named
5863
CFLAGS="$save_CFLAGS"
5864
    something starting with __ and the normal name is an alias.  */
5864
chmod u+w .
5865
#if defined (__stub_getc_unlocked) || defined (__stub___getc_unlocked)
5865
$rm conftest* out/*
5866
choke me
5866
rmdir out
5867
#else
5867
cd ..
5868
char (*f) () = getc_unlocked;
5868
rmdir conftest
5869
#endif
5869
$rm -r conftest 2>/dev/null
5870
#ifdef __cplusplus
5870
5871
}
5871
fi
5872
#endif
5872
5873
5873
compiler_c_o=$lt_cv_compiler_c_o
5874
#ifdef F77_DUMMY_MAIN
5874
echo "$ac_t""$compiler_c_o" 1>&6
5875
#  ifdef __cplusplus
5875
5876
     extern "C"
5876
if test x"$compiler_c_o" = x"yes"; then
5877
#  endif
5877
  # Check to see if we can write to a .lo
5878
   int F77_DUMMY_MAIN() { return 1; }
5878
  echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
5879
#endif
5879
echo "configure:5880: checking if $compiler supports -c -o file.lo" >&5
5880
int
5880
  if eval "test \"`echo '$''{'lt_cv_compiler_o_lo'+set}'`\" = set"; then
5881
main ()
5881
  echo $ac_n "(cached) $ac_c" 1>&6
5882
{
5882
else
5883
return f != getc_unlocked;
5883
  
5884
  ;
5884
  lt_cv_compiler_o_lo=no
5885
  return 0;
5885
  save_CFLAGS="$CFLAGS"
5886
}
5886
  CFLAGS="$CFLAGS -c -o conftest.lo"
5887
_ACEOF
5887
  cat > conftest.$ac_ext <<EOF
5888
rm -f conftest.$ac_objext conftest$ac_exeext
5888
#line 5889 "configure"
5889
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5889
#include "confdefs.h"
5890
  (eval $ac_link) 2>&5
5890
5891
  ac_status=$?
5891
int main() {
5892
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5892
int some_variable = 0;
5893
  (exit $ac_status); } &&
5893
; return 0; }
5894
         { ac_try='test -s conftest$ac_exeext'
5894
EOF
5895
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5895
if { (eval echo configure:5896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5896
  (eval $ac_try) 2>&5
5896
  rm -rf conftest*
5897
  ac_status=$?
5897
      # The compiler can only warn and ignore the option if not recognized
5898
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
5898
    # So say no if there are warnings
5899
  (exit $ac_status); }; }; then
5899
    if test -s conftest.err; then
5900
  ac_cv_func_getc_unlocked=yes
5900
      lt_cv_compiler_o_lo=no
5901
else
5901
    else
5902
  echo "$as_me: failed program was:" >&5
5902
      lt_cv_compiler_o_lo=yes
5903
cat conftest.$ac_ext >&5
5903
    fi
5904
ac_cv_func_getc_unlocked=no
5904
  
5905
fi
5905
else
5906
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5906
  echo "configure: failed program was:" >&5
5907
fi
5907
  cat conftest.$ac_ext >&5
5908
echo "$as_me:$LINENO: result: $ac_cv_func_getc_unlocked" >&5
5908
fi
5909
echo "${ECHO_T}$ac_cv_func_getc_unlocked" >&6
5909
rm -f conftest*
5910
if test $ac_cv_func_getc_unlocked = yes; then
5910
  CFLAGS="$save_CFLAGS"
5911
  cat >>confdefs.h <<\_ACEOF
5911
  
5912
#define HAVE_GETCUNLOCKED 1
5912
fi
5913
_ACEOF
5913
5914
5914
  compiler_o_lo=$lt_cv_compiler_o_lo
5915
fi
5915
  echo "$ac_t""$compiler_c_lo" 1>&6
5916
5916
else
5917
5917
  compiler_o_lo=no
5918
#
5918
fi
5919
# Indicate what the final decision was regarding threads.
5919
##
5920
#
5920
## END FIXME
5921
echo "$as_me:$LINENO: checking whether to build with threads" >&5
5921
5922
echo $ECHO_N "checking whether to build with threads... $ECHO_C" >&6
5922
## FIXME: this should be a separate macro
5923
if $use_threads; then
5923
##
5924
	echo "$as_me:$LINENO: result: yes" >&5
5924
# Check to see if we can do hard links to lock some files if needed
5925
echo "${ECHO_T}yes" >&6
5925
hard_links="nottested"
5926
else
5926
if test "$compiler_c_o" = no && test "$need_locks" != no; then
5927
	echo "$as_me:$LINENO: result: no" >&5
5927
  # do not overwrite the value of need_locks provided by the user
5928
echo "${ECHO_T}no" >&6
5928
  echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
5929
fi
5929
echo "configure:5930: checking if we can lock with hard links" >&5
5930
5930
  hard_links=yes
5931
#
5931
  $rm conftest*
5932
# End of pthreads stuff.
5932
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
5933
#
5933
  touch conftest.a
5934
5934
  ln conftest.a conftest.b 2>&5 || hard_links=no
5935
#
5935
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
5936
# Additional compiler settings.
5936
  echo "$ac_t""$hard_links" 1>&6
5937
#
5937
  if test "$hard_links" = no; then
5938
MKDEPCC="$CC"
5938
    echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
5939
MKDEPCFLAGS="-M"
5939
    need_locks=warn
5940
IRIX_DNSSEC_WARNINGS_HACK=""
5940
  fi
5941
5941
else
5942
if test "X$GCC" = "Xyes"; then
5942
  need_locks=no
5943
	STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat"
5943
fi
5944
else
5944
##
5945
	case $host in
5945
## END FIXME
5946
	*-dec-osf*)
5946
5947
		CC="$CC -std"
5947
## FIXME: this should be a separate macro
5948
		CCOPT="$CCOPT -std"
5948
##
5949
		MKDEPCC="$CC"
5949
if test "$GCC" = yes; then
5950
		;;
5950
  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
5951
	*-hp-hpux*)
5951
  echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
5952
		CC="$CC -Ae -z"
5952
echo "configure:5953: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
5953
		# The version of the C compiler that constantly warns about
5953
  echo "int some_variable = 0;" > conftest.$ac_ext
5954
                # 'const' as well as alignment issues is unfortunately not
5954
  save_CFLAGS="$CFLAGS"
5955
                # able to be discerned via the version of the operating
5955
  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
5956
                # system, nor does cc have a version flag.
5956
  compiler_rtti_exceptions=no
5957
		case "`$CC +W 123 2>&1`" in
5957
  cat > conftest.$ac_ext <<EOF
5958
		*Unknown?option*)
5958
#line 5959 "configure"
5959
			STD_CWARNINGS="+w1"
5959
#include "confdefs.h"
5960
			;;
5960
5961
		*)
5961
int main() {
5962
			# Turn off the pointlessly noisy warnings.
5962
int some_variable = 0;
5963
			STD_CWARNINGS="+w1 +W 474,530"
5963
; return 0; }
5964
			;;
5964
EOF
5965
		esac
5965
if { (eval echo configure:5966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5966
		CCOPT="$CCOPT -Ae -z"
5966
  rm -rf conftest*
5967
		LIBS="-Wl,+vnocompatwarnings $LIBS"
5967
      # The compiler can only warn and ignore the option if not recognized
5968
		MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
5968
    # So say no if there are warnings
5969
		;;
5969
    if test -s conftest.err; then
5970
	*-sgi-irix*)
5970
      compiler_rtti_exceptions=no
5971
		STD_CWARNINGS="-fullwarn -woff 1209"
5971
    else
5972
		#
5972
      compiler_rtti_exceptions=yes
5973
		# Silence more than 250 instances of
5973
    fi
5974
		#   "prototyped function redeclared without prototype"
5974
  
5975
		# and 11 instances of
5975
else
5976
		#   "variable ... was set but never used"
5976
  echo "configure: failed program was:" >&5
5977
		# from lib/dns/sec/openssl.
5977
  cat conftest.$ac_ext >&5
5978
		#
5978
fi
5979
		IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
5979
rm -f conftest*
5980
		;;
5980
  CFLAGS="$save_CFLAGS"
5981
	*-solaris*)
5981
  echo "$ac_t""$compiler_rtti_exceptions" 1>&6
5982
		MKDEPCFLAGS="-xM"
5982
5983
		;;
5983
  if test "$compiler_rtti_exceptions" = "yes"; then
5984
	*-sco-sysv*uw*)
5984
    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
5985
                # UnixWare
5985
  else
5986
		CC="$CC -w"
5986
    no_builtin_flag=' -fno-builtin'
5987
		;;
5987
  fi
5988
	esac
5988
fi
5989
fi
5989
##
5990
5990
## END FIXME
5991
5991
5992
5992
## FIXME: this should be a separate macro
5993
5993
##
5994
5994
# See if the linker supports building shared libraries.
5995
5995
echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
5996
#
5996
echo "configure:5997: checking whether the linker ($LD) supports shared libraries" >&5
5997
# NLS
5997
5998
#
5998
allow_undefined_flag=
5999
echo "$as_me:$LINENO: checking for catgets" >&5
5999
no_undefined_flag=
6000
echo $ECHO_N "checking for catgets... $ECHO_C" >&6
6000
need_lib_prefix=unknown
6001
if test "${ac_cv_func_catgets+set}" = set; then
6001
need_version=unknown
6002
  echo $ECHO_N "(cached) $ECHO_C" >&6
6002
# when you set need_version to no, make sure it does not cause -set_version
6003
else
6003
# flags to be left without arguments
6004
  cat >conftest.$ac_ext <<_ACEOF
6004
archive_cmds=
6005
#line $LINENO "configure"
6005
archive_expsym_cmds=
6006
#include "confdefs.h"
6006
old_archive_from_new_cmds=
6007
/* From autoconf 2.57 */
6007
old_archive_from_expsyms_cmds=
6008
/* Define catgets to an innocuous variant, in case <limits.h> declares catgets.
6008
export_dynamic_flag_spec=
6009
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
6009
whole_archive_flag_spec=
6010
#define catgets innocuous_catgets
6010
thread_safe_flag_spec=
6011
6011
hardcode_into_libs=no
6012
/* System header to define __stub macros and hopefully few prototypes,
6012
hardcode_libdir_flag_spec=
6013
    which can conflict with char catgets (); below.
6013
hardcode_libdir_separator=
6014
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
6014
hardcode_direct=no
6015
    <limits.h> exists even on freestanding compilers.  */
6015
hardcode_minus_L=no
6016
6016
hardcode_shlibpath_var=unsupported
6017
#ifdef __STDC__
6017
runpath_var=
6018
# include <limits.h>
6018
link_all_deplibs=unknown
6019
#else
6019
always_export_symbols=no
6020
# include <assert.h>
6020
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
6021
#endif
6021
# include_expsyms should be a list of space-separated symbols to be *always*
6022
6022
# included in the symbol list
6023
#undef catgets
6023
include_expsyms=
6024
6024
# exclude_expsyms can be an egrep regular expression of symbols to exclude
6025
/* Override any gcc2 internal prototype to avoid an error.  */
6025
# it will be wrapped by ` (' and `)$', so one must not match beginning or
6026
#ifdef __cplusplus
6026
# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
6027
extern "C"
6027
# as well as any symbol that contains `d'.
6028
{
6028
exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
6029
#endif
6029
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
6030
/* We use char because int might match the return type of a gcc2
6030
# platforms (ab)use it in PIC code, but their linkers get confused if
6031
   builtin and then its argument prototype would still apply.  */
6031
# the symbol is explicitly referenced.  Since portable code cannot
6032
char catgets ();
6032
# rely on this symbol name, it's probably fine to never include it in
6033
/* The GNU C library defines this for functions which it implements
6033
# preloaded symbol tables.
6034
    to always fail with ENOSYS.  Some functions are actually named
6034
extract_expsyms_cmds=
6035
    something starting with __ and the normal name is an alias.  */
6035
6036
#if defined (__stub_catgets) || defined (__stub___catgets)
6036
case $host_os in
6037
choke me
6037
cygwin* | mingw* | pw32* )
6038
#else
6038
  # FIXME: the MSVC++ port hasn't been tested in a loooong time
6039
char (*f) () = catgets;
6039
  # When not using gcc, we currently assume that we are using
6040
#endif
6040
  # Microsoft Visual C++.
6041
#ifdef __cplusplus
6041
  if test "$GCC" != yes; then
6042
}
6042
    with_gnu_ld=no
6043
#endif
6043
  fi
6044
6044
  ;;
6045
#ifdef F77_DUMMY_MAIN
6045
6046
#  ifdef __cplusplus
6046
esac
6047
     extern "C"
6047
6048
#  endif
6048
ld_shlibs=yes
6049
   int F77_DUMMY_MAIN() { return 1; }
6049
if test "$with_gnu_ld" = yes; then
6050
#endif
6050
  # If archive_cmds runs LD, not CC, wlarc should be empty
6051
int
6051
  wlarc='${wl}'
6052
main ()
6052
6053
{
6053
  # See if GNU ld supports shared libraries.
6054
return f != catgets;
6054
  case $host_os in
6055
  ;
6055
  aix3* | aix4* | aix5*)
6056
  return 0;
6056
    # On AIX, the GNU linker is very broken
6057
}
6057
    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
6058
_ACEOF
6058
    ld_shlibs=no
6059
rm -f conftest.$ac_objext conftest$ac_exeext
6059
    cat <<EOF 1>&2
6060
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
6060
6061
  (eval $ac_link) 2>&5
6061
*** Warning: the GNU linker, at least up to release 2.9.1, is reported
6062
  ac_status=$?
6062
*** to be unable to reliably create shared libraries on AIX.
6063
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
6063
*** Therefore, libtool is disabling shared libraries support.  If you
6064
  (exit $ac_status); } &&
6064
*** really care for shared libraries, you may want to modify your PATH
6065
         { ac_try='test -s conftest$ac_exeext'
6065
*** so that a non-GNU linker is found, and then restart.
6066
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
6066
6067
  (eval $ac_try) 2>&5
6067
EOF
6068
  ac_status=$?
6068
    ;;
6069
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
6069
6070
  (exit $ac_status); }; }; then
6070
  amigaos*)
6071
  ac_cv_func_catgets=yes
6071
    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
6072
else
6072
    hardcode_libdir_flag_spec='-L$libdir'
6073
  echo "$as_me: failed program was:" >&5
6073
    hardcode_minus_L=yes
6074
cat conftest.$ac_ext >&5
6074
6075
ac_cv_func_catgets=no
6075
    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
6076
fi
6076
    # that the semantics of dynamic libraries on AmigaOS, at least up
6077
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6077
    # to version 4, is to share data among multiple programs linked
6078
fi
6078
    # with the same dynamic library.  Since this doesn't match the
6079
echo "$as_me:$LINENO: result: $ac_cv_func_catgets" >&5
6079
    # behavior of shared libraries on other platforms, we can use
6080
echo "${ECHO_T}$ac_cv_func_catgets" >&6
6080
    # them.
6081
if test $ac_cv_func_catgets = yes; then
6081
    ld_shlibs=no
6082
  cat >>confdefs.h <<\_ACEOF
6082
    ;;
6083
#define HAVE_CATGETS 1
6083
6084
_ACEOF
6084
  beos*)
6085
6085
    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
6086
fi
6086
      allow_undefined_flag=unsupported
6087
6087
      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6088
6088
      # support --undefined.  This deserves some investigation.  FIXME
6089
#
6089
      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6090
# -lxnet buys us one big porting headache...  standards, gotta love 'em.
6090
    else
6091
#
6091
      ld_shlibs=no
6092
# AC_CHECK_LIB(xnet, socket, ,
6092
    fi
6093
#    AC_CHECK_LIB(socket, socket)
6093
    ;;
6094
#    AC_CHECK_LIB(nsl, inet_ntoa)
6094
6095
# )
6095
  cygwin* | mingw* | pw32*)
6096
#
6096
    # hardcode_libdir_flag_spec is actually meaningless, as there is
6097
# Use this for now, instead:
6097
    # no search path for DLLs.
6098
#
6098
    hardcode_libdir_flag_spec='-L$libdir'
6099
case "$host" in
6099
    allow_undefined_flag=unsupported
6100
	mips-sgi-irix*)
6100
    always_export_symbols=yes
6101
		;;
6101
6102
	*)
6102
    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
6103
6103
      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
6104
echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
6104
      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
6105
echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6
6105
      if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
6106
if test "${ac_cv_lib_socket_socket+set}" = set; then
6106
      else $CC -o impgen impgen.c ; fi)~
6107
  echo $ECHO_N "(cached) $ECHO_C" >&6
6107
      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
6108
else
6108
6109
  ac_check_lib_save_LIBS=$LIBS
6109
    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
6110
LIBS="-lsocket  $LIBS"
6110
6111
cat >conftest.$ac_ext <<_ACEOF
6111
    # cygwin and mingw dlls have different entry points and sets of symbols
6112
#line $LINENO "configure"
6112
    # to exclude.
6113
#include "confdefs.h"
6113
    # FIXME: what about values for MSVC?
6114
6114
    dll_entry=__cygwin_dll_entry@12
6115
/* Override any gcc2 internal prototype to avoid an error.  */
6115
    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
6116
#ifdef __cplusplus
6116
    case $host_os in
6117
extern "C"
6117
    mingw*)
6118
#endif
6118
      # mingw values
6119
/* We use char because int might match the return type of a gcc2
6119
      dll_entry=_DllMainCRTStartup@12
6120
   builtin and then its argument prototype would still apply.  */
6120
      dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
6121
char socket ();
6121
      ;;
6122
#ifdef F77_DUMMY_MAIN
6122
    esac
6123
#  ifdef __cplusplus
6123
6124
     extern "C"
6124
    # mingw and cygwin differ, and it's simplest to just exclude the union
6125
#  endif
6125
    # of the two symbol sets.
6126
   int F77_DUMMY_MAIN() { return 1; }
6126
    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
6127
#endif
6127
6128
int
6128
    # recent cygwin and mingw systems supply a stub DllMain which the user
6129
main ()
6129
    # can override, but on older systems we have to supply one (in ltdll.c)
6130
{
6130
    if test "x$lt_cv_need_dllmain" = "xyes"; then
6131
socket ();
6131
      ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
6132
  ;
6132
      ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < [$]0 > $output_objdir/$soname-ltdll.c~
6133
  return 0;
6133
	test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
6134
}
6134
    else
6135
_ACEOF
6135
      ltdll_obj=
6136
rm -f conftest.$ac_objext conftest$ac_exeext
6136
      ltdll_cmds=
6137
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
6137
    fi
6138
  (eval $ac_link) 2>&5
6138
6139
  ac_status=$?
6139
    # Extract the symbol export list from an `--export-all' def file,
6140
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
6140
    # then regenerate the def file from the symbol export list, so that
6141
  (exit $ac_status); } &&
6141
    # the compiled dll only exports the symbol export list.
6142
         { ac_try='test -s conftest$ac_exeext'
6142
    # Be careful not to strip the DATA tag left be newer dlltools.
6143
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
6143
    export_symbols_cmds="$ltdll_cmds"'
6144
  (eval $ac_try) 2>&5
6144
      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
6145
  ac_status=$?
6145
      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
6146
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
6146
6147
  (exit $ac_status); }; }; then
6147
    # If the export-symbols file already is a .def file (1st line
6148
  ac_cv_lib_socket_socket=yes
6148
    # is EXPORTS), use it as is.
6149
else
6149
    # If DATA tags from a recent dlltool are present, honour them!
6150
  echo "$as_me: failed program was:" >&5
6150
    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
6151
cat conftest.$ac_ext >&5
6151
        cp $export_symbols $output_objdir/$soname-def;
6152
ac_cv_lib_socket_socket=no
6152
      else
6153
fi
6153
        echo EXPORTS > $output_objdir/$soname-def;
6154
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6154
        _lt_hint=1;
6155
LIBS=$ac_check_lib_save_LIBS
6155
        cat $export_symbols | while read symbol; do
6156
fi
6156
         set dummy \$symbol;
6157
echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
6157
         case \$# in
6158
echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6
6158
           2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
6159
if test $ac_cv_lib_socket_socket = yes; then
6159
           *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
6160
  cat >>confdefs.h <<_ACEOF
6160
         esac;
6161
#define HAVE_LIBSOCKET 1
6161
         _lt_hint=`expr 1 + \$_lt_hint`;
6162
_ACEOF
6162
        done;
6163
6163
      fi~
6164
  LIBS="-lsocket $LIBS"
6164
      '"$ltdll_cmds"'
6165
6165
      $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
6166
fi
6166
      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
6167
6167
      $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
6168
6168
      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
6169
echo "$as_me:$LINENO: checking for inet_ntoa in -lnsl" >&5
6169
      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
6170
echo $ECHO_N "checking for inet_ntoa in -lnsl... $ECHO_C" >&6
6170
    ;;
6171
if test "${ac_cv_lib_nsl_inet_ntoa+set}" = set; then
6171
6172
  echo $ECHO_N "(cached) $ECHO_C" >&6
6172
  netbsd*)
6173
else
6173
    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6174
  ac_check_lib_save_LIBS=$LIBS
6174
      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
6175
LIBS="-lnsl  $LIBS"
6175
      wlarc=
6176
cat >conftest.$ac_ext <<_ACEOF
6176
    else
6177
#line $LINENO "configure"
6177
      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6178
#include "confdefs.h"
6178
      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6179
6179
    fi
6180
/* Override any gcc2 internal prototype to avoid an error.  */
6180
    ;;
6181
#ifdef __cplusplus
6181
6182
extern "C"
6182
  solaris* | sysv5*)
6183
#endif
6183
    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
6184
/* We use char because int might match the return type of a gcc2
6184
      ld_shlibs=no
6185
   builtin and then its argument prototype would still apply.  */
6185
      cat <<EOF 1>&2
6186
char inet_ntoa ();
6186
6187
#ifdef F77_DUMMY_MAIN
6187
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
6188
#  ifdef __cplusplus
6188
*** create shared libraries on Solaris systems.  Therefore, libtool
6189
     extern "C"
6189
*** is disabling shared libraries support.  We urge you to upgrade GNU
6190
#  endif
6190
*** binutils to release 2.9.1 or newer.  Another option is to modify
6191
   int F77_DUMMY_MAIN() { return 1; }
6191
*** your PATH or compiler configuration so that the native linker is
6192
#endif
6192
*** used, and then restart.
6193
int
6193
6194
main ()
6194
EOF
6195
{
6195
    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
6196
inet_ntoa ();
6196
      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6197
  ;
6197
      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6198
  return 0;
6198
    else
6199
}
6199
      ld_shlibs=no
6200
_ACEOF
6200
    fi
6201
rm -f conftest.$ac_objext conftest$ac_exeext
6201
    ;;
6202
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
6202
6203
  (eval $ac_link) 2>&5
6203
  sunos4*)
6204
  ac_status=$?
6204
    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6205
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
6205
    wlarc=
6206
  (exit $ac_status); } &&
6206
    hardcode_direct=yes
6207
         { ac_try='test -s conftest$ac_exeext'
6207
    hardcode_shlibpath_var=no
6208
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
6208
    ;;
6209
  (eval $ac_try) 2>&5
6209
6210
  ac_status=$?
6210
  *)
6211
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
6211
    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
6212
  (exit $ac_status); }; }; then
6212
      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6213
  ac_cv_lib_nsl_inet_ntoa=yes
6213
      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6214
else
6214
    else
6215
  echo "$as_me: failed program was:" >&5
6215
      ld_shlibs=no
6216
cat conftest.$ac_ext >&5
6216
    fi
6217
ac_cv_lib_nsl_inet_ntoa=no
6217
    ;;
6218
fi
6218
  esac
6219
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6219
6220
LIBS=$ac_check_lib_save_LIBS
6220
  if test "$ld_shlibs" = yes; then
6221
fi
6221
    runpath_var=LD_RUN_PATH
6222
echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_inet_ntoa" >&5
6222
    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
6223
echo "${ECHO_T}$ac_cv_lib_nsl_inet_ntoa" >&6
6223
    export_dynamic_flag_spec='${wl}--export-dynamic'
6224
if test $ac_cv_lib_nsl_inet_ntoa = yes; then
6224
    case $host_os in
6225
  cat >>confdefs.h <<_ACEOF
6225
    cygwin* | mingw* | pw32*)
6226
#define HAVE_LIBNSL 1
6226
      # dlltool doesn't understand --whole-archive et. al.
6227
_ACEOF
6227
      whole_archive_flag_spec=
6228
6228
      ;;
6229
  LIBS="-lnsl $LIBS"
6229
    *)
6230
6230
      # ancient GNU ld didn't support --whole-archive et. al.
6231
fi
6231
      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
6232
6232
	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6233
		;;
6233
      else
6234
esac
6234
	whole_archive_flag_spec=
6235
6235
      fi
6236
#
6236
      ;;
6237
# Purify support
6237
    esac
6238
#
6238
  fi
6239
echo "$as_me:$LINENO: checking whether to use purify" >&5
6239
else
6240
echo $ECHO_N "checking whether to use purify... $ECHO_C" >&6
6240
  # PORTME fill in a description of your system's linker (not GNU ld)
6241
6241
  case $host_os in
6242
# Check whether --with-purify or --without-purify was given.
6242
  aix3*)
6243
if test "${with_purify+set}" = set; then
6243
    allow_undefined_flag=unsupported
6244
  withval="$with_purify"
6244
    always_export_symbols=yes
6245
  use_purify="$withval"
6245
    archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
6246
else
6246
    # Note: this linker hardcodes the directories in LIBPATH if there
6247
  use_purify="no"
6247
    # are no directories specified by -L.
6248
fi;
6248
    hardcode_minus_L=yes
6249
6249
    if test "$GCC" = yes && test -z "$link_static_flag"; then
6250
case "$use_purify" in
6250
      # Neither direct hardcoding nor static linking is supported with a
6251
	no)
6251
      # broken collect2.
6252
		;;
6252
      hardcode_direct=unsupported
6253
	yes)
6253
    fi
6254
		# Extract the first word of "purify", so it can be a program name with args.
6254
    ;;
6255
set dummy purify; ac_word=$2
6255
6256
echo "$as_me:$LINENO: checking for $ac_word" >&5
6256
  aix4* | aix5*)
6257
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6257
    # When large executables or shared objects are built, AIX ld can
6258
if test "${ac_cv_path_purify_path+set}" = set; then
6258
    # have problems creating the table of contents.  If linking a library
6259
  echo $ECHO_N "(cached) $ECHO_C" >&6
6259
    # or program results in "error TOC overflow" add -mminimal-toc to
6260
else
6260
    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6261
  case $purify_path in
6261
    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6262
  [\\/]* | ?:[\\/]*)
6262
6263
  ac_cv_path_purify_path="$purify_path" # Let the user override the test with a path.
6263
    archive_cmds=''
6264
  ;;
6264
    hardcode_libdir_separator=':'
6265
  *)
6265
    if test "$GCC" = yes; then
6266
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6266
      collect2name=`${CC} -print-prog-name=collect2`
6267
for as_dir in $PATH
6267
      if test -f "$collect2name" && \
6268
do
6268
	 strings "$collect2name" | grep resolve_lib_name >/dev/null
6269
  IFS=$as_save_IFS
6269
      then
6270
  test -z "$as_dir" && as_dir=.
6270
	# We have reworked collect2
6271
  for ac_exec_ext in '' $ac_executable_extensions; do
6271
	hardcode_direct=yes
6272
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6272
      else
6273
    ac_cv_path_purify_path="$as_dir/$ac_word$ac_exec_ext"
6273
        # We have old collect2
6274
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
6274
        hardcode_direct=unsupported
6275
    break 2
6275
        # It fails to find uninstalled libraries when the uninstalled
6276
  fi
6276
        # path is not listed in the libpath.  Setting hardcode_minus_L
6277
done
6277
        # to unsupported forces relinking
6278
done
6278
        hardcode_minus_L=yes
6279
6279
        hardcode_libdir_flag_spec='-L$libdir'
6280
  test -z "$ac_cv_path_purify_path" && ac_cv_path_purify_path="purify"
6280
        hardcode_libdir_separator=
6281
  ;;
6281
      fi
6282
esac
6282
      shared_flag='-shared'
6283
fi
6283
    else
6284
purify_path=$ac_cv_path_purify_path
6284
      if test "$host_cpu" = ia64; then
6285
6285
        shared_flag='-G'
6286
if test -n "$purify_path"; then
6286
      else
6287
  echo "$as_me:$LINENO: result: $purify_path" >&5
6287
        shared_flag='${wl}-bM:SRE'
6288
echo "${ECHO_T}$purify_path" >&6
6288
      fi
6289
else
6289
      hardcode_direct=yes
6290
  echo "$as_me:$LINENO: result: no" >&5
6290
    fi
6291
echo "${ECHO_T}no" >&6
6291
6292
fi
6292
    if test "$host_cpu" = ia64; then
6293
6293
      # On IA64, the linker does run time linking by default, so we don't
6294
		;;
6294
      # have to do anything special.
6295
	*)
6295
      aix_use_runtimelinking=no
6296
		purify_path="$use_purify"
6296
      exp_sym_flag='-Bexport'
6297
		;;
6297
      no_entry_flag=""
6298
esac
6298
    else
6299
6299
      # Test if we are trying to use run time linking, or normal AIX style linking.
6300
case "$use_purify" in
6300
      # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
6301
	no)
6301
      aix_use_runtimelinking=no
6302
		echo "$as_me:$LINENO: result: no" >&5
6302
      for ld_flag in $LDFLAGS; do
6303
echo "${ECHO_T}no" >&6
6303
        if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
6304
		PURIFY=""
6304
          aix_use_runtimelinking=yes
6305
		;;
6305
          break
6306
	*)
6306
        fi
6307
		if test -f $purify_path || test $purify_path = purify; then
6307
      done
6308
			echo "$as_me:$LINENO: result: $purify_path" >&5
6308
      exp_sym_flag='-bexport'
6309
echo "${ECHO_T}$purify_path" >&6
6309
      no_entry_flag='-bnoentry'
6310
			PURIFYFLAGS="`echo $PURIFYOPTIONS`"
6310
    fi
6311
			PURIFY="$purify_path $PURIFYFLAGS"
6311
    # It seems that -bexpall can do strange things, so it is better to
6312
		else
6312
    # generate a list of symbols to export.
6313
			{ { echo "$as_me:$LINENO: error: $purify_path not found.
6313
    always_export_symbols=yes
6314
6314
    if test "$aix_use_runtimelinking" = yes; then
6315
Please choose the proper path with the following command:
6315
      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
6316
6316
      allow_undefined_flag=' -Wl,-G'
6317
    configure --with-purify=PATH
6317
      archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
6318
" >&5
6318
    else
6319
echo "$as_me: error: $purify_path not found.
6319
      if test "$host_cpu" = ia64; then
6320
6320
        hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
6321
Please choose the proper path with the following command:
6321
       allow_undefined_flag="-znodefs"
6322
6322
        archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
6323
    configure --with-purify=PATH
6323
      else
6324
" >&2;}
6324
        hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
6325
   { (exit 1); exit 1; }; }
6325
        # Warning - without using the other run time loading flags, -berok will
6326
		fi
6326
        #           link without error, but may produce a broken library.
6327
		;;
6327
        allow_undefined_flag='${wl}-berok"
6328
esac
6328
        # This is a bit strange, but is similar to how AIX traditionally builds
6329
6329
        # it's shared libraries.
6330
6330
        archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
6331
6331
      fi
6332
#
6332
    fi
6333
# GNU libtool support
6333
    ;;
6334
#
6334
6335
6335
  amigaos*)
6336
# Check whether --with-libtool or --without-libtool was given.
6336
    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
6337
if test "${with_libtool+set}" = set; then
6337
    hardcode_libdir_flag_spec='-L$libdir'
6338
  withval="$with_libtool"
6338
    hardcode_minus_L=yes
6339
  use_libtool="$withval"
6339
    # see comment about different semantics on the GNU ld section
6340
else
6340
    ld_shlibs=no
6341
  use_libtool="no"
6341
    ;;
6342
fi;
6342
6343
6343
  cygwin* | mingw* | pw32*)
6344
case $use_libtool in
6344
    # When not using gcc, we currently assume that we are using
6345
	yes)
6345
    # Microsoft Visual C++.
6346
		# Check whether --enable-shared or --disable-shared was given.
6346
    # hardcode_libdir_flag_spec is actually meaningless, as there is
6347
if test "${enable_shared+set}" = set; then
6347
    # no search path for DLLs.
6348
  enableval="$enable_shared"
6348
    hardcode_libdir_flag_spec=' '
6349
  p=${PACKAGE-default}
6349
    allow_undefined_flag=unsupported
6350
case $enableval in
6350
    # Tell ltmain to make .lib files, not .a files.
6351
yes) enable_shared=yes ;;
6351
    libext=lib
6352
no) enable_shared=no ;;
6352
    # FIXME: Setting linknames here is a bad hack.
6353
*)
6353
    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
6354
  enable_shared=no
6354
    # The linker will automatically build a .lib file if we build a DLL.
6355
  # Look at the argument we got.  We use all the common list separators.
6355
    old_archive_from_new_cmds='true'
6356
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
6356
    # FIXME: Should let the user specify the lib program.
6357
  for pkg in $enableval; do
6357
    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
6358
    if test "X$pkg" = "X$p"; then
6358
    fix_srcfile_path='`cygpath -w "$srcfile"`'
6359
      enable_shared=yes
6359
    ;;
6360
    fi
6360
6361
  done
6361
  darwin* | rhapsody*)
6362
  IFS="$ac_save_ifs"
6362
    allow_undefined_flag='-undefined suppress'
6363
  ;;
6363
    # FIXME: Relying on posixy $() will cause problems for
6364
esac
6364
    #        cross-compilation, but unfortunately the echo tests do not
6365
else
6365
    #        yet detect zsh echo's removal of \ escapes.
6366
  enable_shared=yes
6366
    archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)'
6367
fi;
6367
    # We need to add '_' to the symbols in $export_symbols first
6368
# Check whether --enable-static or --disable-static was given.
6368
    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
6369
if test "${enable_static+set}" = set; then
6369
    hardcode_direct=yes
6370
  enableval="$enable_static"
6370
    hardcode_shlibpath_var=no
6371
  p=${PACKAGE-default}
6371
    whole_archive_flag_spec='-all_load $convenience'
6372
case $enableval in
6372
    ;;
6373
yes) enable_static=yes ;;
6373
6374
no) enable_static=no ;;
6374
  freebsd1*)
6375
*)
6375
    ld_shlibs=no
6376
  enable_static=no
6376
    ;;
6377
  # Look at the argument we got.  We use all the common list separators.
6377
6378
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
6378
  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6379
  for pkg in $enableval; do
6379
  # support.  Future versions do this automatically, but an explicit c++rt0.o
6380
    if test "X$pkg" = "X$p"; then
6380
  # does not break anything, and helps significantly (at the cost of a little
6381
      enable_static=yes
6381
  # extra space).
6382
    fi
6382
  freebsd2.2*)
6383
  done
6383
    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6384
  IFS="$ac_save_ifs"
6384
    hardcode_libdir_flag_spec='-R$libdir'
6385
  ;;
6385
    hardcode_direct=yes
6386
esac
6386
    hardcode_shlibpath_var=no
6387
else
6387
    ;;
6388
  enable_static=yes
6388
6389
fi;
6389
  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6390
# Check whether --enable-fast-install or --disable-fast-install was given.
6390
  freebsd2*)
6391
if test "${enable_fast_install+set}" = set; then
6391
    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6392
  enableval="$enable_fast_install"
6392
    hardcode_direct=yes
6393
  p=${PACKAGE-default}
6393
    hardcode_minus_L=yes
6394
case $enableval in
6394
    hardcode_shlibpath_var=no
6395
yes) enable_fast_install=yes ;;
6395
    ;;
6396
no) enable_fast_install=no ;;
6396
6397
*)
6397
  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6398
  enable_fast_install=no
6398
  freebsd*)
6399
  # Look at the argument we got.  We use all the common list separators.
6399
    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
6400
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
6400
    hardcode_libdir_flag_spec='-R$libdir'
6401
  for pkg in $enableval; do
6401
    hardcode_direct=yes
6402
    if test "X$pkg" = "X$p"; then
6402
    hardcode_shlibpath_var=no
6403
      enable_fast_install=yes
6403
    ;;
6404
    fi
6404
6405
  done
6405
  hpux9* | hpux10* | hpux11*)
6406
  IFS="$ac_save_ifs"
6406
    case $host_os in
6407
  ;;
6407
    hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
6408
esac
6408
    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
6409
else
6409
    esac
6410
  enable_fast_install=yes
6410
    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
6411
fi;
6411
    hardcode_libdir_separator=:
6412
6412
    hardcode_direct=yes
6413
# Check whether --with-gnu-ld or --without-gnu-ld was given.
6413
    hardcode_minus_L=yes # Not in the search PATH, but as the default
6414
if test "${with_gnu_ld+set}" = set; then
6414
			 # location of the library.
6415
  withval="$with_gnu_ld"
6415
    export_dynamic_flag_spec='${wl}-E'
6416
  test "$withval" = no || with_gnu_ld=yes
6416
    ;;
6417
else
6417
6418
  with_gnu_ld=no
6418
  irix5* | irix6*)
6419
fi;
6419
    if test "$GCC" = yes; then
6420
ac_prog=ld
6420
      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6421
if test "$GCC" = yes; then
6421
    else
6422
  # Check if gcc -print-prog-name=ld gives a path.
6422
      archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
6423
  echo "$as_me:$LINENO: checking for ld used by GCC" >&5
6423
    fi
6424
echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
6424
    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
6425
  case $host in
6425
    hardcode_libdir_separator=:
6426
  *-*-mingw*)
6426
    link_all_deplibs=yes
6427
    # gcc leaves a trailing carriage return which upsets mingw
6427
    ;;
6428
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
6428
6429
  *)
6429
  netbsd*)
6430
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
6430
    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6431
  esac
6431
      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6432
  case $ac_prog in
6432
    else
6433
    # Accept absolute paths.
6433
      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6434
    [\\/]* | [A-Za-z]:[\\/]*)
6434
    fi
6435
      re_direlt='/[^/][^/]*/\.\./'
6435
    hardcode_libdir_flag_spec='-R$libdir'
6436
      # Canonicalize the path of ld
6436
    hardcode_direct=yes
6437
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
6437
    hardcode_shlibpath_var=no
6438
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
6438
    ;;
6439
	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
6439
6440
      done
6440
  newsos6)
6441
      test -z "$LD" && LD="$ac_prog"
6441
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
6442
      ;;
6442
    hardcode_direct=yes
6443
  "")
6443
    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
6444
    # If it fails, then pretend we aren't using GCC.
6444
    hardcode_libdir_separator=:
6445
    ac_prog=ld
6445
    hardcode_shlibpath_var=no
6446
    ;;
6446
    ;;
6447
  *)
6447
6448
    # If it is relative, then search for the first ld in PATH.
6448
  openbsd*)
6449
    with_gnu_ld=unknown
6449
    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6450
    ;;
6450
    hardcode_libdir_flag_spec='-R$libdir'
6451
  esac
6451
    hardcode_direct=yes
6452
elif test "$with_gnu_ld" = yes; then
6452
    hardcode_shlibpath_var=no
6453
  echo "$as_me:$LINENO: checking for GNU ld" >&5
6453
    ;;
6454
echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
6454
6455
else
6455
  os2*)
6456
  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
6456
    hardcode_libdir_flag_spec='-L$libdir'
6457
echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
6457
    hardcode_minus_L=yes
6458
fi
6458
    allow_undefined_flag=unsupported
6459
if test "${lt_cv_path_LD+set}" = set; then
6459
    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
6460
  echo $ECHO_N "(cached) $ECHO_C" >&6
6460
    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6461
else
6461
    ;;
6462
  if test -z "$LD"; then
6462
6463
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
6463
  osf3*)
6464
  for ac_dir in $PATH; do
6464
    if test "$GCC" = yes; then
6465
    test -z "$ac_dir" && ac_dir=.
6465
      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
6466
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
6466
      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6467
      lt_cv_path_LD="$ac_dir/$ac_prog"
6467
    else
6468
      # Check to see if the program is GNU ld.  I'd rather use --version,
6468
      allow_undefined_flag=' -expect_unresolved \*'
6469
      # but apparently some GNU ld's only accept -v.
6469
      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
6470
      # Break only if it was the GNU/non-GNU ld that we prefer.
6470
    fi
6471
      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
6471
    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
6472
	test "$with_gnu_ld" != no && break
6472
    hardcode_libdir_separator=:
6473
      else
6473
    ;;
6474
	test "$with_gnu_ld" != yes && break
6474
6475
      fi
6475
  osf4* | osf5*)	# as osf3* with the addition of -msym flag
6476
    fi
6476
    if test "$GCC" = yes; then
6477
  done
6477
      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
6478
  IFS="$ac_save_ifs"
6478
      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6479
else
6479
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
6480
  lt_cv_path_LD="$LD" # Let the user override the test with a path.
6480
    else
6481
fi
6481
      allow_undefined_flag=' -expect_unresolved \*'
6482
fi
6482
      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
6483
6483
      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
6484
LD="$lt_cv_path_LD"
6484
      $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
6485
if test -n "$LD"; then
6485
6486
  echo "$as_me:$LINENO: result: $LD" >&5
6486
      #Both c and cxx compiler support -rpath directly
6487
echo "${ECHO_T}$LD" >&6
6487
      hardcode_libdir_flag_spec='-rpath $libdir'
6488
else
6488
    fi
6489
  echo "$as_me:$LINENO: result: no" >&5
6489
    hardcode_libdir_separator=:
6490
echo "${ECHO_T}no" >&6
6490
    ;;
6491
fi
6491
6492
test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
6492
  sco3.2v5*)
6493
echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
6493
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6494
   { (exit 1); exit 1; }; }
6494
    hardcode_shlibpath_var=no
6495
echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
6495
    runpath_var=LD_RUN_PATH
6496
echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
6496
    hardcode_runpath_var=yes
6497
if test "${lt_cv_prog_gnu_ld+set}" = set; then
6497
    ;;
6498
  echo $ECHO_N "(cached) $ECHO_C" >&6
6498
6499
else
6499
  solaris*)
6500
  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
6500
    no_undefined_flag=' -z defs'
6501
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
6501
    # $CC -shared without GNU ld will not create a library from C++
6502
  lt_cv_prog_gnu_ld=yes
6502
    # object files and a static libstdc++, better avoid it by now
6503
else
6503
    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6504
  lt_cv_prog_gnu_ld=no
6504
    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6505
fi
6505
		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6506
fi
6506
    hardcode_libdir_flag_spec='-R$libdir'
6507
echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
6507
    hardcode_shlibpath_var=no
6508
echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
6508
    case $host_os in
6509
with_gnu_ld=$lt_cv_prog_gnu_ld
6509
    solaris2.[0-5] | solaris2.[0-5].*) ;;
6510
6510
    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
6511
6511
      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
6512
echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
6512
    esac
6513
echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
6513
    link_all_deplibs=yes
6514
if test "${lt_cv_ld_reload_flag+set}" = set; then
6514
    ;;
6515
  echo $ECHO_N "(cached) $ECHO_C" >&6
6515
6516
else
6516
  sunos4*)
6517
  lt_cv_ld_reload_flag='-r'
6517
    if test "x$host_vendor" = xsequent; then
6518
fi
6518
      # Use $CC to link under sequent, because it throws in some extra .o
6519
echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
6519
      # files that make .init and .fini sections work.
6520
echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
6520
      archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6521
reload_flag=$lt_cv_ld_reload_flag
6521
    else
6522
test -n "$reload_flag" && reload_flag=" $reload_flag"
6522
      archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6523
6523
    fi
6524
echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
6524
    hardcode_libdir_flag_spec='-L$libdir'
6525
echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
6525
    hardcode_direct=yes
6526
if test "${lt_cv_path_NM+set}" = set; then
6526
    hardcode_minus_L=yes
6527
  echo $ECHO_N "(cached) $ECHO_C" >&6
6527
    hardcode_shlibpath_var=no
6528
else
6528
    ;;
6529
  if test -n "$NM"; then
6529
6530
  # Let the user override the test.
6530
  sysv4)
6531
  lt_cv_path_NM="$NM"
6531
    if test "x$host_vendor" = xsno; then
6532
else
6532
      archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linkopts'
6533
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
6533
      hardcode_direct=yes # is this really true???
6534
  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
6534
    else
6535
    test -z "$ac_dir" && ac_dir=.
6535
      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6536
    tmp_nm=$ac_dir/${ac_tool_prefix}nm
6536
      hardcode_direct=no #Motorola manual says yes, but my tests say they lie
6537
    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
6537
    fi
6538
      # Check to see if the nm accepts a BSD-compat flag.
6538
    runpath_var='LD_RUN_PATH'
6539
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
6539
    hardcode_shlibpath_var=no
6540
      #   nm: unknown option "B" ignored
6540
    ;;
6541
      # Tru64's nm complains that /dev/null is an invalid object file
6541
6542
      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
6542
  sysv4.3*)
6543
	lt_cv_path_NM="$tmp_nm -B"
6543
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6544
	break
6544
    hardcode_shlibpath_var=no
6545
      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
6545
    export_dynamic_flag_spec='-Bexport'
6546
	lt_cv_path_NM="$tmp_nm -p"
6546
    ;;
6547
	break
6547
6548
      else
6548
  sysv5*)
6549
	lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
6549
    no_undefined_flag=' -z text'
6550
	continue # so that we can try to find one that supports BSD flags
6550
    # $CC -shared without GNU ld will not create a library from C++
6551
      fi
6551
    # object files and a static libstdc++, better avoid it by now
6552
    fi
6552
    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6553
  done
6553
    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6554
  IFS="$ac_save_ifs"
6554
		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6555
  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
6555
    hardcode_libdir_flag_spec=
6556
fi
6556
    hardcode_shlibpath_var=no
6557
fi
6557
    runpath_var='LD_RUN_PATH'
6558
6558
    ;;
6559
NM="$lt_cv_path_NM"
6559
6560
echo "$as_me:$LINENO: result: $NM" >&5
6560
  uts4*)
6561
echo "${ECHO_T}$NM" >&6
6561
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6562
6562
    hardcode_libdir_flag_spec='-L$libdir'
6563
echo "$as_me:$LINENO: checking whether ln -s works" >&5
6563
    hardcode_shlibpath_var=no
6564
echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
6564
    ;;
6565
LN_S=$as_ln_s
6565
6566
if test "$LN_S" = "ln -s"; then
6566
  dgux*)
6567
  echo "$as_me:$LINENO: result: yes" >&5
6567
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6568
echo "${ECHO_T}yes" >&6
6568
    hardcode_libdir_flag_spec='-L$libdir'
6569
else
6569
    hardcode_shlibpath_var=no
6570
  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
6570
    ;;
6571
echo "${ECHO_T}no, using $LN_S" >&6
6571
6572
fi
6572
  sysv4*MP*)
6573
6573
    if test -d /usr/nec; then
6574
echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5
6574
      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6575
echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6
6575
      hardcode_shlibpath_var=no
6576
if test "${lt_cv_deplibs_check_method+set}" = set; then
6576
      runpath_var=LD_RUN_PATH
6577
  echo $ECHO_N "(cached) $ECHO_C" >&6
6577
      hardcode_runpath_var=yes
6578
else
6578
      ld_shlibs=yes
6579
  lt_cv_file_magic_cmd='$MAGIC_CMD'
6579
    fi
6580
lt_cv_file_magic_test_file=
6580
    ;;
6581
lt_cv_deplibs_check_method='unknown'
6581
6582
# Need to set the preceding variable on all platforms that support
6582
  sysv4.2uw2*)
6583
# interlibrary dependencies.
6583
    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6584
# 'none' -- dependencies not supported.
6584
    hardcode_direct=yes
6585
# `unknown' -- same as none, but documents that we really don't know.
6585
    hardcode_minus_L=no
6586
# 'pass_all' -- all dependencies passed with no checks.
6586
    hardcode_shlibpath_var=no
6587
# 'test_compile' -- check by making test program.
6587
    hardcode_runpath_var=yes
6588
# ['file_magic [regex]'] -- check by looking for files in library path
6588
    runpath_var=LD_RUN_PATH
6589
# which responds to the $file_magic_cmd with a given egrep regex.
6589
    ;;
6590
# If you have `file' or equivalent on your system and you're not sure
6590
6591
# whether `pass_all' will *always* work, you probably want this one.
6591
  sysv5uw7* | unixware7*)
6592
6592
    no_undefined_flag='${wl}-z ${wl}text'
6593
case $host_os in
6593
    if test "$GCC" = yes; then
6594
aix4* | aix5*)
6594
      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6595
  lt_cv_deplibs_check_method=pass_all
6595
    else
6596
  ;;
6596
      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6597
6597
    fi
6598
beos*)
6598
    runpath_var='LD_RUN_PATH'
6599
  lt_cv_deplibs_check_method=pass_all
6599
    hardcode_shlibpath_var=no
6600
  ;;
6600
    ;;
6601
6601
6602
bsdi4*)
6602
  *)
6603
  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
6603
    ld_shlibs=no
6604
  lt_cv_file_magic_cmd='/usr/bin/file -L'
6604
    ;;
6605
  lt_cv_file_magic_test_file=/shlib/libc.so
6605
  esac
6606
  ;;
6606
fi
6607
6607
echo "$ac_t""$ld_shlibs" 1>&6
6608
cygwin* | mingw* | pw32*)
6608
test "$ld_shlibs" = no && can_build_shared=no
6609
  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
6609
##
6610
  lt_cv_file_magic_cmd='$OBJDUMP -f'
6610
## END FIXME
6611
  ;;
6611
6612
6612
## FIXME: this should be a separate macro
6613
darwin* | rhapsody*)
6613
##
6614
  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
6614
# Check hardcoding attributes.
6615
  lt_cv_file_magic_cmd='/usr/bin/file -L'
6615
echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
6616
  case "$host_os" in
6616
echo "configure:6617: checking how to hardcode library paths into programs" >&5
6617
  rhapsody* | darwin1.012)
6617
hardcode_action=
6618
    lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
6618
if test -n "$hardcode_libdir_flag_spec" || \
6619
    ;;
6619
   test -n "$runpath_var"; then
6620
  *) # Darwin 1.3 on
6620
6621
    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
6621
  # We can hardcode non-existant directories.
6622
    ;;
6622
  if test "$hardcode_direct" != no &&
6623
  esac
6623
     # If the only mechanism to avoid hardcoding is shlibpath_var, we
6624
  ;;
6624
     # have to relink, otherwise we might link with an installed library
6625
6625
     # when we should be linking with a yet-to-be-installed one
6626
freebsd*)
6626
     ## test "$hardcode_shlibpath_var" != no &&
6627
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
6627
     test "$hardcode_minus_L" != no; then
6628
    case $host_cpu in
6628
    # Linking always hardcodes the temporary library directory.
6629
    i*86 )
6629
    hardcode_action=relink
6630
      # Not sure whether the presence of OpenBSD here was a mistake.
6630
  else
6631
      # Let's accept both of them until this is cleared up.
6631
    # We can link without hardcoding, and we can hardcode nonexisting dirs.
6632
      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
6632
    hardcode_action=immediate
6633
      lt_cv_file_magic_cmd=/usr/bin/file
6633
  fi
6634
      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
6634
else
6635
      ;;
6635
  # We cannot hardcode anything, or else we can only hardcode existing
6636
    esac
6636
  # directories.
6637
  else
6637
  hardcode_action=unsupported
6638
    lt_cv_deplibs_check_method=pass_all
6638
fi
6639
  fi
6639
echo "$ac_t""$hardcode_action" 1>&6
6640
  ;;
6640
##
6641
6641
## END FIXME
6642
gnu*)
6642
6643
  lt_cv_deplibs_check_method=pass_all
6643
## FIXME: this should be a separate macro
6644
  ;;
6644
##
6645
6645
striplib=
6646
hpux10.20*|hpux11*)
6646
old_striplib=
6647
  lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
6647
echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
6648
  lt_cv_file_magic_cmd=/usr/bin/file
6648
echo "configure:6649: checking whether stripping libraries is possible" >&5
6649
  lt_cv_file_magic_test_file=/usr/lib/libc.sl
6649
if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
6650
  ;;
6650
  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
6651
6651
  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
6652
irix5* | irix6*)
6652
  echo "$ac_t""yes" 1>&6
6653
  case $host_os in
6653
else
6654
  irix5*)
6654
  echo "$ac_t""no" 1>&6
6655
    # this will be overridden with pass_all, but let us keep it just in case
6655
fi
6656
    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
6656
##
6657
    ;;
6657
## END FIXME
6658
  *)
6658
6659
    case $LD in
6659
reload_cmds='$LD$reload_flag -o $output$reload_objs'
6660
    *-32|*"-32 ") libmagic=32-bit;;
6660
test -z "$deplibs_check_method" && deplibs_check_method=unknown
6661
    *-n32|*"-n32 ") libmagic=N32;;
6661
6662
    *-64|*"-64 ") libmagic=64-bit;;
6662
## FIXME: this should be a separate macro
6663
    *) libmagic=never-match;;
6663
##
6664
    esac
6664
# PORTME Fill in your ld.so characteristics
6665
    # this will be overridden with pass_all, but let us keep it just in case
6665
echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
6666
    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
6666
echo "configure:6667: checking dynamic linker characteristics" >&5
6667
    ;;
6667
library_names_spec=
6668
  esac
6668
libname_spec='lib$name'
6669
  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
6669
soname_spec=
6670
  lt_cv_deplibs_check_method=pass_all
6670
postinstall_cmds=
6671
  ;;
6671
postuninstall_cmds=
6672
6672
finish_cmds=
6673
# This must be Linux ELF.
6673
finish_eval=
6674
linux-gnu*)
6674
shlibpath_var=
6675
  case $host_cpu in
6675
shlibpath_overrides_runpath=unknown
6676
  alpha* | i*86 | powerpc* | sparc* | ia64* )
6676
version_type=none
6677
    lt_cv_deplibs_check_method=pass_all ;;
6677
dynamic_linker="$host_os ld.so"
6678
  *)
6678
sys_lib_dlsearch_path_spec="/lib /usr/lib"
6679
    # glibc up to 2.1.1 does not perform some relocations on ARM
6679
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6680
    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
6680
6681
  esac
6681
case $host_os in
6682
  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
6682
aix3*)
6683
  ;;
6683
  version_type=linux
6684
6684
  library_names_spec='${libname}${release}.so$versuffix $libname.a'
6685
netbsd*)
6685
  shlibpath_var=LIBPATH
6686
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
6686
6687
    lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
6687
  # AIX has no versioning support, so we append a major version to the name.
6688
  else
6688
  soname_spec='${libname}${release}.so$major'
6689
    lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
6689
  ;;
6690
  fi
6690
6691
  ;;
6691
aix4* | aix5*)
6692
6692
  version_type=linux
6693
newos6*)
6693
  if test "$host_cpu" = ia64; then
6694
  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
6694
    # AIX 5 supports IA64
6695
  lt_cv_file_magic_cmd=/usr/bin/file
6695
    library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
6696
  lt_cv_file_magic_test_file=/usr/lib/libnls.so
6696
    shlibpath_var=LD_LIBRARY_PATH
6697
  ;;
6697
  else
6698
6698
    # With GCC up to 2.95.x, collect2 would create an import file
6699
osf3* | osf4* | osf5*)
6699
    # for dependence libraries.  The import file would start with
6700
  # this will be overridden with pass_all, but let us keep it just in case
6700
    # the line `#! .'.  This would cause the generated library to
6701
  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
6701
    # depend on `.', always an invalid library.  This was fixed in
6702
  lt_cv_file_magic_test_file=/shlib/libc.so
6702
    # development snapshots of GCC prior to 3.0.
6703
  lt_cv_deplibs_check_method=pass_all
6703
    case $host_os in
6704
  ;;
6704
       aix4 | aix4.[01] | aix4.[01].*)
6705
6705
      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
6706
sco3.2v5*)
6706
           echo ' yes '
6707
  lt_cv_deplibs_check_method=pass_all
6707
           echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
6708
  ;;
6708
        :
6709
6709
      else
6710
solaris*)
6710
        can_build_shared=no
6711
  lt_cv_deplibs_check_method=pass_all
6711
      fi
6712
  lt_cv_file_magic_test_file=/lib/libc.so
6712
      ;;
6713
  ;;
6713
    esac
6714
6714
    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
6715
sysv5uw[78]* | sysv4*uw2*)
6715
    # soname into executable. Probably we can add versioning support to
6716
  lt_cv_deplibs_check_method=pass_all
6716
    # collect2, so additional links can be useful in future.
6717
  ;;
6717
    if test "$aix_use_runtimelinking" = yes; then
6718
6718
      # If using run time linking (on AIX 4.2 or later) use lib<name>.so instead of
6719
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6719
      # lib<name>.a to let people know that these are not typical AIX shared libraries.
6720
  case $host_vendor in
6720
      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6721
  motorola)
6721
    else
6722
    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
6722
      # We preserve .a as extension for shared libraries through AIX4.2
6723
    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
6723
      # and later when we are not doing run time linking.
6724
    ;;
6724
      library_names_spec='${libname}${release}.a $libname.a'
6725
  ncr)
6725
      soname_spec='${libname}${release}.so$major'
6726
    lt_cv_deplibs_check_method=pass_all
6726
    fi
6727
    ;;
6727
    shlibpath_var=LIBPATH
6728
  sequent)
6728
    deplibs_check_method=pass_all
6729
    lt_cv_file_magic_cmd='/bin/file'
6729
  fi
6730
    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
6730
  ;;
6731
    ;;
6731
6732
  sni)
6732
amigaos*)
6733
    lt_cv_file_magic_cmd='/bin/file'
6733
  library_names_spec='$libname.ixlibrary $libname.a'
6734
    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
6734
  # Create ${libname}_ixlibrary.a entries in /sys/libs.
6735
    lt_cv_file_magic_test_file=/lib/libc.so
6735
  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
6736
    ;;
6736
  ;;
6737
  esac
6737
6738
  ;;
6738
beos*)
6739
esac
6739
  library_names_spec='${libname}.so'
6740
6740
  dynamic_linker="$host_os ld.so"
6741
fi
6741
  shlibpath_var=LIBRARY_PATH
6742
echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
6742
  ;;
6743
echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
6743
6744
file_magic_cmd=$lt_cv_file_magic_cmd
6744
bsdi4*)
6745
deplibs_check_method=$lt_cv_deplibs_check_method
6745
  version_type=linux
6746
6746
  need_version=no
6747
6747
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6748
6748
  soname_spec='${libname}${release}.so$major'
6749
6749
  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
6750
6750
  shlibpath_var=LD_LIBRARY_PATH
6751
6751
  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
6752
6752
  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
6753
# Check for command to grab the raw symbol name followed by C symbol from nm.
6753
  export_dynamic_flag_spec=-rdynamic
6754
echo "$as_me:$LINENO: checking command to parse $NM output" >&5
6754
  # the default ld.so.conf also contains /usr/contrib/lib and
6755
echo $ECHO_N "checking command to parse $NM output... $ECHO_C" >&6
6755
  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
6756
if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
6756
  # libtool to hard-code these into programs
6757
  echo $ECHO_N "(cached) $ECHO_C" >&6
6757
  ;;
6758
else
6758
6759
6759
cygwin* | mingw* | pw32*)
6760
# These are sane defaults that work on at least a few old systems.
6760
  version_type=windows
6761
# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
6761
  need_version=no
6762
6762
  need_lib_prefix=no
6763
# Character class describing NM global symbol codes.
6763
  case $GCC,$host_os in
6764
symcode='[BCDEGRST]'
6764
  yes,cygwin*)
6765
6765
    library_names_spec='$libname.dll.a'
6766
# Regexp to match symbols that can be accessed directly from C.
6766
    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6767
sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
6767
    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
6768
6768
      dldir=$destdir/`dirname \$dlpath`~
6769
# Transform the above into a raw symbol and a C symbol.
6769
      test -d \$dldir || mkdir -p \$dldir~
6770
symxfrm='\1 \2\3 \3'
6770
      $install_prog .libs/$dlname \$dldir/$dlname'
6771
6771
    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
6772
# Transform an extracted symbol line into a proper C declaration
6772
      dlpath=$dir/\$dldll~
6773
lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
6773
       $rm \$dlpath'
6774
6774
    ;;
6775
# Define system-specific variables.
6775
  yes,mingw*)
6776
case $host_os in
6776
    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6777
aix*)
6777
    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
6778
  symcode='[BCDT]'
6778
    ;;
6779
  ;;
6779
  yes,pw32*)
6780
cygwin* | mingw* | pw32*)
6780
    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
6781
  symcode='[ABCDGISTW]'
6781
    ;;
6782
  ;;
6782
  *)
6783
hpux*) # Its linker distinguishes data from code symbols
6783
    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
6784
  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
6784
    ;;
6785
  ;;
6785
  esac
6786
irix*)
6786
  dynamic_linker='Win32 ld.exe'
6787
  symcode='[BCDEGRST]'
6787
  # FIXME: first we should search . and the directory the executable is in
6788
  ;;
6788
  shlibpath_var=PATH
6789
solaris* | sysv5*)
6789
  ;;
6790
  symcode='[BDT]'
6790
6791
  ;;
6791
darwin* | rhapsody*)
6792
sysv4)
6792
  dynamic_linker="$host_os dyld"
6793
  symcode='[DFNSTU]'
6793
  version_type=darwin
6794
  ;;
6794
  need_lib_prefix=no
6795
esac
6795
  need_version=no
6796
6796
  # FIXME: Relying on posixy $() will cause problems for
6797
# Handle CRLF in mingw tool chain
6797
  #        cross-compilation, but unfortunately the echo tests do not
6798
opt_cr=
6798
  #        yet detect zsh echo's removal of \ escapes.
6799
case $host_os in
6799
  library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
6800
mingw*)
6800
  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
6801
  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
6801
  shlibpath_overrides_runpath=yes
6802
  ;;
6802
  shlibpath_var=DYLD_LIBRARY_PATH
6803
esac
6803
  ;;
6804
6804
6805
# If we're using GNU nm, then use its standard symbol codes.
6805
freebsd1*)
6806
if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
6806
  dynamic_linker=no
6807
  symcode='[ABCDGISTW]'
6807
  ;;
6808
fi
6808
6809
6809
freebsd*)
6810
# Try without a prefix undercore, then with it.
6810
  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
6811
for ac_symprfx in "" "_"; do
6811
  version_type=freebsd-$objformat
6812
6812
  case $version_type in
6813
  # Write the raw and C identifiers.
6813
    freebsd-elf*)
6814
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
6814
      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6815
6815
      need_version=no
6816
  # Check to see that the pipe works correctly.
6816
      need_lib_prefix=no
6817
  pipe_works=no
6817
      ;;
6818
  rm -f conftest*
6818
    freebsd-*)
6819
  cat > conftest.$ac_ext <<EOF
6819
      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
6820
#ifdef __cplusplus
6820
      need_version=yes
6821
extern "C" {
6821
      ;;
6822
#endif
6822
  esac
6823
char nm_test_var;
6823
  shlibpath_var=LD_LIBRARY_PATH
6824
void nm_test_func(){}
6824
  case $host_os in
6825
#ifdef __cplusplus
6825
  freebsd2*)
6826
}
6826
    shlibpath_overrides_runpath=yes
6827
#endif
6827
    ;;
6828
int main(){nm_test_var='a';nm_test_func();return(0);}
6828
  *)
6829
EOF
6829
    shlibpath_overrides_runpath=no
6830
6830
    hardcode_into_libs=yes
6831
  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
6831
    ;;
6832
  (eval $ac_compile) 2>&5
6832
  esac
6833
  ac_status=$?
6833
  ;;
6834
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
6834
6835
  (exit $ac_status); }; then
6835
gnu*)
6836
    # Now try to grab the symbols.
6836
  version_type=linux
6837
    nlist=conftest.nm
6837
  need_lib_prefix=no
6838
    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
6838
  need_version=no
6839
  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
6839
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
6840
  ac_status=$?
6840
  soname_spec='${libname}${release}.so$major'
6841
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
6841
  shlibpath_var=LD_LIBRARY_PATH
6842
  (exit $ac_status); } && test -s "$nlist"; then
6842
  hardcode_into_libs=yes
6843
      # Try sorting and uniquifying the output.
6843
  ;;
6844
      if sort "$nlist" | uniq > "$nlist"T; then
6844
6845
	mv -f "$nlist"T "$nlist"
6845
hpux9* | hpux10* | hpux11*)
6846
      else
6846
  # Give a soname corresponding to the major version so that dld.sl refuses to
6847
	rm -f "$nlist"T
6847
  # link against other versions.
6848
      fi
6848
  dynamic_linker="$host_os dld.sl"
6849
6849
  version_type=sunos
6850
      # Make sure that we snagged all the symbols we need.
6850
  need_lib_prefix=no
6851
      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
6851
  need_version=no
6852
	if egrep ' nm_test_func$' "$nlist" >/dev/null; then
6852
  shlibpath_var=SHLIB_PATH
6853
	  cat <<EOF > conftest.$ac_ext
6853
  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6854
#ifdef __cplusplus
6854
  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
6855
extern "C" {
6855
  soname_spec='${libname}${release}.sl$major'
6856
#endif
6856
  # HP-UX runs *really* slowly unless shared libraries are mode 555.
6857
6857
  postinstall_cmds='chmod 555 $lib'
6858
EOF
6858
  ;;
6859
	  # Now generate the symbol file.
6859
6860
	  eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
6860
irix5* | irix6*)
6861
6861
  version_type=irix
6862
	  cat <<EOF >> conftest.$ac_ext
6862
  need_lib_prefix=no
6863
#if defined (__STDC__) && __STDC__
6863
  need_version=no
6864
# define lt_ptr_t void *
6864
  soname_spec='${libname}${release}.so$major'
6865
#else
6865
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
6866
# define lt_ptr_t char *
6866
  case $host_os in
6867
# define const
6867
  irix5*)
6868
#endif
6868
    libsuff= shlibsuff=
6869
6869
    ;;
6870
/* The mapping between symbol names and symbols. */
6870
  *)
6871
const struct {
6871
    case $LD in # libtool.m4 will add one of these switches to LD
6872
  const char *name;
6872
    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
6873
  lt_ptr_t address;
6873
    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
6874
}
6874
    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
6875
lt_preloaded_symbols[] =
6875
    *) libsuff= shlibsuff= libmagic=never-match;;
6876
{
6876
    esac
6877
EOF
6877
    ;;
6878
	  sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext
6878
  esac
6879
	  cat <<\EOF >> conftest.$ac_ext
6879
  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6880
  {0, (lt_ptr_t) 0}
6880
  shlibpath_overrides_runpath=no
6881
};
6881
  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
6882
6882
  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
6883
#ifdef __cplusplus
6883
  ;;
6884
}
6884
6885
#endif
6885
# No shared lib support for Linux oldld, aout, or coff.
6886
EOF
6886
linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
6887
	  # Now try linking the two files.
6887
  dynamic_linker=no
6888
	  mv conftest.$ac_objext conftstm.$ac_objext
6888
  ;;
6889
	  save_LIBS="$LIBS"
6889
6890
	  save_CFLAGS="$CFLAGS"
6890
# This must be Linux ELF.
6891
	  LIBS="conftstm.$ac_objext"
6891
linux-gnu*)
6892
	  CFLAGS="$CFLAGS$no_builtin_flag"
6892
  version_type=linux
6893
	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
6893
  need_lib_prefix=no
6894
  (eval $ac_link) 2>&5
6894
  need_version=no
6895
  ac_status=$?
6895
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6896
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
6896
  soname_spec='${libname}${release}.so$major'
6897
  (exit $ac_status); } && test -s conftest; then
6897
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6898
	    pipe_works=yes
6898
  shlibpath_var=LD_LIBRARY_PATH
6899
	  fi
6899
  shlibpath_overrides_runpath=no
6900
	  LIBS="$save_LIBS"
6900
  # This implies no fast_install, which is unacceptable.
6901
	  CFLAGS="$save_CFLAGS"
6901
  # Some rework will be needed to allow for fast_install
6902
	else
6902
  # before this can be enabled.
6903
	  echo "cannot find nm_test_func in $nlist" >&5
6903
  hardcode_into_libs=yes
6904
	fi
6904
6905
      else
6905
  # We used to test for /lib/ld.so.1 and disable shared libraries on
6906
	echo "cannot find nm_test_var in $nlist" >&5
6906
  # powerpc, because MkLinux only supported shared libraries with the
6907
      fi
6907
  # GNU dynamic linker.  Since this was broken with cross compilers,
6908
    else
6908
  # most powerpc-linux boxes support dynamic linking these days and
6909
      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
6909
  # people can always --disable-shared, the test was removed, and we
6910
    fi
6910
  # assume the GNU/Linux dynamic linker is in use.
6911
  else
6911
  dynamic_linker='GNU/Linux ld.so'
6912
    echo "$progname: failed program was:" >&5
6912
  ;;
6913
    cat conftest.$ac_ext >&5
6913
6914
  fi
6914
netbsd*)
6915
  rm -f conftest* conftst*
6915
  version_type=sunos
6916
6916
  need_lib_prefix=no
6917
  # Do not use the global_symbol_pipe unless it works.
6917
  need_version=no
6918
  if test "$pipe_works" = yes; then
6918
  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6919
    break
6919
    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6920
  else
6920
    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6921
    lt_cv_sys_global_symbol_pipe=
6921
    dynamic_linker='NetBSD (a.out) ld.so'
6922
  fi
6922
  else
6923
done
6923
    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
6924
6924
    soname_spec='${libname}${release}.so$major'
6925
fi
6925
    dynamic_linker='NetBSD ld.elf_so'
6926
6926
  fi
6927
global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
6927
  shlibpath_var=LD_LIBRARY_PATH
6928
if test -z "$lt_cv_sys_global_symbol_pipe"; then
6928
  shlibpath_overrides_runpath=yes
6929
  global_symbol_to_cdecl=
6929
  hardcode_into_libs=yes
6930
else
6930
  ;;
6931
  global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
6931
6932
fi
6932
newsos6)
6933
if test -z "$global_symbol_pipe$global_symbol_to_cdecl"; then
6933
  version_type=linux
6934
  echo "$as_me:$LINENO: result: failed" >&5
6934
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6935
echo "${ECHO_T}failed" >&6
6935
  shlibpath_var=LD_LIBRARY_PATH
6936
else
6936
  shlibpath_overrides_runpath=yes
6937
  echo "$as_me:$LINENO: result: ok" >&5
6937
  ;;
6938
echo "${ECHO_T}ok" >&6
6938
6939
fi
6939
openbsd*)
6940
6940
  version_type=sunos
6941
6941
  if test "$with_gnu_ld" = yes; then
6942
for ac_header in dlfcn.h
6942
    need_lib_prefix=no
6943
do
6943
    need_version=no
6944
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6944
  fi
6945
if eval "test \"\${$as_ac_Header+set}\" = set"; then
6945
  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6946
  echo "$as_me:$LINENO: checking for $ac_header" >&5
6946
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6947
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6947
  shlibpath_var=LD_LIBRARY_PATH
6948
if eval "test \"\${$as_ac_Header+set}\" = set"; then
6948
  ;;
6949
  echo $ECHO_N "(cached) $ECHO_C" >&6
6949
6950
fi
6950
os2*)
6951
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
6951
  libname_spec='$name'
6952
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6952
  need_lib_prefix=no
6953
else
6953
  library_names_spec='$libname.dll $libname.a'
6954
  # Is the header compilable?
6954
  dynamic_linker='OS/2 ld.exe'
6955
echo "$as_me:$LINENO: checking $ac_header usability" >&5
6955
  shlibpath_var=LIBPATH
6956
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
6956
  ;;
6957
cat >conftest.$ac_ext <<_ACEOF
6957
6958
#line $LINENO "configure"
6958
osf3* | osf4* | osf5*)
6959
#include "confdefs.h"
6959
  version_type=osf
6960
$ac_includes_default
6960
  need_version=no
6961
#include <$ac_header>
6961
  soname_spec='${libname}${release}.so'
6962
_ACEOF
6962
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6963
rm -f conftest.$ac_objext
6963
  shlibpath_var=LD_LIBRARY_PATH
6964
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
6964
  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6965
  (eval $ac_compile) 2>&5
6965
  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
6966
  ac_status=$?
6966
  ;;
6967
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
6967
6968
  (exit $ac_status); } &&
6968
sco3.2v5*)
6969
         { ac_try='test -s conftest.$ac_objext'
6969
  version_type=osf
6970
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
6970
  soname_spec='${libname}${release}.so$major'
6971
  (eval $ac_try) 2>&5
6971
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6972
  ac_status=$?
6972
  shlibpath_var=LD_LIBRARY_PATH
6973
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
6973
  ;;
6974
  (exit $ac_status); }; }; then
6974
6975
  ac_header_compiler=yes
6975
solaris*)
6976
else
6976
  version_type=linux
6977
  echo "$as_me: failed program was:" >&5
6977
  need_lib_prefix=no
6978
cat conftest.$ac_ext >&5
6978
  need_version=no
6979
ac_header_compiler=no
6979
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6980
fi
6980
  soname_spec='${libname}${release}.so$major'
6981
rm -f conftest.$ac_objext conftest.$ac_ext
6981
  shlibpath_var=LD_LIBRARY_PATH
6982
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
6982
  shlibpath_overrides_runpath=yes
6983
echo "${ECHO_T}$ac_header_compiler" >&6
6983
  hardcode_into_libs=yes
6984
6984
  # ldd complains unless libraries are executable
6985
# Is the header present?
6985
  postinstall_cmds='chmod +x $lib'
6986
echo "$as_me:$LINENO: checking $ac_header presence" >&5
6986
  ;;
6987
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
6987
6988
cat >conftest.$ac_ext <<_ACEOF
6988
sunos4*)
6989
#line $LINENO "configure"
6989
  version_type=sunos
6990
#include "confdefs.h"
6990
  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6991
#include <$ac_header>
6991
  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6992
_ACEOF
6992
  shlibpath_var=LD_LIBRARY_PATH
6993
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
6993
  shlibpath_overrides_runpath=yes
6994
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6994
  if test "$with_gnu_ld" = yes; then
6995
  ac_status=$?
6995
    need_lib_prefix=no
6996
  egrep -v '^ *\+' conftest.er1 >conftest.err
6996
  fi
6997
  rm -f conftest.er1
6997
  need_version=yes
6998
  cat conftest.err >&5
6998
  ;;
6999
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
6999
7000
  (exit $ac_status); } >/dev/null; then
7000
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
7001
  if test -s conftest.err; then
7001
  version_type=linux
7002
    ac_cpp_err=$ac_c_preproc_warn_flag
7002
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
7003
  else
7003
  soname_spec='${libname}${release}.so$major'
7004
    ac_cpp_err=
7004
  shlibpath_var=LD_LIBRARY_PATH
7005
  fi
7005
  case $host_vendor in
7006
else
7006
    sni)
7007
  ac_cpp_err=yes
7007
      shlibpath_overrides_runpath=no
7008
fi
7008
      ;;
7009
if test -z "$ac_cpp_err"; then
7009
    motorola)
7010
  ac_header_preproc=yes
7010
      need_lib_prefix=no
7011
else
7011
      need_version=no
7012
  echo "$as_me: failed program was:" >&5
7012
      shlibpath_overrides_runpath=no
7013
  cat conftest.$ac_ext >&5
7013
      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
7014
  ac_header_preproc=no
7014
      ;;
7015
fi
7015
  esac
7016
rm -f conftest.err conftest.$ac_ext
7016
  ;;
7017
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
7017
7018
echo "${ECHO_T}$ac_header_preproc" >&6
7018
uts4*)
7019
7019
  version_type=linux
7020
# So?  What about this header?
7020
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
7021
case $ac_header_compiler:$ac_header_preproc in
7021
  soname_spec='${libname}${release}.so$major'
7022
  yes:no )
7022
  shlibpath_var=LD_LIBRARY_PATH
7023
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
7023
  ;;
7024
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
7024
7025
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
7025
dgux*)
7026
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
7026
  version_type=linux
7027
  no:yes )
7027
  need_lib_prefix=no
7028
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
7028
  need_version=no
7029
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
7029
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
7030
    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
7030
  soname_spec='${libname}${release}.so$major'
7031
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
7031
  shlibpath_var=LD_LIBRARY_PATH
7032
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
7032
  ;;
7033
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
7033
7034
esac
7034
sysv4*MP*)
7035
echo "$as_me:$LINENO: checking for $ac_header" >&5
7035
  if test -d /usr/nec ;then
7036
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7036
    version_type=linux
7037
if eval "test \"\${$as_ac_Header+set}\" = set"; then
7037
    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
7038
  echo $ECHO_N "(cached) $ECHO_C" >&6
7038
    soname_spec='$libname.so.$major'
7039
else
7039
    shlibpath_var=LD_LIBRARY_PATH
7040
  eval "$as_ac_Header=$ac_header_preproc"
7040
  fi
7041
fi
7041
  ;;
7042
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
7042
7043
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7043
*)
7044
7044
  dynamic_linker=no
7045
fi
7045
  ;;
7046
if test `eval echo '${'$as_ac_Header'}'` = yes; then
7046
esac
7047
  cat >>confdefs.h <<_ACEOF
7047
echo "$ac_t""$dynamic_linker" 1>&6
7048
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7048
test "$dynamic_linker" = no && can_build_shared=no
7049
_ACEOF
7049
##
7050
7050
## END FIXME
7051
fi
7051
7052
7052
## FIXME: this should be a separate macro
7053
done
7053
##
7054
7054
# Report the final consequences.
7055
7055
echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
7056
7056
echo "configure:7057: checking if libtool supports shared libraries" >&5
7057
7057
echo "$ac_t""$can_build_shared" 1>&6
7058
7058
##
7059
# Only perform the check for file, if the check method requires it
7059
## END FIXME
7060
case $deplibs_check_method in
7060
7061
file_magic*)
7061
if test "$hardcode_action" = relink; then
7062
  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
7062
  # Fast installation is not supported
7063
    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
7063
  enable_fast_install=no
7064
echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
7064
elif test "$shlibpath_overrides_runpath" = yes ||
7065
if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
7065
     test "$enable_shared" = no; then
7066
  echo $ECHO_N "(cached) $ECHO_C" >&6
7066
  # Fast installation is not necessary
7067
else
7067
  enable_fast_install=needless
7068
  case $MAGIC_CMD in
7068
fi
7069
  /*)
7069
7070
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
7070
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
7071
  ;;
7071
if test "$GCC" = yes; then
7072
  ?:/*)
7072
  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7073
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
7073
fi
7074
  ;;
7074
7075
  *)
7075
if test "x$enable_dlopen" != xyes; then
7076
  ac_save_MAGIC_CMD="$MAGIC_CMD"
7076
  enable_dlopen=unknown
7077
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7077
  enable_dlopen_self=unknown
7078
  ac_dummy="/usr/bin:$PATH"
7078
  enable_dlopen_self_static=unknown
7079
  for ac_dir in $ac_dummy; do
7079
else
7080
    test -z "$ac_dir" && ac_dir=.
7080
  lt_cv_dlopen=no
7081
    if test -f $ac_dir/${ac_tool_prefix}file; then
7081
  lt_cv_dlopen_libs=
7082
      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
7082
7083
      if test -n "$file_magic_test_file"; then
7083
  case $host_os in
7084
	case $deplibs_check_method in
7084
  beos*)
7085
	"file_magic "*)
7085
    lt_cv_dlopen="load_add_on"
7086
	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
7086
    lt_cv_dlopen_libs=
7087
	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7087
    lt_cv_dlopen_self=yes
7088
	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7088
    ;;
7089
	    egrep "$file_magic_regex" > /dev/null; then
7089
7090
	    :
7090
  cygwin* | mingw* | pw32*)
7091
	  else
7091
    lt_cv_dlopen="LoadLibrary"
7092
	    cat <<EOF 1>&2
7092
    lt_cv_dlopen_libs=
7093
7093
   ;;
7094
*** Warning: the command libtool uses to detect shared libraries,
7094
7095
*** $file_magic_cmd, produces output that libtool cannot recognize.
7095
  *)
7096
*** The result is that libtool may fail to recognize shared libraries
7096
    echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
7097
*** as such.  This will affect the creation of libtool libraries that
7097
echo "configure:7098: checking for dlopen in -ldl" >&5
7098
*** depend on shared libraries, but programs linked with such libtool
7098
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
7099
*** libraries will work regardless of this problem.  Nevertheless, you
7099
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7100
*** may want to report the problem to your system manager and/or to
7100
  echo $ac_n "(cached) $ac_c" 1>&6
7101
*** bug-libtool@gnu.org
7101
else
7102
7102
  ac_save_LIBS="$LIBS"
7103
EOF
7103
LIBS="-ldl  $LIBS"
7104
	  fi ;;
7104
cat > conftest.$ac_ext <<EOF
7105
	esac
7105
#line 7106 "configure"
7106
      fi
7106
#include "confdefs.h"
7107
      break
7107
/* Override any gcc2 internal prototype to avoid an error.  */
7108
    fi
7108
/* We use char because int might match the return type of a gcc2
7109
  done
7109
    builtin and then its argument prototype would still apply.  */
7110
  IFS="$ac_save_ifs"
7110
char dlopen();
7111
  MAGIC_CMD="$ac_save_MAGIC_CMD"
7111
7112
  ;;
7112
int main() {
7113
esac
7113
dlopen()
7114
fi
7114
; return 0; }
7115
7115
EOF
7116
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7116
if { (eval echo configure:7117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7117
if test -n "$MAGIC_CMD"; then
7117
  rm -rf conftest*
7118
  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
7118
  eval "ac_cv_lib_$ac_lib_var=yes"
7119
echo "${ECHO_T}$MAGIC_CMD" >&6
7119
else
7120
else
7120
  echo "configure: failed program was:" >&5
7121
  echo "$as_me:$LINENO: result: no" >&5
7121
  cat conftest.$ac_ext >&5
7122
echo "${ECHO_T}no" >&6
7122
  rm -rf conftest*
7123
fi
7123
  eval "ac_cv_lib_$ac_lib_var=no"
7124
7124
fi
7125
if test -z "$lt_cv_path_MAGIC_CMD"; then
7125
rm -f conftest*
7126
  if test -n "$ac_tool_prefix"; then
7126
LIBS="$ac_save_LIBS"
7127
    echo "$as_me:$LINENO: checking for file" >&5
7127
7128
echo $ECHO_N "checking for file... $ECHO_C" >&6
7128
fi
7129
if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
7129
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7130
  echo $ECHO_N "(cached) $ECHO_C" >&6
7130
  echo "$ac_t""yes" 1>&6
7131
else
7131
  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
7132
  case $MAGIC_CMD in
7132
else
7133
  /*)
7133
  echo "$ac_t""no" 1>&6
7134
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
7134
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
7135
  ;;
7135
echo "configure:7136: checking for dlopen" >&5
7136
  ?:/*)
7136
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
7137
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
7137
  echo $ac_n "(cached) $ac_c" 1>&6
7138
  ;;
7138
else
7139
  *)
7139
  cat > conftest.$ac_ext <<EOF
7140
  ac_save_MAGIC_CMD="$MAGIC_CMD"
7140
#line 7141 "configure"
7141
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7141
#include "confdefs.h"
7142
  ac_dummy="/usr/bin:$PATH"
7142
/* System header to define __stub macros and hopefully few prototypes,
7143
  for ac_dir in $ac_dummy; do
7143
    which can conflict with char dlopen(); below.  */
7144
    test -z "$ac_dir" && ac_dir=.
7144
#include <assert.h>
7145
    if test -f $ac_dir/file; then
7145
/* Override any gcc2 internal prototype to avoid an error.  */
7146
      lt_cv_path_MAGIC_CMD="$ac_dir/file"
7146
/* We use char because int might match the return type of a gcc2
7147
      if test -n "$file_magic_test_file"; then
7147
    builtin and then its argument prototype would still apply.  */
7148
	case $deplibs_check_method in
7148
char dlopen();
7149
	"file_magic "*)
7149
7150
	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
7150
int main() {
7151
	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7151
7152
	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7152
/* The GNU C library defines this for functions which it implements
7153
	    egrep "$file_magic_regex" > /dev/null; then
7153
    to always fail with ENOSYS.  Some functions are actually named
7154
	    :
7154
    something starting with __ and the normal name is an alias.  */
7155
	  else
7155
#if defined (__stub_dlopen) || defined (__stub___dlopen)
7156
	    cat <<EOF 1>&2
7156
choke me
7157
7157
#else
7158
*** Warning: the command libtool uses to detect shared libraries,
7158
dlopen();
7159
*** $file_magic_cmd, produces output that libtool cannot recognize.
7159
#endif
7160
*** The result is that libtool may fail to recognize shared libraries
7160
7161
*** as such.  This will affect the creation of libtool libraries that
7161
; return 0; }
7162
*** depend on shared libraries, but programs linked with such libtool
7162
EOF
7163
*** libraries will work regardless of this problem.  Nevertheless, you
7163
if { (eval echo configure:7164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7164
*** may want to report the problem to your system manager and/or to
7164
  rm -rf conftest*
7165
*** bug-libtool@gnu.org
7165
  eval "ac_cv_func_dlopen=yes"
7166
7166
else
7167
EOF
7167
  echo "configure: failed program was:" >&5
7168
	  fi ;;
7168
  cat conftest.$ac_ext >&5
7169
	esac
7169
  rm -rf conftest*
7170
      fi
7170
  eval "ac_cv_func_dlopen=no"
7171
      break
7171
fi
7172
    fi
7172
rm -f conftest*
7173
  done
7173
fi
7174
  IFS="$ac_save_ifs"
7174
7175
  MAGIC_CMD="$ac_save_MAGIC_CMD"
7175
if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
7176
  ;;
7176
  echo "$ac_t""yes" 1>&6
7177
esac
7177
  lt_cv_dlopen="dlopen"
7178
fi
7178
else
7179
7179
  echo "$ac_t""no" 1>&6
7180
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7180
echo $ac_n "checking for shl_load""... $ac_c" 1>&6
7181
if test -n "$MAGIC_CMD"; then
7181
echo "configure:7182: checking for shl_load" >&5
7182
  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
7182
if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
7183
echo "${ECHO_T}$MAGIC_CMD" >&6
7183
  echo $ac_n "(cached) $ac_c" 1>&6
7184
else
7184
else
7185
  echo "$as_me:$LINENO: result: no" >&5
7185
  cat > conftest.$ac_ext <<EOF
7186
echo "${ECHO_T}no" >&6
7186
#line 7187 "configure"
7187
fi
7187
#include "confdefs.h"
7188
7188
/* System header to define __stub macros and hopefully few prototypes,
7189
  else
7189
    which can conflict with char shl_load(); below.  */
7190
    MAGIC_CMD=:
7190
#include <assert.h>
7191
  fi
7191
/* Override any gcc2 internal prototype to avoid an error.  */
7192
fi
7192
/* We use char because int might match the return type of a gcc2
7193
7193
    builtin and then its argument prototype would still apply.  */
7194
  fi
7194
char shl_load();
7195
  ;;
7195
7196
esac
7196
int main() {
7197
7197
7198
if test -n "$ac_tool_prefix"; then
7198
/* The GNU C library defines this for functions which it implements
7199
  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
7199
    to always fail with ENOSYS.  Some functions are actually named
7200
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
7200
    something starting with __ and the normal name is an alias.  */
7201
echo "$as_me:$LINENO: checking for $ac_word" >&5
7201
#if defined (__stub_shl_load) || defined (__stub___shl_load)
7202
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7202
choke me
7203
if test "${ac_cv_prog_RANLIB+set}" = set; then
7203
#else
7204
  echo $ECHO_N "(cached) $ECHO_C" >&6
7204
shl_load();
7205
else
7205
#endif
7206
  if test -n "$RANLIB"; then
7206
7207
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
7207
; return 0; }
7208
else
7208
EOF
7209
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7209
if { (eval echo configure:7210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7210
for as_dir in $PATH
7210
  rm -rf conftest*
7211
do
7211
  eval "ac_cv_func_shl_load=yes"
7212
  IFS=$as_save_IFS
7212
else
7213
  test -z "$as_dir" && as_dir=.
7213
  echo "configure: failed program was:" >&5
7214
  for ac_exec_ext in '' $ac_executable_extensions; do
7214
  cat conftest.$ac_ext >&5
7215
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7215
  rm -rf conftest*
7216
    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
7216
  eval "ac_cv_func_shl_load=no"
7217
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7217
fi
7218
    break 2
7218
rm -f conftest*
7219
  fi
7219
fi
7220
done
7220
7221
done
7221
if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
7222
7222
  echo "$ac_t""yes" 1>&6
7223
fi
7223
  lt_cv_dlopen="shl_load"
7224
fi
7224
else
7225
RANLIB=$ac_cv_prog_RANLIB
7225
  echo "$ac_t""no" 1>&6
7226
if test -n "$RANLIB"; then
7226
echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
7227
  echo "$as_me:$LINENO: result: $RANLIB" >&5
7227
echo "configure:7228: checking for dlopen in -lsvld" >&5
7228
echo "${ECHO_T}$RANLIB" >&6
7228
ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'`
7229
else
7229
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7230
  echo "$as_me:$LINENO: result: no" >&5
7230
  echo $ac_n "(cached) $ac_c" 1>&6
7231
echo "${ECHO_T}no" >&6
7231
else
7232
fi
7232
  ac_save_LIBS="$LIBS"
7233
7233
LIBS="-lsvld  $LIBS"
7234
fi
7234
cat > conftest.$ac_ext <<EOF
7235
if test -z "$ac_cv_prog_RANLIB"; then
7235
#line 7236 "configure"
7236
  ac_ct_RANLIB=$RANLIB
7236
#include "confdefs.h"
7237
  # Extract the first word of "ranlib", so it can be a program name with args.
7237
/* Override any gcc2 internal prototype to avoid an error.  */
7238
set dummy ranlib; ac_word=$2
7238
/* We use char because int might match the return type of a gcc2
7239
echo "$as_me:$LINENO: checking for $ac_word" >&5
7239
    builtin and then its argument prototype would still apply.  */
7240
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7240
char dlopen();
7241
if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
7241
7242
  echo $ECHO_N "(cached) $ECHO_C" >&6
7242
int main() {
7243
else
7243
dlopen()
7244
  if test -n "$ac_ct_RANLIB"; then
7244
; return 0; }
7245
  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
7245
EOF
7246
else
7246
if { (eval echo configure:7247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7247
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7247
  rm -rf conftest*
7248
for as_dir in $PATH
7248
  eval "ac_cv_lib_$ac_lib_var=yes"
7249
do
7249
else
7250
  IFS=$as_save_IFS
7250
  echo "configure: failed program was:" >&5
7251
  test -z "$as_dir" && as_dir=.
7251
  cat conftest.$ac_ext >&5
7252
  for ac_exec_ext in '' $ac_executable_extensions; do
7252
  rm -rf conftest*
7253
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7253
  eval "ac_cv_lib_$ac_lib_var=no"
7254
    ac_cv_prog_ac_ct_RANLIB="ranlib"
7254
fi
7255
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7255
rm -f conftest*
7256
    break 2
7256
LIBS="$ac_save_LIBS"
7257
  fi
7257
7258
done
7258
fi
7259
done
7259
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7260
7260
  echo "$ac_t""yes" 1>&6
7261
  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
7261
  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
7262
fi
7262
else
7263
fi
7263
  echo "$ac_t""no" 1>&6
7264
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
7264
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
7265
if test -n "$ac_ct_RANLIB"; then
7265
echo "configure:7266: checking for shl_load in -ldld" >&5
7266
  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
7266
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
7267
echo "${ECHO_T}$ac_ct_RANLIB" >&6
7267
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7268
else
7268
  echo $ac_n "(cached) $ac_c" 1>&6
7269
  echo "$as_me:$LINENO: result: no" >&5
7269
else
7270
echo "${ECHO_T}no" >&6
7270
  ac_save_LIBS="$LIBS"
7271
fi
7271
LIBS="-ldld  $LIBS"
7272
7272
cat > conftest.$ac_ext <<EOF
7273
  RANLIB=$ac_ct_RANLIB
7273
#line 7274 "configure"
7274
else
7274
#include "confdefs.h"
7275
  RANLIB="$ac_cv_prog_RANLIB"
7275
/* Override any gcc2 internal prototype to avoid an error.  */
7276
fi
7276
/* We use char because int might match the return type of a gcc2
7277
7277
    builtin and then its argument prototype would still apply.  */
7278
if test -n "$ac_tool_prefix"; then
7278
char shl_load();
7279
  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
7279
7280
set dummy ${ac_tool_prefix}strip; ac_word=$2
7280
int main() {
7281
echo "$as_me:$LINENO: checking for $ac_word" >&5
7281
shl_load()
7282
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7282
; return 0; }
7283
if test "${ac_cv_prog_STRIP+set}" = set; then
7283
EOF
7284
  echo $ECHO_N "(cached) $ECHO_C" >&6
7284
if { (eval echo configure:7285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7285
else
7285
  rm -rf conftest*
7286
  if test -n "$STRIP"; then
7286
  eval "ac_cv_lib_$ac_lib_var=yes"
7287
  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
7287
else
7288
else
7288
  echo "configure: failed program was:" >&5
7289
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7289
  cat conftest.$ac_ext >&5
7290
for as_dir in $PATH
7290
  rm -rf conftest*
7291
do
7291
  eval "ac_cv_lib_$ac_lib_var=no"
7292
  IFS=$as_save_IFS
7292
fi
7293
  test -z "$as_dir" && as_dir=.
7293
rm -f conftest*
7294
  for ac_exec_ext in '' $ac_executable_extensions; do
7294
LIBS="$ac_save_LIBS"
7295
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7295
7296
    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
7296
fi
7297
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7297
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7298
    break 2
7298
  echo "$ac_t""yes" 1>&6
7299
  fi
7299
  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
7300
done
7300
else
7301
done
7301
  echo "$ac_t""no" 1>&6
7302
7302
fi
7303
fi
7303
7304
fi
7304
	    
7305
STRIP=$ac_cv_prog_STRIP
7305
fi
7306
if test -n "$STRIP"; then
7306
7307
  echo "$as_me:$LINENO: result: $STRIP" >&5
7307
          
7308
echo "${ECHO_T}$STRIP" >&6
7308
fi
7309
else
7309
7310
  echo "$as_me:$LINENO: result: no" >&5
7310
        
7311
echo "${ECHO_T}no" >&6
7311
fi
7312
fi
7312
7313
7313
      
7314
fi
7314
fi
7315
if test -z "$ac_cv_prog_STRIP"; then
7315
7316
  ac_ct_STRIP=$STRIP
7316
    ;;
7317
  # Extract the first word of "strip", so it can be a program name with args.
7317
  esac
7318
set dummy strip; ac_word=$2
7318
7319
echo "$as_me:$LINENO: checking for $ac_word" >&5
7319
  if test "x$lt_cv_dlopen" != xno; then
7320
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7320
    enable_dlopen=yes
7321
if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
7321
  else
7322
  echo $ECHO_N "(cached) $ECHO_C" >&6
7322
    enable_dlopen=no
7323
else
7323
  fi
7324
  if test -n "$ac_ct_STRIP"; then
7324
7325
  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
7325
  case $lt_cv_dlopen in
7326
else
7326
  dlopen)
7327
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7327
    save_CPPFLAGS="$CPPFLAGS"
7328
for as_dir in $PATH
7328
        test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
7329
do
7329
7330
  IFS=$as_save_IFS
7330
    save_LDFLAGS="$LDFLAGS"
7331
  test -z "$as_dir" && as_dir=.
7331
    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
7332
  for ac_exec_ext in '' $ac_executable_extensions; do
7332
7333
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7333
    save_LIBS="$LIBS"
7334
    ac_cv_prog_ac_ct_STRIP="strip"
7334
    LIBS="$lt_cv_dlopen_libs $LIBS"
7335
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7335
7336
    break 2
7336
    echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
7337
  fi
7337
echo "configure:7338: checking whether a program can dlopen itself" >&5
7338
done
7338
if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then
7339
done
7339
  echo $ac_n "(cached) $ac_c" 1>&6
7340
7340
else
7341
  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
7341
  	  if test "$cross_compiling" = yes; then :
7342
fi
7342
  lt_cv_dlopen_self=cross
7343
fi
7343
else
7344
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
7344
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
7345
if test -n "$ac_ct_STRIP"; then
7345
  lt_status=$lt_dlunknown
7346
  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
7346
  cat > conftest.$ac_ext <<EOF
7347
echo "${ECHO_T}$ac_ct_STRIP" >&6
7347
#line 7348 "configure"
7348
else
7348
#include "confdefs.h"
7349
  echo "$as_me:$LINENO: result: no" >&5
7349
7350
echo "${ECHO_T}no" >&6
7350
#if HAVE_DLFCN_H
7351
fi
7351
#include <dlfcn.h>
7352
7352
#endif
7353
  STRIP=$ac_ct_STRIP
7353
7354
else
7354
#include <stdio.h>
7355
  STRIP="$ac_cv_prog_STRIP"
7355
7356
fi
7356
#ifdef RTLD_GLOBAL
7357
7357
#  define LT_DLGLOBAL		RTLD_GLOBAL
7358
7358
#else
7359
enable_dlopen=no
7359
#  ifdef DL_GLOBAL
7360
enable_win32_dll=no
7360
#    define LT_DLGLOBAL		DL_GLOBAL
7361
7361
#  else
7362
# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
7362
#    define LT_DLGLOBAL		0
7363
if test "${enable_libtool_lock+set}" = set; then
7363
#  endif
7364
  enableval="$enable_libtool_lock"
7364
#endif
7365
7365
7366
fi;
7366
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
7367
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
7367
   find out it does not work in some platform. */
7368
7368
#ifndef LT_DLLAZY_OR_NOW
7369
# Some flags need to be propagated to the compiler or linker for good
7369
#  ifdef RTLD_LAZY
7370
# libtool support.
7370
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
7371
case $host in
7371
#  else
7372
*-*-irix6*)
7372
#    ifdef DL_LAZY
7373
  # Find out which ABI we are using.
7373
#      define LT_DLLAZY_OR_NOW		DL_LAZY
7374
  echo '#line 7374 "configure"' > conftest.$ac_ext
7374
#    else
7375
  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
7375
#      ifdef RTLD_NOW
7376
  (eval $ac_compile) 2>&5
7376
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
7377
  ac_status=$?
7377
#      else
7378
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
7378
#        ifdef DL_NOW
7379
  (exit $ac_status); }; then
7379
#          define LT_DLLAZY_OR_NOW	DL_NOW
7380
    case `/usr/bin/file conftest.$ac_objext` in
7380
#        else
7381
    *32-bit*)
7381
#          define LT_DLLAZY_OR_NOW	0
7382
      LD="${LD-ld} -32"
7382
#        endif
7383
      ;;
7383
#      endif
7384
    *N32*)
7384
#    endif
7385
      LD="${LD-ld} -n32"
7385
#  endif
7386
      ;;
7386
#endif
7387
    *64-bit*)
7387
7388
      LD="${LD-ld} -64"
7388
#ifdef __cplusplus
7389
      ;;
7389
extern "C" void exit (int);
7390
    esac
7390
#endif
7391
  fi
7391
7392
  rm -rf conftest*
7392
void fnord() { int i=42;}
7393
  ;;
7393
int main ()
7394
7394
{
7395
*-*-sco3.2v5*)
7395
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
7396
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
7396
  int status = $lt_dlunknown;
7397
  SAVE_CFLAGS="$CFLAGS"
7397
7398
  CFLAGS="$CFLAGS -belf"
7398
  if (self)
7399
  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
7399
    {
7400
echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
7400
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
7401
if test "${lt_cv_cc_needs_belf+set}" = set; then
7401
      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
7402
  echo $ECHO_N "(cached) $ECHO_C" >&6
7402
      /* dlclose (self); */
7403
else
7403
    }
7404
7404
7405
7405
    exit (status);
7406
     ac_ext=c
7406
}
7407
ac_cpp='$CPP $CPPFLAGS'
7407
EOF
7408
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7408
  if { (eval echo configure:7409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
7409
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7409
    (./conftest; exit; ) 2>/dev/null
7410
ac_compiler_gnu=$ac_cv_c_compiler_gnu
7410
    lt_status=$?
7411
7411
    case x$lt_status in
7412
     cat >conftest.$ac_ext <<_ACEOF
7412
      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
7413
#line $LINENO "configure"
7413
      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
7414
#include "confdefs.h"
7414
      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
7415
7415
    esac
7416
#ifdef F77_DUMMY_MAIN
7416
  else :
7417
#  ifdef __cplusplus
7417
    # compilation failed
7418
     extern "C"
7418
    lt_cv_dlopen_self=no
7419
#  endif
7419
  fi
7420
   int F77_DUMMY_MAIN() { return 1; }
7420
fi
7421
#endif
7421
rm -fr conftest*
7422
int
7422
7423
main ()
7423
    
7424
{
7424
fi
7425
7425
7426
  ;
7426
echo "$ac_t""$lt_cv_dlopen_self" 1>&6
7427
  return 0;
7427
7428
}
7428
    if test "x$lt_cv_dlopen_self" = xyes; then
7429
_ACEOF
7429
      LDFLAGS="$LDFLAGS $link_static_flag"
7430
rm -f conftest.$ac_objext conftest$ac_exeext
7430
      echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
7431
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
7431
echo "configure:7432: checking whether a statically linked program can dlopen itself" >&5
7432
  (eval $ac_link) 2>&5
7432
if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then
7433
  ac_status=$?
7433
  echo $ac_n "(cached) $ac_c" 1>&6
7434
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
7434
else
7435
  (exit $ac_status); } &&
7435
  	  if test "$cross_compiling" = yes; then :
7436
         { ac_try='test -s conftest$ac_exeext'
7436
  lt_cv_dlopen_self_static=cross
7437
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
7437
else
7438
  (eval $ac_try) 2>&5
7438
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
7439
  ac_status=$?
7439
  lt_status=$lt_dlunknown
7440
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
7440
  cat > conftest.$ac_ext <<EOF
7441
  (exit $ac_status); }; }; then
7441
#line 7442 "configure"
7442
  lt_cv_cc_needs_belf=yes
7442
#include "confdefs.h"
7443
else
7443
7444
  echo "$as_me: failed program was:" >&5
7444
#if HAVE_DLFCN_H
7445
cat conftest.$ac_ext >&5
7445
#include <dlfcn.h>
7446
lt_cv_cc_needs_belf=no
7446
#endif
7447
fi
7447
7448
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7448
#include <stdio.h>
7449
     ac_ext=c
7449
7450
ac_cpp='$CPP $CPPFLAGS'
7450
#ifdef RTLD_GLOBAL
7451
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7451
#  define LT_DLGLOBAL		RTLD_GLOBAL
7452
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7452
#else
7453
ac_compiler_gnu=$ac_cv_c_compiler_gnu
7453
#  ifdef DL_GLOBAL
7454
7454
#    define LT_DLGLOBAL		DL_GLOBAL
7455
fi
7455
#  else
7456
echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
7456
#    define LT_DLGLOBAL		0
7457
echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
7457
#  endif
7458
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
7458
#endif
7459
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
7459
7460
    CFLAGS="$SAVE_CFLAGS"
7460
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
7461
  fi
7461
   find out it does not work in some platform. */
7462
  ;;
7462
#ifndef LT_DLLAZY_OR_NOW
7463
7463
#  ifdef RTLD_LAZY
7464
7464
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
7465
esac
7465
#  else
7466
7466
#    ifdef DL_LAZY
7467
# Sed substitution that helps us do robust quoting.  It backslashifies
7467
#      define LT_DLLAZY_OR_NOW		DL_LAZY
7468
# metacharacters that are still active within double-quoted strings.
7468
#    else
7469
Xsed='sed -e s/^X//'
7469
#      ifdef RTLD_NOW
7470
sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
7470
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
7471
7471
#      else
7472
# Same as above, but do not quote variable references.
7472
#        ifdef DL_NOW
7473
double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
7473
#          define LT_DLLAZY_OR_NOW	DL_NOW
7474
7474
#        else
7475
# Sed substitution to delay expansion of an escaped shell variable in a
7475
#          define LT_DLLAZY_OR_NOW	0
7476
# double_quote_subst'ed string.
7476
#        endif
7477
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
7477
#      endif
7478
7478
#    endif
7479
# Constants:
7479
#  endif
7480
rm="rm -f"
7480
#endif
7481
7481
7482
# Global variables:
7482
#ifdef __cplusplus
7483
default_ofile=libtool
7483
extern "C" void exit (int);
7484
can_build_shared=yes
7484
#endif
7485
7485
7486
# All known linkers require a `.a' archive for static linking (except M$VC,
7486
void fnord() { int i=42;}
7487
# which needs '.lib').
7487
int main ()
7488
libext=a
7488
{
7489
ltmain="$ac_aux_dir/ltmain.sh"
7489
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
7490
ofile="$default_ofile"
7490
  int status = $lt_dlunknown;
7491
with_gnu_ld="$lt_cv_prog_gnu_ld"
7491
7492
need_locks="$enable_libtool_lock"
7492
  if (self)
7493
7493
    {
7494
old_CC="$CC"
7494
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
7495
old_CFLAGS="$CFLAGS"
7495
      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
7496
7496
      /* dlclose (self); */
7497
# Set sane defaults for various variables
7497
    }
7498
test -z "$AR" && AR=ar
7498
7499
test -z "$AR_FLAGS" && AR_FLAGS=cru
7499
    exit (status);
7500
test -z "$AS" && AS=as
7500
}
7501
test -z "$CC" && CC=cc
7501
EOF
7502
test -z "$DLLTOOL" && DLLTOOL=dlltool
7502
  if { (eval echo configure:7503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
7503
test -z "$LD" && LD=ld
7503
    (./conftest; exit; ) 2>/dev/null
7504
test -z "$LN_S" && LN_S="ln -s"
7504
    lt_status=$?
7505
test -z "$MAGIC_CMD" && MAGIC_CMD=file
7505
    case x$lt_status in
7506
test -z "$NM" && NM=nm
7506
      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
7507
test -z "$OBJDUMP" && OBJDUMP=objdump
7507
      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
7508
test -z "$RANLIB" && RANLIB=:
7508
      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
7509
test -z "$STRIP" && STRIP=:
7509
    esac
7510
test -z "$ac_objext" && ac_objext=o
7510
  else :
7511
7511
    # compilation failed
7512
if test x"$host" != x"$build"; then
7512
    lt_cv_dlopen_self_static=no
7513
  ac_tool_prefix=${host_alias}-
7513
  fi
7514
else
7514
fi
7515
  ac_tool_prefix=
7515
rm -fr conftest*
7516
fi
7516
7517
7517
      
7518
# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
7518
fi
7519
case $host_os in
7519
7520
linux-gnu*) ;;
7520
echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
7521
linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
7521
    fi
7522
esac
7522
7523
7523
    CPPFLAGS="$save_CPPFLAGS"
7524
case $host_os in
7524
    LDFLAGS="$save_LDFLAGS"
7525
aix3*)
7525
    LIBS="$save_LIBS"
7526
  # AIX sometimes has problems with the GCC collect2 program.  For some
7526
    ;;
7527
  # reason, if we set the COLLECT_NAMES environment variable, the problems
7527
  esac
7528
  # vanish in a puff of smoke.
7528
7529
  if test "X${COLLECT_NAMES+set}" != Xset; then
7529
  case $lt_cv_dlopen_self in
7530
    COLLECT_NAMES=
7530
  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
7531
    export COLLECT_NAMES
7531
  *) enable_dlopen_self=unknown ;;
7532
  fi
7532
  esac
7533
  ;;
7533
7534
esac
7534
  case $lt_cv_dlopen_self_static in
7535
7535
  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
7536
# Determine commands to create old-style static archives.
7536
  *) enable_dlopen_self_static=unknown ;;
7537
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
7537
  esac
7538
old_postinstall_cmds='chmod 644 $oldlib'
7538
fi
7539
old_postuninstall_cmds=
7539
7540
7540
7541
if test -n "$RANLIB"; then
7541
## FIXME: this should be a separate macro
7542
  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
7542
##
7543
  old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
7543
if test "$enable_shared" = yes && test "$GCC" = yes; then
7544
fi
7544
  case $archive_cmds in
7545
7545
  *'~'*)
7546
# Allow CC to be a program name with arguments.
7546
    # FIXME: we may have to deal with multi-command sequences.
7547
set dummy $CC
7547
    ;;
7548
compiler="$2"
7548
  '$CC '*)
7549
7549
    # Test whether the compiler implicitly links with -lc since on some
7550
## FIXME: this should be a separate macro
7550
    # systems, -lgcc has to come before -lc. If gcc already passes -lc
7551
##
7551
    # to ld, don't add -lc before -lgcc.
7552
echo "$as_me:$LINENO: checking for objdir" >&5
7552
    echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
7553
echo $ECHO_N "checking for objdir... $ECHO_C" >&6
7553
echo "configure:7554: checking whether -lc should be explicitly linked in" >&5
7554
rm -f .libs 2>/dev/null
7554
    if eval "test \"`echo '$''{'lt_cv_archive_cmds_need_lc'+set}'`\" = set"; then
7555
mkdir .libs 2>/dev/null
7555
  echo $ac_n "(cached) $ac_c" 1>&6
7556
if test -d .libs; then
7556
else
7557
  objdir=.libs
7557
  $rm conftest*
7558
else
7558
    echo 'static int dummy;' > conftest.$ac_ext
7559
  # MS-DOS does not allow filenames that begin with a dot.
7559
7560
  objdir=_libs
7560
    if { (eval echo configure:7561: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7561
fi
7561
      soname=conftest
7562
rmdir .libs 2>/dev/null
7562
      lib=conftest
7563
echo "$as_me:$LINENO: result: $objdir" >&5
7563
      libobjs=conftest.$ac_objext
7564
echo "${ECHO_T}$objdir" >&6
7564
      deplibs=
7565
##
7565
      wl=$lt_cv_prog_cc_wl
7566
## END FIXME
7566
      compiler_flags=-v
7567
7567
      linker_flags=-v
7568
7568
      verstring=
7569
## FIXME: this should be a separate macro
7569
      output_objdir=.
7570
##
7570
      libname=conftest
7571
7571
      save_allow_undefined_flag=$allow_undefined_flag
7572
# Check whether --with-pic or --without-pic was given.
7572
      allow_undefined_flag=
7573
if test "${with_pic+set}" = set; then
7573
      if { (eval echo configure:7574: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
7574
  withval="$with_pic"
7574
      then
7575
  pic_mode="$withval"
7575
	lt_cv_archive_cmds_need_lc=no
7576
else
7576
      else
7577
  pic_mode=default
7577
	lt_cv_archive_cmds_need_lc=yes
7578
fi;
7578
      fi
7579
test -z "$pic_mode" && pic_mode=default
7579
      allow_undefined_flag=$save_allow_undefined_flag
7580
7580
    else
7581
# We assume here that the value for lt_cv_prog_cc_pic will not be cached
7581
      cat conftest.err 1>&5
7582
# in isolation, and that seeing it set (from the cache) indicates that
7582
    fi
7583
# the associated values are set (in the cache) correctly too.
7583
fi
7584
echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
7584
7585
echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
7585
    echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
7586
if test "${lt_cv_prog_cc_pic+set}" = set; then
7586
    ;;
7587
  echo $ECHO_N "(cached) $ECHO_C" >&6
7587
  esac
7588
else
7588
fi
7589
   lt_cv_prog_cc_pic=
7589
need_lc=${lt_cv_archive_cmds_need_lc-yes}
7590
  lt_cv_prog_cc_shlib=
7590
##
7591
  lt_cv_prog_cc_wl=
7591
## END FIXME
7592
  lt_cv_prog_cc_static=
7592
7593
  lt_cv_prog_cc_no_builtin=
7593
## FIXME: this should be a separate macro
7594
  lt_cv_prog_cc_can_build_shared=$can_build_shared
7594
##
7595
7595
# The second clause should only fire when bootstrapping the
7596
  if test "$GCC" = yes; then
7596
# libtool distribution, otherwise you forgot to ship ltmain.sh
7597
    lt_cv_prog_cc_wl='-Wl,'
7597
# with your package, and you will get complaints that there are
7598
    lt_cv_prog_cc_static='-static'
7598
# no rules to generate ltmain.sh.
7599
7599
if test -f "$ltmain"; then
7600
    case $host_os in
7600
  :
7601
    aix*)
7601
else
7602
      # Below there is a dirty hack to force normal static linking with -ldl
7602
  # If there is no Makefile yet, we rely on a make rule to execute
7603
      # The problem is because libdl dynamically linked with both libc and
7603
  # `config.status --recheck' to rerun these tests and create the
7604
      # libC (AIX C++ library), which obviously doesn't included in libraries
7604
  # libtool script then.
7605
      # list by gcc. This cause undefined symbols with -static flags.
7605
  test -f Makefile && make "$ltmain"
7606
      # This hack allows C programs to be linked with "-static -ldl", but
7606
fi
7607
      # we not sure about C++ programs.
7607
7608
      lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
7608
if test -f "$ltmain"; then
7609
      ;;
7609
  trap "$rm \"${ofile}T\"; exit 1" 1 2 15
7610
    amigaos*)
7610
  $rm -f "${ofile}T"
7611
      # FIXME: we need at least 68020 code to build shared libraries, but
7611
7612
      # adding the `-m68020' flag to GCC prevents building anything better,
7612
  echo creating $ofile
7613
      # like `-m68040'.
7613
7614
      lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
7614
  # Now quote all the things that may contain metacharacters while being
7615
      ;;
7615
  # careful not to overquote the AC_SUBSTed values.  We take copies of the
7616
    beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
7616
  # variables and quote the copies for generation of the libtool script.
7617
      # PIC is the default for these OSes.
7617
  for var in echo old_CC old_CFLAGS \
7618
      ;;
7618
    AR AR_FLAGS CC LD LN_S NM SHELL \
7619
    darwin* | rhapsody*)
7619
    reload_flag reload_cmds wl \
7620
      # PIC is the default on this platform
7620
    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
7621
      # Common symbols not allowed in MH_DYLIB files
7621
    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
7622
      lt_cv_prog_cc_pic='-fno-common'
7622
    library_names_spec soname_spec \
7623
      ;;
7623
    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
7624
    cygwin* | mingw* | pw32* | os2*)
7624
    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
7625
      # This hack is so that the source file can tell whether it is being
7625
    postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
7626
      # built for inclusion in a dll (and should export symbols for example).
7626
    old_striplib striplib file_magic_cmd export_symbols_cmds \
7627
      lt_cv_prog_cc_pic='-DDLL_EXPORT'
7627
    deplibs_check_method allow_undefined_flag no_undefined_flag \
7628
      ;;
7628
    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
7629
    sysv4*MP*)
7629
    hardcode_libdir_flag_spec hardcode_libdir_separator  \
7630
      if test -d /usr/nec; then
7630
    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
7631
	 lt_cv_prog_cc_pic=-Kconform_pic
7631
    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
7632
      fi
7632
7633
      ;;
7633
    case $var in
7634
    *)
7634
    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
7635
      lt_cv_prog_cc_pic='-fPIC'
7635
    old_postinstall_cmds | old_postuninstall_cmds | \
7636
      ;;
7636
    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
7637
    esac
7637
    extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
7638
  else
7638
    postinstall_cmds | postuninstall_cmds | \
7639
    # PORTME Check for PIC flags for the system compiler.
7639
    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
7640
    case $host_os in
7640
      # Double-quote double-evaled strings.
7641
    aix3* | aix4* | aix5*)
7641
      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
7642
      # All AIX code is PIC.
7642
      ;;
7643
      if test "$host_cpu" = ia64; then
7643
    *)
7644
        # AIX 5 now supports IA64 processor
7644
      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
7645
        lt_cv_prog_cc_static='-Bstatic'
7645
      ;;
7646
        lt_cv_prog_cc_wl='-Wl,'
7646
    esac
7647
      else
7647
  done
7648
        lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
7648
7649
      fi
7649
  cat <<__EOF__ > "${ofile}T"
7650
      ;;
7650
#! $SHELL
7651
7651
7652
    hpux9* | hpux10* | hpux11*)
7652
# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
7653
      # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
7653
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
7654
      lt_cv_prog_cc_wl='-Wl,'
7654
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7655
      lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
7655
#
7656
      lt_cv_prog_cc_pic='+Z'
7656
# Copyright (C) 1996-2000 Free Software Foundation, Inc.
7657
      ;;
7657
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7658
7658
#
7659
    irix5* | irix6*)
7659
# This program is free software; you can redistribute it and/or modify
7660
      lt_cv_prog_cc_wl='-Wl,'
7660
# it under the terms of the GNU General Public License as published by
7661
      lt_cv_prog_cc_static='-non_shared'
7661
# the Free Software Foundation; either version 2 of the License, or
7662
      # PIC (with -KPIC) is the default.
7662
# (at your option) any later version.
7663
      ;;
7663
#
7664
7664
# This program is distributed in the hope that it will be useful, but
7665
    cygwin* | mingw* | pw32* | os2*)
7665
# WITHOUT ANY WARRANTY; without even the implied warranty of
7666
      # This hack is so that the source file can tell whether it is being
7666
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7667
      # built for inclusion in a dll (and should export symbols for example).
7667
# General Public License for more details.
7668
      lt_cv_prog_cc_pic='-DDLL_EXPORT'
7668
#
7669
      ;;
7669
# You should have received a copy of the GNU General Public License
7670
7670
# along with this program; if not, write to the Free Software
7671
    newsos6)
7671
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7672
      lt_cv_prog_cc_pic='-KPIC'
7672
#
7673
      lt_cv_prog_cc_static='-Bstatic'
7673
# As a special exception to the GNU General Public License, if you
7674
      ;;
7674
# distribute this file as part of a program that contains a
7675
7675
# configuration script generated by Autoconf, you may include it under
7676
    osf3* | osf4* | osf5*)
7676
# the same distribution terms that you use for the rest of that program.
7677
      # All OSF/1 code is PIC.
7677
7678
      lt_cv_prog_cc_wl='-Wl,'
7678
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
7679
      lt_cv_prog_cc_static='-non_shared'
7679
Xsed="sed -e s/^X//"
7680
      ;;
7680
7681
7681
# The HP-UX ksh and POSIX shell print the target directory to stdout
7682
    sco3.2v5*)
7682
# if CDPATH is set.
7683
      lt_cv_prog_cc_pic='-Kpic'
7683
if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
7684
      lt_cv_prog_cc_static='-dn'
7684
7685
      lt_cv_prog_cc_shlib='-belf'
7685
# ### BEGIN LIBTOOL CONFIG
7686
      ;;
7686
7687
7687
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7688
    solaris*)
7688
7689
      lt_cv_prog_cc_pic='-KPIC'
7689
# Shell to use when invoking shell scripts.
7690
      lt_cv_prog_cc_static='-Bstatic'
7690
SHELL=$lt_SHELL
7691
      lt_cv_prog_cc_wl='-Wl,'
7691
7692
      ;;
7692
# Whether or not to build shared libraries.
7693
7693
build_libtool_libs=$enable_shared
7694
    sunos4*)
7694
7695
      lt_cv_prog_cc_pic='-PIC'
7695
# Whether or not to add -lc for building shared libraries.
7696
      lt_cv_prog_cc_static='-Bstatic'
7696
build_libtool_need_lc=$need_lc
7697
      lt_cv_prog_cc_wl='-Qoption ld '
7697
7698
      ;;
7698
# Whether or not to build static libraries.
7699
7699
build_old_libs=$enable_static
7700
    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
7700
7701
      lt_cv_prog_cc_pic='-KPIC'
7701
# Whether or not to optimize for fast installation.
7702
      lt_cv_prog_cc_static='-Bstatic'
7702
fast_install=$enable_fast_install
7703
      if test "x$host_vendor" = xsni; then
7703
7704
        lt_cv_prog_cc_wl='-LD'
7704
# The host system.
7705
      else
7705
host_alias=$host_alias
7706
        lt_cv_prog_cc_wl='-Wl,'
7706
host=$host
7707
      fi
7707
7708
      ;;
7708
# An echo program that does not interpret backslashes.
7709
7709
echo=$lt_echo
7710
    uts4*)
7710
7711
      lt_cv_prog_cc_pic='-pic'
7711
# The archiver.
7712
      lt_cv_prog_cc_static='-Bstatic'
7712
AR=$lt_AR
7713
      ;;
7713
AR_FLAGS=$lt_AR_FLAGS
7714
7714
7715
    sysv4*MP*)
7715
# The default C compiler.
7716
      if test -d /usr/nec ;then
7716
CC=$lt_CC
7717
	lt_cv_prog_cc_pic='-Kconform_pic'
7717
7718
	lt_cv_prog_cc_static='-Bstatic'
7718
# Is the compiler the GNU C compiler?
7719
      fi
7719
with_gcc=$GCC
7720
      ;;
7720
7721
7721
# The linker used to build libraries.
7722
    *)
7722
LD=$lt_LD
7723
      lt_cv_prog_cc_can_build_shared=no
7723
7724
      ;;
7724
# Whether we need hard or soft links.
7725
    esac
7725
LN_S=$lt_LN_S
7726
  fi
7726
7727
7727
# A BSD-compatible nm program.
7728
fi
7728
NM=$lt_NM
7729
7729
7730
if test -z "$lt_cv_prog_cc_pic"; then
7730
# A symbol stripping program
7731
  echo "$as_me:$LINENO: result: none" >&5
7731
STRIP=$STRIP
7732
echo "${ECHO_T}none" >&6
7732
7733
else
7733
# Used to examine libraries when file_magic_cmd begins "file"
7734
  echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic" >&5
7734
MAGIC_CMD=$MAGIC_CMD
7735
echo "${ECHO_T}$lt_cv_prog_cc_pic" >&6
7735
7736
7736
# Used on cygwin: DLL creation program.
7737
  # Check to make sure the pic_flag actually works.
7737
DLLTOOL="$DLLTOOL"
7738
  echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
7738
7739
echo $ECHO_N "checking if $compiler PIC flag $lt_cv_prog_cc_pic works... $ECHO_C" >&6
7739
# Used on cygwin: object dumper.
7740
  if test "${lt_cv_prog_cc_pic_works+set}" = set; then
7740
OBJDUMP="$OBJDUMP"
7741
  echo $ECHO_N "(cached) $ECHO_C" >&6
7741
7742
else
7742
# Used on cygwin: assembler.
7743
      save_CFLAGS="$CFLAGS"
7743
AS="$AS"
7744
    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
7744
7745
    cat >conftest.$ac_ext <<_ACEOF
7745
# The name of the directory that contains temporary libtool files.
7746
#line $LINENO "configure"
7746
objdir=$objdir
7747
#include "confdefs.h"
7747
7748
7748
# How to create reloadable object files.
7749
#ifdef F77_DUMMY_MAIN
7749
reload_flag=$lt_reload_flag
7750
#  ifdef __cplusplus
7750
reload_cmds=$lt_reload_cmds
7751
     extern "C"
7751
7752
#  endif
7752
# How to pass a linker flag through the compiler.
7753
   int F77_DUMMY_MAIN() { return 1; }
7753
wl=$lt_wl
7754
#endif
7754
7755
int
7755
# Object file suffix (normally "o").
7756
main ()
7756
objext="$ac_objext"
7757
{
7757
7758
7758
# Old archive suffix (normally "a").
7759
  ;
7759
libext="$libext"
7760
  return 0;
7760
7761
}
7761
# Executable file suffix (normally "").
7762
_ACEOF
7762
exeext="$exeext"
7763
rm -f conftest.$ac_objext
7763
7764
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
7764
# Additional compiler flags for building library objects.
7765
  (eval $ac_compile) 2>&5
7765
pic_flag=$lt_pic_flag
7766
  ac_status=$?
7766
pic_mode=$pic_mode
7767
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
7767
7768
  (exit $ac_status); } &&
7768
# Does compiler simultaneously support -c and -o options?
7769
         { ac_try='test -s conftest.$ac_objext'
7769
compiler_c_o=$lt_compiler_c_o
7770
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
7770
7771
  (eval $ac_try) 2>&5
7771
# Can we write directly to a .lo ?
7772
  ac_status=$?
7772
compiler_o_lo=$lt_compiler_o_lo
7773
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
7773
7774
  (exit $ac_status); }; }; then
7774
# Must we lock files when doing compilation ?
7775
        case $host_os in
7775
need_locks=$lt_need_locks
7776
      hpux9* | hpux10* | hpux11*)
7776
7777
	# On HP-UX, both CC and GCC only warn that PIC is supported... then
7777
# Do we need the lib prefix for modules?
7778
	# they create non-PIC objects.  So, if there were any warnings, we
7778
need_lib_prefix=$need_lib_prefix
7779
	# assume that PIC is not supported.
7779
7780
	if test -s conftest.err; then
7780
# Do we need a version for libraries?
7781
	  lt_cv_prog_cc_pic_works=no
7781
need_version=$need_version
7782
	else
7782
7783
	  lt_cv_prog_cc_pic_works=yes
7783
# Whether dlopen is supported.
7784
	fi
7784
dlopen_support=$enable_dlopen
7785
	;;
7785
7786
      *)
7786
# Whether dlopen of programs is supported.
7787
	lt_cv_prog_cc_pic_works=yes
7787
dlopen_self=$enable_dlopen_self
7788
	;;
7788
7789
      esac
7789
# Whether dlopen of statically linked programs is supported.
7790
7790
dlopen_self_static=$enable_dlopen_self_static
7791
else
7791
7792
  echo "$as_me: failed program was:" >&5
7792
# Compiler flag to prevent dynamic linking.
7793
cat conftest.$ac_ext >&5
7793
link_static_flag=$lt_link_static_flag
7794
      lt_cv_prog_cc_pic_works=no
7794
7795
7795
# Compiler flag to turn off builtin functions.
7796
fi
7796
no_builtin_flag=$lt_no_builtin_flag
7797
rm -f conftest.$ac_objext conftest.$ac_ext
7797
7798
    CFLAGS="$save_CFLAGS"
7798
# Compiler flag to allow reflexive dlopens.
7799
7799
export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
7800
fi
7800
7801
7801
# Compiler flag to generate shared objects directly from archives.
7802
7802
whole_archive_flag_spec=$lt_whole_archive_flag_spec
7803
  if test "X$lt_cv_prog_cc_pic_works" = Xno; then
7803
7804
    lt_cv_prog_cc_pic=
7804
# Compiler flag to generate thread-safe objects.
7805
    lt_cv_prog_cc_can_build_shared=no
7805
thread_safe_flag_spec=$lt_thread_safe_flag_spec
7806
  else
7806
7807
    lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
7807
# Library versioning type.
7808
  fi
7808
version_type=$version_type
7809
7809
7810
  echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic_works" >&5
7810
# Format of library name prefix.
7811
echo "${ECHO_T}$lt_cv_prog_cc_pic_works" >&6
7811
libname_spec=$lt_libname_spec
7812
fi
7812
7813
##
7813
# List of archive names.  First name is the real one, the rest are links.
7814
## END FIXME
7814
# The last name is the one that the linker finds with -lNAME.
7815
7815
library_names_spec=$lt_library_names_spec
7816
# Check for any special shared library compilation flags.
7816
7817
if test -n "$lt_cv_prog_cc_shlib"; then
7817
# The coded name of the library, if different from the real name.
7818
  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&5
7818
soname_spec=$lt_soname_spec
7819
echo "$as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&2;}
7819
7820
  if echo "$old_CC $old_CFLAGS " | egrep -e "[ 	]$lt_cv_prog_cc_shlib[ 	]" >/dev/null; then :
7820
# Commands used to build and install an old-style archive.
7821
  else
7821
RANLIB=$lt_RANLIB
7822
   { echo "$as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
7822
old_archive_cmds=$lt_old_archive_cmds
7823
echo "$as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
7823
old_postinstall_cmds=$lt_old_postinstall_cmds
7824
    lt_cv_prog_cc_can_build_shared=no
7824
old_postuninstall_cmds=$lt_old_postuninstall_cmds
7825
  fi
7825
7826
fi
7826
# Create an old-style archive from a shared archive.
7827
7827
old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
7828
## FIXME: this should be a separate macro
7828
7829
##
7829
# Create a temporary old-style archive to link instead of a shared archive.
7830
echo "$as_me:$LINENO: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
7830
old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
7831
echo $ECHO_N "checking if $compiler static flag $lt_cv_prog_cc_static works... $ECHO_C" >&6
7831
7832
if test "${lt_cv_prog_cc_static_works+set}" = set; then
7832
# Commands used to build and install a shared archive.
7833
  echo $ECHO_N "(cached) $ECHO_C" >&6
7833
archive_cmds=$lt_archive_cmds
7834
else
7834
archive_expsym_cmds=$lt_archive_expsym_cmds
7835
    lt_cv_prog_cc_static_works=no
7835
postinstall_cmds=$lt_postinstall_cmds
7836
  save_LDFLAGS="$LDFLAGS"
7836
postuninstall_cmds=$lt_postuninstall_cmds
7837
  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
7837
7838
  cat >conftest.$ac_ext <<_ACEOF
7838
# Commands to strip libraries.
7839
#line $LINENO "configure"
7839
old_striplib=$lt_old_striplib
7840
#include "confdefs.h"
7840
striplib=$lt_striplib
7841
7841
7842
#ifdef F77_DUMMY_MAIN
7842
# Method to check whether dependent libraries are shared objects.
7843
#  ifdef __cplusplus
7843
deplibs_check_method=$lt_deplibs_check_method
7844
     extern "C"
7844
7845
#  endif
7845
# Command to use when deplibs_check_method == file_magic.
7846
   int F77_DUMMY_MAIN() { return 1; }
7846
file_magic_cmd=$lt_file_magic_cmd
7847
#endif
7847
7848
int
7848
# Flag that allows shared libraries with undefined symbols to be built.
7849
main ()
7849
allow_undefined_flag=$lt_allow_undefined_flag
7850
{
7850
7851
7851
# Flag that forces no undefined symbols.
7852
  ;
7852
no_undefined_flag=$lt_no_undefined_flag
7853
  return 0;
7853
7854
}
7854
# Commands used to finish a libtool library installation in a directory.
7855
_ACEOF
7855
finish_cmds=$lt_finish_cmds
7856
rm -f conftest.$ac_objext conftest$ac_exeext
7856
7857
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
7857
# Same as above, but a single script fragment to be evaled but not shown.
7858
  (eval $ac_link) 2>&5
7858
finish_eval=$lt_finish_eval
7859
  ac_status=$?
7859
7860
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
7860
# Take the output of nm and produce a listing of raw symbols and C names.
7861
  (exit $ac_status); } &&
7861
global_symbol_pipe=$lt_global_symbol_pipe
7862
         { ac_try='test -s conftest$ac_exeext'
7862
7863
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
7863
# Transform the output of nm in a proper C declaration
7864
  (eval $ac_try) 2>&5
7864
global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
7865
  ac_status=$?
7865
7866
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
7866
# This is the shared library runtime path variable.
7867
  (exit $ac_status); }; }; then
7867
runpath_var=$runpath_var
7868
  lt_cv_prog_cc_static_works=yes
7868
7869
else
7869
# This is the shared library path variable.
7870
  echo "$as_me: failed program was:" >&5
7870
shlibpath_var=$shlibpath_var
7871
cat conftest.$ac_ext >&5
7871
7872
fi
7872
# Is shlibpath searched before the hard-coded library search path?
7873
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7873
shlibpath_overrides_runpath=$shlibpath_overrides_runpath
7874
  LDFLAGS="$save_LDFLAGS"
7874
7875
7875
# How to hardcode a shared library path into an executable.
7876
fi
7876
hardcode_action=$hardcode_action
7877
7877
7878
7878
# Whether we should hardcode library paths into libraries.
7879
# Belt *and* braces to stop my trousers falling down:
7879
hardcode_into_libs=$hardcode_into_libs
7880
test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
7880
7881
echo "$as_me:$LINENO: result: $lt_cv_prog_cc_static_works" >&5
7881
# Flag to hardcode \$libdir into a binary during linking.
7882
echo "${ECHO_T}$lt_cv_prog_cc_static_works" >&6
7882
# This must work even if \$libdir does not exist.
7883
7883
hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
7884
pic_flag="$lt_cv_prog_cc_pic"
7884
7885
special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
7885
# Whether we need a single -rpath flag with a separated argument.
7886
wl="$lt_cv_prog_cc_wl"
7886
hardcode_libdir_separator=$lt_hardcode_libdir_separator
7887
link_static_flag="$lt_cv_prog_cc_static"
7887
7888
no_builtin_flag="$lt_cv_prog_cc_no_builtin"
7888
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
7889
can_build_shared="$lt_cv_prog_cc_can_build_shared"
7889
# resulting binary.
7890
##
7890
hardcode_direct=$hardcode_direct
7891
## END FIXME
7891
7892
7892
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7893
7893
# resulting binary.
7894
## FIXME: this should be a separate macro
7894
hardcode_minus_L=$hardcode_minus_L
7895
##
7895
7896
# Check to see if options -o and -c are simultaneously supported by compiler
7896
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7897
echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
7897
# the resulting binary.
7898
echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
7898
hardcode_shlibpath_var=$hardcode_shlibpath_var
7899
if test "${lt_cv_compiler_c_o+set}" = set; then
7899
7900
  echo $ECHO_N "(cached) $ECHO_C" >&6
7900
# Variables whose values should be saved in libtool wrapper scripts and
7901
else
7901
# restored at relink time.
7902
7902
variables_saved_for_relink="$variables_saved_for_relink"
7903
$rm -r conftest 2>/dev/null
7903
7904
mkdir conftest
7904
# Whether libtool must link a program against all its dependency libraries.
7905
cd conftest
7905
link_all_deplibs=$link_all_deplibs
7906
echo "int some_variable = 0;" > conftest.$ac_ext
7906
7907
mkdir out
7907
# Compile-time system search path for libraries
7908
# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
7908
sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
7909
# that will create temporary files in the current directory regardless of
7909
7910
# the output directory.  Thus, making CWD read-only will cause this test
7910
# Run-time system search path for libraries
7911
# to fail, enabling locking or at least warning the user not to do parallel
7911
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
7912
# builds.
7912
7913
chmod -w .
7913
# Fix the shell variable \$srcfile for the compiler.
7914
save_CFLAGS="$CFLAGS"
7914
fix_srcfile_path="$fix_srcfile_path"
7915
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
7915
7916
compiler_c_o=no
7916
# Set to yes if exported symbols are required.
7917
if { (eval echo configure:7917: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
7917
always_export_symbols=$always_export_symbols
7918
  # The compiler can only warn and ignore the option if not recognized
7918
7919
  # So say no if there are warnings
7919
# The commands to list exported symbols.
7920
  if test -s out/conftest.err; then
7920
export_symbols_cmds=$lt_export_symbols_cmds
7921
    lt_cv_compiler_c_o=no
7921
7922
  else
7922
# The commands to extract the exported symbol list from a shared archive.
7923
    lt_cv_compiler_c_o=yes
7923
extract_expsyms_cmds=$lt_extract_expsyms_cmds
7924
  fi
7924
7925
else
7925
# Symbols that should not be listed in the preloaded symbols.
7926
  # Append any errors to the config.log.
7926
exclude_expsyms=$lt_exclude_expsyms
7927
  cat out/conftest.err 1>&5
7927
7928
  lt_cv_compiler_c_o=no
7928
# Symbols that must always be exported.
7929
fi
7929
include_expsyms=$lt_include_expsyms
7930
CFLAGS="$save_CFLAGS"
7930
7931
chmod u+w .
7931
# ### END LIBTOOL CONFIG
7932
$rm conftest* out/*
7932
7933
rmdir out
7933
__EOF__
7934
cd ..
7934
7935
rmdir conftest
7935
  case $host_os in
7936
$rm -r conftest 2>/dev/null
7936
  aix3*)
7937
7937
    cat <<\EOF >> "${ofile}T"
7938
fi
7938
7939
7939
# AIX sometimes has problems with the GCC collect2 program.  For some
7940
compiler_c_o=$lt_cv_compiler_c_o
7940
# reason, if we set the COLLECT_NAMES environment variable, the problems
7941
echo "$as_me:$LINENO: result: $compiler_c_o" >&5
7941
# vanish in a puff of smoke.
7942
echo "${ECHO_T}$compiler_c_o" >&6
7942
if test "X${COLLECT_NAMES+set}" != Xset; then
7943
7943
  COLLECT_NAMES=
7944
if test x"$compiler_c_o" = x"yes"; then
7944
  export COLLECT_NAMES
7945
  # Check to see if we can write to a .lo
7945
fi
7946
  echo "$as_me:$LINENO: checking if $compiler supports -c -o file.lo" >&5
7946
EOF
7947
echo $ECHO_N "checking if $compiler supports -c -o file.lo... $ECHO_C" >&6
7947
    ;;
7948
  if test "${lt_cv_compiler_o_lo+set}" = set; then
7948
  esac
7949
  echo $ECHO_N "(cached) $ECHO_C" >&6
7949
7950
else
7950
  case $host_os in
7951
7951
  cygwin* | mingw* | pw32* | os2*)
7952
  lt_cv_compiler_o_lo=no
7952
    cat <<'EOF' >> "${ofile}T"
7953
  save_CFLAGS="$CFLAGS"
7953
      # This is a source program that is used to create dlls on Windows
7954
  CFLAGS="$CFLAGS -c -o conftest.lo"
7954
      # Don't remove nor modify the starting and closing comments
7955
  cat >conftest.$ac_ext <<_ACEOF
7955
# /* ltdll.c starts here */
7956
#line $LINENO "configure"
7956
# #define WIN32_LEAN_AND_MEAN
7957
#include "confdefs.h"
7957
# #include <windows.h>
7958
7958
# #undef WIN32_LEAN_AND_MEAN
7959
#ifdef F77_DUMMY_MAIN
7959
# #include <stdio.h>
7960
#  ifdef __cplusplus
7960
#
7961
     extern "C"
7961
# #ifndef __CYGWIN__
7962
#  endif
7962
# #  ifdef __CYGWIN32__
7963
   int F77_DUMMY_MAIN() { return 1; }
7963
# #    define __CYGWIN__ __CYGWIN32__
7964
#endif
7964
# #  endif
7965
int
7965
# #endif
7966
main ()
7966
#
7967
{
7967
# #ifdef __cplusplus
7968
int some_variable = 0;
7968
# extern "C" {
7969
  ;
7969
# #endif
7970
  return 0;
7970
# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
7971
}
7971
# #ifdef __cplusplus
7972
_ACEOF
7972
# }
7973
rm -f conftest.$ac_objext
7973
# #endif
7974
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
7974
#
7975
  (eval $ac_compile) 2>&5
7975
# #ifdef __CYGWIN__
7976
  ac_status=$?
7976
# #include <cygwin/cygwin_dll.h>
7977
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
7977
# DECLARE_CYGWIN_DLL( DllMain );
7978
  (exit $ac_status); } &&
7978
# #endif
7979
         { ac_try='test -s conftest.$ac_objext'
7979
# HINSTANCE __hDllInstance_base;
7980
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
7980
#
7981
  (eval $ac_try) 2>&5
7981
# BOOL APIENTRY
7982
  ac_status=$?
7982
# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
7983
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
7983
# {
7984
  (exit $ac_status); }; }; then
7984
#   __hDllInstance_base = hInst;
7985
      # The compiler can only warn and ignore the option if not recognized
7985
#   return TRUE;
7986
    # So say no if there are warnings
7986
# }
7987
    if test -s conftest.err; then
7987
# /* ltdll.c ends here */
7988
      lt_cv_compiler_o_lo=no
7988
        # This is a source program that is used to create import libraries
7989
    else
7989
        # on Windows for dlls which lack them. Don't remove nor modify the
7990
      lt_cv_compiler_o_lo=yes
7990
        # starting and closing comments
7991
    fi
7991
# /* impgen.c starts here */
7992
7992
# /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
7993
else
7993
#
7994
  echo "$as_me: failed program was:" >&5
7994
#  This file is part of GNU libtool.
7995
cat conftest.$ac_ext >&5
7995
#
7996
fi
7996
#  This program is free software; you can redistribute it and/or modify
7997
rm -f conftest.$ac_objext conftest.$ac_ext
7997
#  it under the terms of the GNU General Public License as published by
7998
  CFLAGS="$save_CFLAGS"
7998
#  the Free Software Foundation; either version 2 of the License, or
7999
7999
#  (at your option) any later version.
8000
fi
8000
#
8001
8001
#  This program is distributed in the hope that it will be useful,
8002
  compiler_o_lo=$lt_cv_compiler_o_lo
8002
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
8003
  echo "$as_me:$LINENO: result: $compiler_c_lo" >&5
8003
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
8004
echo "${ECHO_T}$compiler_c_lo" >&6
8004
#  GNU General Public License for more details.
8005
else
8005
#
8006
  compiler_o_lo=no
8006
#  You should have received a copy of the GNU General Public License
8007
fi
8007
#  along with this program; if not, write to the Free Software
8008
##
8008
#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
8009
## END FIXME
8009
#  */
8010
8010
#
8011
## FIXME: this should be a separate macro
8011
# #include <stdio.h>		/* for printf() */
8012
##
8012
# #include <unistd.h>		/* for open(), lseek(), read() */
8013
# Check to see if we can do hard links to lock some files if needed
8013
# #include <fcntl.h>		/* for O_RDONLY, O_BINARY */
8014
hard_links="nottested"
8014
# #include <string.h>		/* for strdup() */
8015
if test "$compiler_c_o" = no && test "$need_locks" != no; then
8015
#
8016
  # do not overwrite the value of need_locks provided by the user
8016
# /* O_BINARY isn't required (or even defined sometimes) under Unix */
8017
  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
8017
# #ifndef O_BINARY
8018
echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
8018
# #define O_BINARY 0
8019
  hard_links=yes
8019
# #endif
8020
  $rm conftest*
8020
#
8021
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
8021
# static unsigned int
8022
  touch conftest.a
8022
# pe_get16 (fd, offset)
8023
  ln conftest.a conftest.b 2>&5 || hard_links=no
8023
#      int fd;
8024
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
8024
#      int offset;
8025
  echo "$as_me:$LINENO: result: $hard_links" >&5
8025
# {
8026
echo "${ECHO_T}$hard_links" >&6
8026
#   unsigned char b[2];
8027
  if test "$hard_links" = no; then
8027
#   lseek (fd, offset, SEEK_SET);
8028
    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
8028
#   read (fd, b, 2);
8029
echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
8029
#   return b[0] + (b[1]<<8);
8030
    need_locks=warn
8030
# }
8031
  fi
8031
#
8032
else
8032
# static unsigned int
8033
  need_locks=no
8033
# pe_get32 (fd, offset)
8034
fi
8034
#     int fd;
8035
##
8035
#     int offset;
8036
## END FIXME
8036
# {
8037
8037
#   unsigned char b[4];
8038
## FIXME: this should be a separate macro
8038
#   lseek (fd, offset, SEEK_SET);
8039
##
8039
#   read (fd, b, 4);
8040
if test "$GCC" = yes; then
8040
#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
8041
  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
8041
# }
8042
  echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
8042
#
8043
echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
8043
# static unsigned int
8044
  echo "int some_variable = 0;" > conftest.$ac_ext
8044
# pe_as32 (ptr)
8045
  save_CFLAGS="$CFLAGS"
8045
#      void *ptr;
8046
  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
8046
# {
8047
  compiler_rtti_exceptions=no
8047
#   unsigned char *b = ptr;
8048
  cat >conftest.$ac_ext <<_ACEOF
8048
#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
8049
#line $LINENO "configure"
8049
# }
8050
#include "confdefs.h"
8050
#
8051
8051
# int
8052
#ifdef F77_DUMMY_MAIN
8052
# main (argc, argv)
8053
#  ifdef __cplusplus
8053
#     int argc;
8054
     extern "C"
8054
#     char *argv[];
8055
#  endif
8055
# {
8056
   int F77_DUMMY_MAIN() { return 1; }
8056
#     int dll;
8057
#endif
8057
#     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
8058
int
8058
#     unsigned long export_rva, export_size, nsections, secptr, expptr;
8059
main ()
8059
#     unsigned long name_rvas, nexp;
8060
{
8060
#     unsigned char *expdata, *erva;
8061
int some_variable = 0;
8061
#     char *filename, *dll_name;
8062
  ;
8062
#
8063
  return 0;
8063
#     filename = argv[1];
8064
}
8064
#
8065
_ACEOF
8065
#     dll = open(filename, O_RDONLY|O_BINARY);
8066
rm -f conftest.$ac_objext
8066
#     if (dll < 1)
8067
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
8067
# 	return 1;
8068
  (eval $ac_compile) 2>&5
8068
#
8069
  ac_status=$?
8069
#     dll_name = filename;
8070
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
8070
#
8071
  (exit $ac_status); } &&
8071
#     for (i=0; filename[i]; i++)
8072
         { ac_try='test -s conftest.$ac_objext'
8072
# 	if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
8073
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8073
# 	    dll_name = filename + i +1;
8074
  (eval $ac_try) 2>&5
8074
#
8075
  ac_status=$?
8075
#     pe_header_offset = pe_get32 (dll, 0x3c);
8076
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
8076
#     opthdr_ofs = pe_header_offset + 4 + 20;
8077
  (exit $ac_status); }; }; then
8077
#     num_entries = pe_get32 (dll, opthdr_ofs + 92);
8078
      # The compiler can only warn and ignore the option if not recognized
8078
#
8079
    # So say no if there are warnings
8079
#     if (num_entries < 1) /* no exports */
8080
    if test -s conftest.err; then
8080
# 	return 1;
8081
      compiler_rtti_exceptions=no
8081
#
8082
    else
8082
#     export_rva = pe_get32 (dll, opthdr_ofs + 96);
8083
      compiler_rtti_exceptions=yes
8083
#     export_size = pe_get32 (dll, opthdr_ofs + 100);
8084
    fi
8084
#     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
8085
8085
#     secptr = (pe_header_offset + 4 + 20 +
8086
else
8086
# 	      pe_get16 (dll, pe_header_offset + 4 + 16));
8087
  echo "$as_me: failed program was:" >&5
8087
#
8088
cat conftest.$ac_ext >&5
8088
#     expptr = 0;
8089
fi
8089
#     for (i = 0; i < nsections; i++)
8090
rm -f conftest.$ac_objext conftest.$ac_ext
8090
#     {
8091
  CFLAGS="$save_CFLAGS"
8091
# 	char sname[8];
8092
  echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5
8092
# 	unsigned long secptr1 = secptr + 40 * i;
8093
echo "${ECHO_T}$compiler_rtti_exceptions" >&6
8093
# 	unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
8094
8094
# 	unsigned long vsize = pe_get32 (dll, secptr1 + 16);
8095
  if test "$compiler_rtti_exceptions" = "yes"; then
8095
# 	unsigned long fptr = pe_get32 (dll, secptr1 + 20);
8096
    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
8096
# 	lseek(dll, secptr1, SEEK_SET);
8097
  else
8097
# 	read(dll, sname, 8);
8098
    no_builtin_flag=' -fno-builtin'
8098
# 	if (vaddr <= export_rva && vaddr+vsize > export_rva)
8099
  fi
8099
# 	{
8100
fi
8100
# 	    expptr = fptr + (export_rva - vaddr);
8101
##
8101
# 	    if (export_rva + export_size > vaddr + vsize)
8102
## END FIXME
8102
# 		export_size = vsize - (export_rva - vaddr);
8103
8103
# 	    break;
8104
## FIXME: this should be a separate macro
8104
# 	}
8105
##
8105
#     }
8106
# See if the linker supports building shared libraries.
8106
#
8107
echo "$as_me:$LINENO: checking whether the linker ($LD) supports shared libraries" >&5
8107
#     expdata = (unsigned char*)malloc(export_size);
8108
echo $ECHO_N "checking whether the linker ($LD) supports shared libraries... $ECHO_C" >&6
8108
#     lseek (dll, expptr, SEEK_SET);
8109
8109
#     read (dll, expdata, export_size);
8110
allow_undefined_flag=
8110
#     erva = expdata - export_rva;
8111
no_undefined_flag=
8111
#
8112
need_lib_prefix=unknown
8112
#     nexp = pe_as32 (expdata+24);
8113
need_version=unknown
8113
#     name_rvas = pe_as32 (expdata+32);
8114
# when you set need_version to no, make sure it does not cause -set_version
8114
#
8115
# flags to be left without arguments
8115
#     printf ("EXPORTS\n");
8116
archive_cmds=
8116
#     for (i = 0; i<nexp; i++)
8117
archive_expsym_cmds=
8117
#     {
8118
old_archive_from_new_cmds=
8118
# 	unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
8119
old_archive_from_expsyms_cmds=
8119
# 	printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
8120
export_dynamic_flag_spec=
8120
#     }
8121
whole_archive_flag_spec=
8121
#
8122
thread_safe_flag_spec=
8122
#     return 0;
8123
hardcode_into_libs=no
8123
# }
8124
hardcode_libdir_flag_spec=
8124
# /* impgen.c ends here */
8125
hardcode_libdir_separator=
8125
8126
hardcode_direct=no
8126
EOF
8127
hardcode_minus_L=no
8127
    ;;
8128
hardcode_shlibpath_var=unsupported
8128
  esac
8129
runpath_var=
8129
8130
link_all_deplibs=unknown
8130
  # We use sed instead of cat because bash on DJGPP gets confused if
8131
always_export_symbols=no
8131
  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
8132
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
8132
  # text mode, it properly converts lines to CR/LF.  This bash problem
8133
# include_expsyms should be a list of space-separated symbols to be *always*
8133
  # is reportedly fixed, but why not run on old versions too?
8134
# included in the symbol list
8134
  sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
8135
include_expsyms=
8135
8136
# exclude_expsyms can be an egrep regular expression of symbols to exclude
8136
  mv -f "${ofile}T" "$ofile" || \
8137
# it will be wrapped by ` (' and `)$', so one must not match beginning or
8137
    (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
8138
# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
8138
  chmod +x "$ofile"
8139
# as well as any symbol that contains `d'.
8139
fi
8140
exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
8140
##
8141
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
8141
## END FIXME
8142
# platforms (ab)use it in PIC code, but their linkers get confused if
8142
8143
# the symbol is explicitly referenced.  Since portable code cannot
8143
8144
# rely on this symbol name, it's probably fine to never include it in
8144
8145
# preloaded symbol tables.
8145
8146
extract_expsyms_cmds=
8146
8147
8147
# This can be used to rebuild libtool when needed
8148
case $host_os in
8148
LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
8149
cygwin* | mingw* | pw32* )
8149
8150
  # FIXME: the MSVC++ port hasn't been tested in a loooong time
8150
# Always use our own libtool.
8151
  # When not using gcc, we currently assume that we are using
8151
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
8152
  # Microsoft Visual C++.
8152
8153
  if test "$GCC" != yes; then
8153
# Prevent multiple expansion
8154
    with_gnu_ld=no
8154
8155
  fi
8155
8156
  ;;
8156
		O=lo
8157
8157
		A=la
8158
esac
8158
		LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
8159
8159
		;;
8160
ld_shlibs=yes
8160
	*)
8161
if test "$with_gnu_ld" = yes; then
8161
		O=o
8162
  # If archive_cmds runs LD, not CC, wlarc should be empty
8162
		A=a
8163
  wlarc='${wl}'
8163
		LIBTOOL=
8164
8164
		
8165
  # See if GNU ld supports shared libraries.
8165
		LIBTOOL_MKDEP_SED=
8166
  case $host_os in
8166
		;;
8167
  aix3* | aix4* | aix5*)
8167
esac
8168
    # On AIX, the GNU linker is very broken
8168
8169
    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
8169
#
8170
    ld_shlibs=no
8170
# File name extension for static archive files, for those few places
8171
    cat <<EOF 1>&2
8171
# where they are treated differently from dynamic ones.
8172
8172
#
8173
*** Warning: the GNU linker, at least up to release 2.9.1, is reported
8173
SA=a
8174
*** to be unable to reliably create shared libraries on AIX.
8174
8175
*** Therefore, libtool is disabling shared libraries support.  If you
8175
8176
*** really care for shared libraries, you may want to modify your PATH
8176
8177
*** so that a non-GNU linker is found, and then restart.
8177
8178
8178
8179
EOF
8179
8180
    ;;
8180
#
8181
8181
# build libbind?
8182
  amigaos*)
8182
#
8183
    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
8183
# Check whether --enable-libbind or --disable-libbind was given.
8184
    hardcode_libdir_flag_spec='-L$libdir'
8184
if test "${enable_libbind+set}" = set; then
8185
    hardcode_minus_L=yes
8185
  enableval="$enable_libbind"
8186
8186
  :
8187
    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
8187
fi
8188
    # that the semantics of dynamic libraries on AmigaOS, at least up
8188
8189
    # to version 4, is to share data among multiple programs linked
8189
8190
    # with the same dynamic library.  Since this doesn't match the
8190
case "$enable_libbind" in
8191
    # behavior of shared libraries on other platforms, we can use
8191
	yes)
8192
    # them.
8192
		LIBBIND=lib/bind
8193
    ld_shlibs=no
8193
		
8194
    ;;
8194
		;;
8195
8195
	no|'')
8196
  beos*)
8196
		;;
8197
    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
8197
esac
8198
      allow_undefined_flag=unsupported
8198
8199
      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
8199
#
8200
      # support --undefined.  This deserves some investigation.  FIXME
8200
# Here begins a very long section to determine the system's networking
8201
      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8201
# capabilities.  The order of the tests is signficant.
8202
    else
8202
#
8203
      ld_shlibs=no
8203
8204
    fi
8204
#
8205
    ;;
8205
# IPv6
8206
8206
#
8207
  cygwin* | mingw* | pw32*)
8207
# Check whether --enable-ipv6 or --disable-ipv6 was given.
8208
    # hardcode_libdir_flag_spec is actually meaningless, as there is
8208
if test "${enable_ipv6+set}" = set; then
8209
    # no search path for DLLs.
8209
  enableval="$enable_ipv6"
8210
    hardcode_libdir_flag_spec='-L$libdir'
8210
  :
8211
    allow_undefined_flag=unsupported
8211
fi
8212
    always_export_symbols=yes
8212
8213
8213
8214
    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
8214
case "$enable_ipv6" in
8215
      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
8215
	yes|''|autodetect)
8216
      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
8216
		cat >> confdefs.h <<\EOF
8217
      if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
8217
#define WANT_IPV6 1
8218
      else $CC -o impgen impgen.c ; fi)~
8218
EOF
8219
      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
8219
8220
8220
		;;
8221
    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
8221
	no)
8222
8222
		;;
8223
    # cygwin and mingw dlls have different entry points and sets of symbols
8223
esac
8224
    # to exclude.
8224
8225
    # FIXME: what about values for MSVC?
8225
#
8226
    dll_entry=__cygwin_dll_entry@12
8226
# We do the IPv6 compilation checking after libtool so that we can put
8227
    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
8227
# the right suffix on the files.
8228
    case $host_os in
8228
#
8229
    mingw*)
8229
echo $ac_n "checking for IPv6 structures""... $ac_c" 1>&6
8230
      # mingw values
8230
echo "configure:8231: checking for IPv6 structures" >&5
8231
      dll_entry=_DllMainCRTStartup@12
8231
cat > conftest.$ac_ext <<EOF
8232
      dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
8232
#line 8233 "configure"
8233
      ;;
8233
#include "confdefs.h"
8234
    esac
8234
8235
8235
#include <sys/types.h>
8236
    # mingw and cygwin differ, and it's simplest to just exclude the union
8236
#include <sys/socket.h>
8237
    # of the two symbol sets.
8237
#include <netinet/in.h>
8238
    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
8238
int main() {
8239
8239
struct sockaddr_in6 sin6; return (0);
8240
    # recent cygwin and mingw systems supply a stub DllMain which the user
8240
; return 0; }
8241
    # can override, but on older systems we have to supply one (in ltdll.c)
8241
EOF
8242
    if test "x$lt_cv_need_dllmain" = "xyes"; then
8242
if { (eval echo configure:8243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8243
      ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
8243
  rm -rf conftest*
8244
      ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < [$]0 > $output_objdir/$soname-ltdll.c~
8244
  echo "$ac_t""yes" 1>&6
8245
	test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
8245
	 found_ipv6=yes
8246
    else
8246
else
8247
      ltdll_obj=
8247
  echo "configure: failed program was:" >&5
8248
      ltdll_cmds=
8248
  cat conftest.$ac_ext >&5
8249
    fi
8249
  rm -rf conftest*
8250
8250
  echo "$ac_t""no" 1>&6
8251
    # Extract the symbol export list from an `--export-all' def file,
8251
	 found_ipv6=no
8252
    # then regenerate the def file from the symbol export list, so that
8252
fi
8253
    # the compiled dll only exports the symbol export list.
8253
rm -f conftest*
8254
    # Be careful not to strip the DATA tag left be newer dlltools.
8254
8255
    export_symbols_cmds="$ltdll_cmds"'
8255
#
8256
      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
8256
# See whether IPv6 support is provided via a Kame add-on.
8257
      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
8257
# This is done before other IPv6 linking tests to LIBS is properly set.
8258
8258
#
8259
    # If the export-symbols file already is a .def file (1st line
8259
echo $ac_n "checking for Kame IPv6 support""... $ac_c" 1>&6
8260
    # is EXPORTS), use it as is.
8260
echo "configure:8261: checking for Kame IPv6 support" >&5
8261
    # If DATA tags from a recent dlltool are present, honour them!
8261
# Check whether --with-kame or --without-kame was given.
8262
    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
8262
if test "${with_kame+set}" = set; then
8263
        cp $export_symbols $output_objdir/$soname-def;
8263
  withval="$with_kame"
8264
      else
8264
  use_kame="$withval"
8265
        echo EXPORTS > $output_objdir/$soname-def;
8265
else
8266
        _lt_hint=1;
8266
  use_kame="no"
8267
        cat $export_symbols | while read symbol; do
8267
fi
8268
         set dummy \$symbol;
8268
8269
         case \$# in
8269
8270
           2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
8270
case "$use_kame" in
8271
           *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
8271
	no)
8272
         esac;
8272
		;;
8273
         _lt_hint=`expr 1 + \$_lt_hint`;
8273
	yes)
8274
        done;
8274
		kame_path=/usr/local/v6
8275
      fi~
8275
		;;
8276
      '"$ltdll_cmds"'
8276
	*)
8277
      $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
8277
		kame_path="$use_kame"
8278
      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
8278
		;;
8279
      $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
8279
esac
8280
      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
8280
8281
      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
8281
case "$use_kame" in
8282
    ;;
8282
	no)
8283
8283
		echo "$ac_t""no" 1>&6
8284
  netbsd*)
8284
		;;
8285
    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
8285
	*)
8286
      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
8286
		if test -f $kame_path/lib/libinet6.a; then
8287
      wlarc=
8287
			echo "$ac_t""$kame_path/lib/libinet6.a" 1>&6
8288
    else
8288
			LIBS="-L$kame_path/lib -linet6 $LIBS"
8289
      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8289
		else
8290
      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8290
			{ echo "configure: error: $kame_path/lib/libinet6.a not found.
8291
    fi
8291
8292
    ;;
8292
Please choose the proper path with the following command:
8293
8293
8294
  solaris* | sysv5*)
8294
    configure --with-kame=PATH
8295
    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
8295
" 1>&2; exit 1; }
8296
      ld_shlibs=no
8296
		fi
8297
      cat <<EOF 1>&2
8297
		;;
8298
8298
esac
8299
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
8299
8300
*** create shared libraries on Solaris systems.  Therefore, libtool
8300
#
8301
*** is disabling shared libraries support.  We urge you to upgrade GNU
8301
# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
8302
*** binutils to release 2.9.1 or newer.  Another option is to modify
8302
# Including it on Kame-using platforms is very bad, though, because
8303
*** your PATH or compiler configuration so that the native linker is
8303
# Kame uses #error against direct inclusion.   So include it on only
8304
*** used, and then restart.
8304
# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
8305
8305
# This is done before the in6_pktinfo check because that's what
8306
EOF
8306
# netinet6/in6.h is needed for.
8307
    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
8307
#
8308
      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8308
8309
      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8309
case "$host" in
8310
    else
8310
*-bsdi4.[01]*)
8311
      ld_shlibs=no
8311
	ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
8312
    fi
8312
	LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
8313
    ;;
8313
	isc_netinet6in6_hack="#include <netinet6/in6.h>"
8314
8314
	;;
8315
  sunos4*)
8315
*)
8316
    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8316
	ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
8317
    wlarc=
8317
	LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
8318
    hardcode_direct=yes
8318
	isc_netinet6in6_hack=""
8319
    hardcode_shlibpath_var=no
8319
	;;
8320
    ;;
8320
esac
8321
8321
8322
  *)
8322
8323
    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
8323
#
8324
      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8324
# This is similar to the netinet6/in6.h issue.
8325
      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8325
#
8326
    else
8326
case "$host" in
8327
      ld_shlibs=no
8327
*-sco-sysv*uw*)
8328
    fi
8328
        # UnixWare
8329
    ;;
8329
	ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
8330
  esac
8330
	LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
8331
8331
        ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
8332
  if test "$ld_shlibs" = yes; then
8332
	isc_netinetin6_hack="#include <netinet/in6.h>"
8333
    runpath_var=LD_RUN_PATH
8333
	;;
8334
    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
8334
*)
8335
    export_dynamic_flag_spec='${wl}--export-dynamic'
8335
	ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
8336
    case $host_os in
8336
	LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
8337
    cygwin* | mingw* | pw32*)
8337
        ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
8338
      # dlltool doesn't understand --whole-archive et. al.
8338
	isc_netinetin6_hack=""
8339
      whole_archive_flag_spec=
8339
	;;
8340
      ;;
8340
esac
8341
    *)
8341
8342
      # ancient GNU ld didn't support --whole-archive et. al.
8342
#
8343
      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
8343
# Now delve deeper into the suitability of the IPv6 support.
8344
	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
8344
#
8345
      else
8345
case "$found_ipv6" in
8346
	whole_archive_flag_spec=
8346
	yes)
8347
      fi
8347
		ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
8348
      ;;
8348
		LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
8349
    esac
8349
8350
  fi
8350
		echo $ac_n "checking for in6_addr""... $ac_c" 1>&6
8351
else
8351
echo "configure:8352: checking for in6_addr" >&5
8352
  # PORTME fill in a description of your system's linker (not GNU ld)
8352
		cat > conftest.$ac_ext <<EOF
8353
  case $host_os in
8353
#line 8354 "configure"
8354
  aix3*)
8354
#include "confdefs.h"
8355
    allow_undefined_flag=unsupported
8355
8356
    always_export_symbols=yes
8356
#include <sys/types.h>
8357
    archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
8357
#include <sys/socket.h>
8358
    # Note: this linker hardcodes the directories in LIBPATH if there
8358
#include <netinet/in.h>
8359
    # are no directories specified by -L.
8359
$isc_netinetin6_hack
8360
    hardcode_minus_L=yes
8360
$isc_netinet6in6_hack
8361
    if test "$GCC" = yes && test -z "$link_static_flag"; then
8361
8362
      # Neither direct hardcoding nor static linking is supported with a
8362
int main() {
8363
      # broken collect2.
8363
struct in6_addr in6; return (0);
8364
      hardcode_direct=unsupported
8364
; return 0; }
8365
    fi
8365
EOF
8366
    ;;
8366
if { (eval echo configure:8367: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8367
8367
  rm -rf conftest*
8368
  aix4* | aix5*)
8368
  echo "$ac_t""yes" 1>&6
8369
    # When large executables or shared objects are built, AIX ld can
8369
		 ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
8370
    # have problems creating the table of contents.  If linking a library
8370
		 LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
8371
    # or program results in "error TOC overflow" add -mminimal-toc to
8371
		 isc_in_addr6_hack=""
8372
    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
8372
else
8373
    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
8373
  echo "configure: failed program was:" >&5
8374
8374
  cat conftest.$ac_ext >&5
8375
    archive_cmds=''
8375
  rm -rf conftest*
8376
    hardcode_libdir_separator=':'
8376
  echo "$ac_t""no" 1>&6
8377
    if test "$GCC" = yes; then
8377
		 ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
8378
      collect2name=`${CC} -print-prog-name=collect2`
8378
		 LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
8379
      if test -f "$collect2name" && \
8379
		 isc_in_addr6_hack="#define in6_addr in_addr6"
8380
	 strings "$collect2name" | grep resolve_lib_name >/dev/null
8380
fi
8381
      then
8381
rm -f conftest*
8382
	# We have reworked collect2
8382
8383
	hardcode_direct=yes
8383
		echo $ac_n "checking for in6addr_any""... $ac_c" 1>&6
8384
      else
8384
echo "configure:8385: checking for in6addr_any" >&5
8385
        # We have old collect2
8385
		cat > conftest.$ac_ext <<EOF
8386
        hardcode_direct=unsupported
8386
#line 8387 "configure"
8387
        # It fails to find uninstalled libraries when the uninstalled
8387
#include "confdefs.h"
8388
        # path is not listed in the libpath.  Setting hardcode_minus_L
8388
8389
        # to unsupported forces relinking
8389
#include <sys/types.h>
8390
        hardcode_minus_L=yes
8390
#include <sys/socket.h>
8391
        hardcode_libdir_flag_spec='-L$libdir'
8391
#include <netinet/in.h>
8392
        hardcode_libdir_separator=
8392
$isc_netinetin6_hack
8393
      fi
8393
$isc_netinet6in6_hack
8394
      shared_flag='-shared'
8394
$isc_in_addr6_hack
8395
    else
8395
8396
      if test "$host_cpu" = ia64; then
8396
int main() {
8397
        shared_flag='-G'
8397
struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);
8398
      else
8398
; return 0; }
8399
        shared_flag='${wl}-bM:SRE'
8399
EOF
8400
      fi
8400
if { (eval echo configure:8401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8401
      hardcode_direct=yes
8401
  rm -rf conftest*
8402
    fi
8402
  echo "$ac_t""yes" 1>&6
8403
8403
			 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
8404
    if test "$host_cpu" = ia64; then
8404
			 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
8405
      # On IA64, the linker does run time linking by default, so we don't
8405
else
8406
      # have to do anything special.
8406
  echo "configure: failed program was:" >&5
8407
      aix_use_runtimelinking=no
8407
  cat conftest.$ac_ext >&5
8408
      exp_sym_flag='-Bexport'
8408
  rm -rf conftest*
8409
      no_entry_flag=""
8409
  echo "$ac_t""no" 1>&6
8410
    else
8410
			 ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
8411
      # Test if we are trying to use run time linking, or normal AIX style linking.
8411
			 LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"
8412
      # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
8412
fi
8413
      aix_use_runtimelinking=no
8413
rm -f conftest*
8414
      for ld_flag in $LDFLAGS; do
8414
8415
        if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
8415
		echo $ac_n "checking for in6addr_loopback""... $ac_c" 1>&6
8416
          aix_use_runtimelinking=yes
8416
echo "configure:8417: checking for in6addr_loopback" >&5
8417
          break
8417
		cat > conftest.$ac_ext <<EOF
8418
        fi
8418
#line 8419 "configure"
8419
      done
8419
#include "confdefs.h"
8420
      exp_sym_flag='-bexport'
8420
8421
      no_entry_flag='-bnoentry'
8421
#include <sys/types.h>
8422
    fi
8422
#include <sys/socket.h>
8423
    # It seems that -bexpall can do strange things, so it is better to
8423
#include <netinet/in.h>
8424
    # generate a list of symbols to export.
8424
$isc_netinetin6_hack
8425
    always_export_symbols=yes
8425
$isc_netinet6in6_hack
8426
    if test "$aix_use_runtimelinking" = yes; then
8426
$isc_in_addr6_hack
8427
      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
8427
8428
      allow_undefined_flag=' -Wl,-G'
8428
int main() {
8429
      archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
8429
struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);
8430
    else
8430
; return 0; }
8431
      if test "$host_cpu" = ia64; then
8431
EOF
8432
        hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
8432
if { (eval echo configure:8433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8433
       allow_undefined_flag="-znodefs"
8433
  rm -rf conftest*
8434
        archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
8434
  echo "$ac_t""yes" 1>&6
8435
      else
8435
			 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
8436
        hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
8436
			 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"
8437
        # Warning - without using the other run time loading flags, -berok will
8437
else
8438
        #           link without error, but may produce a broken library.
8438
  echo "configure: failed program was:" >&5
8439
        allow_undefined_flag='${wl}-berok"
8439
  cat conftest.$ac_ext >&5
8440
        # This is a bit strange, but is similar to how AIX traditionally builds
8440
  rm -rf conftest*
8441
        # it's shared libraries.
8441
  echo "$ac_t""no" 1>&6
8442
        archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
8442
			 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
8443
      fi
8443
			 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
8444
    fi
8444
fi
8445
    ;;
8445
rm -f conftest*
8446
8446
8447
  amigaos*)
8447
		echo $ac_n "checking for sin6_scope_id in struct sockaddr_in6""... $ac_c" 1>&6
8448
    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
8448
echo "configure:8449: checking for sin6_scope_id in struct sockaddr_in6" >&5
8449
    hardcode_libdir_flag_spec='-L$libdir'
8449
		cat > conftest.$ac_ext <<EOF
8450
    hardcode_minus_L=yes
8450
#line 8451 "configure"
8451
    # see comment about different semantics on the GNU ld section
8451
#include "confdefs.h"
8452
    ld_shlibs=no
8452
8453
    ;;
8453
#include <sys/types.h>
8454
8454
#include <sys/socket.h>
8455
  cygwin* | mingw* | pw32*)
8455
#include <netinet/in.h>
8456
    # When not using gcc, we currently assume that we are using
8456
$isc_netinetin6_hack
8457
    # Microsoft Visual C++.
8457
$isc_netinet6in6_hack
8458
    # hardcode_libdir_flag_spec is actually meaningless, as there is
8458
8459
    # no search path for DLLs.
8459
int main() {
8460
    hardcode_libdir_flag_spec=' '
8460
struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);
8461
    allow_undefined_flag=unsupported
8461
; return 0; }
8462
    # Tell ltmain to make .lib files, not .a files.
8462
EOF
8463
    libext=lib
8463
if { (eval echo configure:8464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8464
    # FIXME: Setting linknames here is a bad hack.
8464
  rm -rf conftest*
8465
    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
8465
  echo "$ac_t""yes" 1>&6
8466
    # The linker will automatically build a .lib file if we build a DLL.
8466
			 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
8467
    old_archive_from_new_cmds='true'
8467
else
8468
    # FIXME: Should let the user specify the lib program.
8468
  echo "configure: failed program was:" >&5
8469
    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
8469
  cat conftest.$ac_ext >&5
8470
    fix_srcfile_path='`cygpath -w "$srcfile"`'
8470
  rm -rf conftest*
8471
    ;;
8471
  echo "$ac_t""no" 1>&6
8472
8472
			 result="#undef LWRES_HAVE_SIN6_SCOPE_ID"
8473
  darwin* | rhapsody*)
8473
fi
8474
    allow_undefined_flag='-undefined suppress'
8474
rm -f conftest*
8475
    # FIXME: Relying on posixy $() will cause problems for
8475
		LWRES_HAVE_SIN6_SCOPE_ID="$result"
8476
    #        cross-compilation, but unfortunately the echo tests do not
8476
8477
    #        yet detect zsh echo's removal of \ escapes.
8477
		echo $ac_n "checking for in6_pktinfo""... $ac_c" 1>&6
8478
    archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)'
8478
echo "configure:8479: checking for in6_pktinfo" >&5
8479
    # We need to add '_' to the symbols in $export_symbols first
8479
		cat > conftest.$ac_ext <<EOF
8480
    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
8480
#line 8481 "configure"
8481
    hardcode_direct=yes
8481
#include "confdefs.h"
8482
    hardcode_shlibpath_var=no
8482
8483
    whole_archive_flag_spec='-all_load $convenience'
8483
#include <sys/types.h>
8484
    ;;
8484
#include <sys/socket.h>
8485
8485
#include <netinet/in.h>
8486
  freebsd1*)
8486
$isc_netinetin6_hack
8487
    ld_shlibs=no
8487
$isc_netinet6in6_hack
8488
    ;;
8488
8489
8489
int main() {
8490
  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
8490
struct in6_pktinfo xyzzy; return (0);
8491
  # support.  Future versions do this automatically, but an explicit c++rt0.o
8491
; return 0; }
8492
  # does not break anything, and helps significantly (at the cost of a little
8492
EOF
8493
  # extra space).
8493
if { (eval echo configure:8494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8494
  freebsd2.2*)
8494
  rm -rf conftest*
8495
    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
8495
  echo "$ac_t""yes" 1>&6
8496
    hardcode_libdir_flag_spec='-R$libdir'
8496
			 ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"
8497
    hardcode_direct=yes
8497
else
8498
    hardcode_shlibpath_var=no
8498
  echo "configure: failed program was:" >&5
8499
    ;;
8499
  cat conftest.$ac_ext >&5
8500
8500
  rm -rf conftest*
8501
  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
8501
  echo "$ac_t""no -- disabling runtime ipv6 support" 1>&6
8502
  freebsd2*)
8502
			 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
8503
    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8503
fi
8504
    hardcode_direct=yes
8504
rm -f conftest*
8505
    hardcode_minus_L=yes
8505
		;;
8506
    hardcode_shlibpath_var=no
8506
	no)
8507
    ;;
8507
		ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
8508
8508
		LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
8509
  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
8509
		ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
8510
  freebsd*)
8510
		LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
8511
    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
8511
		ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
8512
    hardcode_libdir_flag_spec='-R$libdir'
8512
		LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
8513
    hardcode_direct=yes
8513
		ISC_IPV6_H="ipv6.h"
8514
    hardcode_shlibpath_var=no
8514
		ISC_IPV6_O="ipv6.$O"
8515
    ;;
8515
		ISC_ISCIPV6_O="unix/ipv6.$O"
8516
8516
		ISC_IPV6_C="ipv6.c"
8517
  hpux9* | hpux10* | hpux11*)
8517
		;;
8518
    case $host_os in
8518
esac
8519
    hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
8519
8520
    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
8520
8521
    esac
8521
8522
    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
8522
8523
    hardcode_libdir_separator=:
8523
8524
    hardcode_direct=yes
8524
8525
    hardcode_minus_L=yes # Not in the search PATH, but as the default
8525
8526
			 # location of the library.
8526
8527
    export_dynamic_flag_spec='${wl}-E'
8527
8528
    ;;
8528
8529
8529
8530
  irix5* | irix6*)
8530
8531
    if test "$GCC" = yes; then
8531
8532
      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8532
8533
    else
8533
8534
      archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
8534
8535
    fi
8535
8536
    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8536
8537
    hardcode_libdir_separator=:
8537
8538
    link_all_deplibs=yes
8538
8539
    ;;
8539
8540
8540
#
8541
  netbsd*)
8541
# Check for network functions that are often missing.  We do this
8542
    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
8542
# after the libtool checking, so we can put the right suffix on
8543
      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
8543
# the files.  It also needs to come after checking for a Kame add-on,
8544
    else
8544
# which provides some (all?) of the desired functions.
8545
      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
8545
#
8546
    fi
8546
8547
    hardcode_libdir_flag_spec='-R$libdir'
8547
echo $ac_n "checking for inet_ntop with IPv6 support""... $ac_c" 1>&6
8548
    hardcode_direct=yes
8548
echo "configure:8549: checking for inet_ntop with IPv6 support" >&5
8549
    hardcode_shlibpath_var=no
8549
if test "$cross_compiling" = yes; then
8550
    ;;
8550
    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
8551
8551
else
8552
  newsos6)
8552
  cat > conftest.$ac_ext <<EOF
8553
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
8553
#line 8554 "configure"
8554
    hardcode_direct=yes
8554
#include "confdefs.h"
8555
    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8555
8556
    hardcode_libdir_separator=:
8556
#include <sys/types.h>
8557
    hardcode_shlibpath_var=no
8557
#include <sys/socket.h>
8558
    ;;
8558
#include <netinet/in.h>
8559
8559
#include <arpa/inet.h>
8560
  openbsd*)
8560
main() {
8561
    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8561
char a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}
8562
    hardcode_libdir_flag_spec='-R$libdir'
8562
EOF
8563
    hardcode_direct=yes
8563
if { (eval echo configure:8564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8564
    hardcode_shlibpath_var=no
8564
then
8565
    ;;
8565
  echo "$ac_t""yes" 1>&6
8566
8566
        ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"
8567
  os2*)
8567
else
8568
    hardcode_libdir_flag_spec='-L$libdir'
8568
  echo "configure: failed program was:" >&5
8569
    hardcode_minus_L=yes
8569
  cat conftest.$ac_ext >&5
8570
    allow_undefined_flag=unsupported
8570
  rm -fr conftest*
8571
    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
8571
  echo "$ac_t""no" 1>&6
8572
    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
8572
        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
8573
    ;;
8573
        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
8574
8574
        ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"
8575
  osf3*)
8575
fi
8576
    if test "$GCC" = yes; then
8576
rm -fr conftest*
8577
      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
8577
fi
8578
      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8578
8579
    else
8579
8580
      allow_undefined_flag=' -expect_unresolved \*'
8580
8581
      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
8581
# On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
8582
    fi
8582
# addresses with less than four octets, like "1.2.3".  Also leading
8583
    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8583
# zeros should also be rejected.
8584
    hardcode_libdir_separator=:
8584
8585
    ;;
8585
echo $ac_n "checking for working inet_pton with IPv6 support""... $ac_c" 1>&6
8586
8586
echo "configure:8587: checking for working inet_pton with IPv6 support" >&5
8587
  osf4* | osf5*)	# as osf3* with the addition of -msym flag
8587
if test "$cross_compiling" = yes; then
8588
    if test "$GCC" = yes; then
8588
  echo "$ac_t""assuming target platform has working inet_pton" 1>&6
8589
      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
8589
	ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"
8590
      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8590
else
8591
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8591
  cat > conftest.$ac_ext <<EOF
8592
    else
8592
#line 8593 "configure"
8593
      allow_undefined_flag=' -expect_unresolved \*'
8593
#include "confdefs.h"
8594
      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
8594
8595
      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
8595
#include <sys/types.h>
8596
      $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
8596
#include <sys/socket.h>
8597
8597
#include <netinet/in.h>
8598
      #Both c and cxx compiler support -rpath directly
8598
#include <arpa/inet.h>
8599
      hardcode_libdir_flag_spec='-rpath $libdir'
8599
main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
8600
    fi
8600
			     inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 : 
8601
    hardcode_libdir_separator=:
8601
			     (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }
8602
    ;;
8602
EOF
8603
8603
if { (eval echo configure:8604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8604
  sco3.2v5*)
8604
then
8605
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8605
  echo "$ac_t""yes" 1>&6
8606
    hardcode_shlibpath_var=no
8606
        ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"
8607
    runpath_var=LD_RUN_PATH
8607
else
8608
    hardcode_runpath_var=yes
8608
  echo "configure: failed program was:" >&5
8609
    ;;
8609
  cat conftest.$ac_ext >&5
8610
8610
  rm -fr conftest*
8611
  solaris*)
8611
  echo "$ac_t""no" 1>&6
8612
    no_undefined_flag=' -z defs'
8612
        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
8613
    # $CC -shared without GNU ld will not create a library from C++
8613
        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
8614
    # object files and a static libstdc++, better avoid it by now
8614
        ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"
8615
    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
8615
fi
8616
    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
8616
rm -fr conftest*
8617
		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
8617
fi
8618
    hardcode_libdir_flag_spec='-R$libdir'
8618
8619
    hardcode_shlibpath_var=no
8619
8620
    case $host_os in
8620
echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
8621
    solaris2.[0-5] | solaris2.[0-5].*) ;;
8621
echo "configure:8622: checking for inet_aton" >&5
8622
    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
8622
cat > conftest.$ac_ext <<EOF
8623
      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
8623
#line 8624 "configure"
8624
    esac
8624
#include "confdefs.h"
8625
    link_all_deplibs=yes
8625
8626
    ;;
8626
#include <sys/types.h>
8627
8627
#include <netinet/in.h>
8628
  sunos4*)
8628
#include <arpa/inet.h>
8629
    if test "x$host_vendor" = xsequent; then
8629
int main() {
8630
      # Use $CC to link under sequent, because it throws in some extra .o
8630
struct in_addr in; inet_aton(0, &in); return (0);
8631
      # files that make .init and .fini sections work.
8631
; return 0; }
8632
      archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
8632
EOF
8633
    else
8633
if { (eval echo configure:8634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8634
      archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
8634
  rm -rf conftest*
8635
    fi
8635
  echo "$ac_t""yes" 1>&6
8636
    hardcode_libdir_flag_spec='-L$libdir'
8636
        ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON"
8637
    hardcode_direct=yes
8637
else
8638
    hardcode_minus_L=yes
8638
  echo "configure: failed program was:" >&5
8639
    hardcode_shlibpath_var=no
8639
  cat conftest.$ac_ext >&5
8640
    ;;
8640
  rm -rf conftest*
8641
8641
  echo "$ac_t""no" 1>&6
8642
  sysv4)
8642
        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_aton.$O"
8643
    if test "x$host_vendor" = xsno; then
8643
        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_aton.c"
8644
      archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linkopts'
8644
        ISC_PLATFORM_NEEDATON="#define ISC_PLATFORM_NEEDATON 1"
8645
      hardcode_direct=yes # is this really true???
8645
fi
8646
    else
8646
rm -f conftest*
8647
      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8647
8648
      hardcode_direct=no #Motorola manual says yes, but my tests say they lie
8648
8649
    fi
8649
8650
    runpath_var='LD_RUN_PATH'
8650
8651
    hardcode_shlibpath_var=no
8651
8652
    ;;
8652
#
8653
8653
# Look for a 4.4BSD-style sa_len member in struct sockaddr.
8654
  sysv4.3*)
8654
#
8655
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8655
case "$host" in
8656
    hardcode_shlibpath_var=no
8656
	*-dec-osf*)
8657
    export_dynamic_flag_spec='-Bexport'
8657
		# Turn on 4.4BSD style sa_len support.
8658
    ;;
8658
		cat >> confdefs.h <<\EOF
8659
8659
#define _SOCKADDR_LEN 1
8660
  sysv5*)
8660
EOF
8661
    no_undefined_flag=' -z text'
8661
8662
    # $CC -shared without GNU ld will not create a library from C++
8662
		;;
8663
    # object files and a static libstdc++, better avoid it by now
8663
esac
8664
    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
8664
8665
    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
8665
echo $ac_n "checking for sa_len in struct sockaddr""... $ac_c" 1>&6
8666
		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
8666
echo "configure:8667: checking for sa_len in struct sockaddr" >&5
8667
    hardcode_libdir_flag_spec=
8667
cat > conftest.$ac_ext <<EOF
8668
    hardcode_shlibpath_var=no
8668
#line 8669 "configure"
8669
    runpath_var='LD_RUN_PATH'
8669
#include "confdefs.h"
8670
    ;;
8670
8671
8671
#include <sys/types.h>
8672
  uts4*)
8672
#include <sys/socket.h>
8673
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8673
int main() {
8674
    hardcode_libdir_flag_spec='-L$libdir'
8674
struct sockaddr sa; sa.sa_len = 0; return (0);
8675
    hardcode_shlibpath_var=no
8675
; return 0; }
8676
    ;;
8676
EOF
8677
8677
if { (eval echo configure:8678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8678
  dgux*)
8678
  rm -rf conftest*
8679
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8679
  echo "$ac_t""yes" 1>&6
8680
    hardcode_libdir_flag_spec='-L$libdir'
8680
	ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
8681
    hardcode_shlibpath_var=no
8681
	LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"
8682
    ;;
8682
else
8683
8683
  echo "configure: failed program was:" >&5
8684
  sysv4*MP*)
8684
  cat conftest.$ac_ext >&5
8685
    if test -d /usr/nec; then
8685
  rm -rf conftest*
8686
      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8686
  echo "$ac_t""no" 1>&6
8687
      hardcode_shlibpath_var=no
8687
	ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
8688
      runpath_var=LD_RUN_PATH
8688
	LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"
8689
      hardcode_runpath_var=yes
8689
fi
8690
      ld_shlibs=yes
8690
rm -f conftest*
8691
    fi
8691
8692
    ;;
8692
8693
8693
8694
  sysv4.2uw2*)
8694
#
8695
    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
8695
# Look for a 4.4BSD or 4.3BSD struct msghdr
8696
    hardcode_direct=yes
8696
#
8697
    hardcode_minus_L=no
8697
echo $ac_n "checking for struct msghdr flavor""... $ac_c" 1>&6
8698
    hardcode_shlibpath_var=no
8698
echo "configure:8699: checking for struct msghdr flavor" >&5
8699
    hardcode_runpath_var=yes
8699
cat > conftest.$ac_ext <<EOF
8700
    runpath_var=LD_RUN_PATH
8700
#line 8701 "configure"
8701
    ;;
8701
#include "confdefs.h"
8702
8702
8703
  sysv5uw7* | unixware7*)
8703
#include <sys/types.h>
8704
    no_undefined_flag='${wl}-z ${wl}text'
8704
#include <sys/socket.h>
8705
    if test "$GCC" = yes; then
8705
int main() {
8706
      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8706
struct msghdr msg; msg.msg_flags = 0; return (0);
8707
    else
8707
; return 0; }
8708
      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8708
EOF
8709
    fi
8709
if { (eval echo configure:8710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8710
    runpath_var='LD_RUN_PATH'
8710
  rm -rf conftest*
8711
    hardcode_shlibpath_var=no
8711
  echo "$ac_t""4.4BSD" 1>&6
8712
    ;;
8712
	ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"
8713
8713
else
8714
  *)
8714
  echo "configure: failed program was:" >&5
8715
    ld_shlibs=no
8715
  cat conftest.$ac_ext >&5
8716
    ;;
8716
  rm -rf conftest*
8717
  esac
8717
  echo "$ac_t""4.3BSD" 1>&6
8718
fi
8718
	ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"
8719
echo "$as_me:$LINENO: result: $ld_shlibs" >&5
8719
fi
8720
echo "${ECHO_T}$ld_shlibs" >&6
8720
rm -f conftest*
8721
test "$ld_shlibs" = no && can_build_shared=no
8721
8722
##
8722
8723
## END FIXME
8723
#
8724
8724
# Look for in_port_t.
8725
## FIXME: this should be a separate macro
8725
#
8726
##
8726
echo $ac_n "checking for type in_port_t""... $ac_c" 1>&6
8727
# Check hardcoding attributes.
8727
echo "configure:8728: checking for type in_port_t" >&5
8728
echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
8728
cat > conftest.$ac_ext <<EOF
8729
echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
8729
#line 8730 "configure"
8730
hardcode_action=
8730
#include "confdefs.h"
8731
if test -n "$hardcode_libdir_flag_spec" || \
8731
8732
   test -n "$runpath_var"; then
8732
#include <sys/types.h>
8733
8733
#include <netinet/in.h>
8734
  # We can hardcode non-existant directories.
8734
int main() {
8735
  if test "$hardcode_direct" != no &&
8735
in_port_t port = 25; return (0);
8736
     # If the only mechanism to avoid hardcoding is shlibpath_var, we
8736
; return 0; }
8737
     # have to relink, otherwise we might link with an installed library
8737
EOF
8738
     # when we should be linking with a yet-to-be-installed one
8738
if { (eval echo configure:8739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8739
     ## test "$hardcode_shlibpath_var" != no &&
8739
  rm -rf conftest*
8740
     test "$hardcode_minus_L" != no; then
8740
  echo "$ac_t""yes" 1>&6
8741
    # Linking always hardcodes the temporary library directory.
8741
	ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"
8742
    hardcode_action=relink
8742
else
8743
  else
8743
  echo "configure: failed program was:" >&5
8744
    # We can link without hardcoding, and we can hardcode nonexisting dirs.
8744
  cat conftest.$ac_ext >&5
8745
    hardcode_action=immediate
8745
  rm -rf conftest*
8746
  fi
8746
  echo "$ac_t""no" 1>&6
8747
else
8747
	ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"
8748
  # We cannot hardcode anything, or else we can only hardcode existing
8748
fi
8749
  # directories.
8749
rm -f conftest*
8750
  hardcode_action=unsupported
8750
8751
fi
8751
8752
echo "$as_me:$LINENO: result: $hardcode_action" >&5
8752
#
8753
echo "${ECHO_T}$hardcode_action" >&6
8753
# Check for addrinfo
8754
##
8754
#
8755
## END FIXME
8755
echo $ac_n "checking for struct addrinfo""... $ac_c" 1>&6
8756
8756
echo "configure:8757: checking for struct addrinfo" >&5
8757
## FIXME: this should be a separate macro
8757
cat > conftest.$ac_ext <<EOF
8758
##
8758
#line 8759 "configure"
8759
striplib=
8759
#include "confdefs.h"
8760
old_striplib=
8760
8761
echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
8761
#include <netdb.h>
8762
echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
8762
int main() {
8763
if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
8763
struct addrinfo a; return (0);
8764
  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
8764
; return 0; }
8765
  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
8765
EOF
8766
  echo "$as_me:$LINENO: result: yes" >&5
8766
if { (eval echo configure:8767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8767
echo "${ECHO_T}yes" >&6
8767
  rm -rf conftest*
8768
else
8768
  echo "$ac_t""yes" 1>&6
8769
  echo "$as_me:$LINENO: result: no" >&5
8769
	ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
8770
echo "${ECHO_T}no" >&6
8770
	cat >> confdefs.h <<\EOF
8771
fi
8771
#define HAVE_ADDRINFO 1
8772
##
8772
EOF
8773
## END FIXME
8773
8774
8774
else
8775
reload_cmds='$LD$reload_flag -o $output$reload_objs'
8775
  echo "configure: failed program was:" >&5
8776
test -z "$deplibs_check_method" && deplibs_check_method=unknown
8776
  cat conftest.$ac_ext >&5
8777
8777
  rm -rf conftest*
8778
## FIXME: this should be a separate macro
8778
  echo "$ac_t""no" 1>&6
8779
##
8779
	ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"
8780
# PORTME Fill in your ld.so characteristics
8780
fi
8781
echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
8781
rm -f conftest*
8782
echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
8782
8783
library_names_spec=
8783
8784
libname_spec='lib$name'
8784
#
8785
soname_spec=
8785
# Check for rrsetinfo
8786
postinstall_cmds=
8786
#
8787
postuninstall_cmds=
8787
echo $ac_n "checking for struct rrsetinfo""... $ac_c" 1>&6
8788
finish_cmds=
8788
echo "configure:8789: checking for struct rrsetinfo" >&5
8789
finish_eval=
8789
cat > conftest.$ac_ext <<EOF
8790
shlibpath_var=
8790
#line 8791 "configure"
8791
shlibpath_overrides_runpath=unknown
8791
#include "confdefs.h"
8792
version_type=none
8792
8793
dynamic_linker="$host_os ld.so"
8793
#include <netdb.h>
8794
sys_lib_dlsearch_path_spec="/lib /usr/lib"
8794
int main() {
8795
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
8795
struct rrsetinfo r; return (0);
8796
8796
; return 0; }
8797
case $host_os in
8797
EOF
8798
aix3*)
8798
if { (eval echo configure:8799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8799
  version_type=linux
8799
  rm -rf conftest*
8800
  library_names_spec='${libname}${release}.so$versuffix $libname.a'
8800
  echo "$ac_t""yes" 1>&6
8801
  shlibpath_var=LIBPATH
8801
	ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"
8802
8802
else
8803
  # AIX has no versioning support, so we append a major version to the name.
8803
  echo "configure: failed program was:" >&5
8804
  soname_spec='${libname}${release}.so$major'
8804
  cat conftest.$ac_ext >&5
8805
  ;;
8805
  rm -rf conftest*
8806
8806
  echo "$ac_t""no" 1>&6
8807
aix4* | aix5*)
8807
	ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"
8808
  version_type=linux
8808
fi
8809
  if test "$host_cpu" = ia64; then
8809
rm -f conftest*
8810
    # AIX 5 supports IA64
8810
8811
    library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
8811
8812
    shlibpath_var=LD_LIBRARY_PATH
8812
echo $ac_n "checking for int sethostent""... $ac_c" 1>&6
8813
  else
8813
echo "configure:8814: checking for int sethostent" >&5
8814
    # With GCC up to 2.95.x, collect2 would create an import file
8814
cat > conftest.$ac_ext <<EOF
8815
    # for dependence libraries.  The import file would start with
8815
#line 8816 "configure"
8816
    # the line `#! .'.  This would cause the generated library to
8816
#include "confdefs.h"
8817
    # depend on `.', always an invalid library.  This was fixed in
8817
8818
    # development snapshots of GCC prior to 3.0.
8818
#include <netdb.h>
8819
    case $host_os in
8819
int main() {
8820
       aix4 | aix4.[01] | aix4.[01].*)
8820
int i = sethostent(0); return(0);
8821
      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
8821
; return 0; }
8822
           echo ' yes '
8822
EOF
8823
           echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
8823
if { (eval echo configure:8824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8824
        :
8824
  rm -rf conftest*
8825
      else
8825
  echo "$ac_t""yes" 1>&6
8826
        can_build_shared=no
8826
	ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"
8827
      fi
8827
else
8828
      ;;
8828
  echo "configure: failed program was:" >&5
8829
    esac
8829
  cat conftest.$ac_ext >&5
8830
    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
8830
  rm -rf conftest*
8831
    # soname into executable. Probably we can add versioning support to
8831
  echo "$ac_t""no" 1>&6
8832
    # collect2, so additional links can be useful in future.
8832
	ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"
8833
    if test "$aix_use_runtimelinking" = yes; then
8833
fi
8834
      # If using run time linking (on AIX 4.2 or later) use lib<name>.so instead of
8834
rm -f conftest*
8835
      # lib<name>.a to let people know that these are not typical AIX shared libraries.
8835
8836
      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
8836
8837
    else
8837
echo $ac_n "checking for int endhostent""... $ac_c" 1>&6
8838
      # We preserve .a as extension for shared libraries through AIX4.2
8838
echo "configure:8839: checking for int endhostent" >&5
8839
      # and later when we are not doing run time linking.
8839
cat > conftest.$ac_ext <<EOF
8840
      library_names_spec='${libname}${release}.a $libname.a'
8840
#line 8841 "configure"
8841
      soname_spec='${libname}${release}.so$major'
8841
#include "confdefs.h"
8842
    fi
8842
8843
    shlibpath_var=LIBPATH
8843
#include <netdb.h>
8844
    deplibs_check_method=pass_all
8844
int main() {
8845
  fi
8845
int i = endhostent(); return(0);
8846
  ;;
8846
; return 0; }
8847
8847
EOF
8848
amigaos*)
8848
if { (eval echo configure:8849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8849
  library_names_spec='$libname.ixlibrary $libname.a'
8849
  rm -rf conftest*
8850
  # Create ${libname}_ixlibrary.a entries in /sys/libs.
8850
  echo "$ac_t""yes" 1>&6
8851
  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
8851
	ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"
8852
  ;;
8852
else
8853
8853
  echo "configure: failed program was:" >&5
8854
beos*)
8854
  cat conftest.$ac_ext >&5
8855
  library_names_spec='${libname}.so'
8855
  rm -rf conftest*
8856
  dynamic_linker="$host_os ld.so"
8856
  echo "$ac_t""no" 1>&6
8857
  shlibpath_var=LIBRARY_PATH
8857
	ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"
8858
  ;;
8858
fi
8859
8859
rm -f conftest*
8860
bsdi4*)
8860
8861
  version_type=linux
8861
8862
  need_version=no
8862
echo $ac_n "checking for getnetbyaddr(in_addr_t, ...)""... $ac_c" 1>&6
8863
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
8863
echo "configure:8864: checking for getnetbyaddr(in_addr_t, ...)" >&5
8864
  soname_spec='${libname}${release}.so$major'
8864
cat > conftest.$ac_ext <<EOF
8865
  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
8865
#line 8866 "configure"
8866
  shlibpath_var=LD_LIBRARY_PATH
8866
#include "confdefs.h"
8867
  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
8867
8868
  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
8868
#include <netdb.h>
8869
  export_dynamic_flag_spec=-rdynamic
8869
struct netent *getnetbyaddr(in_addr_t, int);
8870
  # the default ld.so.conf also contains /usr/contrib/lib and
8870
int main() {
8871
  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
8871
8872
  # libtool to hard-code these into programs
8872
; return 0; }
8873
  ;;
8873
EOF
8874
8874
if { (eval echo configure:8875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8875
cygwin* | mingw* | pw32*)
8875
  rm -rf conftest*
8876
  version_type=windows
8876
  echo "$ac_t""yes" 1>&6
8877
  need_version=no
8877
	ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"
8878
  need_lib_prefix=no
8878
else
8879
  case $GCC,$host_os in
8879
  echo "configure: failed program was:" >&5
8880
  yes,cygwin*)
8880
  cat conftest.$ac_ext >&5
8881
    library_names_spec='$libname.dll.a'
8881
  rm -rf conftest*
8882
    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
8882
  echo "$ac_t""no" 1>&6
8883
    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
8883
	ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"
8884
      dldir=$destdir/`dirname \$dlpath`~
8884
fi
8885
      test -d \$dldir || mkdir -p \$dldir~
8885
rm -f conftest*
8886
      $install_prog .libs/$dlname \$dldir/$dlname'
8886
8887
    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
8887
8888
      dlpath=$dir/\$dldll~
8888
echo $ac_n "checking for int setnetent""... $ac_c" 1>&6
8889
       $rm \$dlpath'
8889
echo "configure:8890: checking for int setnetent" >&5
8890
    ;;
8890
cat > conftest.$ac_ext <<EOF
8891
  yes,mingw*)
8891
#line 8892 "configure"
8892
    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
8892
#include "confdefs.h"
8893
    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
8893
8894
    ;;
8894
#include <netdb.h>
8895
  yes,pw32*)
8895
int main() {
8896
    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
8896
int i = setnetent(0); return(0);
8897
    ;;
8897
; return 0; }
8898
  *)
8898
EOF
8899
    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
8899
if { (eval echo configure:8900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8900
    ;;
8900
  rm -rf conftest*
8901
  esac
8901
  echo "$ac_t""yes" 1>&6
8902
  dynamic_linker='Win32 ld.exe'
8902
	ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"
8903
  # FIXME: first we should search . and the directory the executable is in
8903
else
8904
  shlibpath_var=PATH
8904
  echo "configure: failed program was:" >&5
8905
  ;;
8905
  cat conftest.$ac_ext >&5
8906
8906
  rm -rf conftest*
8907
darwin* | rhapsody*)
8907
  echo "$ac_t""no" 1>&6
8908
  dynamic_linker="$host_os dyld"
8908
	ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"
8909
  version_type=darwin
8909
fi
8910
  need_lib_prefix=no
8910
rm -f conftest*
8911
  need_version=no
8911
8912
  # FIXME: Relying on posixy $() will cause problems for
8912
8913
  #        cross-compilation, but unfortunately the echo tests do not
8913
echo $ac_n "checking for int endnetent""... $ac_c" 1>&6
8914
  #        yet detect zsh echo's removal of \ escapes.
8914
echo "configure:8915: checking for int endnetent" >&5
8915
  library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
8915
cat > conftest.$ac_ext <<EOF
8916
  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
8916
#line 8917 "configure"
8917
  shlibpath_overrides_runpath=yes
8917
#include "confdefs.h"
8918
  shlibpath_var=DYLD_LIBRARY_PATH
8918
8919
  ;;
8919
#include <netdb.h>
8920
8920
int main() {
8921
freebsd1*)
8921
int i = endnetent(); return(0);
8922
  dynamic_linker=no
8922
; return 0; }
8923
  ;;
8923
EOF
8924
8924
if { (eval echo configure:8925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8925
freebsd*)
8925
  rm -rf conftest*
8926
  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
8926
  echo "$ac_t""yes" 1>&6
8927
  version_type=freebsd-$objformat
8927
	ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"
8928
  case $version_type in
8928
else
8929
    freebsd-elf*)
8929
  echo "configure: failed program was:" >&5
8930
      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
8930
  cat conftest.$ac_ext >&5
8931
      need_version=no
8931
  rm -rf conftest*
8932
      need_lib_prefix=no
8932
  echo "$ac_t""no" 1>&6
8933
      ;;
8933
	ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"
8934
    freebsd-*)
8934
fi
8935
      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
8935
rm -f conftest*
8936
      need_version=yes
8936
8937
      ;;
8937
8938
  esac
8938
echo $ac_n "checking for gethostbyaddr(const void *, size_t, ...)""... $ac_c" 1>&6
8939
  shlibpath_var=LD_LIBRARY_PATH
8939
echo "configure:8940: checking for gethostbyaddr(const void *, size_t, ...)" >&5
8940
  case $host_os in
8940
cat > conftest.$ac_ext <<EOF
8941
  freebsd2*)
8941
#line 8942 "configure"
8942
    shlibpath_overrides_runpath=yes
8942
#include "confdefs.h"
8943
    ;;
8943
8944
  *)
8944
#include <netdb.h>
8945
    shlibpath_overrides_runpath=no
8945
struct hostent *gethostbyaddr(const void *, size_t, int);
8946
    hardcode_into_libs=yes
8946
int main() {
8947
    ;;
8947
return(0);
8948
  esac
8948
; return 0; }
8949
  ;;
8949
EOF
8950
8950
if { (eval echo configure:8951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8951
gnu*)
8951
  rm -rf conftest*
8952
  version_type=linux
8952
  echo "$ac_t""yes" 1>&6
8953
  need_lib_prefix=no
8953
	ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"
8954
  need_version=no
8954
else
8955
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
8955
  echo "configure: failed program was:" >&5
8956
  soname_spec='${libname}${release}.so$major'
8956
  cat conftest.$ac_ext >&5
8957
  shlibpath_var=LD_LIBRARY_PATH
8957
  rm -rf conftest*
8958
  hardcode_into_libs=yes
8958
  echo "$ac_t""no" 1>&6
8959
  ;;
8959
	ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"
8960
8960
fi
8961
hpux9* | hpux10* | hpux11*)
8961
rm -f conftest*
8962
  # Give a soname corresponding to the major version so that dld.sl refuses to
8962
8963
  # link against other versions.
8963
8964
  dynamic_linker="$host_os dld.sl"
8964
echo $ac_n "checking for h_errno in netdb.h""... $ac_c" 1>&6
8965
  version_type=sunos
8965
echo "configure:8966: checking for h_errno in netdb.h" >&5
8966
  need_lib_prefix=no
8966
cat > conftest.$ac_ext <<EOF
8967
  need_version=no
8967
#line 8968 "configure"
8968
  shlibpath_var=SHLIB_PATH
8968
#include "confdefs.h"
8969
  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
8969
8970
  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
8970
#include <netdb.h>
8971
  soname_spec='${libname}${release}.sl$major'
8971
int main() {
8972
  # HP-UX runs *really* slowly unless shared libraries are mode 555.
8972
h_errno = 1; return(0);
8973
  postinstall_cmds='chmod 555 $lib'
8973
; return 0; }
8974
  ;;
8974
EOF
8975
8975
if { (eval echo configure:8976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8976
irix5* | irix6*)
8976
  rm -rf conftest*
8977
  version_type=irix
8977
  echo "$ac_t""yes" 1>&6
8978
  need_lib_prefix=no
8978
	ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"
8979
  need_version=no
8979
else
8980
  soname_spec='${libname}${release}.so$major'
8980
  echo "configure: failed program was:" >&5
8981
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
8981
  cat conftest.$ac_ext >&5
8982
  case $host_os in
8982
  rm -rf conftest*
8983
  irix5*)
8983
  echo "$ac_t""no" 1>&6
8984
    libsuff= shlibsuff=
8984
	ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"
8985
    ;;
8985
fi
8986
  *)
8986
rm -f conftest*
8987
    case $LD in # libtool.m4 will add one of these switches to LD
8987
8988
    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
8988
8989
    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
8989
echo $ac_n "checking for getipnodebyname""... $ac_c" 1>&6
8990
    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
8990
echo "configure:8991: checking for getipnodebyname" >&5
8991
    *) libsuff= shlibsuff= libmagic=never-match;;
8991
if eval "test \"`echo '$''{'ac_cv_func_getipnodebyname'+set}'`\" = set"; then
8992
    esac
8992
  echo $ac_n "(cached) $ac_c" 1>&6
8993
    ;;
8993
else
8994
  esac
8994
  cat > conftest.$ac_ext <<EOF
8995
  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
8995
#line 8996 "configure"
8996
  shlibpath_overrides_runpath=no
8996
#include "confdefs.h"
8997
  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
8997
/* System header to define __stub macros and hopefully few prototypes,
8998
  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
8998
    which can conflict with char getipnodebyname(); below.  */
8999
  ;;
8999
#include <assert.h>
9000
9000
/* Override any gcc2 internal prototype to avoid an error.  */
9001
# No shared lib support for Linux oldld, aout, or coff.
9001
/* We use char because int might match the return type of a gcc2
9002
linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
9002
    builtin and then its argument prototype would still apply.  */
9003
  dynamic_linker=no
9003
char getipnodebyname();
9004
  ;;
9004
9005
9005
int main() {
9006
# This must be Linux ELF.
9006
9007
linux-gnu*)
9007
/* The GNU C library defines this for functions which it implements
9008
  version_type=linux
9008
    to always fail with ENOSYS.  Some functions are actually named
9009
  need_lib_prefix=no
9009
    something starting with __ and the normal name is an alias.  */
9010
  need_version=no
9010
#if defined (__stub_getipnodebyname) || defined (__stub___getipnodebyname)
9011
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
9011
choke me
9012
  soname_spec='${libname}${release}.so$major'
9012
#else
9013
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
9013
getipnodebyname();
9014
  shlibpath_var=LD_LIBRARY_PATH
9014
#endif
9015
  shlibpath_overrides_runpath=no
9015
9016
  # This implies no fast_install, which is unacceptable.
9016
; return 0; }
9017
  # Some rework will be needed to allow for fast_install
9017
EOF
9018
  # before this can be enabled.
9018
if { (eval echo configure:9019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9019
  hardcode_into_libs=yes
9019
  rm -rf conftest*
9020
9020
  eval "ac_cv_func_getipnodebyname=yes"
9021
  # We used to test for /lib/ld.so.1 and disable shared libraries on
9021
else
9022
  # powerpc, because MkLinux only supported shared libraries with the
9022
  echo "configure: failed program was:" >&5
9023
  # GNU dynamic linker.  Since this was broken with cross compilers,
9023
  cat conftest.$ac_ext >&5
9024
  # most powerpc-linux boxes support dynamic linking these days and
9024
  rm -rf conftest*
9025
  # people can always --disable-shared, the test was removed, and we
9025
  eval "ac_cv_func_getipnodebyname=no"
9026
  # assume the GNU/Linux dynamic linker is in use.
9026
fi
9027
  dynamic_linker='GNU/Linux ld.so'
9027
rm -f conftest*
9028
  ;;
9028
fi
9029
9029
9030
netbsd*)
9030
if eval "test \"`echo '$ac_cv_func_'getipnodebyname`\" = yes"; then
9031
  version_type=sunos
9031
  echo "$ac_t""yes" 1>&6
9032
  need_lib_prefix=no
9032
  ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"
9033
  need_version=no
9033
else
9034
  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
9034
  echo "$ac_t""no" 1>&6
9035
    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
9035
ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"
9036
    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
9036
fi
9037
    dynamic_linker='NetBSD (a.out) ld.so'
9037
9038
  else
9038
echo $ac_n "checking for getnameinfo""... $ac_c" 1>&6
9039
    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
9039
echo "configure:9040: checking for getnameinfo" >&5
9040
    soname_spec='${libname}${release}.so$major'
9040
if eval "test \"`echo '$''{'ac_cv_func_getnameinfo'+set}'`\" = set"; then
9041
    dynamic_linker='NetBSD ld.elf_so'
9041
  echo $ac_n "(cached) $ac_c" 1>&6
9042
  fi
9042
else
9043
  shlibpath_var=LD_LIBRARY_PATH
9043
  cat > conftest.$ac_ext <<EOF
9044
  shlibpath_overrides_runpath=yes
9044
#line 9045 "configure"
9045
  hardcode_into_libs=yes
9045
#include "confdefs.h"
9046
  ;;
9046
/* System header to define __stub macros and hopefully few prototypes,
9047
9047
    which can conflict with char getnameinfo(); below.  */
9048
newsos6)
9048
#include <assert.h>
9049
  version_type=linux
9049
/* Override any gcc2 internal prototype to avoid an error.  */
9050
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
9050
/* We use char because int might match the return type of a gcc2
9051
  shlibpath_var=LD_LIBRARY_PATH
9051
    builtin and then its argument prototype would still apply.  */
9052
  shlibpath_overrides_runpath=yes
9052
char getnameinfo();
9053
  ;;
9053
9054
9054
int main() {
9055
openbsd*)
9055
9056
  version_type=sunos
9056
/* The GNU C library defines this for functions which it implements
9057
  if test "$with_gnu_ld" = yes; then
9057
    to always fail with ENOSYS.  Some functions are actually named
9058
    need_lib_prefix=no
9058
    something starting with __ and the normal name is an alias.  */
9059
    need_version=no
9059
#if defined (__stub_getnameinfo) || defined (__stub___getnameinfo)
9060
  fi
9060
choke me
9061
  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
9061
#else
9062
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
9062
getnameinfo();
9063
  shlibpath_var=LD_LIBRARY_PATH
9063
#endif
9064
  ;;
9064
9065
9065
; return 0; }
9066
os2*)
9066
EOF
9067
  libname_spec='$name'
9067
if { (eval echo configure:9068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9068
  need_lib_prefix=no
9068
  rm -rf conftest*
9069
  library_names_spec='$libname.dll $libname.a'
9069
  eval "ac_cv_func_getnameinfo=yes"
9070
  dynamic_linker='OS/2 ld.exe'
9070
else
9071
  shlibpath_var=LIBPATH
9071
  echo "configure: failed program was:" >&5
9072
  ;;
9072
  cat conftest.$ac_ext >&5
9073
9073
  rm -rf conftest*
9074
osf3* | osf4* | osf5*)
9074
  eval "ac_cv_func_getnameinfo=no"
9075
  version_type=osf
9075
fi
9076
  need_version=no
9076
rm -f conftest*
9077
  soname_spec='${libname}${release}.so'
9077
fi
9078
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
9078
9079
  shlibpath_var=LD_LIBRARY_PATH
9079
if eval "test \"`echo '$ac_cv_func_'getnameinfo`\" = yes"; then
9080
  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
9080
  echo "$ac_t""yes" 1>&6
9081
  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
9081
  ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"
9082
  ;;
9082
else
9083
9083
  echo "$ac_t""no" 1>&6
9084
sco3.2v5*)
9084
ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"
9085
  version_type=osf
9085
fi
9086
  soname_spec='${libname}${release}.so$major'
9086
9087
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
9087
echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6
9088
  shlibpath_var=LD_LIBRARY_PATH
9088
echo "configure:9089: checking for getaddrinfo" >&5
9089
  ;;
9089
if eval "test \"`echo '$''{'ac_cv_func_getaddrinfo'+set}'`\" = set"; then
9090
9090
  echo $ac_n "(cached) $ac_c" 1>&6
9091
solaris*)
9091
else
9092
  version_type=linux
9092
  cat > conftest.$ac_ext <<EOF
9093
  need_lib_prefix=no
9093
#line 9094 "configure"
9094
  need_version=no
9094
#include "confdefs.h"
9095
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
9095
/* System header to define __stub macros and hopefully few prototypes,
9096
  soname_spec='${libname}${release}.so$major'
9096
    which can conflict with char getaddrinfo(); below.  */
9097
  shlibpath_var=LD_LIBRARY_PATH
9097
#include <assert.h>
9098
  shlibpath_overrides_runpath=yes
9098
/* Override any gcc2 internal prototype to avoid an error.  */
9099
  hardcode_into_libs=yes
9099
/* We use char because int might match the return type of a gcc2
9100
  # ldd complains unless libraries are executable
9100
    builtin and then its argument prototype would still apply.  */
9101
  postinstall_cmds='chmod +x $lib'
9101
char getaddrinfo();
9102
  ;;
9102
9103
9103
int main() {
9104
sunos4*)
9104
9105
  version_type=sunos
9105
/* The GNU C library defines this for functions which it implements
9106
  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
9106
    to always fail with ENOSYS.  Some functions are actually named
9107
  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
9107
    something starting with __ and the normal name is an alias.  */
9108
  shlibpath_var=LD_LIBRARY_PATH
9108
#if defined (__stub_getaddrinfo) || defined (__stub___getaddrinfo)
9109
  shlibpath_overrides_runpath=yes
9109
choke me
9110
  if test "$with_gnu_ld" = yes; then
9110
#else
9111
    need_lib_prefix=no
9111
getaddrinfo();
9112
  fi
9112
#endif
9113
  need_version=yes
9113
9114
  ;;
9114
; return 0; }
9115
9115
EOF
9116
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
9116
if { (eval echo configure:9117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9117
  version_type=linux
9117
  rm -rf conftest*
9118
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
9118
  eval "ac_cv_func_getaddrinfo=yes"
9119
  soname_spec='${libname}${release}.so$major'
9119
else
9120
  shlibpath_var=LD_LIBRARY_PATH
9120
  echo "configure: failed program was:" >&5
9121
  case $host_vendor in
9121
  cat conftest.$ac_ext >&5
9122
    sni)
9122
  rm -rf conftest*
9123
      shlibpath_overrides_runpath=no
9123
  eval "ac_cv_func_getaddrinfo=no"
9124
      ;;
9124
fi
9125
    motorola)
9125
rm -f conftest*
9126
      need_lib_prefix=no
9126
fi
9127
      need_version=no
9127
9128
      shlibpath_overrides_runpath=no
9128
if eval "test \"`echo '$ac_cv_func_'getaddrinfo`\" = yes"; then
9129
      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
9129
  echo "$ac_t""yes" 1>&6
9130
      ;;
9130
  ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
9131
  esac
9131
	cat >> confdefs.h <<\EOF
9132
  ;;
9132
#define HAVE_GETADDRINFO 1
9133
9133
EOF
9134
uts4*)
9134
9135
  version_type=linux
9135
else
9136
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
9136
  echo "$ac_t""no" 1>&6
9137
  soname_spec='${libname}${release}.so$major'
9137
ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"
9138
  shlibpath_var=LD_LIBRARY_PATH
9138
fi
9139
  ;;
9139
9140
9140
echo $ac_n "checking for gai_strerror""... $ac_c" 1>&6
9141
dgux*)
9141
echo "configure:9142: checking for gai_strerror" >&5
9142
  version_type=linux
9142
if eval "test \"`echo '$''{'ac_cv_func_gai_strerror'+set}'`\" = set"; then
9143
  need_lib_prefix=no
9143
  echo $ac_n "(cached) $ac_c" 1>&6
9144
  need_version=no
9144
else
9145
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
9145
  cat > conftest.$ac_ext <<EOF
9146
  soname_spec='${libname}${release}.so$major'
9146
#line 9147 "configure"
9147
  shlibpath_var=LD_LIBRARY_PATH
9147
#include "confdefs.h"
9148
  ;;
9148
/* System header to define __stub macros and hopefully few prototypes,
9149
9149
    which can conflict with char gai_strerror(); below.  */
9150
sysv4*MP*)
9150
#include <assert.h>
9151
  if test -d /usr/nec ;then
9151
/* Override any gcc2 internal prototype to avoid an error.  */
9152
    version_type=linux
9152
/* We use char because int might match the return type of a gcc2
9153
    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
9153
    builtin and then its argument prototype would still apply.  */
9154
    soname_spec='$libname.so.$major'
9154
char gai_strerror();
9155
    shlibpath_var=LD_LIBRARY_PATH
9155
9156
  fi
9156
int main() {
9157
  ;;
9157
9158
9158
/* The GNU C library defines this for functions which it implements
9159
*)
9159
    to always fail with ENOSYS.  Some functions are actually named
9160
  dynamic_linker=no
9160
    something starting with __ and the normal name is an alias.  */
9161
  ;;
9161
#if defined (__stub_gai_strerror) || defined (__stub___gai_strerror)
9162
esac
9162
choke me
9163
echo "$as_me:$LINENO: result: $dynamic_linker" >&5
9163
#else
9164
echo "${ECHO_T}$dynamic_linker" >&6
9164
gai_strerror();
9165
test "$dynamic_linker" = no && can_build_shared=no
9165
#endif
9166
##
9166
9167
## END FIXME
9167
; return 0; }
9168
9168
EOF
9169
## FIXME: this should be a separate macro
9169
if { (eval echo configure:9170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9170
##
9170
  rm -rf conftest*
9171
# Report the final consequences.
9171
  eval "ac_cv_func_gai_strerror=yes"
9172
echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
9172
else
9173
echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
9173
  echo "configure: failed program was:" >&5
9174
echo "$as_me:$LINENO: result: $can_build_shared" >&5
9174
  cat conftest.$ac_ext >&5
9175
echo "${ECHO_T}$can_build_shared" >&6
9175
  rm -rf conftest*
9176
##
9176
  eval "ac_cv_func_gai_strerror=no"
9177
## END FIXME
9177
fi
9178
9178
rm -f conftest*
9179
if test "$hardcode_action" = relink; then
9179
fi
9180
  # Fast installation is not supported
9180
9181
  enable_fast_install=no
9181
if eval "test \"`echo '$ac_cv_func_'gai_strerror`\" = yes"; then
9182
elif test "$shlibpath_overrides_runpath" = yes ||
9182
  echo "$ac_t""yes" 1>&6
9183
     test "$enable_shared" = no; then
9183
  cat >> confdefs.h <<\EOF
9184
  # Fast installation is not necessary
9184
#define HAVE_GAISTRERROR 1
9185
  enable_fast_install=needless
9185
EOF
9186
fi
9186
9187
9187
else
9188
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
9188
  echo "$ac_t""no" 1>&6
9189
if test "$GCC" = yes; then
9189
fi
9190
  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
9190
9191
fi
9191
9192
9192
9193
if test "x$enable_dlopen" != xyes; then
9193
9194
  enable_dlopen=unknown
9194
9195
  enable_dlopen_self=unknown
9195
#
9196
  enable_dlopen_self_static=unknown
9196
# Look for a sysctl call to get the list of network interfaces.
9197
else
9197
#
9198
  lt_cv_dlopen=no
9198
echo $ac_n "checking for interface list sysctl""... $ac_c" 1>&6
9199
  lt_cv_dlopen_libs=
9199
echo "configure:9200: checking for interface list sysctl" >&5
9200
9200
cat > conftest.$ac_ext <<EOF
9201
  case $host_os in
9201
#line 9202 "configure"
9202
  beos*)
9202
#include "confdefs.h"
9203
    lt_cv_dlopen="load_add_on"
9203
9204
    lt_cv_dlopen_libs=
9204
#include <sys/param.h>
9205
    lt_cv_dlopen_self=yes
9205
#include <sys/sysctl.h>
9206
    ;;
9206
#include <sys/socket.h>
9207
9207
#ifdef NET_RT_IFLIST
9208
  cygwin* | mingw* | pw32*)
9208
found_rt_iflist
9209
    lt_cv_dlopen="LoadLibrary"
9209
#endif
9210
    lt_cv_dlopen_libs=
9210
9211
   ;;
9211
EOF
9212
9212
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9213
  *)
9213
  egrep "found_rt_iflist" >/dev/null 2>&1; then
9214
    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
9214
  rm -rf conftest*
9215
echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
9215
  echo "$ac_t""yes" 1>&6
9216
if test "${ac_cv_lib_dl_dlopen+set}" = set; then
9216
	 cat >> confdefs.h <<\EOF
9217
  echo $ECHO_N "(cached) $ECHO_C" >&6
9217
#define HAVE_IFLIST_SYSCTL 1
9218
else
9218
EOF
9219
  ac_check_lib_save_LIBS=$LIBS
9219
9220
LIBS="-ldl  $LIBS"
9220
else
9221
cat >conftest.$ac_ext <<_ACEOF
9221
  rm -rf conftest*
9222
#line $LINENO "configure"
9222
  echo "$ac_t""no" 1>&6
9223
#include "confdefs.h"
9223
fi
9224
9224
rm -f conftest*
9225
/* Override any gcc2 internal prototype to avoid an error.  */
9225
9226
#ifdef __cplusplus
9226
9227
extern "C"
9227
#
9228
#endif
9228
# Check for some other useful functions that are not ever-present.
9229
/* We use char because int might match the return type of a gcc2
9229
#
9230
   builtin and then its argument prototype would still apply.  */
9230
9231
char dlopen ();
9231
# We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
9232
#ifdef F77_DUMMY_MAIN
9232
# because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
9233
#  ifdef __cplusplus
9233
# reportedly defines strsep() without declaring it in <string.h> when
9234
     extern "C"
9234
# -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
9235
#  endif
9235
# AC_CHECK_FUNC() incorrectly succeeds because it declares
9236
   int F77_DUMMY_MAIN() { return 1; }
9236
# the function itself.
9237
#endif
9237
echo $ac_n "checking for correctly declared strsep()""... $ac_c" 1>&6
9238
int
9238
echo "configure:9239: checking for correctly declared strsep()" >&5
9239
main ()
9239
cat > conftest.$ac_ext <<EOF
9240
{
9240
#line 9241 "configure"
9241
dlopen ();
9241
#include "confdefs.h"
9242
  ;
9242
#include <string.h>
9243
  return 0;
9243
int main() {
9244
}
9244
char *sp; char *foo = strsep(&sp, ".");
9245
_ACEOF
9245
; return 0; }
9246
rm -f conftest.$ac_objext conftest$ac_exeext
9246
EOF
9247
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
9247
if { (eval echo configure:9248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9248
  (eval $ac_link) 2>&5
9248
  rm -rf conftest*
9249
  ac_status=$?
9249
  echo "$ac_t""yes" 1>&6; ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"
9250
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9250
else
9251
  (exit $ac_status); } &&
9251
  echo "configure: failed program was:" >&5
9252
         { ac_try='test -s conftest$ac_exeext'
9252
  cat conftest.$ac_ext >&5
9253
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9253
  rm -rf conftest*
9254
  (eval $ac_try) 2>&5
9254
  echo "$ac_t""no" 1>&6; ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"
9255
  ac_status=$?
9255
fi
9256
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9256
rm -f conftest*
9257
  (exit $ac_status); }; }; then
9257
9258
  ac_cv_lib_dl_dlopen=yes
9258
echo $ac_n "checking for vsnprintf""... $ac_c" 1>&6
9259
else
9259
echo "configure:9260: checking for vsnprintf" >&5
9260
  echo "$as_me: failed program was:" >&5
9260
if eval "test \"`echo '$''{'ac_cv_func_vsnprintf'+set}'`\" = set"; then
9261
cat conftest.$ac_ext >&5
9261
  echo $ac_n "(cached) $ac_c" 1>&6
9262
ac_cv_lib_dl_dlopen=no
9262
else
9263
fi
9263
  cat > conftest.$ac_ext <<EOF
9264
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9264
#line 9265 "configure"
9265
LIBS=$ac_check_lib_save_LIBS
9265
#include "confdefs.h"
9266
fi
9266
/* System header to define __stub macros and hopefully few prototypes,
9267
echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
9267
    which can conflict with char vsnprintf(); below.  */
9268
echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
9268
#include <assert.h>
9269
if test $ac_cv_lib_dl_dlopen = yes; then
9269
/* Override any gcc2 internal prototype to avoid an error.  */
9270
  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
9270
/* We use char because int might match the return type of a gcc2
9271
else
9271
    builtin and then its argument prototype would still apply.  */
9272
  echo "$as_me:$LINENO: checking for dlopen" >&5
9272
char vsnprintf();
9273
echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
9273
9274
if test "${ac_cv_func_dlopen+set}" = set; then
9274
int main() {
9275
  echo $ECHO_N "(cached) $ECHO_C" >&6
9275
9276
else
9276
/* The GNU C library defines this for functions which it implements
9277
  cat >conftest.$ac_ext <<_ACEOF
9277
    to always fail with ENOSYS.  Some functions are actually named
9278
#line $LINENO "configure"
9278
    something starting with __ and the normal name is an alias.  */
9279
#include "confdefs.h"
9279
#if defined (__stub_vsnprintf) || defined (__stub___vsnprintf)
9280
/* From autoconf 2.57 */
9280
choke me
9281
/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
9281
#else
9282
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
9282
vsnprintf();
9283
#define dlopen innocuous_dlopen
9283
#endif
9284
9284
9285
/* System header to define __stub macros and hopefully few prototypes,
9285
; return 0; }
9286
    which can conflict with char dlopen (); below.
9286
EOF
9287
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
9287
if { (eval echo configure:9288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9288
    <limits.h> exists even on freestanding compilers.  */
9288
  rm -rf conftest*
9289
9289
  eval "ac_cv_func_vsnprintf=yes"
9290
#ifdef __STDC__
9290
else
9291
# include <limits.h>
9291
  echo "configure: failed program was:" >&5
9292
#else
9292
  cat conftest.$ac_ext >&5
9293
# include <assert.h>
9293
  rm -rf conftest*
9294
#endif
9294
  eval "ac_cv_func_vsnprintf=no"
9295
9295
fi
9296
#undef dlopen
9296
rm -f conftest*
9297
9297
fi
9298
/* Override any gcc2 internal prototype to avoid an error.  */
9298
9299
#ifdef __cplusplus
9299
if eval "test \"`echo '$ac_cv_func_'vsnprintf`\" = yes"; then
9300
extern "C"
9300
  echo "$ac_t""yes" 1>&6
9301
{
9301
  ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"
9302
#endif
9302
else
9303
/* We use char because int might match the return type of a gcc2
9303
  echo "$ac_t""no" 1>&6
9304
   builtin and then its argument prototype would still apply.  */
9304
ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS print.$O"
9305
char dlopen ();
9305
	 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS print.c"
9306
/* The GNU C library defines this for functions which it implements
9306
	 ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
9307
    to always fail with ENOSYS.  Some functions are actually named
9307
fi
9308
    something starting with __ and the normal name is an alias.  */
9308
9309
#if defined (__stub_dlopen) || defined (__stub___dlopen)
9309
9310
choke me
9310
9311
#else
9311
echo $ac_n "checking for strerror""... $ac_c" 1>&6
9312
char (*f) () = dlopen;
9312
echo "configure:9313: checking for strerror" >&5
9313
#endif
9313
if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then
9314
#ifdef __cplusplus
9314
  echo $ac_n "(cached) $ac_c" 1>&6
9315
}
9315
else
9316
#endif
9316
  cat > conftest.$ac_ext <<EOF
9317
9317
#line 9318 "configure"
9318
#ifdef F77_DUMMY_MAIN
9318
#include "confdefs.h"
9319
#  ifdef __cplusplus
9319
/* System header to define __stub macros and hopefully few prototypes,
9320
     extern "C"
9320
    which can conflict with char strerror(); below.  */
9321
#  endif
9321
#include <assert.h>
9322
   int F77_DUMMY_MAIN() { return 1; }
9322
/* Override any gcc2 internal prototype to avoid an error.  */
9323
#endif
9323
/* We use char because int might match the return type of a gcc2
9324
int
9324
    builtin and then its argument prototype would still apply.  */
9325
main ()
9325
char strerror();
9326
{
9326
9327
return f != dlopen;
9327
int main() {
9328
  ;
9328
9329
  return 0;
9329
/* The GNU C library defines this for functions which it implements
9330
}
9330
    to always fail with ENOSYS.  Some functions are actually named
9331
_ACEOF
9331
    something starting with __ and the normal name is an alias.  */
9332
rm -f conftest.$ac_objext conftest$ac_exeext
9332
#if defined (__stub_strerror) || defined (__stub___strerror)
9333
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
9333
choke me
9334
  (eval $ac_link) 2>&5
9334
#else
9335
  ac_status=$?
9335
strerror();
9336
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9336
#endif
9337
  (exit $ac_status); } &&
9337
9338
         { ac_try='test -s conftest$ac_exeext'
9338
; return 0; }
9339
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9339
EOF
9340
  (eval $ac_try) 2>&5
9340
if { (eval echo configure:9341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9341
  ac_status=$?
9341
  rm -rf conftest*
9342
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9342
  eval "ac_cv_func_strerror=yes"
9343
  (exit $ac_status); }; }; then
9343
else
9344
  ac_cv_func_dlopen=yes
9344
  echo "configure: failed program was:" >&5
9345
else
9345
  cat conftest.$ac_ext >&5
9346
  echo "$as_me: failed program was:" >&5
9346
  rm -rf conftest*
9347
cat conftest.$ac_ext >&5
9347
  eval "ac_cv_func_strerror=no"
9348
ac_cv_func_dlopen=no
9348
fi
9349
fi
9349
rm -f conftest*
9350
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9350
fi
9351
fi
9351
9352
echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
9352
if eval "test \"`echo '$ac_cv_func_'strerror`\" = yes"; then
9353
echo "${ECHO_T}$ac_cv_func_dlopen" >&6
9353
  echo "$ac_t""yes" 1>&6
9354
if test $ac_cv_func_dlopen = yes; then
9354
  cat >> confdefs.h <<\EOF
9355
  lt_cv_dlopen="dlopen"
9355
#define HAVE_STRERROR 1
9356
else
9356
EOF
9357
  echo "$as_me:$LINENO: checking for shl_load" >&5
9357
9358
echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
9358
else
9359
if test "${ac_cv_func_shl_load+set}" = set; then
9359
  echo "$ac_t""no" 1>&6
9360
  echo $ECHO_N "(cached) $ECHO_C" >&6
9360
fi
9361
else
9361
9362
  cat >conftest.$ac_ext <<_ACEOF
9362
9363
#line $LINENO "configure"
9363
9364
#include "confdefs.h"
9364
9365
/* From autoconf 2.57 */
9365
9366
/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
9366
#
9367
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
9367
# Determine the printf format characters to use when printing
9368
#define shl_load innocuous_shl_load
9368
# values of type isc_int64_t.  We make the assumption that platforms
9369
9369
# where a "long long" is the same size as a "long" (e.g., Alpha/OSF1)
9370
/* System header to define __stub macros and hopefully few prototypes,
9370
# want "%ld" and everyone else can use "%lld".  Win32 uses "%I64d",
9371
    which can conflict with char shl_load (); below.
9371
# but that's defined elsewhere since we don't use configure on Win32.
9372
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
9372
#
9373
    <limits.h> exists even on freestanding compilers.  */
9373
echo $ac_n "checking printf format modifier for 64-bit integers""... $ac_c" 1>&6
9374
9374
echo "configure:9375: checking printf format modifier for 64-bit integers" >&5
9375
#ifdef __STDC__
9375
if test "$cross_compiling" = yes; then
9376
# include <limits.h>
9376
  echo "$ac_t""assuming target platform uses ll" 1>&6
9377
#else
9377
	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
9378
# include <assert.h>
9378
else
9379
#endif
9379
  cat > conftest.$ac_ext <<EOF
9380
9380
#line 9381 "configure"
9381
#undef shl_load
9381
#include "confdefs.h"
9382
9382
main() { exit(!(sizeof(long long int) == sizeof(long int))); }
9383
/* Override any gcc2 internal prototype to avoid an error.  */
9383
EOF
9384
#ifdef __cplusplus
9384
if { (eval echo configure:9385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9385
extern "C"
9385
then
9386
{
9386
  echo "$ac_t""l" 1>&6
9387
#endif
9387
	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
9388
/* We use char because int might match the return type of a gcc2
9388
else
9389
   builtin and then its argument prototype would still apply.  */
9389
  echo "configure: failed program was:" >&5
9390
char shl_load ();
9390
  cat conftest.$ac_ext >&5
9391
/* The GNU C library defines this for functions which it implements
9391
  rm -fr conftest*
9392
    to always fail with ENOSYS.  Some functions are actually named
9392
  echo "$ac_t""ll" 1>&6
9393
    something starting with __ and the normal name is an alias.  */
9393
	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
9394
#if defined (__stub_shl_load) || defined (__stub___shl_load)
9394
fi
9395
choke me
9395
rm -fr conftest*
9396
#else
9396
fi
9397
char (*f) () = shl_load;
9397
9398
#endif
9398
9399
#ifdef __cplusplus
9399
9400
}
9400
#
9401
#endif
9401
# Security Stuff
9402
9402
#
9403
#ifdef F77_DUMMY_MAIN
9403
echo $ac_n "checking for chroot""... $ac_c" 1>&6
9404
#  ifdef __cplusplus
9404
echo "configure:9405: checking for chroot" >&5
9405
     extern "C"
9405
if eval "test \"`echo '$''{'ac_cv_func_chroot'+set}'`\" = set"; then
9406
#  endif
9406
  echo $ac_n "(cached) $ac_c" 1>&6
9407
   int F77_DUMMY_MAIN() { return 1; }
9407
else
9408
#endif
9408
  cat > conftest.$ac_ext <<EOF
9409
int
9409
#line 9410 "configure"
9410
main ()
9410
#include "confdefs.h"
9411
{
9411
/* System header to define __stub macros and hopefully few prototypes,
9412
return f != shl_load;
9412
    which can conflict with char chroot(); below.  */
9413
  ;
9413
#include <assert.h>
9414
  return 0;
9414
/* Override any gcc2 internal prototype to avoid an error.  */
9415
}
9415
/* We use char because int might match the return type of a gcc2
9416
_ACEOF
9416
    builtin and then its argument prototype would still apply.  */
9417
rm -f conftest.$ac_objext conftest$ac_exeext
9417
char chroot();
9418
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
9418
9419
  (eval $ac_link) 2>&5
9419
int main() {
9420
  ac_status=$?
9420
9421
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9421
/* The GNU C library defines this for functions which it implements
9422
  (exit $ac_status); } &&
9422
    to always fail with ENOSYS.  Some functions are actually named
9423
         { ac_try='test -s conftest$ac_exeext'
9423
    something starting with __ and the normal name is an alias.  */
9424
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9424
#if defined (__stub_chroot) || defined (__stub___chroot)
9425
  (eval $ac_try) 2>&5
9425
choke me
9426
  ac_status=$?
9426
#else
9427
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9427
chroot();
9428
  (exit $ac_status); }; }; then
9428
#endif
9429
  ac_cv_func_shl_load=yes
9429
9430
else
9430
; return 0; }
9431
  echo "$as_me: failed program was:" >&5
9431
EOF
9432
cat conftest.$ac_ext >&5
9432
if { (eval echo configure:9433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9433
ac_cv_func_shl_load=no
9433
  rm -rf conftest*
9434
fi
9434
  eval "ac_cv_func_chroot=yes"
9435
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9435
else
9436
fi
9436
  echo "configure: failed program was:" >&5
9437
echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
9437
  cat conftest.$ac_ext >&5
9438
echo "${ECHO_T}$ac_cv_func_shl_load" >&6
9438
  rm -rf conftest*
9439
if test $ac_cv_func_shl_load = yes; then
9439
  eval "ac_cv_func_chroot=no"
9440
  lt_cv_dlopen="shl_load"
9440
fi
9441
else
9441
rm -f conftest*
9442
  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
9442
fi
9443
echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
9443
9444
if test "${ac_cv_lib_svld_dlopen+set}" = set; then
9444
if eval "test \"`echo '$ac_cv_func_'chroot`\" = yes"; then
9445
  echo $ECHO_N "(cached) $ECHO_C" >&6
9445
  echo "$ac_t""yes" 1>&6
9446
else
9446
  cat >> confdefs.h <<\EOF
9447
  ac_check_lib_save_LIBS=$LIBS
9447
#define HAVE_CHROOT 1
9448
LIBS="-lsvld  $LIBS"
9448
EOF
9449
cat >conftest.$ac_ext <<_ACEOF
9449
9450
#line $LINENO "configure"
9450
else
9451
#include "confdefs.h"
9451
  echo "$ac_t""no" 1>&6
9452
9452
fi
9453
/* Override any gcc2 internal prototype to avoid an error.  */
9453
9454
#ifdef __cplusplus
9454
# Check whether --enable-linux-caps or --disable-linux-caps was given.
9455
extern "C"
9455
if test "${enable_linux_caps+set}" = set; then
9456
#endif
9456
  enableval="$enable_linux_caps"
9457
/* We use char because int might match the return type of a gcc2
9457
  :
9458
   builtin and then its argument prototype would still apply.  */
9458
fi
9459
char dlopen ();
9459
9460
#ifdef F77_DUMMY_MAIN
9460
case "$enable_linux_caps" in
9461
#  ifdef __cplusplus
9461
	yes|'')
9462
     extern "C"
9462
		for ac_hdr in linux/capability.h
9463
#  endif
9463
do
9464
   int F77_DUMMY_MAIN() { return 1; }
9464
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9465
#endif
9465
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9466
int
9466
echo "configure:9467: checking for $ac_hdr" >&5
9467
main ()
9467
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9468
{
9468
  echo $ac_n "(cached) $ac_c" 1>&6
9469
dlopen ();
9469
else
9470
  ;
9470
  cat > conftest.$ac_ext <<EOF
9471
  return 0;
9471
#line 9472 "configure"
9472
}
9472
#include "confdefs.h"
9473
_ACEOF
9473
#include <$ac_hdr>
9474
rm -f conftest.$ac_objext conftest$ac_exeext
9474
EOF
9475
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
9475
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9476
  (eval $ac_link) 2>&5
9476
{ (eval echo configure:9477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9477
  ac_status=$?
9477
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9478
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9478
if test -z "$ac_err"; then
9479
  (exit $ac_status); } &&
9479
  rm -rf conftest*
9480
         { ac_try='test -s conftest$ac_exeext'
9480
  eval "ac_cv_header_$ac_safe=yes"
9481
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9481
else
9482
  (eval $ac_try) 2>&5
9482
  echo "$ac_err" >&5
9483
  ac_status=$?
9483
  echo "configure: failed program was:" >&5
9484
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9484
  cat conftest.$ac_ext >&5
9485
  (exit $ac_status); }; }; then
9485
  rm -rf conftest*
9486
  ac_cv_lib_svld_dlopen=yes
9486
  eval "ac_cv_header_$ac_safe=no"
9487
else
9487
fi
9488
  echo "$as_me: failed program was:" >&5
9488
rm -f conftest*
9489
cat conftest.$ac_ext >&5
9489
fi
9490
ac_cv_lib_svld_dlopen=no
9490
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9491
fi
9491
  echo "$ac_t""yes" 1>&6
9492
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9492
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9493
LIBS=$ac_check_lib_save_LIBS
9493
  cat >> confdefs.h <<EOF
9494
fi
9494
#define $ac_tr_hdr 1
9495
echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
9495
EOF
9496
echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
9496
 
9497
if test $ac_cv_lib_svld_dlopen = yes; then
9497
else
9498
  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
9498
  echo "$ac_t""no" 1>&6
9499
else
9499
fi
9500
  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
9500
done
9501
echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
9501
9502
if test "${ac_cv_lib_dld_shl_load+set}" = set; then
9502
		;;
9503
  echo $ECHO_N "(cached) $ECHO_C" >&6
9503
	no)
9504
else
9504
		;;
9505
  ac_check_lib_save_LIBS=$LIBS
9505
esac
9506
LIBS="-ldld  $LIBS"
9506
for ac_hdr in sys/prctl.h
9507
cat >conftest.$ac_ext <<_ACEOF
9507
do
9508
#line $LINENO "configure"
9508
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9509
#include "confdefs.h"
9509
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9510
9510
echo "configure:9511: checking for $ac_hdr" >&5
9511
/* Override any gcc2 internal prototype to avoid an error.  */
9511
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9512
#ifdef __cplusplus
9512
  echo $ac_n "(cached) $ac_c" 1>&6
9513
extern "C"
9513
else
9514
#endif
9514
  cat > conftest.$ac_ext <<EOF
9515
/* We use char because int might match the return type of a gcc2
9515
#line 9516 "configure"
9516
   builtin and then its argument prototype would still apply.  */
9516
#include "confdefs.h"
9517
char shl_load ();
9517
#include <$ac_hdr>
9518
#ifdef F77_DUMMY_MAIN
9518
EOF
9519
#  ifdef __cplusplus
9519
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9520
     extern "C"
9520
{ (eval echo configure:9521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9521
#  endif
9521
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9522
   int F77_DUMMY_MAIN() { return 1; }
9522
if test -z "$ac_err"; then
9523
#endif
9523
  rm -rf conftest*
9524
int
9524
  eval "ac_cv_header_$ac_safe=yes"
9525
main ()
9525
else
9526
{
9526
  echo "$ac_err" >&5
9527
shl_load ();
9527
  echo "configure: failed program was:" >&5
9528
  ;
9528
  cat conftest.$ac_ext >&5
9529
  return 0;
9529
  rm -rf conftest*
9530
}
9530
  eval "ac_cv_header_$ac_safe=no"
9531
_ACEOF
9531
fi
9532
rm -f conftest.$ac_objext conftest$ac_exeext
9532
rm -f conftest*
9533
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
9533
fi
9534
  (eval $ac_link) 2>&5
9534
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9535
  ac_status=$?
9535
  echo "$ac_t""yes" 1>&6
9536
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9536
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9537
  (exit $ac_status); } &&
9537
  cat >> confdefs.h <<EOF
9538
         { ac_try='test -s conftest$ac_exeext'
9538
#define $ac_tr_hdr 1
9539
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9539
EOF
9540
  (eval $ac_try) 2>&5
9540
 
9541
  ac_status=$?
9541
else
9542
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9542
  echo "$ac_t""no" 1>&6
9543
  (exit $ac_status); }; }; then
9543
fi
9544
  ac_cv_lib_dld_shl_load=yes
9544
done
9545
else
9545
9546
  echo "$as_me: failed program was:" >&5
9546
9547
cat conftest.$ac_ext >&5
9547
#
9548
ac_cv_lib_dld_shl_load=no
9548
# BSD/OS, and perhaps some others, don't define rlim_t.
9549
fi
9549
#
9550
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9550
echo $ac_n "checking for type rlim_t""... $ac_c" 1>&6
9551
LIBS=$ac_check_lib_save_LIBS
9551
echo "configure:9552: checking for type rlim_t" >&5
9552
fi
9552
cat > conftest.$ac_ext <<EOF
9553
echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
9553
#line 9554 "configure"
9554
echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
9554
#include "confdefs.h"
9555
if test $ac_cv_lib_dld_shl_load = yes; then
9555
9556
  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
9556
#include <sys/types.h>
9557
fi
9557
#include <sys/time.h>
9558
9558
#include <sys/resource.h>
9559
9559
int main() {
9560
fi
9560
rlim_t rl = 19671212; return (0);
9561
9561
; return 0; }
9562
9562
EOF
9563
fi
9563
if { (eval echo configure:9564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9564
9564
  rm -rf conftest*
9565
9565
  echo "$ac_t""yes" 1>&6
9566
fi
9566
 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"
9567
9567
else
9568
9568
  echo "configure: failed program was:" >&5
9569
fi
9569
  cat conftest.$ac_ext >&5
9570
9570
  rm -rf conftest*
9571
    ;;
9571
  echo "$ac_t""no" 1>&6
9572
  esac
9572
9573
9573
echo $ac_n "checking type of rlim_cur""... $ac_c" 1>&6
9574
  if test "x$lt_cv_dlopen" != xno; then
9574
echo "configure:9575: checking type of rlim_cur" >&5
9575
    enable_dlopen=yes
9575
if test "$cross_compiling" = yes; then
9576
  else
9576
  { echo "configure: error: cannot determine type of rlim_cur when cross compiling - define rlim_t" 1>&2; exit 1; }
9577
    enable_dlopen=no
9577
else
9578
  fi
9578
  cat > conftest.$ac_ext <<EOF
9579
9579
#line 9580 "configure"
9580
  case $lt_cv_dlopen in
9580
#include "confdefs.h"
9581
  dlopen)
9581
9582
    save_CPPFLAGS="$CPPFLAGS"
9582
#include <sys/types.h>
9583
        test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
9583
#include <sys/time.h>
9584
9584
#include <sys/resource.h>
9585
    save_LDFLAGS="$LDFLAGS"
9585
main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}
9586
    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
9586
EOF
9587
9587
if { (eval echo configure:9588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9588
    save_LIBS="$LIBS"
9588
then
9589
    LIBS="$lt_cv_dlopen_libs $LIBS"
9589
  echo "$ac_t""int" 1>&6
9590
9590
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"
9591
    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
9591
else
9592
echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
9592
  echo "configure: failed program was:" >&5
9593
if test "${lt_cv_dlopen_self+set}" = set; then
9593
  cat conftest.$ac_ext >&5
9594
  echo $ECHO_N "(cached) $ECHO_C" >&6
9594
  rm -fr conftest*
9595
else
9595
  
9596
  	  if test "$cross_compiling" = yes; then :
9596
if test "$cross_compiling" = yes; then
9597
  lt_cv_dlopen_self=cross
9597
  { echo "configure: error: this cannot happen" 1>&2; exit 1; }
9598
else
9598
else
9599
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
9599
  cat > conftest.$ac_ext <<EOF
9600
  lt_status=$lt_dlunknown
9600
#line 9601 "configure"
9601
  cat > conftest.$ac_ext <<EOF
9601
#include "confdefs.h"
9602
#line 9602 "configure"
9602
9603
#include "confdefs.h"
9603
#include <sys/types.h>
9604
9604
#include <sys/time.h>
9605
#if HAVE_DLFCN_H
9605
#include <sys/resource.h>
9606
#include <dlfcn.h>
9606
main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}
9607
#endif
9607
EOF
9608
9608
if { (eval echo configure:9609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9609
#include <stdio.h>
9609
then
9610
9610
  echo "$ac_t""long int" 1>&6
9611
#ifdef RTLD_GLOBAL
9611
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"
9612
#  define LT_DLGLOBAL		RTLD_GLOBAL
9612
else
9613
#else
9613
  echo "configure: failed program was:" >&5
9614
#  ifdef DL_GLOBAL
9614
  cat conftest.$ac_ext >&5
9615
#    define LT_DLGLOBAL		DL_GLOBAL
9615
  rm -fr conftest*
9616
#  else
9616
  
9617
#    define LT_DLGLOBAL		0
9617
if test "$cross_compiling" = yes; then
9618
#  endif
9618
  { echo "configure: error: this cannot happen" 1>&2; exit 1; }
9619
#endif
9619
else
9620
9620
  cat > conftest.$ac_ext <<EOF
9621
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
9621
#line 9622 "configure"
9622
   find out it does not work in some platform. */
9622
#include "confdefs.h"
9623
#ifndef LT_DLLAZY_OR_NOW
9623
9624
#  ifdef RTLD_LAZY
9624
#include <sys/types.h>
9625
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
9625
#include <sys/time.h>
9626
#  else
9626
#include <sys/resource.h>
9627
#    ifdef DL_LAZY
9627
main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}
9628
#      define LT_DLLAZY_OR_NOW		DL_LAZY
9628
EOF
9629
#    else
9629
if { (eval echo configure:9630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9630
#      ifdef RTLD_NOW
9630
then
9631
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
9631
  echo "$ac_t""long long int" 1>&6
9632
#      else
9632
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"
9633
#        ifdef DL_NOW
9633
else
9634
#          define LT_DLLAZY_OR_NOW	DL_NOW
9634
  echo "configure: failed program was:" >&5
9635
#        else
9635
  cat conftest.$ac_ext >&5
9636
#          define LT_DLLAZY_OR_NOW	0
9636
  rm -fr conftest*
9637
#        endif
9637
  { echo "configure: error: unable to determine sizeof rlim_cur" 1>&2; exit 1; }
9638
#      endif
9638
9639
#    endif
9639
fi
9640
#  endif
9640
rm -fr conftest*
9641
#endif
9641
fi
9642
9642
9643
#ifdef __cplusplus
9643
9644
extern "C" void exit (int);
9644
fi
9645
#endif
9645
rm -fr conftest*
9646
9646
fi
9647
void fnord() { int i=42;}
9647
9648
int main ()
9648
9649
{
9649
fi
9650
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
9650
rm -fr conftest*
9651
  int status = $lt_dlunknown;
9651
fi
9652
9652
9653
  if (self)
9653
9654
    {
9654
fi
9655
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
9655
rm -f conftest*
9656
      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
9656
9657
      /* dlclose (self); */
9657
9658
    }
9658
#
9659
9659
# Microsoft has their own way of handling shared libraries that requires
9660
    exit (status);
9660
# additional qualifiers on extern variables.  Unix systems don't need it.
9661
}
9661
#
9662
EOF
9662
9663
  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
9663
ISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
9664
  (eval $ac_link) 2>&5
9664
9665
  ac_status=$?
9665
LWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
9666
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9666
9667
  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
9667
#
9668
    (./conftest; exit; ) 2>/dev/null
9668
# Random remaining OS-specific issues involving compiler warnings.
9669
    lt_status=$?
9669
# XXXDCL print messages to indicate some compensation is being done?
9670
    case x$lt_status in
9670
#
9671
      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
9671
9672
      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
9672
ISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
9673
      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
9673
9674
    esac
9674
case "$host" in
9675
  else :
9675
	*-bsdi3.1*)
9676
    # compilation failed
9676
		hack_shutup_sputaux=yes
9677
    lt_cv_dlopen_self=no
9677
		;;
9678
  fi
9678
	*-bsdi4.0*)
9679
fi
9679
		hack_shutup_sigwait=yes
9680
rm -fr conftest*
9680
		hack_shutup_sputaux=yes
9681
9681
		;;
9682
9682
	*-bsdi4[12]*)
9683
fi
9683
		hack_shutup_stdargcast=yes
9684
echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
9684
		;;
9685
echo "${ECHO_T}$lt_cv_dlopen_self" >&6
9685
	*-solaris2.[89])
9686
9686
		hack_shutup_pthreadonceinit=yes
9687
    if test "x$lt_cv_dlopen_self" = xyes; then
9687
		;;
9688
      LDFLAGS="$LDFLAGS $link_static_flag"
9688
esac
9689
      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
9689
9690
echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
9690
case "$hack_shutup_pthreadonceinit" in
9691
if test "${lt_cv_dlopen_self_static+set}" = set; then
9691
	yes)
9692
  echo $ECHO_N "(cached) $ECHO_C" >&6
9692
		#
9693
else
9693
		# Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
9694
  	  if test "$cross_compiling" = yes; then :
9694
		#
9695
  lt_cv_dlopen_self_static=cross
9695
		ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
9696
else
9696
		;;
9697
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
9697
esac
9698
  lt_status=$lt_dlunknown
9698
9699
  cat > conftest.$ac_ext <<EOF
9699
case "$hack_shutup_sigwait" in
9700
#line 9700 "configure"
9700
	yes)
9701
#include "confdefs.h"
9701
		#
9702
9702
		# Shut up a -Wmissing-prototypes warning for sigwait().
9703
#if HAVE_DLFCN_H
9703
		#
9704
#include <dlfcn.h>
9704
		cat >> confdefs.h <<\EOF
9705
#endif
9705
#define SHUTUP_SIGWAIT 1
9706
9706
EOF
9707
#include <stdio.h>
9707
9708
9708
		;;
9709
#ifdef RTLD_GLOBAL
9709
esac
9710
#  define LT_DLGLOBAL		RTLD_GLOBAL
9710
9711
#else
9711
case "$hack_shutup_sputaux" in
9712
#  ifdef DL_GLOBAL
9712
	yes)
9713
#    define LT_DLGLOBAL		DL_GLOBAL
9713
		#
9714
#  else
9714
		# Shut up a -Wmissing-prototypes warning from <stdio.h>.
9715
#    define LT_DLGLOBAL		0
9715
		#
9716
#  endif
9716
		cat >> confdefs.h <<\EOF
9717
#endif
9717
#define SHUTUP_SPUTAUX 1
9718
9718
EOF
9719
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
9719
9720
   find out it does not work in some platform. */
9720
		;;
9721
#ifndef LT_DLLAZY_OR_NOW
9721
esac
9722
#  ifdef RTLD_LAZY
9722
9723
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
9723
case "$hack_shutup_stdargcast" in
9724
#  else
9724
	yes)
9725
#    ifdef DL_LAZY
9725
		#
9726
#      define LT_DLLAZY_OR_NOW		DL_LAZY
9726
		# Shut up a -Wcast-qual warning from va_start().
9727
#    else
9727
		#
9728
#      ifdef RTLD_NOW
9728
		cat >> confdefs.h <<\EOF
9729
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
9729
#define SHUTUP_STDARG_CAST 1
9730
#      else
9730
EOF
9731
#        ifdef DL_NOW
9731
9732
#          define LT_DLLAZY_OR_NOW	DL_NOW
9732
		;;
9733
#        else
9733
esac
9734
#          define LT_DLLAZY_OR_NOW	0
9734
9735
#        endif
9735
#
9736
#      endif
9736
# The following sections deal with tools used for formatting
9737
#    endif
9737
# the documentation.  They are all optional, unless you are
9738
#  endif
9738
# a developer editing the documentation source.
9739
#endif
9739
#
9740
9740
9741
#ifdef __cplusplus
9741
# Directory trees where SGML files are commonly found.
9742
extern "C" void exit (int);
9742
sgmltrees="/usr/pkg/share/sgml /usr/local/share/sgml"
9743
#endif
9743
9744
9744
#
9745
void fnord() { int i=42;}
9745
# Look for openjade.  Plain jade is no longer supported.
9746
int main ()
9746
#
9747
{
9747
9748
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
9748
for ac_prog in openjade
9749
  int status = $lt_dlunknown;
9749
do
9750
9750
# Extract the first word of "$ac_prog", so it can be a program name with args.
9751
  if (self)
9751
set dummy $ac_prog; ac_word=$2
9752
    {
9752
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
9753
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
9753
echo "configure:9754: checking for $ac_word" >&5
9754
      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
9754
if eval "test \"`echo '$''{'ac_cv_path_OPENJADE'+set}'`\" = set"; then
9755
      /* dlclose (self); */
9755
  echo $ac_n "(cached) $ac_c" 1>&6
9756
    }
9756
else
9757
9757
  case "$OPENJADE" in
9758
    exit (status);
9758
  /*)
9759
}
9759
  ac_cv_path_OPENJADE="$OPENJADE" # Let the user override the test with a path.
9760
EOF
9760
  ;;
9761
  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
9761
  ?:/*)			 
9762
  (eval $ac_link) 2>&5
9762
  ac_cv_path_OPENJADE="$OPENJADE" # Let the user override the test with a dos path.
9763
  ac_status=$?
9763
  ;;
9764
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9764
  *)
9765
  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
9765
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
9766
    (./conftest; exit; ) 2>/dev/null
9766
  ac_dummy="$PATH"
9767
    lt_status=$?
9767
  for ac_dir in $ac_dummy; do 
9768
    case x$lt_status in
9768
    test -z "$ac_dir" && ac_dir=.
9769
      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
9769
    if test -f $ac_dir/$ac_word; then
9770
      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
9770
      ac_cv_path_OPENJADE="$ac_dir/$ac_word"
9771
      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
9771
      break
9772
    esac
9772
    fi
9773
  else :
9773
  done
9774
    # compilation failed
9774
  IFS="$ac_save_ifs"
9775
    lt_cv_dlopen_self_static=no
9775
  ;;
9776
  fi
9776
esac
9777
fi
9777
fi
9778
rm -fr conftest*
9778
OPENJADE="$ac_cv_path_OPENJADE"
9779
9779
if test -n "$OPENJADE"; then
9780
9780
  echo "$ac_t""$OPENJADE" 1>&6
9781
fi
9781
else
9782
echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
9782
  echo "$ac_t""no" 1>&6
9783
echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
9783
fi
9784
    fi
9784
9785
9785
test -n "$OPENJADE" && break
9786
    CPPFLAGS="$save_CPPFLAGS"
9786
done
9787
    LDFLAGS="$save_LDFLAGS"
9787
test -n "$OPENJADE" || OPENJADE="openjade"
9788
    LIBS="$save_LIBS"
9788
9789
    ;;
9789
9790
  esac
9790
9791
9791
#
9792
  case $lt_cv_dlopen_self in
9792
# Look for TeX.
9793
  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
9793
#
9794
  *) enable_dlopen_self=unknown ;;
9794
9795
  esac
9795
for ac_prog in jadetex
9796
9796
do
9797
  case $lt_cv_dlopen_self_static in
9797
# Extract the first word of "$ac_prog", so it can be a program name with args.
9798
  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
9798
set dummy $ac_prog; ac_word=$2
9799
  *) enable_dlopen_self_static=unknown ;;
9799
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
9800
  esac
9800
echo "configure:9801: checking for $ac_word" >&5
9801
fi
9801
if eval "test \"`echo '$''{'ac_cv_path_JADETEX'+set}'`\" = set"; then
9802
9802
  echo $ac_n "(cached) $ac_c" 1>&6
9803
9803
else
9804
## FIXME: this should be a separate macro
9804
  case "$JADETEX" in
9805
##
9805
  /*)
9806
if test "$enable_shared" = yes && test "$GCC" = yes; then
9806
  ac_cv_path_JADETEX="$JADETEX" # Let the user override the test with a path.
9807
  case $archive_cmds in
9807
  ;;
9808
  *'~'*)
9808
  ?:/*)			 
9809
    # FIXME: we may have to deal with multi-command sequences.
9809
  ac_cv_path_JADETEX="$JADETEX" # Let the user override the test with a dos path.
9810
    ;;
9810
  ;;
9811
  '$CC '*)
9811
  *)
9812
    # Test whether the compiler implicitly links with -lc since on some
9812
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
9813
    # systems, -lgcc has to come before -lc. If gcc already passes -lc
9813
  ac_dummy="$PATH"
9814
    # to ld, don't add -lc before -lgcc.
9814
  for ac_dir in $ac_dummy; do 
9815
    echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
9815
    test -z "$ac_dir" && ac_dir=.
9816
echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
9816
    if test -f $ac_dir/$ac_word; then
9817
    if test "${lt_cv_archive_cmds_need_lc+set}" = set; then
9817
      ac_cv_path_JADETEX="$ac_dir/$ac_word"
9818
  echo $ECHO_N "(cached) $ECHO_C" >&6
9818
      break
9819
else
9819
    fi
9820
  $rm conftest*
9820
  done
9821
    echo 'static int dummy;' > conftest.$ac_ext
9821
  IFS="$ac_save_ifs"
9822
9822
  ;;
9823
    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
9823
esac
9824
  (eval $ac_compile) 2>&5
9824
fi
9825
  ac_status=$?
9825
JADETEX="$ac_cv_path_JADETEX"
9826
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9826
if test -n "$JADETEX"; then
9827
  (exit $ac_status); }; then
9827
  echo "$ac_t""$JADETEX" 1>&6
9828
      soname=conftest
9828
else
9829
      lib=conftest
9829
  echo "$ac_t""no" 1>&6
9830
      libobjs=conftest.$ac_objext
9830
fi
9831
      deplibs=
9831
9832
      wl=$lt_cv_prog_cc_wl
9832
test -n "$JADETEX" && break
9833
      compiler_flags=-v
9833
done
9834
      linker_flags=-v
9834
test -n "$JADETEX" || JADETEX="jadetex"
9835
      verstring=
9835
9836
      output_objdir=.
9836
9837
      libname=conftest
9837
9838
      save_allow_undefined_flag=$allow_undefined_flag
9838
for ac_prog in pdfjadetex
9839
      allow_undefined_flag=
9839
do
9840
      if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
9840
# Extract the first word of "$ac_prog", so it can be a program name with args.
9841
  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
9841
set dummy $ac_prog; ac_word=$2
9842
  ac_status=$?
9842
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
9843
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
9843
echo "configure:9844: checking for $ac_word" >&5
9844
  (exit $ac_status); }
9844
if eval "test \"`echo '$''{'ac_cv_path_PDFJADETEX'+set}'`\" = set"; then
9845
      then
9845
  echo $ac_n "(cached) $ac_c" 1>&6
9846
	lt_cv_archive_cmds_need_lc=no
9846
else
9847
      else
9847
  case "$PDFJADETEX" in
9848
	lt_cv_archive_cmds_need_lc=yes
9848
  /*)
9849
      fi
9849
  ac_cv_path_PDFJADETEX="$PDFJADETEX" # Let the user override the test with a path.
9850
      allow_undefined_flag=$save_allow_undefined_flag
9850
  ;;
9851
    else
9851
  ?:/*)			 
9852
      cat conftest.err 1>&5
9852
  ac_cv_path_PDFJADETEX="$PDFJADETEX" # Let the user override the test with a dos path.
9853
    fi
9853
  ;;
9854
fi
9854
  *)
9855
9855
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
9856
    echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5
9856
  ac_dummy="$PATH"
9857
echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6
9857
  for ac_dir in $ac_dummy; do 
9858
    ;;
9858
    test -z "$ac_dir" && ac_dir=.
9859
  esac
9859
    if test -f $ac_dir/$ac_word; then
9860
fi
9860
      ac_cv_path_PDFJADETEX="$ac_dir/$ac_word"
9861
need_lc=${lt_cv_archive_cmds_need_lc-yes}
9861
      break
9862
##
9862
    fi
9863
## END FIXME
9863
  done
9864
9864
  IFS="$ac_save_ifs"
9865
## FIXME: this should be a separate macro
9865
  ;;
9866
##
9866
esac
9867
# The second clause should only fire when bootstrapping the
9867
fi
9868
# libtool distribution, otherwise you forgot to ship ltmain.sh
9868
PDFJADETEX="$ac_cv_path_PDFJADETEX"
9869
# with your package, and you will get complaints that there are
9869
if test -n "$PDFJADETEX"; then
9870
# no rules to generate ltmain.sh.
9870
  echo "$ac_t""$PDFJADETEX" 1>&6
9871
if test -f "$ltmain"; then
9871
else
9872
  :
9872
  echo "$ac_t""no" 1>&6
9873
else
9873
fi
9874
  # If there is no Makefile yet, we rely on a make rule to execute
9874
9875
  # `config.status --recheck' to rerun these tests and create the
9875
test -n "$PDFJADETEX" && break
9876
  # libtool script then.
9876
done
9877
  test -f Makefile && make "$ltmain"
9877
test -n "$PDFJADETEX" || PDFJADETEX="pdfjadetex"
9878
fi
9878
9879
9879
9880
if test -f "$ltmain"; then
9880
9881
  trap "$rm \"${ofile}T\"; exit 1" 1 2 15
9881
#
9882
  $rm -f "${ofile}T"
9882
# Subroutine for searching for an ordinary file (e.g., a stylesheet)
9883
9883
# in a number of directories:
9884
  echo creating $ofile
9884
#
9885
9885
#   NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
9886
  # Now quote all the things that may contain metacharacters while being
9886
#
9887
  # careful not to overquote the AC_SUBSTed values.  We take copies of the
9887
# If the file FILENAME is found in one of the DIRECTORIES, the shell
9888
  # variables and quote the copies for generation of the libtool script.
9888
# variable VARIABLE is defined to its absolute pathname.  Otherwise, 
9889
  for var in echo old_CC old_CFLAGS \
9889
# it is set to FILENAME, with no directory prefix (that's not terribly
9890
    AR AR_FLAGS CC LD LN_S NM SHELL \
9890
# useful, but looks less confusing in substitutions than leaving it
9891
    reload_flag reload_cmds wl \
9891
# empty).  The variable VARIABLE will be substituted into output files.
9892
    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
9892
# 
9893
    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
9893
9894
    library_names_spec soname_spec \
9894
9895
    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
9895
9896
    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
9896
9897
    postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
9897
SGMLCATALOG=""
9898
    old_striplib striplib file_magic_cmd export_symbols_cmds \
9898
echo $ac_n "checking for catalog""... $ac_c" 1>&6
9899
    deplibs_check_method allow_undefined_flag no_undefined_flag \
9899
echo "configure:9900: checking for catalog" >&5
9900
    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
9900
for d in $sgmltrees
9901
    hardcode_libdir_flag_spec hardcode_libdir_separator  \
9901
do
9902
    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
9902
	f=$d/catalog
9903
    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
9903
	if test -f $f
9904
9904
	then
9905
    case $var in
9905
		SGMLCATALOG=$f
9906
    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
9906
		echo "$ac_t""$f" 1>&6
9907
    old_postinstall_cmds | old_postuninstall_cmds | \
9907
		break
9908
    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
9908
	fi
9909
    extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
9909
done
9910
    postinstall_cmds | postuninstall_cmds | \
9910
if test "X$SGMLCATALOG" = "X"
9911
    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
9911
then
9912
      # Double-quote double-evaled strings.
9912
	echo "$ac_t"""not found"" 1>&6;
9913
      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
9913
	SGMLCATALOG=catalog
9914
      ;;
9914
fi
9915
    *)
9915
9916
      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
9916
9917
      ;;
9917
9918
    esac
9918
#
9919
  done
9919
# Look for the HTML stylesheet html/docbook.dsl, used for
9920
9920
# formatting man pages in HTML.  Its location varies,
9921
  cat <<__EOF__ > "${ofile}T"
9921
# so far we have seen:
9922
#! $SHELL
9922
#
9923
9923
# 	NetBSD 	/usr/pkg/share/docbook/dsssl/modular/
9924
# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
9924
# 	FreeBSD	/usr/local/share/docbook/dsssl/modular/
9925
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
9925
#	Linux	/usr/local/share/dsssl/docbook/
9926
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
9926
#
9927
#
9927
# Ditto for the print stylesheet print/docbook.dsl.
9928
# Copyright (C) 1996-2000 Free Software Foundation, Inc.
9928
#
9929
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
9929
9930
#
9930
stylepath=""
9931
# This program is free software; you can redistribute it and/or modify
9931
for d in $sgmltrees 
9932
# it under the terms of the GNU General Public License as published by
9932
do
9933
# the Free Software Foundation; either version 2 of the License, or
9933
	for s in docbook/dsssl/modular dsssl/docbook
9934
# (at your option) any later version.
9934
	do
9935
#
9935
		stylepath="$stylepath $d/$s"
9936
# This program is distributed in the hope that it will be useful, but
9936
	done
9937
# WITHOUT ANY WARRANTY; without even the implied warranty of
9937
done
9938
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9938
9939
# General Public License for more details.
9939
HTMLSTYLE=""
9940
#
9940
echo $ac_n "checking for html/docbook.dsl""... $ac_c" 1>&6
9941
# You should have received a copy of the GNU General Public License
9941
echo "configure:9942: checking for html/docbook.dsl" >&5
9942
# along with this program; if not, write to the Free Software
9942
for d in $stylepath
9943
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9943
do
9944
#
9944
	f=$d/html/docbook.dsl
9945
# As a special exception to the GNU General Public License, if you
9945
	if test -f $f
9946
# distribute this file as part of a program that contains a
9946
	then
9947
# configuration script generated by Autoconf, you may include it under
9947
		HTMLSTYLE=$f
9948
# the same distribution terms that you use for the rest of that program.
9948
		echo "$ac_t""$f" 1>&6
9949
9949
		break
9950
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
9950
	fi
9951
Xsed="sed -e s/^X//"
9951
done
9952
9952
if test "X$HTMLSTYLE" = "X"
9953
# The HP-UX ksh and POSIX shell print the target directory to stdout
9953
then
9954
# if CDPATH is set.
9954
	echo "$ac_t"""not found"" 1>&6;
9955
if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
9955
	HTMLSTYLE=html/docbook.dsl
9956
9956
fi
9957
# ### BEGIN LIBTOOL CONFIG
9957
9958
9958
9959
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
9959
9960
9960
PRINTSTYLE=""
9961
# Shell to use when invoking shell scripts.
9961
echo $ac_n "checking for print/docbook.dsl""... $ac_c" 1>&6
9962
SHELL=$lt_SHELL
9962
echo "configure:9963: checking for print/docbook.dsl" >&5
9963
9963
for d in $stylepath
9964
# Whether or not to build shared libraries.
9964
do
9965
build_libtool_libs=$enable_shared
9965
	f=$d/print/docbook.dsl
9966
9966
	if test -f $f
9967
# Whether or not to add -lc for building shared libraries.
9967
	then
9968
build_libtool_need_lc=$need_lc
9968
		PRINTSTYLE=$f
9969
9969
		echo "$ac_t""$f" 1>&6
9970
# Whether or not to build static libraries.
9970
		break
9971
build_old_libs=$enable_static
9971
	fi
9972
9972
done
9973
# Whether or not to optimize for fast installation.
9973
if test "X$PRINTSTYLE" = "X"
9974
fast_install=$enable_fast_install
9974
then
9975
9975
	echo "$ac_t"""not found"" 1>&6;
9976
# The host system.
9976
	PRINTSTYLE=print/docbook.dsl
9977
host_alias=$host_alias
9977
fi
9978
host=$host
9978
9979
9979
9980
# An echo program that does not interpret backslashes.
9980
9981
echo=$lt_echo
9981
#
9982
9982
# Look for XML declarations
9983
# The archiver.
9983
#
9984
AR=$lt_AR
9984
9985
AR_FLAGS=$lt_AR_FLAGS
9985
9986
9986
XMLDCL=""
9987
# The default C compiler.
9987
echo $ac_n "checking for docbook/dsssl/modular/dtds/decls/xml.dcl""... $ac_c" 1>&6
9988
CC=$lt_CC
9988
echo "configure:9989: checking for docbook/dsssl/modular/dtds/decls/xml.dcl" >&5
9989
9989
for d in $sgmltrees
9990
# Is the compiler the GNU C compiler?
9990
do
9991
with_gcc=$GCC
9991
	f=$d/docbook/dsssl/modular/dtds/decls/xml.dcl
9992
9992
	if test -f $f
9993
# The linker used to build libraries.
9993
	then
9994
LD=$lt_LD
9994
		XMLDCL=$f
9995
9995
		echo "$ac_t""$f" 1>&6
9996
# Whether we need hard or soft links.
9996
		break
9997
LN_S=$lt_LN_S
9997
	fi
9998
9998
done
9999
# A BSD-compatible nm program.
9999
if test "X$XMLDCL" = "X"
10000
NM=$lt_NM
10000
then
10001
10001
	echo "$ac_t"""not found"" 1>&6;
10002
# A symbol stripping program
10002
	XMLDCL=docbook/dsssl/modular/dtds/decls/xml.dcl
10003
STRIP=$STRIP
10003
fi
10004
10004
10005
# Used to examine libraries when file_magic_cmd begins "file"
10005
10006
MAGIC_CMD=$MAGIC_CMD
10006
10007
10007
#
10008
# Used on cygwin: DLL creation program.
10008
# Look for docbook2man-spec.pl
10009
DLLTOOL="$DLLTOOL"
10009
#
10010
10010
10011
# Used on cygwin: object dumper.
10011
10012
OBJDUMP="$OBJDUMP"
10012
DOCBOOK2MANSPEC=""
10013
10013
echo $ac_n "checking for docbook2X/docbook2man-spec.pl""... $ac_c" 1>&6
10014
# Used on cygwin: assembler.
10014
echo "configure:10015: checking for docbook2X/docbook2man-spec.pl" >&5
10015
AS="$AS"
10015
for d in $sgmltrees
10016
10016
do
10017
# The name of the directory that contains temporary libtool files.
10017
	f=$d/docbook2X/docbook2man-spec.pl
10018
objdir=$objdir
10018
	if test -f $f
10019
10019
	then
10020
# How to create reloadable object files.
10020
		DOCBOOK2MANSPEC=$f
10021
reload_flag=$lt_reload_flag
10021
		echo "$ac_t""$f" 1>&6
10022
reload_cmds=$lt_reload_cmds
10022
		break
10023
10023
	fi
10024
# How to pass a linker flag through the compiler.
10024
done
10025
wl=$lt_wl
10025
if test "X$DOCBOOK2MANSPEC" = "X"
10026
10026
then
10027
# Object file suffix (normally "o").
10027
	echo "$ac_t"""not found"" 1>&6;
10028
objext="$ac_objext"
10028
	DOCBOOK2MANSPEC=docbook2X/docbook2man-spec.pl
10029
10029
fi
10030
# Old archive suffix (normally "a").
10030
10031
libext="$libext"
10031
10032
10032
10033
# Executable file suffix (normally "").
10033
#
10034
exeext="$exeext"
10034
# Substitutions
10035
10035
#
10036
# Additional compiler flags for building library objects.
10036
10037
pic_flag=$lt_pic_flag
10037
BIND9_TOP_BUILDDIR=`pwd`
10038
pic_mode=$pic_mode
10038
10039
10039
10040
# Does compiler simultaneously support -c and -o options?
10040
10041
compiler_c_o=$lt_compiler_c_o
10041
10042
10042
10043
# Can we write directly to a .lo ?
10043
10044
compiler_o_lo=$lt_compiler_o_lo
10044
if test "X$srcdir" != "X"; then
10045
10045
	BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
10046
# Must we lock files when doing compilation ?
10046
	BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
10047
need_locks=$lt_need_locks
10047
	BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
10048
10048
	BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
10049
# Do we need the lib prefix for modules?
10049
	BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
10050
need_lib_prefix=$need_lib_prefix
10050
else
10051
10051
	BIND9_ISC_BUILDINCLUDE=""
10052
# Do we need a version for libraries?
10052
	BIND9_ISCCC_BUILDINCLUDE=""
10053
need_version=$need_version
10053
	BIND9_ISCCFG_BUILDINCLUDE=""
10054
10054
	BIND9_DNS_BUILDINCLUDE=""
10055
# Whether dlopen is supported.
10055
	BIND9_LWRES_BUILDINCLUDE=""
10056
dlopen_support=$enable_dlopen
10056
fi
10057
10057
10058
# Whether dlopen of programs is supported.
10058
10059
dlopen_self=$enable_dlopen_self
10059
BIND9_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
10060
10060
10061
# Whether dlopen of statically linked programs is supported.
10061
10062
dlopen_self_static=$enable_dlopen_self_static
10062
BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
10063
10063
10064
# Compiler flag to prevent dynamic linking.
10064
. $srcdir/version
10065
link_static_flag=$lt_link_static_flag
10065
BIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
10066
10066
10067
# Compiler flag to turn off builtin functions.
10067
10068
no_builtin_flag=$lt_no_builtin_flag
10068
10069
10069
LIBISC_API=$srcdir/lib/isc/api
10070
# Compiler flag to allow reflexive dlopens.
10070
10071
export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
10071
10072
10072
LIBISCCC_API=$srcdir/lib/isccc/api
10073
# Compiler flag to generate shared objects directly from archives.
10073
10074
whole_archive_flag_spec=$lt_whole_archive_flag_spec
10074
10075
10075
LIBISCCFG_API=$srcdir/lib/isccfg/api
10076
# Compiler flag to generate thread-safe objects.
10076
10077
thread_safe_flag_spec=$lt_thread_safe_flag_spec
10077
10078
10078
LIBDNS_API=$srcdir/lib/dns/api
10079
# Library versioning type.
10079
10080
version_type=$version_type
10080
10081
10081
LIBLWRES_API=$srcdir/lib/lwres/api
10082
# Format of library name prefix.
10082
10083
libname_spec=$lt_libname_spec
10083
trap '' 1 2 15
10084
10084
cat > confcache <<\EOF
10085
# List of archive names.  First name is the real one, the rest are links.
10085
# This file is a shell script that caches the results of configure
10086
# The last name is the one that the linker finds with -lNAME.
10086
# tests run on this system so they can be shared between configure
10087
library_names_spec=$lt_library_names_spec
10087
# scripts and configure runs.  It is not useful on other systems.
10088
10088
# If it contains results you don't want to keep, you may remove or edit it.
10089
# The coded name of the library, if different from the real name.
10089
#
10090
soname_spec=$lt_soname_spec
10090
# By default, configure uses ./config.cache as the cache file,
10091
10091
# creating it if it does not exist already.  You can give configure
10092
# Commands used to build and install an old-style archive.
10092
# the --cache-file=FILE option to use a different cache file; that is
10093
RANLIB=$lt_RANLIB
10093
# what configure does when it calls configure scripts in
10094
old_archive_cmds=$lt_old_archive_cmds
10094
# subdirectories, so they share the cache.
10095
old_postinstall_cmds=$lt_old_postinstall_cmds
10095
# Giving --cache-file=/dev/null disables caching, for debugging configure.
10096
old_postuninstall_cmds=$lt_old_postuninstall_cmds
10096
# config.status only pays attention to the cache file if you give it the
10097
10097
# --recheck option to rerun configure.
10098
# Create an old-style archive from a shared archive.
10098
#
10099
old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
10099
EOF
10100
10100
# The following way of writing the cache mishandles newlines in values,
10101
# Create a temporary old-style archive to link instead of a shared archive.
10101
# but we know of no workaround that is simple, portable, and efficient.
10102
old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
10102
# So, don't put newlines in cache variables' values.
10103
10103
# Ultrix sh set writes to stderr and can't be redirected directly,
10104
# Commands used to build and install a shared archive.
10104
# and sets the high bit in the cache file unless we assign to the vars.
10105
archive_cmds=$lt_archive_cmds
10105
(set) 2>&1 |
10106
archive_expsym_cmds=$lt_archive_expsym_cmds
10106
  case `(ac_space=' '; set | grep ac_space) 2>&1` in
10107
postinstall_cmds=$lt_postinstall_cmds
10107
  *ac_space=\ *)
10108
postuninstall_cmds=$lt_postuninstall_cmds
10108
    # `set' does not quote correctly, so add quotes (double-quote substitution
10109
10109
    # turns \\\\ into \\, and sed turns \\ into \).
10110
# Commands to strip libraries.
10110
    sed -n \
10111
old_striplib=$lt_old_striplib
10111
      -e "s/'/'\\\\''/g" \
10112
striplib=$lt_striplib
10112
      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
10113
10113
    ;;
10114
# Method to check whether dependent libraries are shared objects.
10114
  *)
10115
deplibs_check_method=$lt_deplibs_check_method
10115
    # `set' quotes correctly as required by POSIX, so do not add quotes.
10116
10116
    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
10117
# Command to use when deplibs_check_method == file_magic.
10117
    ;;
10118
file_magic_cmd=$lt_file_magic_cmd
10118
  esac >> confcache
10119
10119
if cmp -s $cache_file confcache; then
10120
# Flag that allows shared libraries with undefined symbols to be built.
10120
  :
10121
allow_undefined_flag=$lt_allow_undefined_flag
10121
else
10122
10122
  if test -w $cache_file; then
10123
# Flag that forces no undefined symbols.
10123
    echo "updating cache $cache_file"
10124
no_undefined_flag=$lt_no_undefined_flag
10124
    cat confcache > $cache_file
10125
10125
  else
10126
# Commands used to finish a libtool library installation in a directory.
10126
    echo "not updating unwritable cache $cache_file"
10127
finish_cmds=$lt_finish_cmds
10127
  fi
10128
10128
fi
10129
# Same as above, but a single script fragment to be evaled but not shown.
10129
rm -f confcache
10130
finish_eval=$lt_finish_eval
10130
10131
10131
trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
10132
# Take the output of nm and produce a listing of raw symbols and C names.
10132
10133
global_symbol_pipe=$lt_global_symbol_pipe
10133
test "x$prefix" = xNONE && prefix=$ac_default_prefix
10134
10134
# Let make expand exec_prefix.
10135
# Transform the output of nm in a proper C declaration
10135
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
10136
global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
10136
10137
10137
# Any assignment to VPATH causes Sun make to only execute
10138
# This is the shared library runtime path variable.
10138
# the first set of double-colon rules, so remove it if not needed.
10139
runpath_var=$runpath_var
10139
# If there is a colon in the path, we need to keep it.
10140
10140
if test "x$srcdir" = x.; then
10141
# This is the shared library path variable.
10141
  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
10142
shlibpath_var=$shlibpath_var
10142
fi
10143
10143
10144
# Is shlibpath searched before the hard-coded library search path?
10144
trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
10145
shlibpath_overrides_runpath=$shlibpath_overrides_runpath
10145
10146
10146
DEFS=-DHAVE_CONFIG_H
10147
# How to hardcode a shared library path into an executable.
10147
10148
hardcode_action=$hardcode_action
10148
# Without the "./", some shells look in PATH for config.status.
10149
10149
: ${CONFIG_STATUS=./config.status}
10150
# Whether we should hardcode library paths into libraries.
10150
10151
hardcode_into_libs=$hardcode_into_libs
10151
echo creating $CONFIG_STATUS
10152
10152
rm -f $CONFIG_STATUS
10153
# Flag to hardcode \$libdir into a binary during linking.
10153
cat > $CONFIG_STATUS <<EOF
10154
# This must work even if \$libdir does not exist.
10154
#! /bin/sh
10155
hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
10155
# Generated automatically by configure.
10156
10156
# Run this file to recreate the current configuration.
10157
# Whether we need a single -rpath flag with a separated argument.
10157
# This directory was configured as follows,
10158
hardcode_libdir_separator=$lt_hardcode_libdir_separator
10158
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
10159
10159
#
10160
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
10160
# $0 $ac_configure_args
10161
# resulting binary.
10161
#
10162
hardcode_direct=$hardcode_direct
10162
# Compiler output produced by configure, useful for debugging
10163
10163
# configure, is in ./config.log if it exists.
10164
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
10164
10165
# resulting binary.
10165
ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
10166
hardcode_minus_L=$hardcode_minus_L
10166
for ac_option
10167
10167
do
10168
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
10168
  case "\$ac_option" in
10169
# the resulting binary.
10169
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
10170
hardcode_shlibpath_var=$hardcode_shlibpath_var
10170
    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
10171
10171
    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
10172
# Variables whose values should be saved in libtool wrapper scripts and
10172
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
10173
# restored at relink time.
10173
    echo "$CONFIG_STATUS generated by autoconf version 2.13"
10174
variables_saved_for_relink="$variables_saved_for_relink"
10174
    exit 0 ;;
10175
10175
  -help | --help | --hel | --he | --h)
10176
# Whether libtool must link a program against all its dependency libraries.
10176
    echo "\$ac_cs_usage"; exit 0 ;;
10177
link_all_deplibs=$link_all_deplibs
10177
  *) echo "\$ac_cs_usage"; exit 1 ;;
10178
10178
  esac
10179
# Compile-time system search path for libraries
10179
done
10180
sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
10180
10181
10181
ac_given_srcdir=$srcdir
10182
# Run-time system search path for libraries
10182
ac_given_INSTALL="$INSTALL"
10183
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
10183
10184
10184
trap 'rm -fr `echo "make/rules
10185
# Fix the shell variable \$srcfile for the compiler.
10185
        make/includes
10186
fix_srcfile_path="$fix_srcfile_path"
10186
	Makefile
10187
10187
	make/Makefile
10188
# Set to yes if exported symbols are required.
10188
	make/mkdep
10189
always_export_symbols=$always_export_symbols
10189
	lib/Makefile
10190
10190
	lib/isc/Makefile
10191
# The commands to list exported symbols.
10191
	lib/isc/include/Makefile
10192
export_symbols_cmds=$lt_export_symbols_cmds
10192
	lib/isc/include/isc/Makefile
10193
10193
	lib/isc/include/isc/platform.h
10194
# The commands to extract the exported symbol list from a shared archive.
10194
	lib/isc/unix/Makefile
10195
extract_expsyms_cmds=$lt_extract_expsyms_cmds
10195
	lib/isc/unix/include/Makefile
10196
10196
	lib/isc/unix/include/isc/Makefile
10197
# Symbols that should not be listed in the preloaded symbols.
10197
	lib/isc/nls/Makefile
10198
exclude_expsyms=$lt_exclude_expsyms
10198
	lib/isc/$thread_dir/Makefile
10199
10199
	lib/isc/$thread_dir/include/Makefile
10200
# Symbols that must always be exported.
10200
	lib/isc/$thread_dir/include/isc/Makefile
10201
include_expsyms=$lt_include_expsyms
10201
	lib/isccc/Makefile
10202
10202
	lib/isccc/include/Makefile
10203
# ### END LIBTOOL CONFIG
10203
	lib/isccc/include/isccc/Makefile
10204
10204
	lib/isccfg/Makefile
10205
__EOF__
10205
	lib/isccfg/include/Makefile
10206
10206
	lib/isccfg/include/isccfg/Makefile
10207
  case $host_os in
10207
	lib/dns/Makefile
10208
  aix3*)
10208
	lib/dns/include/Makefile
10209
    cat <<\EOF >> "${ofile}T"
10209
	lib/dns/include/dns/Makefile
10210
10210
	lib/dns/sec/Makefile
10211
# AIX sometimes has problems with the GCC collect2 program.  For some
10211
	lib/dns/sec/dst/Makefile
10212
# reason, if we set the COLLECT_NAMES environment variable, the problems
10212
	lib/dns/sec/dst/include/Makefile
10213
# vanish in a puff of smoke.
10213
	lib/dns/sec/dst/include/dst/Makefile
10214
if test "X${COLLECT_NAMES+set}" != Xset; then
10214
	lib/lwres/Makefile
10215
  COLLECT_NAMES=
10215
	lib/lwres/include/Makefile
10216
  export COLLECT_NAMES
10216
	lib/lwres/include/lwres/Makefile
10217
fi
10217
	lib/lwres/include/lwres/netdb.h
10218
EOF
10218
	lib/lwres/include/lwres/platform.h
10219
    ;;
10219
	lib/lwres/man/Makefile
10220
  esac
10220
	lib/lwres/unix/Makefile
10221
10221
	lib/lwres/unix/include/Makefile
10222
  case $host_os in
10222
	lib/lwres/unix/include/lwres/Makefile
10223
  cygwin* | mingw* | pw32* | os2*)
10223
	lib/lwres/win32/Makefile
10224
    cat <<'EOF' >> "${ofile}T"
10224
	lib/lwres/win32/include/Makefile
10225
      # This is a source program that is used to create dlls on Windows
10225
	lib/lwres/win32/include/lwres/Makefile
10226
      # Don't remove nor modify the starting and closing comments
10226
	lib/tests/Makefile
10227
# /* ltdll.c starts here */
10227
	lib/tests/include/Makefile
10228
# #define WIN32_LEAN_AND_MEAN
10228
	lib/tests/include/tests/Makefile
10229
# #include <windows.h>
10229
	bin/Makefile
10230
# #undef WIN32_LEAN_AND_MEAN
10230
        bin/dlzbdb/Makefile
10231
# #include <stdio.h>
10231
	bin/check/Makefile
10232
#
10232
	bin/named/Makefile
10233
# #ifndef __CYGWIN__
10233
	bin/named/unix/Makefile
10234
# #  ifdef __CYGWIN32__
10234
	bin/rndc/Makefile
10235
# #    define __CYGWIN__ __CYGWIN32__
10235
	bin/rndc/unix/Makefile
10236
# #  endif
10236
	bin/dig/Makefile
10237
# #endif
10237
	bin/nsupdate/Makefile
10238
#
10238
	bin/tests/Makefile
10239
# #ifdef __cplusplus
10239
	bin/tests/names/Makefile
10240
# extern "C" {
10240
	bin/tests/master/Makefile
10241
# #endif
10241
	bin/tests/rbt/Makefile
10242
# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
10242
	bin/tests/db/Makefile
10243
# #ifdef __cplusplus
10243
	bin/tests/tasks/Makefile
10244
# }
10244
	bin/tests/timers/Makefile
10245
# #endif
10245
	bin/tests/dst/Makefile
10246
#
10246
	bin/tests/mem/Makefile
10247
# #ifdef __CYGWIN__
10247
	bin/tests/net/Makefile
10248
# #include <cygwin/cygwin_dll.h>
10248
	bin/tests/sockaddr/Makefile
10249
# DECLARE_CYGWIN_DLL( DllMain );
10249
	bin/tests/system/Makefile
10250
# #endif
10250
	bin/tests/system/conf.sh
10251
# HINSTANCE __hDllInstance_base;
10251
	bin/tests/system/lwresd/Makefile
10252
#
10252
	bin/tests/system/tkey/Makefile
10253
# BOOL APIENTRY
10253
	bin/tests/headerdep_test.sh
10254
# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
10254
	bin/dnssec/Makefile
10255
# {
10255
	doc/Makefile
10256
#   __hDllInstance_base = hInst;
10256
	doc/arm/Makefile
10257
#   return TRUE;
10257
	doc/arm/nominum-docbook-html.dsl
10258
# }
10258
	doc/arm/nominum-docbook-print.dsl
10259
# /* ltdll.c ends here */
10259
	doc/arm/validate.sh
10260
        # This is a source program that is used to create import libraries
10260
	doc/misc/Makefile
10261
        # on Windows for dlls which lack them. Don't remove nor modify the
10261
	docutil/docbook2man-wrapper.sh
10262
        # starting and closing comments
10262
	isc-config.sh
10263
# /* impgen.c starts here */
10263
 config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
10264
# /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
10264
EOF
10265
#
10265
cat >> $CONFIG_STATUS <<EOF
10266
#  This file is part of GNU libtool.
10266
10267
#
10267
# Protect against being on the right side of a sed subst in config.status.
10268
#  This program is free software; you can redistribute it and/or modify
10268
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
10269
#  it under the terms of the GNU General Public License as published by
10269
 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
10270
#  the Free Software Foundation; either version 2 of the License, or
10270
$ac_vpsub
10271
#  (at your option) any later version.
10271
$extrasub
10272
#
10272
s%@SHELL@%$SHELL%g
10273
#  This program is distributed in the hope that it will be useful,
10273
s%@CFLAGS@%$CFLAGS%g
10274
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
10274
s%@CPPFLAGS@%$CPPFLAGS%g
10275
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10275
s%@CXXFLAGS@%$CXXFLAGS%g
10276
#  GNU General Public License for more details.
10276
s%@FFLAGS@%$FFLAGS%g
10277
#
10277
s%@DEFS@%$DEFS%g
10278
#  You should have received a copy of the GNU General Public License
10278
s%@LDFLAGS@%$LDFLAGS%g
10279
#  along with this program; if not, write to the Free Software
10279
s%@LIBS@%$LIBS%g
10280
#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
10280
s%@exec_prefix@%$exec_prefix%g
10281
#  */
10281
s%@prefix@%$prefix%g
10282
#
10282
s%@program_transform_name@%$program_transform_name%g
10283
# #include <stdio.h>		/* for printf() */
10283
s%@bindir@%$bindir%g
10284
# #include <unistd.h>		/* for open(), lseek(), read() */
10284
s%@sbindir@%$sbindir%g
10285
# #include <fcntl.h>		/* for O_RDONLY, O_BINARY */
10285
s%@libexecdir@%$libexecdir%g
10286
# #include <string.h>		/* for strdup() */
10286
s%@datadir@%$datadir%g
10287
#
10287
s%@sysconfdir@%$sysconfdir%g
10288
# /* O_BINARY isn't required (or even defined sometimes) under Unix */
10288
s%@sharedstatedir@%$sharedstatedir%g
10289
# #ifndef O_BINARY
10289
s%@localstatedir@%$localstatedir%g
10290
# #define O_BINARY 0
10290
s%@libdir@%$libdir%g
10291
# #endif
10291
s%@includedir@%$includedir%g
10292
#
10292
s%@oldincludedir@%$oldincludedir%g
10293
# static unsigned int
10293
s%@infodir@%$infodir%g
10294
# pe_get16 (fd, offset)
10294
s%@mandir@%$mandir%g
10295
#      int fd;
10295
s%@subdirs@%$subdirs%g
10296
#      int offset;
10296
s%@host@%$host%g
10297
# {
10297
s%@host_alias@%$host_alias%g
10298
#   unsigned char b[2];
10298
s%@host_cpu@%$host_cpu%g
10299
#   lseek (fd, offset, SEEK_SET);
10299
s%@host_vendor@%$host_vendor%g
10300
#   read (fd, b, 2);
10300
s%@host_os@%$host_os%g
10301
#   return b[0] + (b[1]<<8);
10301
s%@SET_MAKE@%$SET_MAKE%g
10302
# }
10302
s%@RANLIB@%$RANLIB%g
10303
#
10303
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
10304
# static unsigned int
10304
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
10305
# pe_get32 (fd, offset)
10305
s%@INSTALL_DATA@%$INSTALL_DATA%g
10306
#     int fd;
10306
s%@STD_CINCLUDES@%$STD_CINCLUDES%g
10307
#     int offset;
10307
s%@STD_CDEFINES@%$STD_CDEFINES%g
10308
# {
10308
s%@STD_CWARNINGS@%$STD_CWARNINGS%g
10309
#   unsigned char b[4];
10309
s%@CCOPT@%$CCOPT%g
10310
#   lseek (fd, offset, SEEK_SET);
10310
s%@AR@%$AR%g
10311
#   read (fd, b, 4);
10311
s%@ARFLAGS@%$ARFLAGS%g
10312
#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
10312
s%@LN@%$LN%g
10313
# }
10313
s%@ETAGS@%$ETAGS%g
10314
#
10314
s%@PERL@%$PERL%g
10315
# static unsigned int
10315
s%@CC@%$CC%g
10316
# pe_as32 (ptr)
10316
s%@CPP@%$CPP%g
10317
#      void *ptr;
10317
s%@ISC_PLATFORM_HAVELONGLONG@%$ISC_PLATFORM_HAVELONGLONG%g
10318
# {
10318
s%@ISC_PLATFORM_NEEDSYSSELECTH@%$ISC_PLATFORM_NEEDSYSSELECTH%g
10319
#   unsigned char *b = ptr;
10319
s%@LWRES_PLATFORM_NEEDSYSSELECTH@%$LWRES_PLATFORM_NEEDSYSSELECTH%g
10320
#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
10320
s%@DLZ_POSTGRES_INC@%$DLZ_POSTGRES_INC%g
10321
# }
10321
s%@DLZ_POSTGRES_LIBS@%$DLZ_POSTGRES_LIBS%g
10322
#
10322
s%@USE_DLZ_POSTGRES@%$USE_DLZ_POSTGRES%g
10323
# int
10323
s%@DLZ_MYSQL_INC@%$DLZ_MYSQL_INC%g
10324
# main (argc, argv)
10324
s%@DLZ_MYSQL_LIBS@%$DLZ_MYSQL_LIBS%g
10325
#     int argc;
10325
s%@USE_DLZ_MYSQL@%$USE_DLZ_MYSQL%g
10326
#     char *argv[];
10326
s%@DLZ_BDB_UTIL@%$DLZ_BDB_UTIL%g
10327
# {
10327
s%@DLZ_BDB_INC@%$DLZ_BDB_INC%g
10328
#     int dll;
10328
s%@DLZ_BDB_LIBS@%$DLZ_BDB_LIBS%g
10329
#     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
10329
s%@USE_DLZ_BDB@%$USE_DLZ_BDB%g
10330
#     unsigned long export_rva, export_size, nsections, secptr, expptr;
10330
s%@USE_DLZ_FILESYSTEM@%$USE_DLZ_FILESYSTEM%g
10331
#     unsigned long name_rvas, nexp;
10331
s%@DLZ_LDAP_INC@%$DLZ_LDAP_INC%g
10332
#     unsigned char *expdata, *erva;
10332
s%@DLZ_LDAP_LIBS@%$DLZ_LDAP_LIBS%g
10333
#     char *filename, *dll_name;
10333
s%@USE_DLZ_LDAP@%$USE_DLZ_LDAP%g
10334
#
10334
s%@DLZ_ODBC_INC@%$DLZ_ODBC_INC%g
10335
#     filename = argv[1];
10335
s%@DLZ_ODBC_LIBS@%$DLZ_ODBC_LIBS%g
10336
#
10336
s%@USE_DLZ_ODBC@%$USE_DLZ_ODBC%g
10337
#     dll = open(filename, O_RDONLY|O_BINARY);
10337
s%@USE_DLZ_STUB@%$USE_DLZ_STUB%g
10338
#     if (dll < 1)
10338
s%@USE_DLZ@%$USE_DLZ%g
10339
# 	return 1;
10339
s%@DST_OPENSSL_INC@%$DST_OPENSSL_INC%g
10340
#
10340
s%@DNS_OPENSSL_LIBS@%$DNS_OPENSSL_LIBS%g
10341
#     dll_name = filename;
10341
s%@USE_OPENSSL@%$USE_OPENSSL%g
10342
#
10342
s%@USE_GSSAPI@%$USE_GSSAPI%g
10343
#     for (i=0; filename[i]; i++)
10343
s%@DST_GSSAPI_INC@%$DST_GSSAPI_INC%g
10344
# 	if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
10344
s%@DNS_GSSAPI_LIBS@%$DNS_GSSAPI_LIBS%g
10345
# 	    dll_name = filename + i +1;
10345
s%@ALWAYS_DEFINES@%$ALWAYS_DEFINES%g
10346
#
10346
s%@ISC_PLATFORM_USETHREADS@%$ISC_PLATFORM_USETHREADS%g
10347
#     pe_header_offset = pe_get32 (dll, 0x3c);
10347
s%@ISC_THREAD_DIR@%$ISC_THREAD_DIR%g
10348
#     opthdr_ofs = pe_header_offset + 4 + 20;
10348
s%@MKDEPCC@%$MKDEPCC%g
10349
#     num_entries = pe_get32 (dll, opthdr_ofs + 92);
10349
s%@MKDEPCFLAGS@%$MKDEPCFLAGS%g
10350
#
10350
s%@MKDEPPROG@%$MKDEPPROG%g
10351
#     if (num_entries < 1) /* no exports */
10351
s%@IRIX_DNSSEC_WARNINGS_HACK@%$IRIX_DNSSEC_WARNINGS_HACK%g
10352
# 	return 1;
10352
s%@purify_path@%$purify_path%g
10353
#
10353
s%@PURIFY@%$PURIFY%g
10354
#     export_rva = pe_get32 (dll, opthdr_ofs + 96);
10354
s%@build@%$build%g
10355
#     export_size = pe_get32 (dll, opthdr_ofs + 100);
10355
s%@build_alias@%$build_alias%g
10356
#     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
10356
s%@build_cpu@%$build_cpu%g
10357
#     secptr = (pe_header_offset + 4 + 20 +
10357
s%@build_vendor@%$build_vendor%g
10358
# 	      pe_get16 (dll, pe_header_offset + 4 + 16));
10358
s%@build_os@%$build_os%g
10359
#
10359
s%@LN_S@%$LN_S%g
10360
#     expptr = 0;
10360
s%@OBJEXT@%$OBJEXT%g
10361
#     for (i = 0; i < nsections; i++)
10361
s%@EXEEXT@%$EXEEXT%g
10362
#     {
10362
s%@ECHO@%$ECHO%g
10363
# 	char sname[8];
10363
s%@STRIP@%$STRIP%g
10364
# 	unsigned long secptr1 = secptr + 40 * i;
10364
s%@LIBTOOL@%$LIBTOOL%g
10365
# 	unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
10365
s%@O@%$O%g
10366
# 	unsigned long vsize = pe_get32 (dll, secptr1 + 16);
10366
s%@A@%$A%g
10367
# 	unsigned long fptr = pe_get32 (dll, secptr1 + 20);
10367
s%@SA@%$SA%g
10368
# 	lseek(dll, secptr1, SEEK_SET);
10368
s%@LIBTOOL_MKDEP_SED@%$LIBTOOL_MKDEP_SED%g
10369
# 	read(dll, sname, 8);
10369
s%@LIBBIND@%$LIBBIND%g
10370
# 	if (vaddr <= export_rva && vaddr+vsize > export_rva)
10370
s%@ISC_PLATFORM_HAVEIPV6@%$ISC_PLATFORM_HAVEIPV6%g
10371
# 	{
10371
s%@LWRES_PLATFORM_HAVEIPV6@%$LWRES_PLATFORM_HAVEIPV6%g
10372
# 	    expptr = fptr + (export_rva - vaddr);
10372
s%@ISC_PLATFORM_NEEDNETINETIN6H@%$ISC_PLATFORM_NEEDNETINETIN6H%g
10373
# 	    if (export_rva + export_size > vaddr + vsize)
10373
s%@LWRES_PLATFORM_NEEDNETINETIN6H@%$LWRES_PLATFORM_NEEDNETINETIN6H%g
10374
# 		export_size = vsize - (export_rva - vaddr);
10374
s%@ISC_PLATFORM_NEEDNETINET6IN6H@%$ISC_PLATFORM_NEEDNETINET6IN6H%g
10375
# 	    break;
10375
s%@LWRES_PLATFORM_NEEDNETINET6IN6H@%$LWRES_PLATFORM_NEEDNETINET6IN6H%g
10376
# 	}
10376
s%@ISC_PLATFORM_HAVEINADDR6@%$ISC_PLATFORM_HAVEINADDR6%g
10377
#     }
10377
s%@LWRES_PLATFORM_HAVEINADDR6@%$LWRES_PLATFORM_HAVEINADDR6%g
10378
#
10378
s%@ISC_PLATFORM_NEEDIN6ADDRANY@%$ISC_PLATFORM_NEEDIN6ADDRANY%g
10379
#     expdata = (unsigned char*)malloc(export_size);
10379
s%@LWRES_PLATFORM_NEEDIN6ADDRANY@%$LWRES_PLATFORM_NEEDIN6ADDRANY%g
10380
#     lseek (dll, expptr, SEEK_SET);
10380
s%@ISC_PLATFORM_NEEDIN6ADDRLOOPBACK@%$ISC_PLATFORM_NEEDIN6ADDRLOOPBACK%g
10381
#     read (dll, expdata, export_size);
10381
s%@LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK@%$LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK%g
10382
#     erva = expdata - export_rva;
10382
s%@ISC_PLATFORM_HAVEIN6PKTINFO@%$ISC_PLATFORM_HAVEIN6PKTINFO%g
10383
#
10383
s%@ISC_PLATFORM_FIXIN6ISADDR@%$ISC_PLATFORM_FIXIN6ISADDR%g
10384
#     nexp = pe_as32 (expdata+24);
10384
s%@ISC_IPV6_H@%$ISC_IPV6_H%g
10385
#     name_rvas = pe_as32 (expdata+32);
10385
s%@ISC_IPV6_O@%$ISC_IPV6_O%g
10386
#
10386
s%@ISC_ISCIPV6_O@%$ISC_ISCIPV6_O%g
10387
#     printf ("EXPORTS\n");
10387
s%@ISC_IPV6_C@%$ISC_IPV6_C%g
10388
#     for (i = 0; i<nexp; i++)
10388
s%@LWRES_HAVE_SIN6_SCOPE_ID@%$LWRES_HAVE_SIN6_SCOPE_ID%g
10389
#     {
10389
s%@ISC_PLATFORM_NEEDNTOP@%$ISC_PLATFORM_NEEDNTOP%g
10390
# 	unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
10390
s%@ISC_PLATFORM_NEEDPTON@%$ISC_PLATFORM_NEEDPTON%g
10391
# 	printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
10391
s%@ISC_PLATFORM_NEEDATON@%$ISC_PLATFORM_NEEDATON%g
10392
#     }
10392
s%@ISC_PLATFORM_HAVESALEN@%$ISC_PLATFORM_HAVESALEN%g
10393
#
10393
s%@LWRES_PLATFORM_HAVESALEN@%$LWRES_PLATFORM_HAVESALEN%g
10394
#     return 0;
10394
s%@ISC_PLATFORM_MSGHDRFLAVOR@%$ISC_PLATFORM_MSGHDRFLAVOR%g
10395
# }
10395
s%@ISC_PLATFORM_NEEDPORTT@%$ISC_PLATFORM_NEEDPORTT%g
10396
# /* impgen.c ends here */
10396
s%@ISC_LWRES_NEEDADDRINFO@%$ISC_LWRES_NEEDADDRINFO%g
10397
10397
s%@ISC_LWRES_NEEDRRSETINFO@%$ISC_LWRES_NEEDRRSETINFO%g
10398
EOF
10398
s%@ISC_LWRES_SETHOSTENTINT@%$ISC_LWRES_SETHOSTENTINT%g
10399
    ;;
10399
s%@ISC_LWRES_ENDHOSTENTINT@%$ISC_LWRES_ENDHOSTENTINT%g
10400
  esac
10400
s%@ISC_LWRES_GETNETBYADDRINADDR@%$ISC_LWRES_GETNETBYADDRINADDR%g
10401
10401
s%@ISC_LWRES_SETNETENTINT@%$ISC_LWRES_SETNETENTINT%g
10402
  # We use sed instead of cat because bash on DJGPP gets confused if
10402
s%@ISC_LWRES_ENDNETENTINT@%$ISC_LWRES_ENDNETENTINT%g
10403
  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
10403
s%@ISC_LWRES_GETHOSTBYADDRVOID@%$ISC_LWRES_GETHOSTBYADDRVOID%g
10404
  # text mode, it properly converts lines to CR/LF.  This bash problem
10404
s%@ISC_LWRES_NEEDHERRNO@%$ISC_LWRES_NEEDHERRNO%g
10405
  # is reportedly fixed, but why not run on old versions too?
10405
s%@ISC_LWRES_GETIPNODEPROTO@%$ISC_LWRES_GETIPNODEPROTO%g
10406
  sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
10406
s%@ISC_LWRES_GETADDRINFOPROTO@%$ISC_LWRES_GETADDRINFOPROTO%g
10407
10407
s%@ISC_LWRES_GETNAMEINFOPROTO@%$ISC_LWRES_GETNAMEINFOPROTO%g
10408
  mv -f "${ofile}T" "$ofile" || \
10408
s%@ISC_PLATFORM_NEEDSTRSEP@%$ISC_PLATFORM_NEEDSTRSEP%g
10409
    (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
10409
s%@ISC_PLATFORM_NEEDVSNPRINTF@%$ISC_PLATFORM_NEEDVSNPRINTF%g
10410
  chmod +x "$ofile"
10410
s%@ISC_EXTRA_OBJS@%$ISC_EXTRA_OBJS%g
10411
fi
10411
s%@ISC_EXTRA_SRCS@%$ISC_EXTRA_SRCS%g
10412
##
10412
s%@ISC_PLATFORM_QUADFORMAT@%$ISC_PLATFORM_QUADFORMAT%g
10413
## END FIXME
10413
s%@ISC_PLATFORM_RLIMITTYPE@%$ISC_PLATFORM_RLIMITTYPE%g
10414
10414
s%@ISC_PLATFORM_USEDECLSPEC@%$ISC_PLATFORM_USEDECLSPEC%g
10415
10415
s%@LWRES_PLATFORM_USEDECLSPEC@%$LWRES_PLATFORM_USEDECLSPEC%g
10416
10416
s%@ISC_PLATFORM_BRACEPTHREADONCEINIT@%$ISC_PLATFORM_BRACEPTHREADONCEINIT%g
10417
10417
s%@OPENJADE@%$OPENJADE%g
10418
10418
s%@JADETEX@%$JADETEX%g
10419
# This can be used to rebuild libtool when needed
10419
s%@PDFJADETEX@%$PDFJADETEX%g
10420
LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
10420
s%@SGMLCATALOG@%$SGMLCATALOG%g
10421
10421
s%@HTMLSTYLE@%$HTMLSTYLE%g
10422
# Always use our own libtool.
10422
s%@PRINTSTYLE@%$PRINTSTYLE%g
10423
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
10423
s%@XMLDCL@%$XMLDCL%g
10424
10424
s%@DOCBOOK2MANSPEC@%$DOCBOOK2MANSPEC%g
10425
# Prevent multiple expansion
10425
s%@BIND9_TOP_BUILDDIR@%$BIND9_TOP_BUILDDIR%g
10426
10426
s%@BIND9_ISC_BUILDINCLUDE@%$BIND9_ISC_BUILDINCLUDE%g
10427
10427
s%@BIND9_ISCCC_BUILDINCLUDE@%$BIND9_ISCCC_BUILDINCLUDE%g
10428
		O=lo
10428
s%@BIND9_ISCCFG_BUILDINCLUDE@%$BIND9_ISCCFG_BUILDINCLUDE%g
10429
		A=la
10429
s%@BIND9_DNS_BUILDINCLUDE@%$BIND9_DNS_BUILDINCLUDE%g
10430
		LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
10430
s%@BIND9_LWRES_BUILDINCLUDE@%$BIND9_LWRES_BUILDINCLUDE%g
10431
		;;
10431
/@BIND9_INCLUDES@/r $BIND9_INCLUDES
10432
	*)
10432
s%@BIND9_INCLUDES@%%g
10433
		O=o
10433
/@BIND9_MAKE_RULES@/r $BIND9_MAKE_RULES
10434
		A=a
10434
s%@BIND9_MAKE_RULES@%%g
10435
		LIBTOOL=
10435
s%@BIND9_VERSION@%$BIND9_VERSION%g
10436
10436
/@LIBISC_API@/r $LIBISC_API
10437
		LIBTOOL_MKDEP_SED=
10437
s%@LIBISC_API@%%g
10438
		;;
10438
/@LIBISCCC_API@/r $LIBISCCC_API
10439
esac
10439
s%@LIBISCCC_API@%%g
10440
10440
/@LIBISCCFG_API@/r $LIBISCCFG_API
10441
#
10441
s%@LIBISCCFG_API@%%g
10442
# File name extension for static archive files, for those few places
10442
/@LIBDNS_API@/r $LIBDNS_API
10443
# where they are treated differently from dynamic ones.
10443
s%@LIBDNS_API@%%g
10444
#
10444
/@LIBLWRES_API@/r $LIBLWRES_API
10445
SA=a
10445
s%@LIBLWRES_API@%%g
10446
10446
10447
10447
CEOF
10448
10448
EOF
10449
10449
10450
10450
cat >> $CONFIG_STATUS <<\EOF
10451
10451
10452
#
10452
# Split the substitutions into bite-sized pieces for seds with
10453
# build libbind?
10453
# small command number limits, like on Digital OSF/1 and HP-UX.
10454
#
10454
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
10455
# Check whether --enable-libbind or --disable-libbind was given.
10455
ac_file=1 # Number of current file.
10456
if test "${enable_libbind+set}" = set; then
10456
ac_beg=1 # First line for current file.
10457
  enableval="$enable_libbind"
10457
ac_end=$ac_max_sed_cmds # Line after last line for current file.
10458
10458
ac_more_lines=:
10459
fi;
10459
ac_sed_cmds=""
10460
10460
while $ac_more_lines; do
10461
case "$enable_libbind" in
10461
  if test $ac_beg -gt 1; then
10462
	yes)
10462
    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
10463
		LIBBIND=lib/bind
10463
  else
10464
10464
    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
10465
		;;
10465
  fi
10466
	no|'')
10466
  if test ! -s conftest.s$ac_file; then
10467
		;;
10467
    ac_more_lines=false
10468
esac
10468
    rm -f conftest.s$ac_file
10469
10469
  else
10470
#
10470
    if test -z "$ac_sed_cmds"; then
10471
# Here begins a very long section to determine the system's networking
10471
      ac_sed_cmds="sed -f conftest.s$ac_file"
10472
# capabilities.  The order of the tests is signficant.
10472
    else
10473
#
10473
      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
10474
10474
    fi
10475
#
10475
    ac_file=`expr $ac_file + 1`
10476
# IPv6
10476
    ac_beg=$ac_end
10477
#
10477
    ac_end=`expr $ac_end + $ac_max_sed_cmds`
10478
# Check whether --enable-ipv6 or --disable-ipv6 was given.
10478
  fi
10479
if test "${enable_ipv6+set}" = set; then
10479
done
10480
  enableval="$enable_ipv6"
10480
if test -z "$ac_sed_cmds"; then
10481
10481
  ac_sed_cmds=cat
10482
fi;
10482
fi
10483
10483
EOF
10484
case "$enable_ipv6" in
10484
10485
	yes|''|autodetect)
10485
cat >> $CONFIG_STATUS <<EOF
10486
		cat >>confdefs.h <<\_ACEOF
10486
10487
#define WANT_IPV6 1
10487
CONFIG_FILES=\${CONFIG_FILES-"make/rules
10488
_ACEOF
10488
        make/includes
10489
10489
	Makefile
10490
		;;
10490
	make/Makefile
10491
	no)
10491
	make/mkdep
10492
		;;
10492
	lib/Makefile
10493
esac
10493
	lib/isc/Makefile
10494
10494
	lib/isc/include/Makefile
10495
#
10495
	lib/isc/include/isc/Makefile
10496
# We do the IPv6 compilation checking after libtool so that we can put
10496
	lib/isc/include/isc/platform.h
10497
# the right suffix on the files.
10497
	lib/isc/unix/Makefile
10498
#
10498
	lib/isc/unix/include/Makefile
10499
echo "$as_me:$LINENO: checking for IPv6 structures" >&5
10499
	lib/isc/unix/include/isc/Makefile
10500
echo $ECHO_N "checking for IPv6 structures... $ECHO_C" >&6
10500
	lib/isc/nls/Makefile
10501
cat >conftest.$ac_ext <<_ACEOF
10501
	lib/isc/$thread_dir/Makefile
10502
#line $LINENO "configure"
10502
	lib/isc/$thread_dir/include/Makefile
10503
#include "confdefs.h"
10503
	lib/isc/$thread_dir/include/isc/Makefile
10504
10504
	lib/isccc/Makefile
10505
#include <sys/types.h>
10505
	lib/isccc/include/Makefile
10506
#include <sys/socket.h>
10506
	lib/isccc/include/isccc/Makefile
10507
#include <netinet/in.h>
10507
	lib/isccfg/Makefile
10508
#ifdef F77_DUMMY_MAIN
10508
	lib/isccfg/include/Makefile
10509
#  ifdef __cplusplus
10509
	lib/isccfg/include/isccfg/Makefile
10510
     extern "C"
10510
	lib/dns/Makefile
10511
#  endif
10511
	lib/dns/include/Makefile
10512
   int F77_DUMMY_MAIN() { return 1; }
10512
	lib/dns/include/dns/Makefile
10513
#endif
10513
	lib/dns/sec/Makefile
10514
int
10514
	lib/dns/sec/dst/Makefile
10515
main ()
10515
	lib/dns/sec/dst/include/Makefile
10516
{
10516
	lib/dns/sec/dst/include/dst/Makefile
10517
struct sockaddr_in6 sin6; return (0);
10517
	lib/lwres/Makefile
10518
  ;
10518
	lib/lwres/include/Makefile
10519
  return 0;
10519
	lib/lwres/include/lwres/Makefile
10520
}
10520
	lib/lwres/include/lwres/netdb.h
10521
_ACEOF
10521
	lib/lwres/include/lwres/platform.h
10522
rm -f conftest.$ac_objext
10522
	lib/lwres/man/Makefile
10523
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10523
	lib/lwres/unix/Makefile
10524
  (eval $ac_compile) 2>&5
10524
	lib/lwres/unix/include/Makefile
10525
  ac_status=$?
10525
	lib/lwres/unix/include/lwres/Makefile
10526
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10526
	lib/lwres/win32/Makefile
10527
  (exit $ac_status); } &&
10527
	lib/lwres/win32/include/Makefile
10528
         { ac_try='test -s conftest.$ac_objext'
10528
	lib/lwres/win32/include/lwres/Makefile
10529
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10529
	lib/tests/Makefile
10530
  (eval $ac_try) 2>&5
10530
	lib/tests/include/Makefile
10531
  ac_status=$?
10531
	lib/tests/include/tests/Makefile
10532
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10532
	bin/Makefile
10533
  (exit $ac_status); }; }; then
10533
        bin/dlzbdb/Makefile
10534
  echo "$as_me:$LINENO: result: yes" >&5
10534
	bin/check/Makefile
10535
echo "${ECHO_T}yes" >&6
10535
	bin/named/Makefile
10536
	 found_ipv6=yes
10536
	bin/named/unix/Makefile
10537
else
10537
	bin/rndc/Makefile
10538
  echo "$as_me: failed program was:" >&5
10538
	bin/rndc/unix/Makefile
10539
cat conftest.$ac_ext >&5
10539
	bin/dig/Makefile
10540
echo "$as_me:$LINENO: result: no" >&5
10540
	bin/nsupdate/Makefile
10541
echo "${ECHO_T}no" >&6
10541
	bin/tests/Makefile
10542
	 found_ipv6=no
10542
	bin/tests/names/Makefile
10543
fi
10543
	bin/tests/master/Makefile
10544
rm -f conftest.$ac_objext conftest.$ac_ext
10544
	bin/tests/rbt/Makefile
10545
10545
	bin/tests/db/Makefile
10546
#
10546
	bin/tests/tasks/Makefile
10547
# See whether IPv6 support is provided via a Kame add-on.
10547
	bin/tests/timers/Makefile
10548
# This is done before other IPv6 linking tests to LIBS is properly set.
10548
	bin/tests/dst/Makefile
10549
#
10549
	bin/tests/mem/Makefile
10550
echo "$as_me:$LINENO: checking for Kame IPv6 support" >&5
10550
	bin/tests/net/Makefile
10551
echo $ECHO_N "checking for Kame IPv6 support... $ECHO_C" >&6
10551
	bin/tests/sockaddr/Makefile
10552
10552
	bin/tests/system/Makefile
10553
# Check whether --with-kame or --without-kame was given.
10553
	bin/tests/system/conf.sh
10554
if test "${with_kame+set}" = set; then
10554
	bin/tests/system/lwresd/Makefile
10555
  withval="$with_kame"
10555
	bin/tests/system/tkey/Makefile
10556
  use_kame="$withval"
10556
	bin/tests/headerdep_test.sh
10557
else
10557
	bin/dnssec/Makefile
10558
  use_kame="no"
10558
	doc/Makefile
10559
fi;
10559
	doc/arm/Makefile
10560
10560
	doc/arm/nominum-docbook-html.dsl
10561
case "$use_kame" in
10561
	doc/arm/nominum-docbook-print.dsl
10562
	no)
10562
	doc/arm/validate.sh
10563
		;;
10563
	doc/misc/Makefile
10564
	yes)
10564
	docutil/docbook2man-wrapper.sh
10565
		kame_path=/usr/local/v6
10565
	isc-config.sh
10566
		;;
10566
"}
10567
	*)
10567
EOF
10568
		kame_path="$use_kame"
10568
cat >> $CONFIG_STATUS <<\EOF
10569
		;;
10569
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
10570
esac
10570
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10571
10571
  case "$ac_file" in
10572
case "$use_kame" in
10572
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10573
	no)
10573
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10574
		echo "$as_me:$LINENO: result: no" >&5
10574
  *) ac_file_in="${ac_file}.in" ;;
10575
echo "${ECHO_T}no" >&6
10575
  esac
10576
		;;
10576
10577
	*)
10577
  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
10578
		if test -f $kame_path/lib/libinet6.a; then
10578
10579
			echo "$as_me:$LINENO: result: $kame_path/lib/libinet6.a" >&5
10579
  # Remove last slash and all that follows it.  Not all systems have dirname.
10580
echo "${ECHO_T}$kame_path/lib/libinet6.a" >&6
10580
  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10581
			LIBS="-L$kame_path/lib -linet6 $LIBS"
10581
  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10582
		else
10582
    # The file is in a subdirectory.
10583
			{ { echo "$as_me:$LINENO: error: $kame_path/lib/libinet6.a not found.
10583
    test ! -d "$ac_dir" && mkdir "$ac_dir"
10584
10584
    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
10585
Please choose the proper path with the following command:
10585
    # A "../" for each directory in $ac_dir_suffix.
10586
10586
    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
10587
    configure --with-kame=PATH
10587
  else
10588
" >&5
10588
    ac_dir_suffix= ac_dots=
10589
echo "$as_me: error: $kame_path/lib/libinet6.a not found.
10589
  fi
10590
10590
10591
Please choose the proper path with the following command:
10591
  case "$ac_given_srcdir" in
10592
10592
  .)  srcdir=.
10593
    configure --with-kame=PATH
10593
      if test -z "$ac_dots"; then top_srcdir=.
10594
" >&2;}
10594
      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
10595
   { (exit 1); exit 1; }; }
10595
  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
10596
		fi
10596
  *) # Relative path.
10597
		;;
10597
    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
10598
esac
10598
    top_srcdir="$ac_dots$ac_given_srcdir" ;;
10599
10599
  esac
10600
#
10600
10601
# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
10601
  case "$ac_given_INSTALL" in
10602
# Including it on Kame-using platforms is very bad, though, because
10602
  [/$]*) INSTALL="$ac_given_INSTALL" ;;
10603
# Kame uses #error against direct inclusion.   So include it on only
10603
  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
10604
# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
10604
  esac
10605
# This is done before the in6_pktinfo check because that's what
10605
10606
# netinet6/in6.h is needed for.
10606
  echo creating "$ac_file"
10607
#
10607
  rm -f "$ac_file"
10608
10608
  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
10609
case "$host" in
10609
  case "$ac_file" in
10610
*-bsdi4.[01]*)
10610
  *Makefile*) ac_comsub="1i\\
10611
	ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
10611
# $configure_input" ;;
10612
	LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
10612
  *) ac_comsub= ;;
10613
	isc_netinet6in6_hack="#include <netinet6/in6.h>"
10613
  esac
10614
	;;
10614
10615
*)
10615
  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10616
	ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
10616
  sed -e "$ac_comsub
10617
	LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
10617
s%@configure_input@%$configure_input%g
10618
	isc_netinet6in6_hack=""
10618
s%@srcdir@%$srcdir%g
10619
	;;
10619
s%@top_srcdir@%$top_srcdir%g
10620
esac
10620
s%@INSTALL@%$INSTALL%g
10621
10621
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
10622
10622
fi; done
10623
#
10623
rm -f conftest.s*
10624
# This is similar to the netinet6/in6.h issue.
10624
10625
#
10625
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
10626
case "$host" in
10626
# NAME is the cpp macro being defined and VALUE is the value it is being given.
10627
*-sco-sysv*uw*)
10627
#
10628
        # UnixWare
10628
# ac_d sets the value in "#define NAME VALUE" lines.
10629
	ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
10629
ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
10630
	LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
10630
ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
10631
        ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
10631
ac_dC='\3'
10632
	isc_netinetin6_hack="#include <netinet/in6.h>"
10632
ac_dD='%g'
10633
	;;
10633
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
10634
*)
10634
ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
10635
	ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
10635
ac_uB='\([ 	]\)%\1#\2define\3'
10636
	LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
10636
ac_uC=' '
10637
        ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
10637
ac_uD='\4%g'
10638
	isc_netinetin6_hack=""
10638
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
10639
	;;
10639
ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
10640
esac
10640
ac_eB='$%\1#\2define\3'
10641
10641
ac_eC=' '
10642
#
10642
ac_eD='%g'
10643
# Now delve deeper into the suitability of the IPv6 support.
10643
10644
#
10644
if test "${CONFIG_HEADERS+set}" != set; then
10645
case "$found_ipv6" in
10645
EOF
10646
	yes)
10646
cat >> $CONFIG_STATUS <<EOF
10647
		ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
10647
  CONFIG_HEADERS="config.h"
10648
		LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
10648
EOF
10649
10649
cat >> $CONFIG_STATUS <<\EOF
10650
		echo "$as_me:$LINENO: checking for in6_addr" >&5
10650
fi
10651
echo $ECHO_N "checking for in6_addr... $ECHO_C" >&6
10651
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
10652
		cat >conftest.$ac_ext <<_ACEOF
10652
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10653
#line $LINENO "configure"
10653
  case "$ac_file" in
10654
#include "confdefs.h"
10654
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10655
10655
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10656
#include <sys/types.h>
10656
  *) ac_file_in="${ac_file}.in" ;;
10657
#include <sys/socket.h>
10657
  esac
10658
#include <netinet/in.h>
10658
10659
$isc_netinetin6_hack
10659
  echo creating $ac_file
10660
$isc_netinet6in6_hack
10660
10661
10661
  rm -f conftest.frag conftest.in conftest.out
10662
#ifdef F77_DUMMY_MAIN
10662
  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10663
#  ifdef __cplusplus
10663
  cat $ac_file_inputs > conftest.in
10664
     extern "C"
10664
10665
#  endif
10665
EOF
10666
   int F77_DUMMY_MAIN() { return 1; }
10666
10667
#endif
10667
# Transform confdefs.h into a sed script conftest.vals that substitutes
10668
int
10668
# the proper values into config.h.in to produce config.h.  And first:
10669
main ()
10669
# Protect against being on the right side of a sed subst in config.status.
10670
{
10670
# Protect against being in an unquoted here document in config.status.
10671
struct in6_addr in6; return (0);
10671
rm -f conftest.vals
10672
  ;
10672
cat > conftest.hdr <<\EOF
10673
  return 0;
10673
s/[\\&%]/\\&/g
10674
}
10674
s%[\\$`]%\\&%g
10675
_ACEOF
10675
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
10676
rm -f conftest.$ac_objext
10676
s%ac_d%ac_u%gp
10677
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10677
s%ac_u%ac_e%gp
10678
  (eval $ac_compile) 2>&5
10678
EOF
10679
  ac_status=$?
10679
sed -n -f conftest.hdr confdefs.h > conftest.vals
10680
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10680
rm -f conftest.hdr
10681
  (exit $ac_status); } &&
10681
10682
         { ac_try='test -s conftest.$ac_objext'
10682
# This sed command replaces #undef with comments.  This is necessary, for
10683
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10683
# example, in the case of _POSIX_SOURCE, which is predefined and required
10684
  (eval $ac_try) 2>&5
10684
# on some systems where configure will not decide to define it.
10685
  ac_status=$?
10685
cat >> conftest.vals <<\EOF
10686
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10686
s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
10687
  (exit $ac_status); }; }; then
10687
EOF
10688
  echo "$as_me:$LINENO: result: yes" >&5
10688
10689
echo "${ECHO_T}yes" >&6
10689
# Break up conftest.vals because some shells have a limit on
10690
		 ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
10690
# the size of here documents, and old seds have small limits too.
10691
		 LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
10691
10692
		 isc_in_addr6_hack=""
10692
rm -f conftest.tail
10693
else
10693
while :
10694
  echo "$as_me: failed program was:" >&5
10694
do
10695
cat conftest.$ac_ext >&5
10695
  ac_lines=`grep -c . conftest.vals`
10696
echo "$as_me:$LINENO: result: no" >&5
10696
  # grep -c gives empty output for an empty file on some AIX systems.
10697
echo "${ECHO_T}no" >&6
10697
  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
10698
		 ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
10698
  # Write a limited-size here document to conftest.frag.
10699
		 LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
10699
  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
10700
		 isc_in_addr6_hack="#define in6_addr in_addr6"
10700
  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
10701
fi
10701
  echo 'CEOF
10702
rm -f conftest.$ac_objext conftest.$ac_ext
10702
  sed -f conftest.frag conftest.in > conftest.out
10703
10703
  rm -f conftest.in
10704
		echo "$as_me:$LINENO: checking for in6addr_any" >&5
10704
  mv conftest.out conftest.in
10705
echo $ECHO_N "checking for in6addr_any... $ECHO_C" >&6
10705
' >> $CONFIG_STATUS
10706
		cat >conftest.$ac_ext <<_ACEOF
10706
  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
10707
#line $LINENO "configure"
10707
  rm -f conftest.vals
10708
#include "confdefs.h"
10708
  mv conftest.tail conftest.vals
10709
10709
done
10710
#include <sys/types.h>
10710
rm -f conftest.vals
10711
#include <sys/socket.h>
10711
10712
#include <netinet/in.h>
10712
cat >> $CONFIG_STATUS <<\EOF
10713
$isc_netinetin6_hack
10713
  rm -f conftest.frag conftest.h
10714
$isc_netinet6in6_hack
10714
  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
10715
$isc_in_addr6_hack
10715
  cat conftest.in >> conftest.h
10716
10716
  rm -f conftest.in
10717
#ifdef F77_DUMMY_MAIN
10717
  if cmp -s $ac_file conftest.h 2>/dev/null; then
10718
#  ifdef __cplusplus
10718
    echo "$ac_file is unchanged"
10719
     extern "C"
10719
    rm -f conftest.h
10720
#  endif
10720
  else
10721
   int F77_DUMMY_MAIN() { return 1; }
10721
    # Remove last slash and all that follows it.  Not all systems have dirname.
10722
#endif
10722
      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10723
int
10723
      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10724
main ()
10724
      # The file is in a subdirectory.
10725
{
10725
      test ! -d "$ac_dir" && mkdir "$ac_dir"
10726
struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);
10726
    fi
10727
  ;
10727
    rm -f $ac_file
10728
  return 0;
10728
    mv conftest.h $ac_file
10729
}
10729
  fi
10730
_ACEOF
10730
fi; done
10731
rm -f conftest.$ac_objext conftest$ac_exeext
10731
10732
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
10732
EOF
10733
  (eval $ac_link) 2>&5
10733
cat >> $CONFIG_STATUS <<EOF
10734
  ac_status=$?
10734
10735
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10735
EOF
10736
  (exit $ac_status); } &&
10736
cat >> $CONFIG_STATUS <<\EOF
10737
         { ac_try='test -s conftest$ac_exeext'
10737
10738
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10738
exit 0
10739
  (eval $ac_try) 2>&5
10739
EOF
10740
  ac_status=$?
10740
chmod +x $CONFIG_STATUS
10741
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10741
rm -fr confdefs* $ac_clean_files
10742
  (exit $ac_status); }; }; then
10742
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
10743
  echo "$as_me:$LINENO: result: yes" >&5
10743
10744
echo "${ECHO_T}yes" >&6
10744
if test "$no_recursion" != yes; then
10745
			 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
10745
10746
			 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
10746
  # Remove --cache-file and --srcdir arguments so they do not pile up.
10747
else
10747
  ac_sub_configure_args=
10748
  echo "$as_me: failed program was:" >&5
10748
  ac_prev=
10749
cat conftest.$ac_ext >&5
10749
  for ac_arg in $ac_configure_args; do
10750
echo "$as_me:$LINENO: result: no" >&5
10750
    if test -n "$ac_prev"; then
10751
echo "${ECHO_T}no" >&6
10751
      ac_prev=
10752
			 ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
10752
      continue
10753
			 LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"
10753
    fi
10754
fi
10754
    case "$ac_arg" in
10755
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10755
    -cache-file | --cache-file | --cache-fil | --cache-fi \
10756
10756
    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
10757
		echo "$as_me:$LINENO: checking for in6addr_loopback" >&5
10757
      ac_prev=cache_file ;;
10758
echo $ECHO_N "checking for in6addr_loopback... $ECHO_C" >&6
10758
    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
10759
		cat >conftest.$ac_ext <<_ACEOF
10759
    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
10760
#line $LINENO "configure"
10760
      ;;
10761
#include "confdefs.h"
10761
    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
10762
10762
      ac_prev=srcdir ;;
10763
#include <sys/types.h>
10763
    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
10764
#include <sys/socket.h>
10764
      ;;
10765
#include <netinet/in.h>
10765
    *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
10766
$isc_netinetin6_hack
10766
    esac
10767
$isc_netinet6in6_hack
10767
  done
10768
$isc_in_addr6_hack
10768
10769
10769
  for ac_config_dir in lib/bind; do
10770
#ifdef F77_DUMMY_MAIN
10770
10771
#  ifdef __cplusplus
10771
    # Do not complain, so a configure script can configure whichever
10772
     extern "C"
10772
    # parts of a large source tree are present.
10773
#  endif
10773
    if test ! -d $srcdir/$ac_config_dir; then
10774
   int F77_DUMMY_MAIN() { return 1; }
10774
      continue
10775
#endif
10775
    fi
10776
int
10776
10777
main ()
10777
    echo configuring in $ac_config_dir
10778
{
10778
10779
struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);
10779
    case "$srcdir" in
10780
  ;
10780
    .) ;;
10781
  return 0;
10781
    *)
10782
}
10782
      if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
10783
_ACEOF
10783
      else
10784
rm -f conftest.$ac_objext conftest$ac_exeext
10784
        { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
10785
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
10785
      fi
10786
  (eval $ac_link) 2>&5
10786
      ;;
10787
  ac_status=$?
10787
    esac
10788
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10788
10789
  (exit $ac_status); } &&
10789
    ac_popdir=`pwd`
10790
         { ac_try='test -s conftest$ac_exeext'
10790
    cd $ac_config_dir
10791
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10791
10792
  (eval $ac_try) 2>&5
10792
      # A "../" for each directory in /$ac_config_dir.
10793
  ac_status=$?
10793
      ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
10794
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10794
10795
  (exit $ac_status); }; }; then
10795
    case "$srcdir" in
10796
  echo "$as_me:$LINENO: result: yes" >&5
10796
    .) # No --srcdir option.  We are building in place.
10797
echo "${ECHO_T}yes" >&6
10797
      ac_sub_srcdir=$srcdir ;;
10798
			 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
10798
    /*) # Absolute path.
10799
			 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"
10799
      ac_sub_srcdir=$srcdir/$ac_config_dir ;;
10800
else
10800
    *) # Relative path.
10801
  echo "$as_me: failed program was:" >&5
10801
      ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
10802
cat conftest.$ac_ext >&5
10802
    esac
10803
echo "$as_me:$LINENO: result: no" >&5
10803
10804
echo "${ECHO_T}no" >&6
10804
    # Check for guested configure; otherwise get Cygnus style configure.
10805
			 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
10805
    if test -f $ac_sub_srcdir/configure; then
10806
			 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
10806
      ac_sub_configure=$ac_sub_srcdir/configure
10807
fi
10807
    elif test -f $ac_sub_srcdir/configure.in; then
10808
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10808
      ac_sub_configure=$ac_configure
10809
10809
    else
10810
		echo "$as_me:$LINENO: checking for sin6_scope_id in struct sockaddr_in6" >&5
10810
      echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
10811
echo $ECHO_N "checking for sin6_scope_id in struct sockaddr_in6... $ECHO_C" >&6
10811
      ac_sub_configure=
10812
		cat >conftest.$ac_ext <<_ACEOF
10812
    fi
10813
#line $LINENO "configure"
10813
10814
#include "confdefs.h"
10814
    # The recursion is here.
10815
10815
    if test -n "$ac_sub_configure"; then
10816
#include <sys/types.h>
10816
10817
#include <sys/socket.h>
10817
      # Make the cache file name correct relative to the subdirectory.
10818
#include <netinet/in.h>
10818
      case "$cache_file" in
10819
$isc_netinetin6_hack
10819
      /*) ac_sub_cache_file=$cache_file ;;
10820
$isc_netinet6in6_hack
10820
      *) # Relative path.
10821
10821
        ac_sub_cache_file="$ac_dots$cache_file" ;;
10822
#ifdef F77_DUMMY_MAIN
10822
      esac
10823
#  ifdef __cplusplus
10823
  case "$ac_given_INSTALL" in
10824
     extern "C"
10824
        [/$]*) INSTALL="$ac_given_INSTALL" ;;
10825
#  endif
10825
        *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
10826
   int F77_DUMMY_MAIN() { return 1; }
10826
        esac
10827
#endif
10827
10828
int
10828
      echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
10829
main ()
10829
      # The eval makes quoting arguments work.
10830
{
10830
      if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
10831
struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);
10831
      then :
10832
  ;
10832
      else
10833
  return 0;
10833
        { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
10834
}
10834
      fi
10835
_ACEOF
10835
    fi
10836
rm -f conftest.$ac_objext
10836
10837
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10837
    cd $ac_popdir
10838
  (eval $ac_compile) 2>&5
10838
  done
10839
  ac_status=$?
10839
fi
10840
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10840
10841
  (exit $ac_status); } &&
10841
chmod a+x isc-config.sh
10842
         { ac_try='test -s conftest.$ac_objext'
10842
10843
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10843
# Tell Emacs to edit this file in shell mode.
10844
  (eval $ac_try) 2>&5
10844
# Local Variables:
10845
  ac_status=$?
10845
# mode: sh
10846
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10846
# End:
10847
  (exit $ac_status); }; }; then
10848
  echo "$as_me:$LINENO: result: yes" >&5
10849
echo "${ECHO_T}yes" >&6
10850
			 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
10851
else
10852
  echo "$as_me: failed program was:" >&5
10853
cat conftest.$ac_ext >&5
10854
echo "$as_me:$LINENO: result: no" >&5
10855
echo "${ECHO_T}no" >&6
10856
			 result="#undef LWRES_HAVE_SIN6_SCOPE_ID"
10857
fi
10858
rm -f conftest.$ac_objext conftest.$ac_ext
10859
		LWRES_HAVE_SIN6_SCOPE_ID="$result"
10860
10861
		echo "$as_me:$LINENO: checking for in6_pktinfo" >&5
10862
echo $ECHO_N "checking for in6_pktinfo... $ECHO_C" >&6
10863
		cat >conftest.$ac_ext <<_ACEOF
10864
#line $LINENO "configure"
10865
#include "confdefs.h"
10866
10867
#include <sys/types.h>
10868
#include <sys/socket.h>
10869
#include <netinet/in.h>
10870
$isc_netinetin6_hack
10871
$isc_netinet6in6_hack
10872
10873
#ifdef F77_DUMMY_MAIN
10874
#  ifdef __cplusplus
10875
     extern "C"
10876
#  endif
10877
   int F77_DUMMY_MAIN() { return 1; }
10878
#endif
10879
int
10880
main ()
10881
{
10882
struct in6_pktinfo xyzzy; return (0);
10883
  ;
10884
  return 0;
10885
}
10886
_ACEOF
10887
rm -f conftest.$ac_objext
10888
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10889
  (eval $ac_compile) 2>&5
10890
  ac_status=$?
10891
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10892
  (exit $ac_status); } &&
10893
         { ac_try='test -s conftest.$ac_objext'
10894
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10895
  (eval $ac_try) 2>&5
10896
  ac_status=$?
10897
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10898
  (exit $ac_status); }; }; then
10899
  echo "$as_me:$LINENO: result: yes" >&5
10900
echo "${ECHO_T}yes" >&6
10901
			 ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"
10902
else
10903
  echo "$as_me: failed program was:" >&5
10904
cat conftest.$ac_ext >&5
10905
echo "$as_me:$LINENO: result: no -- disabling runtime ipv6 support" >&5
10906
echo "${ECHO_T}no -- disabling runtime ipv6 support" >&6
10907
			 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
10908
fi
10909
rm -f conftest.$ac_objext conftest.$ac_ext
10910
		;;
10911
	no)
10912
		ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
10913
		LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
10914
		ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
10915
		LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
10916
		ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
10917
		LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
10918
		ISC_IPV6_H="ipv6.h"
10919
		ISC_IPV6_O="ipv6.$O"
10920
		ISC_ISCIPV6_O="unix/ipv6.$O"
10921
		ISC_IPV6_C="ipv6.c"
10922
		;;
10923
esac
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
#
10946
# Check for network functions that are often missing.  We do this
10947
# after the libtool checking, so we can put the right suffix on
10948
# the files.  It also needs to come after checking for a Kame add-on,
10949
# which provides some (all?) of the desired functions.
10950
#
10951
10952
echo "$as_me:$LINENO: checking for inet_ntop with IPv6 support" >&5
10953
echo $ECHO_N "checking for inet_ntop with IPv6 support... $ECHO_C" >&6
10954
if test "$cross_compiling" = yes; then
10955
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5
10956
echo "$as_me: error: cannot run test program while cross compiling" >&2;}
10957
   { (exit 1); exit 1; }; }
10958
else
10959
  cat >conftest.$ac_ext <<_ACEOF
10960
#line $LINENO "configure"
10961
#include "confdefs.h"
10962
10963
#include <sys/types.h>
10964
#include <sys/socket.h>
10965
#include <netinet/in.h>
10966
#include <arpa/inet.h>
10967
main() {
10968
char a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}
10969
_ACEOF
10970
rm -f conftest$ac_exeext
10971
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
10972
  (eval $ac_link) 2>&5
10973
  ac_status=$?
10974
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10975
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10976
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10977
  (eval $ac_try) 2>&5
10978
  ac_status=$?
10979
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
10980
  (exit $ac_status); }; }; then
10981
  echo "$as_me:$LINENO: result: yes" >&5
10982
echo "${ECHO_T}yes" >&6
10983
        ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"
10984
else
10985
  echo "$as_me: program exited with status $ac_status" >&5
10986
echo "$as_me: failed program was:" >&5
10987
cat conftest.$ac_ext >&5
10988
( exit $ac_status )
10989
echo "$as_me:$LINENO: result: no" >&5
10990
echo "${ECHO_T}no" >&6
10991
        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
10992
        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
10993
        ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"
10994
fi
10995
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10996
fi
10997
10998
10999
# On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
11000
# addresses with less than four octets, like "1.2.3".  Also leading
11001
# zeros should also be rejected.
11002
11003
echo "$as_me:$LINENO: checking for working inet_pton with IPv6 support" >&5
11004
echo $ECHO_N "checking for working inet_pton with IPv6 support... $ECHO_C" >&6
11005
if test "$cross_compiling" = yes; then
11006
  echo "$as_me:$LINENO: result: assuming target platform has working inet_pton" >&5
11007
echo "${ECHO_T}assuming target platform has working inet_pton" >&6
11008
	ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"
11009
else
11010
  cat >conftest.$ac_ext <<_ACEOF
11011
#line $LINENO "configure"
11012
#include "confdefs.h"
11013
11014
#include <sys/types.h>
11015
#include <sys/socket.h>
11016
#include <netinet/in.h>
11017
#include <arpa/inet.h>
11018
main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
11019
			     inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 :
11020
			     (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }
11021
_ACEOF
11022
rm -f conftest$ac_exeext
11023
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
11024
  (eval $ac_link) 2>&5
11025
  ac_status=$?
11026
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11027
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11028
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11029
  (eval $ac_try) 2>&5
11030
  ac_status=$?
11031
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11032
  (exit $ac_status); }; }; then
11033
  echo "$as_me:$LINENO: result: yes" >&5
11034
echo "${ECHO_T}yes" >&6
11035
        ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"
11036
else
11037
  echo "$as_me: program exited with status $ac_status" >&5
11038
echo "$as_me: failed program was:" >&5
11039
cat conftest.$ac_ext >&5
11040
( exit $ac_status )
11041
echo "$as_me:$LINENO: result: no" >&5
11042
echo "${ECHO_T}no" >&6
11043
        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
11044
        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
11045
        ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"
11046
fi
11047
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11048
fi
11049
11050
echo "$as_me:$LINENO: checking for inet_aton" >&5
11051
echo $ECHO_N "checking for inet_aton... $ECHO_C" >&6
11052
cat >conftest.$ac_ext <<_ACEOF
11053
#line $LINENO "configure"
11054
#include "confdefs.h"
11055
11056
#include <sys/types.h>
11057
#include <netinet/in.h>
11058
#include <arpa/inet.h>
11059
#ifdef F77_DUMMY_MAIN
11060
#  ifdef __cplusplus
11061
     extern "C"
11062
#  endif
11063
   int F77_DUMMY_MAIN() { return 1; }
11064
#endif
11065
int
11066
main ()
11067
{
11068
struct in_addr in; inet_aton(0, &in); return (0);
11069
  ;
11070
  return 0;
11071
}
11072
_ACEOF
11073
rm -f conftest.$ac_objext conftest$ac_exeext
11074
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
11075
  (eval $ac_link) 2>&5
11076
  ac_status=$?
11077
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11078
  (exit $ac_status); } &&
11079
         { ac_try='test -s conftest$ac_exeext'
11080
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11081
  (eval $ac_try) 2>&5
11082
  ac_status=$?
11083
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11084
  (exit $ac_status); }; }; then
11085
  echo "$as_me:$LINENO: result: yes" >&5
11086
echo "${ECHO_T}yes" >&6
11087
        ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON"
11088
else
11089
  echo "$as_me: failed program was:" >&5
11090
cat conftest.$ac_ext >&5
11091
echo "$as_me:$LINENO: result: no" >&5
11092
echo "${ECHO_T}no" >&6
11093
        ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_aton.$O"
11094
        ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_aton.c"
11095
        ISC_PLATFORM_NEEDATON="#define ISC_PLATFORM_NEEDATON 1"
11096
fi
11097
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11098
11099
11100
11101
11102
11103
#
11104
# Look for a 4.4BSD-style sa_len member in struct sockaddr.
11105
#
11106
case "$host" in
11107
	*-dec-osf*)
11108
		# Turn on 4.4BSD style sa_len support.
11109
		cat >>confdefs.h <<\_ACEOF
11110
#define _SOCKADDR_LEN 1
11111
_ACEOF
11112
11113
		;;
11114
esac
11115
11116
echo "$as_me:$LINENO: checking for sa_len in struct sockaddr" >&5
11117
echo $ECHO_N "checking for sa_len in struct sockaddr... $ECHO_C" >&6
11118
cat >conftest.$ac_ext <<_ACEOF
11119
#line $LINENO "configure"
11120
#include "confdefs.h"
11121
11122
#include <sys/types.h>
11123
#include <sys/socket.h>
11124
#ifdef F77_DUMMY_MAIN
11125
#  ifdef __cplusplus
11126
     extern "C"
11127
#  endif
11128
   int F77_DUMMY_MAIN() { return 1; }
11129
#endif
11130
int
11131
main ()
11132
{
11133
struct sockaddr sa; sa.sa_len = 0; return (0);
11134
  ;
11135
  return 0;
11136
}
11137
_ACEOF
11138
rm -f conftest.$ac_objext
11139
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
11140
  (eval $ac_compile) 2>&5
11141
  ac_status=$?
11142
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11143
  (exit $ac_status); } &&
11144
         { ac_try='test -s conftest.$ac_objext'
11145
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11146
  (eval $ac_try) 2>&5
11147
  ac_status=$?
11148
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11149
  (exit $ac_status); }; }; then
11150
  echo "$as_me:$LINENO: result: yes" >&5
11151
echo "${ECHO_T}yes" >&6
11152
	ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
11153
	LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"
11154
else
11155
  echo "$as_me: failed program was:" >&5
11156
cat conftest.$ac_ext >&5
11157
echo "$as_me:$LINENO: result: no" >&5
11158
echo "${ECHO_T}no" >&6
11159
	ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
11160
	LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"
11161
fi
11162
rm -f conftest.$ac_objext conftest.$ac_ext
11163
11164
11165
11166
#
11167
# Look for a 4.4BSD or 4.3BSD struct msghdr
11168
#
11169
echo "$as_me:$LINENO: checking for struct msghdr flavor" >&5
11170
echo $ECHO_N "checking for struct msghdr flavor... $ECHO_C" >&6
11171
cat >conftest.$ac_ext <<_ACEOF
11172
#line $LINENO "configure"
11173
#include "confdefs.h"
11174
11175
#include <sys/types.h>
11176
#include <sys/socket.h>
11177
#ifdef F77_DUMMY_MAIN
11178
#  ifdef __cplusplus
11179
     extern "C"
11180
#  endif
11181
   int F77_DUMMY_MAIN() { return 1; }
11182
#endif
11183
int
11184
main ()
11185
{
11186
struct msghdr msg; msg.msg_flags = 0; return (0);
11187
  ;
11188
  return 0;
11189
}
11190
_ACEOF
11191
rm -f conftest.$ac_objext
11192
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
11193
  (eval $ac_compile) 2>&5
11194
  ac_status=$?
11195
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11196
  (exit $ac_status); } &&
11197
         { ac_try='test -s conftest.$ac_objext'
11198
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11199
  (eval $ac_try) 2>&5
11200
  ac_status=$?
11201
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11202
  (exit $ac_status); }; }; then
11203
  echo "$as_me:$LINENO: result: 4.4BSD" >&5
11204
echo "${ECHO_T}4.4BSD" >&6
11205
	ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"
11206
else
11207
  echo "$as_me: failed program was:" >&5
11208
cat conftest.$ac_ext >&5
11209
echo "$as_me:$LINENO: result: 4.3BSD" >&5
11210
echo "${ECHO_T}4.3BSD" >&6
11211
	ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"
11212
fi
11213
rm -f conftest.$ac_objext conftest.$ac_ext
11214
11215
11216
#
11217
# Look for in_port_t.
11218
#
11219
echo "$as_me:$LINENO: checking for type in_port_t" >&5
11220
echo $ECHO_N "checking for type in_port_t... $ECHO_C" >&6
11221
cat >conftest.$ac_ext <<_ACEOF
11222
#line $LINENO "configure"
11223
#include "confdefs.h"
11224
11225
#include <sys/types.h>
11226
#include <netinet/in.h>
11227
#ifdef F77_DUMMY_MAIN
11228
#  ifdef __cplusplus
11229
     extern "C"
11230
#  endif
11231
   int F77_DUMMY_MAIN() { return 1; }
11232
#endif
11233
int
11234
main ()
11235
{
11236
in_port_t port = 25; return (0);
11237
  ;
11238
  return 0;
11239
}
11240
_ACEOF
11241
rm -f conftest.$ac_objext
11242
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
11243
  (eval $ac_compile) 2>&5
11244
  ac_status=$?
11245
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11246
  (exit $ac_status); } &&
11247
         { ac_try='test -s conftest.$ac_objext'
11248
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11249
  (eval $ac_try) 2>&5
11250
  ac_status=$?
11251
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11252
  (exit $ac_status); }; }; then
11253
  echo "$as_me:$LINENO: result: yes" >&5
11254
echo "${ECHO_T}yes" >&6
11255
	ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"
11256
else
11257
  echo "$as_me: failed program was:" >&5
11258
cat conftest.$ac_ext >&5
11259
echo "$as_me:$LINENO: result: no" >&5
11260
echo "${ECHO_T}no" >&6
11261
	ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"
11262
fi
11263
rm -f conftest.$ac_objext conftest.$ac_ext
11264
11265
11266
#
11267
# Check for addrinfo
11268
#
11269
echo "$as_me:$LINENO: checking for struct addrinfo" >&5
11270
echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6
11271
cat >conftest.$ac_ext <<_ACEOF
11272
#line $LINENO "configure"
11273
#include "confdefs.h"
11274
11275
#include <netdb.h>
11276
#ifdef F77_DUMMY_MAIN
11277
#  ifdef __cplusplus
11278
     extern "C"
11279
#  endif
11280
   int F77_DUMMY_MAIN() { return 1; }
11281
#endif
11282
int
11283
main ()
11284
{
11285
struct addrinfo a; return (0);
11286
  ;
11287
  return 0;
11288
}
11289
_ACEOF
11290
rm -f conftest.$ac_objext
11291
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
11292
  (eval $ac_compile) 2>&5
11293
  ac_status=$?
11294
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11295
  (exit $ac_status); } &&
11296
         { ac_try='test -s conftest.$ac_objext'
11297
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11298
  (eval $ac_try) 2>&5
11299
  ac_status=$?
11300
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11301
  (exit $ac_status); }; }; then
11302
  echo "$as_me:$LINENO: result: yes" >&5
11303
echo "${ECHO_T}yes" >&6
11304
	ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
11305
	cat >>confdefs.h <<\_ACEOF
11306
#define HAVE_ADDRINFO 1
11307
_ACEOF
11308
11309
else
11310
  echo "$as_me: failed program was:" >&5
11311
cat conftest.$ac_ext >&5
11312
echo "$as_me:$LINENO: result: no" >&5
11313
echo "${ECHO_T}no" >&6
11314
	ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"
11315
fi
11316
rm -f conftest.$ac_objext conftest.$ac_ext
11317
11318
11319
#
11320
# Check for rrsetinfo
11321
#
11322
echo "$as_me:$LINENO: checking for struct rrsetinfo" >&5
11323
echo $ECHO_N "checking for struct rrsetinfo... $ECHO_C" >&6
11324
cat >conftest.$ac_ext <<_ACEOF
11325
#line $LINENO "configure"
11326
#include "confdefs.h"
11327
11328
#include <netdb.h>
11329
#ifdef F77_DUMMY_MAIN
11330
#  ifdef __cplusplus
11331
     extern "C"
11332
#  endif
11333
   int F77_DUMMY_MAIN() { return 1; }
11334
#endif
11335
int
11336
main ()
11337
{
11338
struct rrsetinfo r; return (0);
11339
  ;
11340
  return 0;
11341
}
11342
_ACEOF
11343
rm -f conftest.$ac_objext
11344
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
11345
  (eval $ac_compile) 2>&5
11346
  ac_status=$?
11347
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11348
  (exit $ac_status); } &&
11349
         { ac_try='test -s conftest.$ac_objext'
11350
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11351
  (eval $ac_try) 2>&5
11352
  ac_status=$?
11353
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11354
  (exit $ac_status); }; }; then
11355
  echo "$as_me:$LINENO: result: yes" >&5
11356
echo "${ECHO_T}yes" >&6
11357
	ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"
11358
else
11359
  echo "$as_me: failed program was:" >&5
11360
cat conftest.$ac_ext >&5
11361
echo "$as_me:$LINENO: result: no" >&5
11362
echo "${ECHO_T}no" >&6
11363
	ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"
11364
fi
11365
rm -f conftest.$ac_objext conftest.$ac_ext
11366
11367
11368
echo "$as_me:$LINENO: checking for int sethostent" >&5
11369
echo $ECHO_N "checking for int sethostent... $ECHO_C" >&6
11370
cat >conftest.$ac_ext <<_ACEOF
11371
#line $LINENO "configure"
11372
#include "confdefs.h"
11373
11374
#include <netdb.h>
11375
#ifdef F77_DUMMY_MAIN
11376
#  ifdef __cplusplus
11377
     extern "C"
11378
#  endif
11379
   int F77_DUMMY_MAIN() { return 1; }
11380
#endif
11381
int
11382
main ()
11383
{
11384
int i = sethostent(0); return(0);
11385
  ;
11386
  return 0;
11387
}
11388
_ACEOF
11389
rm -f conftest.$ac_objext
11390
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
11391
  (eval $ac_compile) 2>&5
11392
  ac_status=$?
11393
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11394
  (exit $ac_status); } &&
11395
         { ac_try='test -s conftest.$ac_objext'
11396
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11397
  (eval $ac_try) 2>&5
11398
  ac_status=$?
11399
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11400
  (exit $ac_status); }; }; then
11401
  echo "$as_me:$LINENO: result: yes" >&5
11402
echo "${ECHO_T}yes" >&6
11403
	ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"
11404
else
11405
  echo "$as_me: failed program was:" >&5
11406
cat conftest.$ac_ext >&5
11407
echo "$as_me:$LINENO: result: no" >&5
11408
echo "${ECHO_T}no" >&6
11409
	ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"
11410
fi
11411
rm -f conftest.$ac_objext conftest.$ac_ext
11412
11413
11414
echo "$as_me:$LINENO: checking for int endhostent" >&5
11415
echo $ECHO_N "checking for int endhostent... $ECHO_C" >&6
11416
cat >conftest.$ac_ext <<_ACEOF
11417
#line $LINENO "configure"
11418
#include "confdefs.h"
11419
11420
#include <netdb.h>
11421
#ifdef F77_DUMMY_MAIN
11422
#  ifdef __cplusplus
11423
     extern "C"
11424
#  endif
11425
   int F77_DUMMY_MAIN() { return 1; }
11426
#endif
11427
int
11428
main ()
11429
{
11430
int i = endhostent(); return(0);
11431
  ;
11432
  return 0;
11433
}
11434
_ACEOF
11435
rm -f conftest.$ac_objext
11436
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
11437
  (eval $ac_compile) 2>&5
11438
  ac_status=$?
11439
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11440
  (exit $ac_status); } &&
11441
         { ac_try='test -s conftest.$ac_objext'
11442
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11443
  (eval $ac_try) 2>&5
11444
  ac_status=$?
11445
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11446
  (exit $ac_status); }; }; then
11447
  echo "$as_me:$LINENO: result: yes" >&5
11448
echo "${ECHO_T}yes" >&6
11449
	ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"
11450
else
11451
  echo "$as_me: failed program was:" >&5
11452
cat conftest.$ac_ext >&5
11453
echo "$as_me:$LINENO: result: no" >&5
11454
echo "${ECHO_T}no" >&6
11455
	ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"
11456
fi
11457
rm -f conftest.$ac_objext conftest.$ac_ext
11458
11459
11460
echo "$as_me:$LINENO: checking for getnetbyaddr(in_addr_t, ...)" >&5
11461
echo $ECHO_N "checking for getnetbyaddr(in_addr_t, ...)... $ECHO_C" >&6
11462
cat >conftest.$ac_ext <<_ACEOF
11463
#line $LINENO "configure"
11464
#include "confdefs.h"
11465
11466
#include <netdb.h>
11467
struct netent *getnetbyaddr(in_addr_t, int);
11468
#ifdef F77_DUMMY_MAIN
11469
#  ifdef __cplusplus
11470
     extern "C"
11471
#  endif
11472
   int F77_DUMMY_MAIN() { return 1; }
11473
#endif
11474
int
11475
main ()
11476
{
11477
11478
  ;
11479
  return 0;
11480
}
11481
_ACEOF
11482
rm -f conftest.$ac_objext
11483
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
11484
  (eval $ac_compile) 2>&5
11485
  ac_status=$?
11486
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11487
  (exit $ac_status); } &&
11488
         { ac_try='test -s conftest.$ac_objext'
11489
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11490
  (eval $ac_try) 2>&5
11491
  ac_status=$?
11492
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11493
  (exit $ac_status); }; }; then
11494
  echo "$as_me:$LINENO: result: yes" >&5
11495
echo "${ECHO_T}yes" >&6
11496
	ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"
11497
else
11498
  echo "$as_me: failed program was:" >&5
11499
cat conftest.$ac_ext >&5
11500
echo "$as_me:$LINENO: result: no" >&5
11501
echo "${ECHO_T}no" >&6
11502
	ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"
11503
fi
11504
rm -f conftest.$ac_objext conftest.$ac_ext
11505
11506
11507
echo "$as_me:$LINENO: checking for int setnetent" >&5
11508
echo $ECHO_N "checking for int setnetent... $ECHO_C" >&6
11509
cat >conftest.$ac_ext <<_ACEOF
11510
#line $LINENO "configure"
11511
#include "confdefs.h"
11512
11513
#include <netdb.h>
11514
#ifdef F77_DUMMY_MAIN
11515
#  ifdef __cplusplus
11516
     extern "C"
11517
#  endif
11518
   int F77_DUMMY_MAIN() { return 1; }
11519
#endif
11520
int
11521
main ()
11522
{
11523
int i = setnetent(0); return(0);
11524
  ;
11525
  return 0;
11526
}
11527
_ACEOF
11528
rm -f conftest.$ac_objext
11529
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
11530
  (eval $ac_compile) 2>&5
11531
  ac_status=$?
11532
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11533
  (exit $ac_status); } &&
11534
         { ac_try='test -s conftest.$ac_objext'
11535
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11536
  (eval $ac_try) 2>&5
11537
  ac_status=$?
11538
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11539
  (exit $ac_status); }; }; then
11540
  echo "$as_me:$LINENO: result: yes" >&5
11541
echo "${ECHO_T}yes" >&6
11542
	ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"
11543
else
11544
  echo "$as_me: failed program was:" >&5
11545
cat conftest.$ac_ext >&5
11546
echo "$as_me:$LINENO: result: no" >&5
11547
echo "${ECHO_T}no" >&6
11548
	ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"
11549
fi
11550
rm -f conftest.$ac_objext conftest.$ac_ext
11551
11552
11553
echo "$as_me:$LINENO: checking for int endnetent" >&5
11554
echo $ECHO_N "checking for int endnetent... $ECHO_C" >&6
11555
cat >conftest.$ac_ext <<_ACEOF
11556
#line $LINENO "configure"
11557
#include "confdefs.h"
11558
11559
#include <netdb.h>
11560
#ifdef F77_DUMMY_MAIN
11561
#  ifdef __cplusplus
11562
     extern "C"
11563
#  endif
11564
   int F77_DUMMY_MAIN() { return 1; }
11565
#endif
11566
int
11567
main ()
11568
{
11569
int i = endnetent(); return(0);
11570
  ;
11571
  return 0;
11572
}
11573
_ACEOF
11574
rm -f conftest.$ac_objext
11575
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
11576
  (eval $ac_compile) 2>&5
11577
  ac_status=$?
11578
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11579
  (exit $ac_status); } &&
11580
         { ac_try='test -s conftest.$ac_objext'
11581
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11582
  (eval $ac_try) 2>&5
11583
  ac_status=$?
11584
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11585
  (exit $ac_status); }; }; then
11586
  echo "$as_me:$LINENO: result: yes" >&5
11587
echo "${ECHO_T}yes" >&6
11588
	ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"
11589
else
11590
  echo "$as_me: failed program was:" >&5
11591
cat conftest.$ac_ext >&5
11592
echo "$as_me:$LINENO: result: no" >&5
11593
echo "${ECHO_T}no" >&6
11594
	ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"
11595
fi
11596
rm -f conftest.$ac_objext conftest.$ac_ext
11597
11598
11599
echo "$as_me:$LINENO: checking for gethostbyaddr(const void *, size_t, ...)" >&5
11600
echo $ECHO_N "checking for gethostbyaddr(const void *, size_t, ...)... $ECHO_C" >&6
11601
cat >conftest.$ac_ext <<_ACEOF
11602
#line $LINENO "configure"
11603
#include "confdefs.h"
11604
11605
#include <netdb.h>
11606
struct hostent *gethostbyaddr(const void *, size_t, int);
11607
#ifdef F77_DUMMY_MAIN
11608
#  ifdef __cplusplus
11609
     extern "C"
11610
#  endif
11611
   int F77_DUMMY_MAIN() { return 1; }
11612
#endif
11613
int
11614
main ()
11615
{
11616
return(0);
11617
  ;
11618
  return 0;
11619
}
11620
_ACEOF
11621
rm -f conftest.$ac_objext
11622
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
11623
  (eval $ac_compile) 2>&5
11624
  ac_status=$?
11625
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11626
  (exit $ac_status); } &&
11627
         { ac_try='test -s conftest.$ac_objext'
11628
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11629
  (eval $ac_try) 2>&5
11630
  ac_status=$?
11631
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11632
  (exit $ac_status); }; }; then
11633
  echo "$as_me:$LINENO: result: yes" >&5
11634
echo "${ECHO_T}yes" >&6
11635
	ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"
11636
else
11637
  echo "$as_me: failed program was:" >&5
11638
cat conftest.$ac_ext >&5
11639
echo "$as_me:$LINENO: result: no" >&5
11640
echo "${ECHO_T}no" >&6
11641
	ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"
11642
fi
11643
rm -f conftest.$ac_objext conftest.$ac_ext
11644
11645
11646
echo "$as_me:$LINENO: checking for h_errno in netdb.h" >&5
11647
echo $ECHO_N "checking for h_errno in netdb.h... $ECHO_C" >&6
11648
cat >conftest.$ac_ext <<_ACEOF
11649
#line $LINENO "configure"
11650
#include "confdefs.h"
11651
11652
#include <netdb.h>
11653
#ifdef F77_DUMMY_MAIN
11654
#  ifdef __cplusplus
11655
     extern "C"
11656
#  endif
11657
   int F77_DUMMY_MAIN() { return 1; }
11658
#endif
11659
int
11660
main ()
11661
{
11662
h_errno = 1; return(0);
11663
  ;
11664
  return 0;
11665
}
11666
_ACEOF
11667
rm -f conftest.$ac_objext
11668
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
11669
  (eval $ac_compile) 2>&5
11670
  ac_status=$?
11671
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11672
  (exit $ac_status); } &&
11673
         { ac_try='test -s conftest.$ac_objext'
11674
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11675
  (eval $ac_try) 2>&5
11676
  ac_status=$?
11677
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11678
  (exit $ac_status); }; }; then
11679
  echo "$as_me:$LINENO: result: yes" >&5
11680
echo "${ECHO_T}yes" >&6
11681
	ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"
11682
else
11683
  echo "$as_me: failed program was:" >&5
11684
cat conftest.$ac_ext >&5
11685
echo "$as_me:$LINENO: result: no" >&5
11686
echo "${ECHO_T}no" >&6
11687
	ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"
11688
fi
11689
rm -f conftest.$ac_objext conftest.$ac_ext
11690
11691
11692
echo "$as_me:$LINENO: checking for getipnodebyname" >&5
11693
echo $ECHO_N "checking for getipnodebyname... $ECHO_C" >&6
11694
if test "${ac_cv_func_getipnodebyname+set}" = set; then
11695
  echo $ECHO_N "(cached) $ECHO_C" >&6
11696
else
11697
  cat >conftest.$ac_ext <<_ACEOF
11698
#line $LINENO "configure"
11699
#include "confdefs.h"
11700
/* From autoconf 2.57 */
11701
/* Define getipnodebyname to an innocuous variant, in case <limits.h> declares getipnodebyname.
11702
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
11703
#define getipnodebyname innocuous_getipnodebyname
11704
11705
/* System header to define __stub macros and hopefully few prototypes,
11706
    which can conflict with char getipnodebyname (); below.
11707
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
11708
    <limits.h> exists even on freestanding compilers.  */
11709
11710
#ifdef __STDC__
11711
# include <limits.h>
11712
#else
11713
# include <assert.h>
11714
#endif
11715
11716
#undef getipnodebyname
11717
11718
/* Override any gcc2 internal prototype to avoid an error.  */
11719
#ifdef __cplusplus
11720
extern "C"
11721
{
11722
#endif
11723
/* We use char because int might match the return type of a gcc2
11724
   builtin and then its argument prototype would still apply.  */
11725
char getipnodebyname ();
11726
/* The GNU C library defines this for functions which it implements
11727
    to always fail with ENOSYS.  Some functions are actually named
11728
    something starting with __ and the normal name is an alias.  */
11729
#if defined (__stub_getipnodebyname) || defined (__stub___getipnodebyname)
11730
choke me
11731
#else
11732
char (*f) () = getipnodebyname;
11733
#endif
11734
#ifdef __cplusplus
11735
}
11736
#endif
11737
11738
#ifdef F77_DUMMY_MAIN
11739
#  ifdef __cplusplus
11740
     extern "C"
11741
#  endif
11742
   int F77_DUMMY_MAIN() { return 1; }
11743
#endif
11744
int
11745
main ()
11746
{
11747
return f != getipnodebyname;
11748
  ;
11749
  return 0;
11750
}
11751
_ACEOF
11752
rm -f conftest.$ac_objext conftest$ac_exeext
11753
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
11754
  (eval $ac_link) 2>&5
11755
  ac_status=$?
11756
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11757
  (exit $ac_status); } &&
11758
         { ac_try='test -s conftest$ac_exeext'
11759
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11760
  (eval $ac_try) 2>&5
11761
  ac_status=$?
11762
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11763
  (exit $ac_status); }; }; then
11764
  ac_cv_func_getipnodebyname=yes
11765
else
11766
  echo "$as_me: failed program was:" >&5
11767
cat conftest.$ac_ext >&5
11768
ac_cv_func_getipnodebyname=no
11769
fi
11770
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11771
fi
11772
echo "$as_me:$LINENO: result: $ac_cv_func_getipnodebyname" >&5
11773
echo "${ECHO_T}$ac_cv_func_getipnodebyname" >&6
11774
if test $ac_cv_func_getipnodebyname = yes; then
11775
  ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"
11776
else
11777
  ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"
11778
fi
11779
11780
echo "$as_me:$LINENO: checking for getnameinfo" >&5
11781
echo $ECHO_N "checking for getnameinfo... $ECHO_C" >&6
11782
if test "${ac_cv_func_getnameinfo+set}" = set; then
11783
  echo $ECHO_N "(cached) $ECHO_C" >&6
11784
else
11785
  cat >conftest.$ac_ext <<_ACEOF
11786
#line $LINENO "configure"
11787
#include "confdefs.h"
11788
/* From autoconf 2.57 */
11789
/* Define getnameinfo to an innocuous variant, in case <limits.h> declares getnameinfo.
11790
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
11791
#define getnameinfo innocuous_getnameinfo
11792
11793
/* System header to define __stub macros and hopefully few prototypes,
11794
    which can conflict with char getnameinfo (); below.
11795
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
11796
    <limits.h> exists even on freestanding compilers.  */
11797
11798
#ifdef __STDC__
11799
# include <limits.h>
11800
#else
11801
# include <assert.h>
11802
#endif
11803
11804
#undef getnameinfo
11805
11806
/* Override any gcc2 internal prototype to avoid an error.  */
11807
#ifdef __cplusplus
11808
extern "C"
11809
{
11810
#endif
11811
/* We use char because int might match the return type of a gcc2
11812
   builtin and then its argument prototype would still apply.  */
11813
char getnameinfo ();
11814
/* The GNU C library defines this for functions which it implements
11815
    to always fail with ENOSYS.  Some functions are actually named
11816
    something starting with __ and the normal name is an alias.  */
11817
#if defined (__stub_getnameinfo) || defined (__stub___getnameinfo)
11818
choke me
11819
#else
11820
char (*f) () = getnameinfo;
11821
#endif
11822
#ifdef __cplusplus
11823
}
11824
#endif
11825
11826
#ifdef F77_DUMMY_MAIN
11827
#  ifdef __cplusplus
11828
     extern "C"
11829
#  endif
11830
   int F77_DUMMY_MAIN() { return 1; }
11831
#endif
11832
int
11833
main ()
11834
{
11835
return f != getnameinfo;
11836
  ;
11837
  return 0;
11838
}
11839
_ACEOF
11840
rm -f conftest.$ac_objext conftest$ac_exeext
11841
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
11842
  (eval $ac_link) 2>&5
11843
  ac_status=$?
11844
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11845
  (exit $ac_status); } &&
11846
         { ac_try='test -s conftest$ac_exeext'
11847
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11848
  (eval $ac_try) 2>&5
11849
  ac_status=$?
11850
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11851
  (exit $ac_status); }; }; then
11852
  ac_cv_func_getnameinfo=yes
11853
else
11854
  echo "$as_me: failed program was:" >&5
11855
cat conftest.$ac_ext >&5
11856
ac_cv_func_getnameinfo=no
11857
fi
11858
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11859
fi
11860
echo "$as_me:$LINENO: result: $ac_cv_func_getnameinfo" >&5
11861
echo "${ECHO_T}$ac_cv_func_getnameinfo" >&6
11862
if test $ac_cv_func_getnameinfo = yes; then
11863
  ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"
11864
else
11865
  ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"
11866
fi
11867
11868
echo "$as_me:$LINENO: checking for getaddrinfo" >&5
11869
echo $ECHO_N "checking for getaddrinfo... $ECHO_C" >&6
11870
if test "${ac_cv_func_getaddrinfo+set}" = set; then
11871
  echo $ECHO_N "(cached) $ECHO_C" >&6
11872
else
11873
  cat >conftest.$ac_ext <<_ACEOF
11874
#line $LINENO "configure"
11875
#include "confdefs.h"
11876
/* From autoconf 2.57 */
11877
/* Define getaddrinfo to an innocuous variant, in case <limits.h> declares getaddrinfo.
11878
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
11879
#define getaddrinfo innocuous_getaddrinfo
11880
11881
/* System header to define __stub macros and hopefully few prototypes,
11882
    which can conflict with char getaddrinfo (); below.
11883
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
11884
    <limits.h> exists even on freestanding compilers.  */
11885
11886
#ifdef __STDC__
11887
# include <limits.h>
11888
#else
11889
# include <assert.h>
11890
#endif
11891
11892
#undef getaddrinfo
11893
11894
/* Override any gcc2 internal prototype to avoid an error.  */
11895
#ifdef __cplusplus
11896
extern "C"
11897
{
11898
#endif
11899
/* We use char because int might match the return type of a gcc2
11900
   builtin and then its argument prototype would still apply.  */
11901
char getaddrinfo ();
11902
/* The GNU C library defines this for functions which it implements
11903
    to always fail with ENOSYS.  Some functions are actually named
11904
    something starting with __ and the normal name is an alias.  */
11905
#if defined (__stub_getaddrinfo) || defined (__stub___getaddrinfo)
11906
choke me
11907
#else
11908
char (*f) () = getaddrinfo;
11909
#endif
11910
#ifdef __cplusplus
11911
}
11912
#endif
11913
11914
#ifdef F77_DUMMY_MAIN
11915
#  ifdef __cplusplus
11916
     extern "C"
11917
#  endif
11918
   int F77_DUMMY_MAIN() { return 1; }
11919
#endif
11920
int
11921
main ()
11922
{
11923
return f != getaddrinfo;
11924
  ;
11925
  return 0;
11926
}
11927
_ACEOF
11928
rm -f conftest.$ac_objext conftest$ac_exeext
11929
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
11930
  (eval $ac_link) 2>&5
11931
  ac_status=$?
11932
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11933
  (exit $ac_status); } &&
11934
         { ac_try='test -s conftest$ac_exeext'
11935
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11936
  (eval $ac_try) 2>&5
11937
  ac_status=$?
11938
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
11939
  (exit $ac_status); }; }; then
11940
  ac_cv_func_getaddrinfo=yes
11941
else
11942
  echo "$as_me: failed program was:" >&5
11943
cat conftest.$ac_ext >&5
11944
ac_cv_func_getaddrinfo=no
11945
fi
11946
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11947
fi
11948
echo "$as_me:$LINENO: result: $ac_cv_func_getaddrinfo" >&5
11949
echo "${ECHO_T}$ac_cv_func_getaddrinfo" >&6
11950
if test $ac_cv_func_getaddrinfo = yes; then
11951
  ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
11952
	cat >>confdefs.h <<\_ACEOF
11953
#define HAVE_GETADDRINFO 1
11954
_ACEOF
11955
11956
else
11957
  ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"
11958
fi
11959
11960
echo "$as_me:$LINENO: checking for gai_strerror" >&5
11961
echo $ECHO_N "checking for gai_strerror... $ECHO_C" >&6
11962
if test "${ac_cv_func_gai_strerror+set}" = set; then
11963
  echo $ECHO_N "(cached) $ECHO_C" >&6
11964
else
11965
  cat >conftest.$ac_ext <<_ACEOF
11966
#line $LINENO "configure"
11967
#include "confdefs.h"
11968
/* From autoconf 2.57 */
11969
/* Define gai_strerror to an innocuous variant, in case <limits.h> declares gai_strerror.
11970
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
11971
#define gai_strerror innocuous_gai_strerror
11972
11973
/* System header to define __stub macros and hopefully few prototypes,
11974
    which can conflict with char gai_strerror (); below.
11975
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
11976
    <limits.h> exists even on freestanding compilers.  */
11977
11978
#ifdef __STDC__
11979
# include <limits.h>
11980
#else
11981
# include <assert.h>
11982
#endif
11983
11984
#undef gai_strerror
11985
11986
/* Override any gcc2 internal prototype to avoid an error.  */
11987
#ifdef __cplusplus
11988
extern "C"
11989
{
11990
#endif
11991
/* We use char because int might match the return type of a gcc2
11992
   builtin and then its argument prototype would still apply.  */
11993
char gai_strerror ();
11994
/* The GNU C library defines this for functions which it implements
11995
    to always fail with ENOSYS.  Some functions are actually named
11996
    something starting with __ and the normal name is an alias.  */
11997
#if defined (__stub_gai_strerror) || defined (__stub___gai_strerror)
11998
choke me
11999
#else
12000
char (*f) () = gai_strerror;
12001
#endif
12002
#ifdef __cplusplus
12003
}
12004
#endif
12005
12006
#ifdef F77_DUMMY_MAIN
12007
#  ifdef __cplusplus
12008
     extern "C"
12009
#  endif
12010
   int F77_DUMMY_MAIN() { return 1; }
12011
#endif
12012
int
12013
main ()
12014
{
12015
return f != gai_strerror;
12016
  ;
12017
  return 0;
12018
}
12019
_ACEOF
12020
rm -f conftest.$ac_objext conftest$ac_exeext
12021
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
12022
  (eval $ac_link) 2>&5
12023
  ac_status=$?
12024
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12025
  (exit $ac_status); } &&
12026
         { ac_try='test -s conftest$ac_exeext'
12027
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12028
  (eval $ac_try) 2>&5
12029
  ac_status=$?
12030
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12031
  (exit $ac_status); }; }; then
12032
  ac_cv_func_gai_strerror=yes
12033
else
12034
  echo "$as_me: failed program was:" >&5
12035
cat conftest.$ac_ext >&5
12036
ac_cv_func_gai_strerror=no
12037
fi
12038
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12039
fi
12040
echo "$as_me:$LINENO: result: $ac_cv_func_gai_strerror" >&5
12041
echo "${ECHO_T}$ac_cv_func_gai_strerror" >&6
12042
if test $ac_cv_func_gai_strerror = yes; then
12043
  cat >>confdefs.h <<\_ACEOF
12044
#define HAVE_GAISTRERROR 1
12045
_ACEOF
12046
12047
fi
12048
12049
12050
12051
12052
12053
#
12054
# Look for a sysctl call to get the list of network interfaces.
12055
#
12056
echo "$as_me:$LINENO: checking for interface list sysctl" >&5
12057
echo $ECHO_N "checking for interface list sysctl... $ECHO_C" >&6
12058
cat >conftest.$ac_ext <<_ACEOF
12059
#line $LINENO "configure"
12060
#include "confdefs.h"
12061
12062
#include <sys/param.h>
12063
#include <sys/sysctl.h>
12064
#include <sys/socket.h>
12065
#ifdef NET_RT_IFLIST
12066
found_rt_iflist
12067
#endif
12068
12069
_ACEOF
12070
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12071
  egrep "found_rt_iflist" >/dev/null 2>&1; then
12072
  echo "$as_me:$LINENO: result: yes" >&5
12073
echo "${ECHO_T}yes" >&6
12074
	 cat >>confdefs.h <<\_ACEOF
12075
#define HAVE_IFLIST_SYSCTL 1
12076
_ACEOF
12077
12078
else
12079
  echo "$as_me:$LINENO: result: no" >&5
12080
echo "${ECHO_T}no" >&6
12081
fi
12082
rm -f conftest*
12083
12084
12085
#
12086
# Check for some other useful functions that are not ever-present.
12087
#
12088
12089
# We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
12090
# because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
12091
# reportedly defines strsep() without declaring it in <string.h> when
12092
# -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
12093
# AC_CHECK_FUNC() incorrectly succeeds because it declares
12094
# the function itself.
12095
echo "$as_me:$LINENO: checking for correctly declared strsep()" >&5
12096
echo $ECHO_N "checking for correctly declared strsep()... $ECHO_C" >&6
12097
cat >conftest.$ac_ext <<_ACEOF
12098
#line $LINENO "configure"
12099
#include "confdefs.h"
12100
#include <string.h>
12101
#ifdef F77_DUMMY_MAIN
12102
#  ifdef __cplusplus
12103
     extern "C"
12104
#  endif
12105
   int F77_DUMMY_MAIN() { return 1; }
12106
#endif
12107
int
12108
main ()
12109
{
12110
char *sp; char *foo = strsep(&sp, ".");
12111
  ;
12112
  return 0;
12113
}
12114
_ACEOF
12115
rm -f conftest.$ac_objext conftest$ac_exeext
12116
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
12117
  (eval $ac_link) 2>&5
12118
  ac_status=$?
12119
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12120
  (exit $ac_status); } &&
12121
         { ac_try='test -s conftest$ac_exeext'
12122
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12123
  (eval $ac_try) 2>&5
12124
  ac_status=$?
12125
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12126
  (exit $ac_status); }; }; then
12127
  echo "$as_me:$LINENO: result: yes" >&5
12128
echo "${ECHO_T}yes" >&6; ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"
12129
else
12130
  echo "$as_me: failed program was:" >&5
12131
cat conftest.$ac_ext >&5
12132
echo "$as_me:$LINENO: result: no" >&5
12133
echo "${ECHO_T}no" >&6; ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"
12134
fi
12135
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12136
12137
echo "$as_me:$LINENO: checking for vsnprintf" >&5
12138
echo $ECHO_N "checking for vsnprintf... $ECHO_C" >&6
12139
if test "${ac_cv_func_vsnprintf+set}" = set; then
12140
  echo $ECHO_N "(cached) $ECHO_C" >&6
12141
else
12142
  cat >conftest.$ac_ext <<_ACEOF
12143
#line $LINENO "configure"
12144
#include "confdefs.h"
12145
/* From autoconf 2.57 */
12146
/* Define vsnprintf to an innocuous variant, in case <limits.h> declares vsnprintf.
12147
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
12148
#define vsnprintf innocuous_vsnprintf
12149
12150
/* System header to define __stub macros and hopefully few prototypes,
12151
    which can conflict with char vsnprintf (); below.
12152
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
12153
    <limits.h> exists even on freestanding compilers.  */
12154
12155
#ifdef __STDC__
12156
# include <limits.h>
12157
#else
12158
# include <assert.h>
12159
#endif
12160
12161
#undef vsnprintf
12162
12163
/* Override any gcc2 internal prototype to avoid an error.  */
12164
#ifdef __cplusplus
12165
extern "C"
12166
{
12167
#endif
12168
/* We use char because int might match the return type of a gcc2
12169
   builtin and then its argument prototype would still apply.  */
12170
char vsnprintf ();
12171
/* The GNU C library defines this for functions which it implements
12172
    to always fail with ENOSYS.  Some functions are actually named
12173
    something starting with __ and the normal name is an alias.  */
12174
#if defined (__stub_vsnprintf) || defined (__stub___vsnprintf)
12175
choke me
12176
#else
12177
char (*f) () = vsnprintf;
12178
#endif
12179
#ifdef __cplusplus
12180
}
12181
#endif
12182
12183
#ifdef F77_DUMMY_MAIN
12184
#  ifdef __cplusplus
12185
     extern "C"
12186
#  endif
12187
   int F77_DUMMY_MAIN() { return 1; }
12188
#endif
12189
int
12190
main ()
12191
{
12192
return f != vsnprintf;
12193
  ;
12194
  return 0;
12195
}
12196
_ACEOF
12197
rm -f conftest.$ac_objext conftest$ac_exeext
12198
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
12199
  (eval $ac_link) 2>&5
12200
  ac_status=$?
12201
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12202
  (exit $ac_status); } &&
12203
         { ac_try='test -s conftest$ac_exeext'
12204
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12205
  (eval $ac_try) 2>&5
12206
  ac_status=$?
12207
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12208
  (exit $ac_status); }; }; then
12209
  ac_cv_func_vsnprintf=yes
12210
else
12211
  echo "$as_me: failed program was:" >&5
12212
cat conftest.$ac_ext >&5
12213
ac_cv_func_vsnprintf=no
12214
fi
12215
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12216
fi
12217
echo "$as_me:$LINENO: result: $ac_cv_func_vsnprintf" >&5
12218
echo "${ECHO_T}$ac_cv_func_vsnprintf" >&6
12219
if test $ac_cv_func_vsnprintf = yes; then
12220
  ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"
12221
else
12222
  ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS print.$O"
12223
	 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS print.c"
12224
	 ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
12225
fi
12226
12227
12228
12229
echo "$as_me:$LINENO: checking for strerror" >&5
12230
echo $ECHO_N "checking for strerror... $ECHO_C" >&6
12231
if test "${ac_cv_func_strerror+set}" = set; then
12232
  echo $ECHO_N "(cached) $ECHO_C" >&6
12233
else
12234
  cat >conftest.$ac_ext <<_ACEOF
12235
#line $LINENO "configure"
12236
#include "confdefs.h"
12237
/* From autoconf 2.57 */
12238
/* Define strerror to an innocuous variant, in case <limits.h> declares strerror.
12239
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
12240
#define strerror innocuous_strerror
12241
12242
/* System header to define __stub macros and hopefully few prototypes,
12243
    which can conflict with char strerror (); below.
12244
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
12245
    <limits.h> exists even on freestanding compilers.  */
12246
12247
#ifdef __STDC__
12248
# include <limits.h>
12249
#else
12250
# include <assert.h>
12251
#endif
12252
12253
#undef strerror
12254
12255
/* Override any gcc2 internal prototype to avoid an error.  */
12256
#ifdef __cplusplus
12257
extern "C"
12258
{
12259
#endif
12260
/* We use char because int might match the return type of a gcc2
12261
   builtin and then its argument prototype would still apply.  */
12262
char strerror ();
12263
/* The GNU C library defines this for functions which it implements
12264
    to always fail with ENOSYS.  Some functions are actually named
12265
    something starting with __ and the normal name is an alias.  */
12266
#if defined (__stub_strerror) || defined (__stub___strerror)
12267
choke me
12268
#else
12269
char (*f) () = strerror;
12270
#endif
12271
#ifdef __cplusplus
12272
}
12273
#endif
12274
12275
#ifdef F77_DUMMY_MAIN
12276
#  ifdef __cplusplus
12277
     extern "C"
12278
#  endif
12279
   int F77_DUMMY_MAIN() { return 1; }
12280
#endif
12281
int
12282
main ()
12283
{
12284
return f != strerror;
12285
  ;
12286
  return 0;
12287
}
12288
_ACEOF
12289
rm -f conftest.$ac_objext conftest$ac_exeext
12290
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
12291
  (eval $ac_link) 2>&5
12292
  ac_status=$?
12293
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12294
  (exit $ac_status); } &&
12295
         { ac_try='test -s conftest$ac_exeext'
12296
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12297
  (eval $ac_try) 2>&5
12298
  ac_status=$?
12299
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12300
  (exit $ac_status); }; }; then
12301
  ac_cv_func_strerror=yes
12302
else
12303
  echo "$as_me: failed program was:" >&5
12304
cat conftest.$ac_ext >&5
12305
ac_cv_func_strerror=no
12306
fi
12307
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12308
fi
12309
echo "$as_me:$LINENO: result: $ac_cv_func_strerror" >&5
12310
echo "${ECHO_T}$ac_cv_func_strerror" >&6
12311
if test $ac_cv_func_strerror = yes; then
12312
  cat >>confdefs.h <<\_ACEOF
12313
#define HAVE_STRERROR 1
12314
_ACEOF
12315
12316
fi
12317
12318
12319
12320
12321
12322
#
12323
# Determine the printf format characters to use when printing
12324
# values of type isc_int64_t.  We make the assumption that platforms
12325
# where a "long long" is the same size as a "long" (e.g., Alpha/OSF1)
12326
# want "%ld" and everyone else can use "%lld".  Win32 uses "%I64d",
12327
# but that's defined elsewhere since we don't use configure on Win32.
12328
#
12329
echo "$as_me:$LINENO: checking printf format modifier for 64-bit integers" >&5
12330
echo $ECHO_N "checking printf format modifier for 64-bit integers... $ECHO_C" >&6
12331
if test "$cross_compiling" = yes; then
12332
  echo "$as_me:$LINENO: result: assuming target platform uses ll" >&5
12333
echo "${ECHO_T}assuming target platform uses ll" >&6
12334
	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
12335
else
12336
  cat >conftest.$ac_ext <<_ACEOF
12337
#line $LINENO "configure"
12338
#include "confdefs.h"
12339
main() { exit(!(sizeof(long long int) == sizeof(long int))); }
12340
_ACEOF
12341
rm -f conftest$ac_exeext
12342
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
12343
  (eval $ac_link) 2>&5
12344
  ac_status=$?
12345
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12346
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12347
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12348
  (eval $ac_try) 2>&5
12349
  ac_status=$?
12350
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12351
  (exit $ac_status); }; }; then
12352
  echo "$as_me:$LINENO: result: l" >&5
12353
echo "${ECHO_T}l" >&6
12354
	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
12355
else
12356
  echo "$as_me: program exited with status $ac_status" >&5
12357
echo "$as_me: failed program was:" >&5
12358
cat conftest.$ac_ext >&5
12359
( exit $ac_status )
12360
echo "$as_me:$LINENO: result: ll" >&5
12361
echo "${ECHO_T}ll" >&6
12362
	ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
12363
fi
12364
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12365
fi
12366
12367
12368
#
12369
# Security Stuff
12370
#
12371
echo "$as_me:$LINENO: checking for chroot" >&5
12372
echo $ECHO_N "checking for chroot... $ECHO_C" >&6
12373
if test "${ac_cv_func_chroot+set}" = set; then
12374
  echo $ECHO_N "(cached) $ECHO_C" >&6
12375
else
12376
  cat >conftest.$ac_ext <<_ACEOF
12377
#line $LINENO "configure"
12378
#include "confdefs.h"
12379
/* From autoconf 2.57 */
12380
/* Define chroot to an innocuous variant, in case <limits.h> declares chroot.
12381
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
12382
#define chroot innocuous_chroot
12383
12384
/* System header to define __stub macros and hopefully few prototypes,
12385
    which can conflict with char chroot (); below.
12386
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
12387
    <limits.h> exists even on freestanding compilers.  */
12388
12389
#ifdef __STDC__
12390
# include <limits.h>
12391
#else
12392
# include <assert.h>
12393
#endif
12394
12395
#undef chroot
12396
12397
/* Override any gcc2 internal prototype to avoid an error.  */
12398
#ifdef __cplusplus
12399
extern "C"
12400
{
12401
#endif
12402
/* We use char because int might match the return type of a gcc2
12403
   builtin and then its argument prototype would still apply.  */
12404
char chroot ();
12405
/* The GNU C library defines this for functions which it implements
12406
    to always fail with ENOSYS.  Some functions are actually named
12407
    something starting with __ and the normal name is an alias.  */
12408
#if defined (__stub_chroot) || defined (__stub___chroot)
12409
choke me
12410
#else
12411
char (*f) () = chroot;
12412
#endif
12413
#ifdef __cplusplus
12414
}
12415
#endif
12416
12417
#ifdef F77_DUMMY_MAIN
12418
#  ifdef __cplusplus
12419
     extern "C"
12420
#  endif
12421
   int F77_DUMMY_MAIN() { return 1; }
12422
#endif
12423
int
12424
main ()
12425
{
12426
return f != chroot;
12427
  ;
12428
  return 0;
12429
}
12430
_ACEOF
12431
rm -f conftest.$ac_objext conftest$ac_exeext
12432
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
12433
  (eval $ac_link) 2>&5
12434
  ac_status=$?
12435
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12436
  (exit $ac_status); } &&
12437
         { ac_try='test -s conftest$ac_exeext'
12438
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12439
  (eval $ac_try) 2>&5
12440
  ac_status=$?
12441
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12442
  (exit $ac_status); }; }; then
12443
  ac_cv_func_chroot=yes
12444
else
12445
  echo "$as_me: failed program was:" >&5
12446
cat conftest.$ac_ext >&5
12447
ac_cv_func_chroot=no
12448
fi
12449
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12450
fi
12451
echo "$as_me:$LINENO: result: $ac_cv_func_chroot" >&5
12452
echo "${ECHO_T}$ac_cv_func_chroot" >&6
12453
if test $ac_cv_func_chroot = yes; then
12454
  cat >>confdefs.h <<\_ACEOF
12455
#define HAVE_CHROOT 1
12456
_ACEOF
12457
12458
fi
12459
12460
# Check whether --enable-linux-caps or --disable-linux-caps was given.
12461
if test "${enable_linux_caps+set}" = set; then
12462
  enableval="$enable_linux_caps"
12463
12464
fi;
12465
case "$enable_linux_caps" in
12466
	yes|'')
12467
12468
for ac_header in linux/capability.h
12469
do
12470
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12471
if eval "test \"\${$as_ac_Header+set}\" = set"; then
12472
  echo "$as_me:$LINENO: checking for $ac_header" >&5
12473
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12474
if eval "test \"\${$as_ac_Header+set}\" = set"; then
12475
  echo $ECHO_N "(cached) $ECHO_C" >&6
12476
fi
12477
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
12478
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12479
else
12480
  # Is the header compilable?
12481
echo "$as_me:$LINENO: checking $ac_header usability" >&5
12482
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
12483
cat >conftest.$ac_ext <<_ACEOF
12484
#line $LINENO "configure"
12485
#include "confdefs.h"
12486
$ac_includes_default
12487
#include <$ac_header>
12488
_ACEOF
12489
rm -f conftest.$ac_objext
12490
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12491
  (eval $ac_compile) 2>&5
12492
  ac_status=$?
12493
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12494
  (exit $ac_status); } &&
12495
         { ac_try='test -s conftest.$ac_objext'
12496
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12497
  (eval $ac_try) 2>&5
12498
  ac_status=$?
12499
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12500
  (exit $ac_status); }; }; then
12501
  ac_header_compiler=yes
12502
else
12503
  echo "$as_me: failed program was:" >&5
12504
cat conftest.$ac_ext >&5
12505
ac_header_compiler=no
12506
fi
12507
rm -f conftest.$ac_objext conftest.$ac_ext
12508
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
12509
echo "${ECHO_T}$ac_header_compiler" >&6
12510
12511
# Is the header present?
12512
echo "$as_me:$LINENO: checking $ac_header presence" >&5
12513
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
12514
cat >conftest.$ac_ext <<_ACEOF
12515
#line $LINENO "configure"
12516
#include "confdefs.h"
12517
#include <$ac_header>
12518
_ACEOF
12519
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
12520
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12521
  ac_status=$?
12522
  egrep -v '^ *\+' conftest.er1 >conftest.err
12523
  rm -f conftest.er1
12524
  cat conftest.err >&5
12525
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12526
  (exit $ac_status); } >/dev/null; then
12527
  if test -s conftest.err; then
12528
    ac_cpp_err=$ac_c_preproc_warn_flag
12529
  else
12530
    ac_cpp_err=
12531
  fi
12532
else
12533
  ac_cpp_err=yes
12534
fi
12535
if test -z "$ac_cpp_err"; then
12536
  ac_header_preproc=yes
12537
else
12538
  echo "$as_me: failed program was:" >&5
12539
  cat conftest.$ac_ext >&5
12540
  ac_header_preproc=no
12541
fi
12542
rm -f conftest.err conftest.$ac_ext
12543
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
12544
echo "${ECHO_T}$ac_header_preproc" >&6
12545
12546
# So?  What about this header?
12547
case $ac_header_compiler:$ac_header_preproc in
12548
  yes:no )
12549
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
12550
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
12551
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
12552
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
12553
  no:yes )
12554
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
12555
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
12556
    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
12557
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
12558
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
12559
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
12560
esac
12561
echo "$as_me:$LINENO: checking for $ac_header" >&5
12562
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12563
if eval "test \"\${$as_ac_Header+set}\" = set"; then
12564
  echo $ECHO_N "(cached) $ECHO_C" >&6
12565
else
12566
  eval "$as_ac_Header=$ac_header_preproc"
12567
fi
12568
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
12569
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12570
12571
fi
12572
if test `eval echo '${'$as_ac_Header'}'` = yes; then
12573
  cat >>confdefs.h <<_ACEOF
12574
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12575
_ACEOF
12576
12577
fi
12578
12579
done
12580
12581
		;;
12582
	no)
12583
		;;
12584
esac
12585
12586
for ac_header in sys/prctl.h
12587
do
12588
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12589
if eval "test \"\${$as_ac_Header+set}\" = set"; then
12590
  echo "$as_me:$LINENO: checking for $ac_header" >&5
12591
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12592
if eval "test \"\${$as_ac_Header+set}\" = set"; then
12593
  echo $ECHO_N "(cached) $ECHO_C" >&6
12594
fi
12595
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
12596
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12597
else
12598
  # Is the header compilable?
12599
echo "$as_me:$LINENO: checking $ac_header usability" >&5
12600
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
12601
cat >conftest.$ac_ext <<_ACEOF
12602
#line $LINENO "configure"
12603
#include "confdefs.h"
12604
$ac_includes_default
12605
#include <$ac_header>
12606
_ACEOF
12607
rm -f conftest.$ac_objext
12608
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12609
  (eval $ac_compile) 2>&5
12610
  ac_status=$?
12611
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12612
  (exit $ac_status); } &&
12613
         { ac_try='test -s conftest.$ac_objext'
12614
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12615
  (eval $ac_try) 2>&5
12616
  ac_status=$?
12617
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12618
  (exit $ac_status); }; }; then
12619
  ac_header_compiler=yes
12620
else
12621
  echo "$as_me: failed program was:" >&5
12622
cat conftest.$ac_ext >&5
12623
ac_header_compiler=no
12624
fi
12625
rm -f conftest.$ac_objext conftest.$ac_ext
12626
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
12627
echo "${ECHO_T}$ac_header_compiler" >&6
12628
12629
# Is the header present?
12630
echo "$as_me:$LINENO: checking $ac_header presence" >&5
12631
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
12632
cat >conftest.$ac_ext <<_ACEOF
12633
#line $LINENO "configure"
12634
#include "confdefs.h"
12635
#include <$ac_header>
12636
_ACEOF
12637
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
12638
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12639
  ac_status=$?
12640
  egrep -v '^ *\+' conftest.er1 >conftest.err
12641
  rm -f conftest.er1
12642
  cat conftest.err >&5
12643
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12644
  (exit $ac_status); } >/dev/null; then
12645
  if test -s conftest.err; then
12646
    ac_cpp_err=$ac_c_preproc_warn_flag
12647
  else
12648
    ac_cpp_err=
12649
  fi
12650
else
12651
  ac_cpp_err=yes
12652
fi
12653
if test -z "$ac_cpp_err"; then
12654
  ac_header_preproc=yes
12655
else
12656
  echo "$as_me: failed program was:" >&5
12657
  cat conftest.$ac_ext >&5
12658
  ac_header_preproc=no
12659
fi
12660
rm -f conftest.err conftest.$ac_ext
12661
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
12662
echo "${ECHO_T}$ac_header_preproc" >&6
12663
12664
# So?  What about this header?
12665
case $ac_header_compiler:$ac_header_preproc in
12666
  yes:no )
12667
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
12668
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
12669
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
12670
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
12671
  no:yes )
12672
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
12673
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
12674
    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
12675
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
12676
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
12677
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
12678
esac
12679
echo "$as_me:$LINENO: checking for $ac_header" >&5
12680
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12681
if eval "test \"\${$as_ac_Header+set}\" = set"; then
12682
  echo $ECHO_N "(cached) $ECHO_C" >&6
12683
else
12684
  eval "$as_ac_Header=$ac_header_preproc"
12685
fi
12686
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
12687
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12688
12689
fi
12690
if test `eval echo '${'$as_ac_Header'}'` = yes; then
12691
  cat >>confdefs.h <<_ACEOF
12692
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12693
_ACEOF
12694
12695
fi
12696
12697
done
12698
12699
12700
#
12701
# BSD/OS, and perhaps some others, don't define rlim_t.
12702
#
12703
echo "$as_me:$LINENO: checking for type rlim_t" >&5
12704
echo $ECHO_N "checking for type rlim_t... $ECHO_C" >&6
12705
cat >conftest.$ac_ext <<_ACEOF
12706
#line $LINENO "configure"
12707
#include "confdefs.h"
12708
12709
#include <sys/types.h>
12710
#include <sys/time.h>
12711
#include <sys/resource.h>
12712
#ifdef F77_DUMMY_MAIN
12713
#  ifdef __cplusplus
12714
     extern "C"
12715
#  endif
12716
   int F77_DUMMY_MAIN() { return 1; }
12717
#endif
12718
int
12719
main ()
12720
{
12721
rlim_t rl = 19671212; return (0);
12722
  ;
12723
  return 0;
12724
}
12725
_ACEOF
12726
rm -f conftest.$ac_objext
12727
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12728
  (eval $ac_compile) 2>&5
12729
  ac_status=$?
12730
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12731
  (exit $ac_status); } &&
12732
         { ac_try='test -s conftest.$ac_objext'
12733
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12734
  (eval $ac_try) 2>&5
12735
  ac_status=$?
12736
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12737
  (exit $ac_status); }; }; then
12738
  echo "$as_me:$LINENO: result: yes" >&5
12739
echo "${ECHO_T}yes" >&6
12740
 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"
12741
else
12742
  echo "$as_me: failed program was:" >&5
12743
cat conftest.$ac_ext >&5
12744
echo "$as_me:$LINENO: result: no" >&5
12745
echo "${ECHO_T}no" >&6
12746
12747
echo "$as_me:$LINENO: checking type of rlim_cur" >&5
12748
echo $ECHO_N "checking type of rlim_cur... $ECHO_C" >&6
12749
if test "$cross_compiling" = yes; then
12750
  { { echo "$as_me:$LINENO: error: cannot determine type of rlim_cur when cross compiling - define rlim_t" >&5
12751
echo "$as_me: error: cannot determine type of rlim_cur when cross compiling - define rlim_t" >&2;}
12752
   { (exit 1); exit 1; }; }
12753
else
12754
  cat >conftest.$ac_ext <<_ACEOF
12755
#line $LINENO "configure"
12756
#include "confdefs.h"
12757
12758
#include <sys/types.h>
12759
#include <sys/time.h>
12760
#include <sys/resource.h>
12761
main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}
12762
_ACEOF
12763
rm -f conftest$ac_exeext
12764
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
12765
  (eval $ac_link) 2>&5
12766
  ac_status=$?
12767
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12768
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12769
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12770
  (eval $ac_try) 2>&5
12771
  ac_status=$?
12772
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12773
  (exit $ac_status); }; }; then
12774
  echo "$as_me:$LINENO: result: int" >&5
12775
echo "${ECHO_T}int" >&6
12776
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"
12777
else
12778
  echo "$as_me: program exited with status $ac_status" >&5
12779
echo "$as_me: failed program was:" >&5
12780
cat conftest.$ac_ext >&5
12781
( exit $ac_status )
12782
12783
if test "$cross_compiling" = yes; then
12784
  { { echo "$as_me:$LINENO: error: this cannot happen" >&5
12785
echo "$as_me: error: this cannot happen" >&2;}
12786
   { (exit 1); exit 1; }; }
12787
else
12788
  cat >conftest.$ac_ext <<_ACEOF
12789
#line $LINENO "configure"
12790
#include "confdefs.h"
12791
12792
#include <sys/types.h>
12793
#include <sys/time.h>
12794
#include <sys/resource.h>
12795
main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}
12796
_ACEOF
12797
rm -f conftest$ac_exeext
12798
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
12799
  (eval $ac_link) 2>&5
12800
  ac_status=$?
12801
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12802
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12803
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12804
  (eval $ac_try) 2>&5
12805
  ac_status=$?
12806
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12807
  (exit $ac_status); }; }; then
12808
  echo "$as_me:$LINENO: result: long int" >&5
12809
echo "${ECHO_T}long int" >&6
12810
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"
12811
else
12812
  echo "$as_me: program exited with status $ac_status" >&5
12813
echo "$as_me: failed program was:" >&5
12814
cat conftest.$ac_ext >&5
12815
( exit $ac_status )
12816
12817
if test "$cross_compiling" = yes; then
12818
  { { echo "$as_me:$LINENO: error: this cannot happen" >&5
12819
echo "$as_me: error: this cannot happen" >&2;}
12820
   { (exit 1); exit 1; }; }
12821
else
12822
  cat >conftest.$ac_ext <<_ACEOF
12823
#line $LINENO "configure"
12824
#include "confdefs.h"
12825
12826
#include <sys/types.h>
12827
#include <sys/time.h>
12828
#include <sys/resource.h>
12829
main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}
12830
_ACEOF
12831
rm -f conftest$ac_exeext
12832
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
12833
  (eval $ac_link) 2>&5
12834
  ac_status=$?
12835
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12836
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12837
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12838
  (eval $ac_try) 2>&5
12839
  ac_status=$?
12840
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
12841
  (exit $ac_status); }; }; then
12842
  echo "$as_me:$LINENO: result: long long int" >&5
12843
echo "${ECHO_T}long long int" >&6
12844
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"
12845
else
12846
  echo "$as_me: program exited with status $ac_status" >&5
12847
echo "$as_me: failed program was:" >&5
12848
cat conftest.$ac_ext >&5
12849
( exit $ac_status )
12850
{ { echo "$as_me:$LINENO: error: unable to determine sizeof rlim_cur" >&5
12851
echo "$as_me: error: unable to determine sizeof rlim_cur" >&2;}
12852
   { (exit 1); exit 1; }; }
12853
12854
fi
12855
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12856
fi
12857
12858
fi
12859
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12860
fi
12861
12862
fi
12863
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12864
fi
12865
12866
fi
12867
rm -f conftest.$ac_objext conftest.$ac_ext
12868
12869
12870
#
12871
# Microsoft has their own way of handling shared libraries that requires
12872
# additional qualifiers on extern variables.  Unix systems don't need it.
12873
#
12874
12875
ISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
12876
12877
LWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
12878
12879
#
12880
# Random remaining OS-specific issues involving compiler warnings.
12881
# XXXDCL print messages to indicate some compensation is being done?
12882
#
12883
12884
ISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
12885
12886
case "$host" in
12887
	*-bsdi3.1*)
12888
		hack_shutup_sputaux=yes
12889
		;;
12890
	*-bsdi4.0*)
12891
		hack_shutup_sigwait=yes
12892
		hack_shutup_sputaux=yes
12893
		;;
12894
	*-bsdi4[12]*)
12895
		hack_shutup_stdargcast=yes
12896
		;;
12897
	*-solaris2.[89])
12898
		hack_shutup_pthreadonceinit=yes
12899
		;;
12900
esac
12901
12902
case "$hack_shutup_pthreadonceinit" in
12903
	yes)
12904
		#
12905
		# Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
12906
		#
12907
		ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
12908
		;;
12909
esac
12910
12911
case "$hack_shutup_sigwait" in
12912
	yes)
12913
		#
12914
		# Shut up a -Wmissing-prototypes warning for sigwait().
12915
		#
12916
		cat >>confdefs.h <<\_ACEOF
12917
#define SHUTUP_SIGWAIT 1
12918
_ACEOF
12919
12920
		;;
12921
esac
12922
12923
case "$hack_shutup_sputaux" in
12924
	yes)
12925
		#
12926
		# Shut up a -Wmissing-prototypes warning from <stdio.h>.
12927
		#
12928
		cat >>confdefs.h <<\_ACEOF
12929
#define SHUTUP_SPUTAUX 1
12930
_ACEOF
12931
12932
		;;
12933
esac
12934
12935
case "$hack_shutup_stdargcast" in
12936
	yes)
12937
		#
12938
		# Shut up a -Wcast-qual warning from va_start().
12939
		#
12940
		cat >>confdefs.h <<\_ACEOF
12941
#define SHUTUP_STDARG_CAST 1
12942
_ACEOF
12943
12944
		;;
12945
esac
12946
12947
#
12948
# The following sections deal with tools used for formatting
12949
# the documentation.  They are all optional, unless you are
12950
# a developer editing the documentation source.
12951
#
12952
12953
# Directory trees where SGML files are commonly found.
12954
sgmltrees="/usr/pkg/share/sgml /usr/local/share/sgml"
12955
12956
#
12957
# Look for openjade.  Plain jade is no longer supported.
12958
#
12959
12960
for ac_prog in openjade
12961
do
12962
  # Extract the first word of "$ac_prog", so it can be a program name with args.
12963
set dummy $ac_prog; ac_word=$2
12964
echo "$as_me:$LINENO: checking for $ac_word" >&5
12965
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12966
if test "${ac_cv_path_OPENJADE+set}" = set; then
12967
  echo $ECHO_N "(cached) $ECHO_C" >&6
12968
else
12969
  case $OPENJADE in
12970
  [\\/]* | ?:[\\/]*)
12971
  ac_cv_path_OPENJADE="$OPENJADE" # Let the user override the test with a path.
12972
  ;;
12973
  *)
12974
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12975
for as_dir in $PATH
12976
do
12977
  IFS=$as_save_IFS
12978
  test -z "$as_dir" && as_dir=.
12979
  for ac_exec_ext in '' $ac_executable_extensions; do
12980
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
12981
    ac_cv_path_OPENJADE="$as_dir/$ac_word$ac_exec_ext"
12982
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
12983
    break 2
12984
  fi
12985
done
12986
done
12987
12988
  ;;
12989
esac
12990
fi
12991
OPENJADE=$ac_cv_path_OPENJADE
12992
12993
if test -n "$OPENJADE"; then
12994
  echo "$as_me:$LINENO: result: $OPENJADE" >&5
12995
echo "${ECHO_T}$OPENJADE" >&6
12996
else
12997
  echo "$as_me:$LINENO: result: no" >&5
12998
echo "${ECHO_T}no" >&6
12999
fi
13000
13001
  test -n "$OPENJADE" && break
13002
done
13003
test -n "$OPENJADE" || OPENJADE="openjade"
13004
13005
13006
13007
#
13008
# Look for TeX.
13009
#
13010
13011
for ac_prog in jadetex
13012
do
13013
  # Extract the first word of "$ac_prog", so it can be a program name with args.
13014
set dummy $ac_prog; ac_word=$2
13015
echo "$as_me:$LINENO: checking for $ac_word" >&5
13016
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13017
if test "${ac_cv_path_JADETEX+set}" = set; then
13018
  echo $ECHO_N "(cached) $ECHO_C" >&6
13019
else
13020
  case $JADETEX in
13021
  [\\/]* | ?:[\\/]*)
13022
  ac_cv_path_JADETEX="$JADETEX" # Let the user override the test with a path.
13023
  ;;
13024
  *)
13025
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13026
for as_dir in $PATH
13027
do
13028
  IFS=$as_save_IFS
13029
  test -z "$as_dir" && as_dir=.
13030
  for ac_exec_ext in '' $ac_executable_extensions; do
13031
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
13032
    ac_cv_path_JADETEX="$as_dir/$ac_word$ac_exec_ext"
13033
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
13034
    break 2
13035
  fi
13036
done
13037
done
13038
13039
  ;;
13040
esac
13041
fi
13042
JADETEX=$ac_cv_path_JADETEX
13043
13044
if test -n "$JADETEX"; then
13045
  echo "$as_me:$LINENO: result: $JADETEX" >&5
13046
echo "${ECHO_T}$JADETEX" >&6
13047
else
13048
  echo "$as_me:$LINENO: result: no" >&5
13049
echo "${ECHO_T}no" >&6
13050
fi
13051
13052
  test -n "$JADETEX" && break
13053
done
13054
test -n "$JADETEX" || JADETEX="jadetex"
13055
13056
13057
13058
for ac_prog in pdfjadetex
13059
do
13060
  # Extract the first word of "$ac_prog", so it can be a program name with args.
13061
set dummy $ac_prog; ac_word=$2
13062
echo "$as_me:$LINENO: checking for $ac_word" >&5
13063
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13064
if test "${ac_cv_path_PDFJADETEX+set}" = set; then
13065
  echo $ECHO_N "(cached) $ECHO_C" >&6
13066
else
13067
  case $PDFJADETEX in
13068
  [\\/]* | ?:[\\/]*)
13069
  ac_cv_path_PDFJADETEX="$PDFJADETEX" # Let the user override the test with a path.
13070
  ;;
13071
  *)
13072
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13073
for as_dir in $PATH
13074
do
13075
  IFS=$as_save_IFS
13076
  test -z "$as_dir" && as_dir=.
13077
  for ac_exec_ext in '' $ac_executable_extensions; do
13078
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
13079
    ac_cv_path_PDFJADETEX="$as_dir/$ac_word$ac_exec_ext"
13080
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
13081
    break 2
13082
  fi
13083
done
13084
done
13085
13086
  ;;
13087
esac
13088
fi
13089
PDFJADETEX=$ac_cv_path_PDFJADETEX
13090
13091
if test -n "$PDFJADETEX"; then
13092
  echo "$as_me:$LINENO: result: $PDFJADETEX" >&5
13093
echo "${ECHO_T}$PDFJADETEX" >&6
13094
else
13095
  echo "$as_me:$LINENO: result: no" >&5
13096
echo "${ECHO_T}no" >&6
13097
fi
13098
13099
  test -n "$PDFJADETEX" && break
13100
done
13101
test -n "$PDFJADETEX" || PDFJADETEX="pdfjadetex"
13102
13103
13104
13105
#
13106
# Subroutine for searching for an ordinary file (e.g., a stylesheet)
13107
# in a number of directories:
13108
#
13109
#   NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
13110
#
13111
# If the file FILENAME is found in one of the DIRECTORIES, the shell
13112
# variable VARIABLE is defined to its absolute pathname.  Otherwise,
13113
# it is set to FILENAME, with no directory prefix (that's not terribly
13114
# useful, but looks less confusing in substitutions than leaving it
13115
# empty).  The variable VARIABLE will be substituted into output files.
13116
#
13117
13118
13119
13120
13121
SGMLCATALOG=""
13122
echo "$as_me:$LINENO: checking for catalog" >&5
13123
echo $ECHO_N "checking for catalog... $ECHO_C" >&6
13124
for d in $sgmltrees
13125
do
13126
	f=$d/catalog
13127
	if test -f $f
13128
	then
13129
		SGMLCATALOG=$f
13130
		echo "$as_me:$LINENO: result: $f" >&5
13131
echo "${ECHO_T}$f" >&6
13132
		break
13133
	fi
13134
done
13135
if test "X$SGMLCATALOG" = "X"
13136
then
13137
	echo "$as_me:$LINENO: result: \"not found\"" >&5
13138
echo "${ECHO_T}\"not found\"" >&6;
13139
	SGMLCATALOG=catalog
13140
fi
13141
13142
13143
13144
#
13145
# Look for the HTML stylesheet html/docbook.dsl, used for
13146
# formatting man pages in HTML.  Its location varies,
13147
# so far we have seen:
13148
#
13149
# 	NetBSD 	/usr/pkg/share/docbook/dsssl/modular/
13150
# 	FreeBSD	/usr/local/share/docbook/dsssl/modular/
13151
#	Linux	/usr/local/share/dsssl/docbook/
13152
#
13153
# Ditto for the print stylesheet print/docbook.dsl.
13154
#
13155
13156
stylepath=""
13157
for d in $sgmltrees
13158
do
13159
	for s in docbook/dsssl/modular dsssl/docbook
13160
	do
13161
		stylepath="$stylepath $d/$s"
13162
	done
13163
done
13164
13165
HTMLSTYLE=""
13166
echo "$as_me:$LINENO: checking for html/docbook.dsl" >&5
13167
echo $ECHO_N "checking for html/docbook.dsl... $ECHO_C" >&6
13168
for d in $stylepath
13169
do
13170
	f=$d/html/docbook.dsl
13171
	if test -f $f
13172
	then
13173
		HTMLSTYLE=$f
13174
		echo "$as_me:$LINENO: result: $f" >&5
13175
echo "${ECHO_T}$f" >&6
13176
		break
13177
	fi
13178
done
13179
if test "X$HTMLSTYLE" = "X"
13180
then
13181
	echo "$as_me:$LINENO: result: \"not found\"" >&5
13182
echo "${ECHO_T}\"not found\"" >&6;
13183
	HTMLSTYLE=html/docbook.dsl
13184
fi
13185
13186
13187
13188
PRINTSTYLE=""
13189
echo "$as_me:$LINENO: checking for print/docbook.dsl" >&5
13190
echo $ECHO_N "checking for print/docbook.dsl... $ECHO_C" >&6
13191
for d in $stylepath
13192
do
13193
	f=$d/print/docbook.dsl
13194
	if test -f $f
13195
	then
13196
		PRINTSTYLE=$f
13197
		echo "$as_me:$LINENO: result: $f" >&5
13198
echo "${ECHO_T}$f" >&6
13199
		break
13200
	fi
13201
done
13202
if test "X$PRINTSTYLE" = "X"
13203
then
13204
	echo "$as_me:$LINENO: result: \"not found\"" >&5
13205
echo "${ECHO_T}\"not found\"" >&6;
13206
	PRINTSTYLE=print/docbook.dsl
13207
fi
13208
13209
13210
13211
#
13212
# Look for XML declarations
13213
#
13214
13215
13216
XMLDCL=""
13217
echo "$as_me:$LINENO: checking for docbook/dsssl/modular/dtds/decls/xml.dcl" >&5
13218
echo $ECHO_N "checking for docbook/dsssl/modular/dtds/decls/xml.dcl... $ECHO_C" >&6
13219
for d in $sgmltrees
13220
do
13221
	f=$d/docbook/dsssl/modular/dtds/decls/xml.dcl
13222
	if test -f $f
13223
	then
13224
		XMLDCL=$f
13225
		echo "$as_me:$LINENO: result: $f" >&5
13226
echo "${ECHO_T}$f" >&6
13227
		break
13228
	fi
13229
done
13230
if test "X$XMLDCL" = "X"
13231
then
13232
	echo "$as_me:$LINENO: result: \"not found\"" >&5
13233
echo "${ECHO_T}\"not found\"" >&6;
13234
	XMLDCL=docbook/dsssl/modular/dtds/decls/xml.dcl
13235
fi
13236
13237
13238
13239
#
13240
# Look for docbook2man-spec.pl
13241
#
13242
13243
13244
DOCBOOK2MANSPEC=""
13245
echo "$as_me:$LINENO: checking for docbook2X/docbook2man-spec.pl" >&5
13246
echo $ECHO_N "checking for docbook2X/docbook2man-spec.pl... $ECHO_C" >&6
13247
for d in $sgmltrees
13248
do
13249
	f=$d/docbook2X/docbook2man-spec.pl
13250
	if test -f $f
13251
	then
13252
		DOCBOOK2MANSPEC=$f
13253
		echo "$as_me:$LINENO: result: $f" >&5
13254
echo "${ECHO_T}$f" >&6
13255
		break
13256
	fi
13257
done
13258
if test "X$DOCBOOK2MANSPEC" = "X"
13259
then
13260
	echo "$as_me:$LINENO: result: \"not found\"" >&5
13261
echo "${ECHO_T}\"not found\"" >&6;
13262
	DOCBOOK2MANSPEC=docbook2X/docbook2man-spec.pl
13263
fi
13264
13265
13266
13267
#
13268
# Substitutions
13269
#
13270
13271
BIND9_TOP_BUILDDIR=`pwd`
13272
13273
13274
13275
13276
13277
13278
if test "X$srcdir" != "X"; then
13279
	BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
13280
	BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
13281
	BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
13282
	BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
13283
	BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
13284
else
13285
	BIND9_ISC_BUILDINCLUDE=""
13286
	BIND9_ISCCC_BUILDINCLUDE=""
13287
	BIND9_ISCCFG_BUILDINCLUDE=""
13288
	BIND9_DNS_BUILDINCLUDE=""
13289
	BIND9_LWRES_BUILDINCLUDE=""
13290
fi
13291
13292
13293
BIND9_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
13294
13295
13296
BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
13297
13298
. $srcdir/version
13299
BIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
13300
13301
13302
13303
LIBISC_API=$srcdir/lib/isc/api
13304
13305
13306
LIBISCCC_API=$srcdir/lib/isccc/api
13307
13308
13309
LIBISCCFG_API=$srcdir/lib/isccfg/api
13310
13311
13312
LIBDNS_API=$srcdir/lib/dns/api
13313
13314
13315
LIBLWRES_API=$srcdir/lib/lwres/api
13316
13317
ac_config_files="$ac_config_files make/rules make/includes Makefile make/Makefile make/mkdep lib/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/nls/Makefile lib/isc/$thread_dir/Makefile lib/isc/$thread_dir/include/Makefile lib/isc/$thread_dir/include/isc/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/sec/Makefile lib/dns/sec/dst/Makefile lib/dns/sec/dst/include/Makefile lib/dns/sec/dst/include/dst/Makefile lib/lwres/Makefile lib/lwres/include/Makefile lib/lwres/include/lwres/Makefile lib/lwres/include/lwres/netdb.h lib/lwres/include/lwres/platform.h lib/lwres/man/Makefile lib/lwres/unix/Makefile lib/lwres/unix/include/Makefile lib/lwres/unix/include/lwres/Makefile lib/lwres/win32/Makefile lib/lwres/win32/include/Makefile lib/lwres/win32/include/lwres/Makefile lib/tests/Makefile lib/tests/include/Makefile lib/tests/include/tests/Makefile bin/Makefile bin/check/Makefile bin/named/Makefile bin/named/unix/Makefile bin/rndc/Makefile bin/rndc/unix/Makefile bin/dig/Makefile bin/nsupdate/Makefile bin/tests/Makefile bin/tests/names/Makefile bin/tests/master/Makefile bin/tests/rbt/Makefile bin/tests/db/Makefile bin/tests/tasks/Makefile bin/tests/timers/Makefile bin/tests/dst/Makefile bin/tests/mem/Makefile bin/tests/net/Makefile bin/tests/sockaddr/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/lwresd/Makefile bin/tests/system/tkey/Makefile bin/tests/headerdep_test.sh bin/dnssec/Makefile doc/Makefile doc/arm/Makefile doc/arm/nominum-docbook-html.dsl doc/arm/nominum-docbook-print.dsl doc/arm/validate.sh doc/misc/Makefile docutil/docbook2man-wrapper.sh isc-config.sh"
13318
cat >confcache <<\_ACEOF
13319
# This file is a shell script that caches the results of configure
13320
# tests run on this system so they can be shared between configure
13321
# scripts and configure runs, see configure's option --config-cache.
13322
# It is not useful on other systems.  If it contains results you don't
13323
# want to keep, you may remove or edit it.
13324
#
13325
# config.status only pays attention to the cache file if you give it
13326
# the --recheck option to rerun configure.
13327
#
13328
# `ac_cv_env_foo' variables (set or unset) will be overriden when
13329
# loading this file, other *unset* `ac_cv_foo' will be assigned the
13330
# following values.
13331
13332
_ACEOF
13333
13334
# The following way of writing the cache mishandles newlines in values,
13335
# but we know of no workaround that is simple, portable, and efficient.
13336
# So, don't put newlines in cache variables' values.
13337
# Ultrix sh set writes to stderr and can't be redirected directly,
13338
# and sets the high bit in the cache file unless we assign to the vars.
13339
{
13340
  (set) 2>&1 |
13341
    case `(ac_space=' '; set | grep ac_space) 2>&1` in
13342
    *ac_space=\ *)
13343
      # `set' does not quote correctly, so add quotes (double-quote
13344
      # substitution turns \\\\ into \\, and sed turns \\ into \).
13345
      sed -n \
13346
        "s/'/'\\\\''/g;
13347
    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
13348
      ;;
13349
    *)
13350
      # `set' quotes correctly as required by POSIX, so do not add quotes.
13351
      sed -n \
13352
        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
13353
      ;;
13354
    esac;
13355
} |
13356
  sed '
13357
     t clear
13358
     : clear
13359
     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
13360
     t end
13361
     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
13362
     : end' >>confcache
13363
if cmp -s $cache_file confcache; then :; else
13364
  if test -w $cache_file; then
13365
    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
13366
    cat confcache >$cache_file
13367
  else
13368
    echo "not updating unwritable cache $cache_file"
13369
  fi
13370
fi
13371
rm -f confcache
13372
13373
test "x$prefix" = xNONE && prefix=$ac_default_prefix
13374
# Let make expand exec_prefix.
13375
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13376
13377
# VPATH may cause trouble with some makes, so we remove $(srcdir),
13378
# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
13379
# trailing colons and then remove the whole line if VPATH becomes empty
13380
# (actually we leave an empty line to preserve line numbers).
13381
if test "x$srcdir" = x.; then
13382
  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
13383
s/:*\$(srcdir):*/:/;
13384
s/:*\${srcdir}:*/:/;
13385
s/:*@srcdir@:*/:/;
13386
s/^\([^=]*=[ 	]*\):*/\1/;
13387
s/:*$//;
13388
s/^[^=]*=[ 	]*$//;
13389
}'
13390
fi
13391
13392
DEFS=-DHAVE_CONFIG_H
13393
13394
13395
: ${CONFIG_STATUS=./config.status}
13396
ac_clean_files_save=$ac_clean_files
13397
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
13398
{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
13399
echo "$as_me: creating $CONFIG_STATUS" >&6;}
13400
cat >$CONFIG_STATUS <<_ACEOF
13401
#! $SHELL
13402
# Generated by $as_me.
13403
# Run this file to recreate the current configuration.
13404
# Compiler output produced by configure, useful for debugging
13405
# configure, is in config.log if it exists.
13406
13407
debug=false
13408
SHELL=\${CONFIG_SHELL-$SHELL}
13409
_ACEOF
13410
13411
cat >>$CONFIG_STATUS <<\_ACEOF
13412
13413
## --------------------- ##
13414
## M4sh Initialization.  ##
13415
## --------------------- ##
13416
13417
# Be Bourne compatible
13418
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
13419
  emulate sh
13420
  NULLCMD=:
13421
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
13422
  set -o posix
13423
fi
13424
13425
# NLS nuisances.
13426
# Support unset when possible.
13427
if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
13428
  as_unset=unset
13429
else
13430
  as_unset=false
13431
fi
13432
13433
(set +x; test -n "`(LANG=C; export LANG) 2>&1`") &&
13434
    { $as_unset LANG || test "${LANG+set}" != set; } ||
13435
      { LANG=C; export LANG; }
13436
(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") &&
13437
    { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } ||
13438
      { LC_ALL=C; export LC_ALL; }
13439
(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") &&
13440
    { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } ||
13441
      { LC_TIME=C; export LC_TIME; }
13442
(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") &&
13443
    { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } ||
13444
      { LC_CTYPE=C; export LC_CTYPE; }
13445
(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") &&
13446
    { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } ||
13447
      { LANGUAGE=C; export LANGUAGE; }
13448
(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") &&
13449
    { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } ||
13450
      { LC_COLLATE=C; export LC_COLLATE; }
13451
(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") &&
13452
    { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } ||
13453
      { LC_NUMERIC=C; export LC_NUMERIC; }
13454
(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") &&
13455
    { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
13456
      { LC_MESSAGES=C; export LC_MESSAGES; }
13457
13458
13459
# Name of the executable.
13460
as_me=`(basename "$0") 2>/dev/null ||
13461
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
13462
	 X"$0" : 'X\(//\)$' \| \
13463
	 X"$0" : 'X\(/\)$' \| \
13464
	 .     : '\(.\)' 2>/dev/null ||
13465
echo X/"$0" |
13466
    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
13467
  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
13468
  	  /^X\/\(\/\).*/{ s//\1/; q; }
13469
  	  s/.*/./; q'`
13470
13471
# PATH needs CR, and LINENO needs CR and PATH.
13472
# Avoid depending upon Character Ranges.
13473
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13474
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13475
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
13476
as_cr_digits='0123456789'
13477
as_cr_alnum=$as_cr_Letters$as_cr_digits
13478
13479
# The user is always right.
13480
if test "${PATH_SEPARATOR+set}" != set; then
13481
  echo "#! /bin/sh" >conftest.sh
13482
  echo  "exit 0"   >>conftest.sh
13483
  chmod +x conftest.sh
13484
  if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
13485
    PATH_SEPARATOR=';'
13486
  else
13487
    PATH_SEPARATOR=:
13488
  fi
13489
  rm -f conftest.sh
13490
fi
13491
13492
13493
  as_lineno_1=$LINENO
13494
  as_lineno_2=$LINENO
13495
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
13496
  test "x$as_lineno_1" != "x$as_lineno_2" &&
13497
  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
13498
  # Find who we are.  Look in the path if we contain no path at all
13499
  # relative or not.
13500
  case $0 in
13501
    *[\\/]* ) as_myself=$0 ;;
13502
    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13503
for as_dir in $PATH
13504
do
13505
  IFS=$as_save_IFS
13506
  test -z "$as_dir" && as_dir=.
13507
  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
13508
done
13509
13510
       ;;
13511
  esac
13512
  # We did not find ourselves, most probably we were run as `sh COMMAND'
13513
  # in which case we are not to be found in the path.
13514
  if test "x$as_myself" = x; then
13515
    as_myself=$0
13516
  fi
13517
  if test ! -f "$as_myself"; then
13518
    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
13519
echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
13520
   { (exit 1); exit 1; }; }
13521
  fi
13522
  case $CONFIG_SHELL in
13523
  '')
13524
    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13525
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
13526
do
13527
  IFS=$as_save_IFS
13528
  test -z "$as_dir" && as_dir=.
13529
  for as_base in sh bash ksh sh5; do
13530
	 case $as_dir in
13531
	 /*)
13532
	   if ("$as_dir/$as_base" -c '
13533
  as_lineno_1=$LINENO
13534
  as_lineno_2=$LINENO
13535
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
13536
  test "x$as_lineno_1" != "x$as_lineno_2" &&
13537
  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
13538
	     CONFIG_SHELL=$as_dir/$as_base
13539
	     export CONFIG_SHELL
13540
	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
13541
	   fi;;
13542
	 esac
13543
       done
13544
done
13545
;;
13546
  esac
13547
13548
  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
13549
  # uniformly replaced by the line number.  The first 'sed' inserts a
13550
  # line-number line before each line; the second 'sed' does the real
13551
  # work.  The second script uses 'N' to pair each line-number line
13552
  # with the numbered line, and appends trailing '-' during
13553
  # substitution so that $LINENO is not a special case at line end.
13554
  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
13555
  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
13556
  sed '=' <$as_myself |
13557
    sed '
13558
      N
13559
      s,$,-,
13560
      : loop
13561
      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
13562
      t loop
13563
      s,-$,,
13564
      s,^['$as_cr_digits']*\n,,
13565
    ' >$as_me.lineno &&
13566
  chmod +x $as_me.lineno ||
13567
    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
13568
echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
13569
   { (exit 1); exit 1; }; }
13570
13571
  # Don't try to exec as it changes $[0], causing all sort of problems
13572
  # (the dirname of $[0] is not the place where we might find the
13573
  # original and so on.  Autoconf is especially sensible to this).
13574
  . ./$as_me.lineno
13575
  # Exit status is that of the last command.
13576
  exit
13577
}
13578
13579
13580
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
13581
  *c*,-n*) ECHO_N= ECHO_C='
13582
' ECHO_T='	' ;;
13583
  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
13584
  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
13585
esac
13586
13587
if expr a : '\(a\)' >/dev/null 2>&1; then
13588
  as_expr=expr
13589
else
13590
  as_expr=false
13591
fi
13592
13593
rm -f conf$$ conf$$.exe conf$$.file
13594
echo >conf$$.file
13595
if ln -s conf$$.file conf$$ 2>/dev/null; then
13596
  # We could just check for DJGPP; but this test a) works b) is more generic
13597
  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
13598
  if test -f conf$$.exe; then
13599
    # Don't use ln at all; we don't have any links
13600
    as_ln_s='cp -p'
13601
  else
13602
    as_ln_s='ln -s'
13603
  fi
13604
elif ln conf$$.file conf$$ 2>/dev/null; then
13605
  as_ln_s=ln
13606
else
13607
  as_ln_s='cp -p'
13608
fi
13609
rm -f conf$$ conf$$.exe conf$$.file
13610
13611
as_executable_p="test -f"
13612
13613
# Sed expression to map a string onto a valid CPP name.
13614
as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
13615
13616
# Sed expression to map a string onto a valid variable name.
13617
as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
13618
13619
13620
# IFS
13621
# We need space, tab and new line, in precisely that order.
13622
as_nl='
13623
'
13624
IFS=" 	$as_nl"
13625
13626
# CDPATH.
13627
$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
13628
13629
exec 6>&1
13630
13631
# Open the log real soon, to keep \$[0] and so on meaningful, and to
13632
# report actual input values of CONFIG_FILES etc. instead of their
13633
# values after options handling.  Logging --version etc. is OK.
13634
exec 5>>config.log
13635
{
13636
  echo
13637
  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
13638
## Running $as_me. ##
13639
_ASBOX
13640
} >&5
13641
cat >&5 <<_CSEOF
13642
13643
This file was extended by $as_me, which was
13644
generated by GNU Autoconf 2.53.  Invocation command line was
13645
13646
  CONFIG_FILES    = $CONFIG_FILES
13647
  CONFIG_HEADERS  = $CONFIG_HEADERS
13648
  CONFIG_LINKS    = $CONFIG_LINKS
13649
  CONFIG_COMMANDS = $CONFIG_COMMANDS
13650
  $ $0 $@
13651
13652
_CSEOF
13653
echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
13654
echo >&5
13655
_ACEOF
13656
13657
# Files that config.status was made for.
13658
if test -n "$ac_config_files"; then
13659
  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
13660
fi
13661
13662
if test -n "$ac_config_headers"; then
13663
  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
13664
fi
13665
13666
if test -n "$ac_config_links"; then
13667
  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
13668
fi
13669
13670
if test -n "$ac_config_commands"; then
13671
  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
13672
fi
13673
13674
cat >>$CONFIG_STATUS <<\_ACEOF
13675
13676
ac_cs_usage="\
13677
\`$as_me' instantiates files from templates according to the
13678
current configuration.
13679
13680
Usage: $0 [OPTIONS] [FILE]...
13681
13682
  -h, --help       print this help, then exit
13683
  -V, --version    print version number, then exit
13684
  -d, --debug      don't remove temporary files
13685
      --recheck    update $as_me by reconfiguring in the same conditions
13686
  --file=FILE[:TEMPLATE]
13687
                   instantiate the configuration file FILE
13688
  --header=FILE[:TEMPLATE]
13689
                   instantiate the configuration header FILE
13690
13691
Configuration files:
13692
$config_files
13693
13694
Configuration headers:
13695
$config_headers
13696
13697
Report bugs to <bug-autoconf@gnu.org>."
13698
_ACEOF
13699
13700
cat >>$CONFIG_STATUS <<_ACEOF
13701
ac_cs_version="\\
13702
config.status
13703
configured by $0, generated by GNU Autoconf 2.53,
13704
  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
13705
13706
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
13707
Free Software Foundation, Inc.
13708
This config.status script is free software; the Free Software Foundation
13709
gives unlimited permission to copy, distribute and modify it."
13710
srcdir=$srcdir
13711
INSTALL="$INSTALL"
13712
_ACEOF
13713
13714
cat >>$CONFIG_STATUS <<\_ACEOF
13715
# If no file are specified by the user, then we need to provide default
13716
# value.  By we need to know if files were specified by the user.
13717
ac_need_defaults=:
13718
while test $# != 0
13719
do
13720
  case $1 in
13721
  --*=*)
13722
    ac_option=`expr "x$1" : 'x\([^=]*\)='`
13723
    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
13724
    shift
13725
    set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
13726
    shift
13727
    ;;
13728
  -*);;
13729
  *) # This is not an option, so the user has probably given explicit
13730
     # arguments.
13731
     ac_need_defaults=false;;
13732
  esac
13733
13734
  case $1 in
13735
  # Handling of the options.
13736
_ACEOF
13737
cat >>$CONFIG_STATUS <<_ACEOF
13738
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
13739
    echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
13740
    exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
13741
_ACEOF
13742
cat >>$CONFIG_STATUS <<\_ACEOF
13743
  --version | --vers* | -V )
13744
    echo "$ac_cs_version"; exit 0 ;;
13745
  --he | --h)
13746
    # Conflict between --help and --header
13747
    { { echo "$as_me:$LINENO: error: ambiguous option: $1
13748
Try \`$0 --help' for more information." >&5
13749
echo "$as_me: error: ambiguous option: $1
13750
Try \`$0 --help' for more information." >&2;}
13751
   { (exit 1); exit 1; }; };;
13752
  --help | --hel | -h )
13753
    echo "$ac_cs_usage"; exit 0 ;;
13754
  --debug | --d* | -d )
13755
    debug=: ;;
13756
  --file | --fil | --fi | --f )
13757
    shift
13758
    CONFIG_FILES="$CONFIG_FILES $1"
13759
    ac_need_defaults=false;;
13760
  --header | --heade | --head | --hea )
13761
    shift
13762
    CONFIG_HEADERS="$CONFIG_HEADERS $1"
13763
    ac_need_defaults=false;;
13764
13765
  # This is an error.
13766
  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
13767
Try \`$0 --help' for more information." >&5
13768
echo "$as_me: error: unrecognized option: $1
13769
Try \`$0 --help' for more information." >&2;}
13770
   { (exit 1); exit 1; }; } ;;
13771
13772
  *) ac_config_targets="$ac_config_targets $1" ;;
13773
13774
  esac
13775
  shift
13776
done
13777
13778
_ACEOF
13779
13780
13781
13782
13783
13784
cat >>$CONFIG_STATUS <<\_ACEOF
13785
for ac_config_target in $ac_config_targets
13786
do
13787
  case "$ac_config_target" in
13788
  # Handling of arguments.
13789
  "make/rules" ) CONFIG_FILES="$CONFIG_FILES make/rules" ;;
13790
  "make/includes" ) CONFIG_FILES="$CONFIG_FILES make/includes" ;;
13791
  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
13792
  "make/Makefile" ) CONFIG_FILES="$CONFIG_FILES make/Makefile" ;;
13793
  "make/mkdep" ) CONFIG_FILES="$CONFIG_FILES make/mkdep" ;;
13794
  "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
13795
  "lib/isc/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isc/Makefile" ;;
13796
  "lib/isc/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isc/include/Makefile" ;;
13797
  "lib/isc/include/isc/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isc/include/isc/Makefile" ;;
13798
  "lib/isc/include/isc/platform.h" ) CONFIG_FILES="$CONFIG_FILES lib/isc/include/isc/platform.h" ;;
13799
  "lib/isc/unix/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isc/unix/Makefile" ;;
13800
  "lib/isc/unix/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isc/unix/include/Makefile" ;;
13801
  "lib/isc/unix/include/isc/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isc/unix/include/isc/Makefile" ;;
13802
  "lib/isc/nls/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isc/nls/Makefile" ;;
13803
  "lib/isc/$thread_dir/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isc/$thread_dir/Makefile" ;;
13804
  "lib/isc/$thread_dir/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isc/$thread_dir/include/Makefile" ;;
13805
  "lib/isc/$thread_dir/include/isc/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isc/$thread_dir/include/isc/Makefile" ;;
13806
  "lib/isccc/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isccc/Makefile" ;;
13807
  "lib/isccc/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isccc/include/Makefile" ;;
13808
  "lib/isccc/include/isccc/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isccc/include/isccc/Makefile" ;;
13809
  "lib/isccfg/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isccfg/Makefile" ;;
13810
  "lib/isccfg/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isccfg/include/Makefile" ;;
13811
  "lib/isccfg/include/isccfg/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/isccfg/include/isccfg/Makefile" ;;
13812
  "lib/dns/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/dns/Makefile" ;;
13813
  "lib/dns/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/dns/include/Makefile" ;;
13814
  "lib/dns/include/dns/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/dns/include/dns/Makefile" ;;
13815
  "lib/dns/sec/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/dns/sec/Makefile" ;;
13816
  "lib/dns/sec/dst/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/dns/sec/dst/Makefile" ;;
13817
  "lib/dns/sec/dst/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/dns/sec/dst/include/Makefile" ;;
13818
  "lib/dns/sec/dst/include/dst/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/dns/sec/dst/include/dst/Makefile" ;;
13819
  "lib/lwres/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/lwres/Makefile" ;;
13820
  "lib/lwres/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/lwres/include/Makefile" ;;
13821
  "lib/lwres/include/lwres/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/lwres/include/lwres/Makefile" ;;
13822
  "lib/lwres/include/lwres/netdb.h" ) CONFIG_FILES="$CONFIG_FILES lib/lwres/include/lwres/netdb.h" ;;
13823
  "lib/lwres/include/lwres/platform.h" ) CONFIG_FILES="$CONFIG_FILES lib/lwres/include/lwres/platform.h" ;;
13824
  "lib/lwres/man/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/lwres/man/Makefile" ;;
13825
  "lib/lwres/unix/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/lwres/unix/Makefile" ;;
13826
  "lib/lwres/unix/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/lwres/unix/include/Makefile" ;;
13827
  "lib/lwres/unix/include/lwres/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/lwres/unix/include/lwres/Makefile" ;;
13828
  "lib/lwres/win32/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/lwres/win32/Makefile" ;;
13829
  "lib/lwres/win32/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/lwres/win32/include/Makefile" ;;
13830
  "lib/lwres/win32/include/lwres/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/lwres/win32/include/lwres/Makefile" ;;
13831
  "lib/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/tests/Makefile" ;;
13832
  "lib/tests/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/tests/include/Makefile" ;;
13833
  "lib/tests/include/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/tests/include/tests/Makefile" ;;
13834
  "bin/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
13835
  "bin/check/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/check/Makefile" ;;
13836
  "bin/named/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/named/Makefile" ;;
13837
  "bin/named/unix/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/named/unix/Makefile" ;;
13838
  "bin/rndc/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/rndc/Makefile" ;;
13839
  "bin/rndc/unix/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/rndc/unix/Makefile" ;;
13840
  "bin/dig/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/dig/Makefile" ;;
13841
  "bin/nsupdate/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/nsupdate/Makefile" ;;
13842
  "bin/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/tests/Makefile" ;;
13843
  "bin/tests/names/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/tests/names/Makefile" ;;
13844
  "bin/tests/master/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/tests/master/Makefile" ;;
13845
  "bin/tests/rbt/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/tests/rbt/Makefile" ;;
13846
  "bin/tests/db/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/tests/db/Makefile" ;;
13847
  "bin/tests/tasks/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/tests/tasks/Makefile" ;;
13848
  "bin/tests/timers/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/tests/timers/Makefile" ;;
13849
  "bin/tests/dst/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/tests/dst/Makefile" ;;
13850
  "bin/tests/mem/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/tests/mem/Makefile" ;;
13851
  "bin/tests/net/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/tests/net/Makefile" ;;
13852
  "bin/tests/sockaddr/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/tests/sockaddr/Makefile" ;;
13853
  "bin/tests/system/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/tests/system/Makefile" ;;
13854
  "bin/tests/system/conf.sh" ) CONFIG_FILES="$CONFIG_FILES bin/tests/system/conf.sh" ;;
13855
  "bin/tests/system/lwresd/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/tests/system/lwresd/Makefile" ;;
13856
  "bin/tests/system/tkey/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/tests/system/tkey/Makefile" ;;
13857
  "bin/tests/headerdep_test.sh" ) CONFIG_FILES="$CONFIG_FILES bin/tests/headerdep_test.sh" ;;
13858
  "bin/dnssec/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/dnssec/Makefile" ;;
13859
  "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
13860
  "doc/arm/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/arm/Makefile" ;;
13861
  "doc/arm/nominum-docbook-html.dsl" ) CONFIG_FILES="$CONFIG_FILES doc/arm/nominum-docbook-html.dsl" ;;
13862
  "doc/arm/nominum-docbook-print.dsl" ) CONFIG_FILES="$CONFIG_FILES doc/arm/nominum-docbook-print.dsl" ;;
13863
  "doc/arm/validate.sh" ) CONFIG_FILES="$CONFIG_FILES doc/arm/validate.sh" ;;
13864
  "doc/misc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/misc/Makefile" ;;
13865
  "docutil/docbook2man-wrapper.sh" ) CONFIG_FILES="$CONFIG_FILES docutil/docbook2man-wrapper.sh" ;;
13866
  "isc-config.sh" ) CONFIG_FILES="$CONFIG_FILES isc-config.sh" ;;
13867
  "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
13868
  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
13869
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
13870
   { (exit 1); exit 1; }; };;
13871
  esac
13872
done
13873
13874
# If the user did not use the arguments to specify the items to instantiate,
13875
# then the envvar interface is used.  Set only those that are not.
13876
# We use the long form for the default assignment because of an extremely
13877
# bizarre bug on SunOS 4.1.3.
13878
if $ac_need_defaults; then
13879
  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
13880
  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
13881
fi
13882
13883
# Create a temporary directory, and hook for its removal unless debugging.
13884
$debug ||
13885
{
13886
  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
13887
  trap '{ (exit 1); exit 1; }' 1 2 13 15
13888
}
13889
13890
# Create a (secure) tmp directory for tmp files.
13891
: ${TMPDIR=/tmp}
13892
{
13893
  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
13894
  test -n "$tmp" && test -d "$tmp"
13895
}  ||
13896
{
13897
  tmp=$TMPDIR/cs$$-$RANDOM
13898
  (umask 077 && mkdir $tmp)
13899
} ||
13900
{
13901
   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
13902
   { (exit 1); exit 1; }
13903
}
13904
13905
_ACEOF
13906
13907
cat >>$CONFIG_STATUS <<_ACEOF
13908
13909
#
13910
# CONFIG_FILES section.
13911
#
13912
13913
# No need to generate the scripts if there are no CONFIG_FILES.
13914
# This happens for instance when ./config.status config.h
13915
if test -n "\$CONFIG_FILES"; then
13916
  # Protect against being on the right side of a sed subst in config.status.
13917
  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
13918
   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
13919
s,@SHELL@,$SHELL,;t t
13920
s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
13921
s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
13922
s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
13923
s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
13924
s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
13925
s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
13926
s,@exec_prefix@,$exec_prefix,;t t
13927
s,@prefix@,$prefix,;t t
13928
s,@program_transform_name@,$program_transform_name,;t t
13929
s,@bindir@,$bindir,;t t
13930
s,@sbindir@,$sbindir,;t t
13931
s,@libexecdir@,$libexecdir,;t t
13932
s,@datadir@,$datadir,;t t
13933
s,@sysconfdir@,$sysconfdir,;t t
13934
s,@sharedstatedir@,$sharedstatedir,;t t
13935
s,@localstatedir@,$localstatedir,;t t
13936
s,@libdir@,$libdir,;t t
13937
s,@includedir@,$includedir,;t t
13938
s,@oldincludedir@,$oldincludedir,;t t
13939
s,@infodir@,$infodir,;t t
13940
s,@mandir@,$mandir,;t t
13941
s,@build_alias@,$build_alias,;t t
13942
s,@host_alias@,$host_alias,;t t
13943
s,@target_alias@,$target_alias,;t t
13944
s,@DEFS@,$DEFS,;t t
13945
s,@ECHO_C@,$ECHO_C,;t t
13946
s,@ECHO_N@,$ECHO_N,;t t
13947
s,@ECHO_T@,$ECHO_T,;t t
13948
s,@LIBS@,$LIBS,;t t
13949
s,@subdirs@,$subdirs,;t t
13950
s,@build@,$build,;t t
13951
s,@build_cpu@,$build_cpu,;t t
13952
s,@build_vendor@,$build_vendor,;t t
13953
s,@build_os@,$build_os,;t t
13954
s,@host@,$host,;t t
13955
s,@host_cpu@,$host_cpu,;t t
13956
s,@host_vendor@,$host_vendor,;t t
13957
s,@host_os@,$host_os,;t t
13958
s,@SET_MAKE@,$SET_MAKE,;t t
13959
s,@RANLIB@,$RANLIB,;t t
13960
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
13961
s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
13962
s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
13963
s,@INSTALL_DATA@,$INSTALL_DATA,;t t
13964
s,@STD_CINCLUDES@,$STD_CINCLUDES,;t t
13965
s,@STD_CDEFINES@,$STD_CDEFINES,;t t
13966
s,@STD_CWARNINGS@,$STD_CWARNINGS,;t t
13967
s,@CCOPT@,$CCOPT,;t t
13968
s,@AR@,$AR,;t t
13969
s,@ARFLAGS@,$ARFLAGS,;t t
13970
s,@LN@,$LN,;t t
13971
s,@ETAGS@,$ETAGS,;t t
13972
s,@PERL@,$PERL,;t t
13973
s,@CC@,$CC,;t t
13974
s,@CFLAGS@,$CFLAGS,;t t
13975
s,@LDFLAGS@,$LDFLAGS,;t t
13976
s,@CPPFLAGS@,$CPPFLAGS,;t t
13977
s,@ac_ct_CC@,$ac_ct_CC,;t t
13978
s,@EXEEXT@,$EXEEXT,;t t
13979
s,@OBJEXT@,$OBJEXT,;t t
13980
s,@CPP@,$CPP,;t t
13981
s,@ISC_PLATFORM_HAVELONGLONG@,$ISC_PLATFORM_HAVELONGLONG,;t t
13982
s,@ISC_PLATFORM_NEEDSYSSELECTH@,$ISC_PLATFORM_NEEDSYSSELECTH,;t t
13983
s,@LWRES_PLATFORM_NEEDSYSSELECTH@,$LWRES_PLATFORM_NEEDSYSSELECTH,;t t
13984
s,@DST_OPENSSL_INC@,$DST_OPENSSL_INC,;t t
13985
s,@DNS_OPENSSL_LIBS@,$DNS_OPENSSL_LIBS,;t t
13986
s,@USE_OPENSSL@,$USE_OPENSSL,;t t
13987
s,@USE_GSSAPI@,$USE_GSSAPI,;t t
13988
s,@DST_GSSAPI_INC@,$DST_GSSAPI_INC,;t t
13989
s,@DNS_GSSAPI_LIBS@,$DNS_GSSAPI_LIBS,;t t
13990
s,@ALWAYS_DEFINES@,$ALWAYS_DEFINES,;t t
13991
s,@ISC_PLATFORM_USETHREADS@,$ISC_PLATFORM_USETHREADS,;t t
13992
s,@ISC_THREAD_DIR@,$ISC_THREAD_DIR,;t t
13993
s,@MKDEPCC@,$MKDEPCC,;t t
13994
s,@MKDEPCFLAGS@,$MKDEPCFLAGS,;t t
13995
s,@MKDEPPROG@,$MKDEPPROG,;t t
13996
s,@IRIX_DNSSEC_WARNINGS_HACK@,$IRIX_DNSSEC_WARNINGS_HACK,;t t
13997
s,@purify_path@,$purify_path,;t t
13998
s,@PURIFY@,$PURIFY,;t t
13999
s,@LN_S@,$LN_S,;t t
14000
s,@ECHO@,$ECHO,;t t
14001
s,@STRIP@,$STRIP,;t t
14002
s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
14003
s,@LIBTOOL@,$LIBTOOL,;t t
14004
s,@O@,$O,;t t
14005
s,@A@,$A,;t t
14006
s,@SA@,$SA,;t t
14007
s,@LIBTOOL_MKDEP_SED@,$LIBTOOL_MKDEP_SED,;t t
14008
s,@LIBBIND@,$LIBBIND,;t t
14009
s,@ISC_PLATFORM_HAVEIPV6@,$ISC_PLATFORM_HAVEIPV6,;t t
14010
s,@LWRES_PLATFORM_HAVEIPV6@,$LWRES_PLATFORM_HAVEIPV6,;t t
14011
s,@ISC_PLATFORM_NEEDNETINETIN6H@,$ISC_PLATFORM_NEEDNETINETIN6H,;t t
14012
s,@LWRES_PLATFORM_NEEDNETINETIN6H@,$LWRES_PLATFORM_NEEDNETINETIN6H,;t t
14013
s,@ISC_PLATFORM_NEEDNETINET6IN6H@,$ISC_PLATFORM_NEEDNETINET6IN6H,;t t
14014
s,@LWRES_PLATFORM_NEEDNETINET6IN6H@,$LWRES_PLATFORM_NEEDNETINET6IN6H,;t t
14015
s,@ISC_PLATFORM_HAVEINADDR6@,$ISC_PLATFORM_HAVEINADDR6,;t t
14016
s,@LWRES_PLATFORM_HAVEINADDR6@,$LWRES_PLATFORM_HAVEINADDR6,;t t
14017
s,@ISC_PLATFORM_NEEDIN6ADDRANY@,$ISC_PLATFORM_NEEDIN6ADDRANY,;t t
14018
s,@LWRES_PLATFORM_NEEDIN6ADDRANY@,$LWRES_PLATFORM_NEEDIN6ADDRANY,;t t
14019
s,@ISC_PLATFORM_NEEDIN6ADDRLOOPBACK@,$ISC_PLATFORM_NEEDIN6ADDRLOOPBACK,;t t
14020
s,@LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK@,$LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK,;t t
14021
s,@ISC_PLATFORM_HAVEIN6PKTINFO@,$ISC_PLATFORM_HAVEIN6PKTINFO,;t t
14022
s,@ISC_PLATFORM_FIXIN6ISADDR@,$ISC_PLATFORM_FIXIN6ISADDR,;t t
14023
s,@ISC_IPV6_H@,$ISC_IPV6_H,;t t
14024
s,@ISC_IPV6_O@,$ISC_IPV6_O,;t t
14025
s,@ISC_ISCIPV6_O@,$ISC_ISCIPV6_O,;t t
14026
s,@ISC_IPV6_C@,$ISC_IPV6_C,;t t
14027
s,@LWRES_HAVE_SIN6_SCOPE_ID@,$LWRES_HAVE_SIN6_SCOPE_ID,;t t
14028
s,@ISC_PLATFORM_NEEDNTOP@,$ISC_PLATFORM_NEEDNTOP,;t t
14029
s,@ISC_PLATFORM_NEEDPTON@,$ISC_PLATFORM_NEEDPTON,;t t
14030
s,@ISC_PLATFORM_NEEDATON@,$ISC_PLATFORM_NEEDATON,;t t
14031
s,@ISC_PLATFORM_HAVESALEN@,$ISC_PLATFORM_HAVESALEN,;t t
14032
s,@LWRES_PLATFORM_HAVESALEN@,$LWRES_PLATFORM_HAVESALEN,;t t
14033
s,@ISC_PLATFORM_MSGHDRFLAVOR@,$ISC_PLATFORM_MSGHDRFLAVOR,;t t
14034
s,@ISC_PLATFORM_NEEDPORTT@,$ISC_PLATFORM_NEEDPORTT,;t t
14035
s,@ISC_LWRES_NEEDADDRINFO@,$ISC_LWRES_NEEDADDRINFO,;t t
14036
s,@ISC_LWRES_NEEDRRSETINFO@,$ISC_LWRES_NEEDRRSETINFO,;t t
14037
s,@ISC_LWRES_SETHOSTENTINT@,$ISC_LWRES_SETHOSTENTINT,;t t
14038
s,@ISC_LWRES_ENDHOSTENTINT@,$ISC_LWRES_ENDHOSTENTINT,;t t
14039
s,@ISC_LWRES_GETNETBYADDRINADDR@,$ISC_LWRES_GETNETBYADDRINADDR,;t t
14040
s,@ISC_LWRES_SETNETENTINT@,$ISC_LWRES_SETNETENTINT,;t t
14041
s,@ISC_LWRES_ENDNETENTINT@,$ISC_LWRES_ENDNETENTINT,;t t
14042
s,@ISC_LWRES_GETHOSTBYADDRVOID@,$ISC_LWRES_GETHOSTBYADDRVOID,;t t
14043
s,@ISC_LWRES_NEEDHERRNO@,$ISC_LWRES_NEEDHERRNO,;t t
14044
s,@ISC_LWRES_GETIPNODEPROTO@,$ISC_LWRES_GETIPNODEPROTO,;t t
14045
s,@ISC_LWRES_GETADDRINFOPROTO@,$ISC_LWRES_GETADDRINFOPROTO,;t t
14046
s,@ISC_LWRES_GETNAMEINFOPROTO@,$ISC_LWRES_GETNAMEINFOPROTO,;t t
14047
s,@ISC_PLATFORM_NEEDSTRSEP@,$ISC_PLATFORM_NEEDSTRSEP,;t t
14048
s,@ISC_PLATFORM_NEEDVSNPRINTF@,$ISC_PLATFORM_NEEDVSNPRINTF,;t t
14049
s,@ISC_EXTRA_OBJS@,$ISC_EXTRA_OBJS,;t t
14050
s,@ISC_EXTRA_SRCS@,$ISC_EXTRA_SRCS,;t t
14051
s,@ISC_PLATFORM_QUADFORMAT@,$ISC_PLATFORM_QUADFORMAT,;t t
14052
s,@ISC_PLATFORM_RLIMITTYPE@,$ISC_PLATFORM_RLIMITTYPE,;t t
14053
s,@ISC_PLATFORM_USEDECLSPEC@,$ISC_PLATFORM_USEDECLSPEC,;t t
14054
s,@LWRES_PLATFORM_USEDECLSPEC@,$LWRES_PLATFORM_USEDECLSPEC,;t t
14055
s,@ISC_PLATFORM_BRACEPTHREADONCEINIT@,$ISC_PLATFORM_BRACEPTHREADONCEINIT,;t t
14056
s,@OPENJADE@,$OPENJADE,;t t
14057
s,@JADETEX@,$JADETEX,;t t
14058
s,@PDFJADETEX@,$PDFJADETEX,;t t
14059
s,@SGMLCATALOG@,$SGMLCATALOG,;t t
14060
s,@HTMLSTYLE@,$HTMLSTYLE,;t t
14061
s,@PRINTSTYLE@,$PRINTSTYLE,;t t
14062
s,@XMLDCL@,$XMLDCL,;t t
14063
s,@DOCBOOK2MANSPEC@,$DOCBOOK2MANSPEC,;t t
14064
s,@BIND9_TOP_BUILDDIR@,$BIND9_TOP_BUILDDIR,;t t
14065
s,@BIND9_ISC_BUILDINCLUDE@,$BIND9_ISC_BUILDINCLUDE,;t t
14066
s,@BIND9_ISCCC_BUILDINCLUDE@,$BIND9_ISCCC_BUILDINCLUDE,;t t
14067
s,@BIND9_ISCCFG_BUILDINCLUDE@,$BIND9_ISCCFG_BUILDINCLUDE,;t t
14068
s,@BIND9_DNS_BUILDINCLUDE@,$BIND9_DNS_BUILDINCLUDE,;t t
14069
s,@BIND9_LWRES_BUILDINCLUDE@,$BIND9_LWRES_BUILDINCLUDE,;t t
14070
/@BIND9_INCLUDES@/r $BIND9_INCLUDES
14071
s,@BIND9_INCLUDES@,,;t t
14072
/@BIND9_MAKE_RULES@/r $BIND9_MAKE_RULES
14073
s,@BIND9_MAKE_RULES@,,;t t
14074
s,@BIND9_VERSION@,$BIND9_VERSION,;t t
14075
/@LIBISC_API@/r $LIBISC_API
14076
s,@LIBISC_API@,,;t t
14077
/@LIBISCCC_API@/r $LIBISCCC_API
14078
s,@LIBISCCC_API@,,;t t
14079
/@LIBISCCFG_API@/r $LIBISCCFG_API
14080
s,@LIBISCCFG_API@,,;t t
14081
/@LIBDNS_API@/r $LIBDNS_API
14082
s,@LIBDNS_API@,,;t t
14083
/@LIBLWRES_API@/r $LIBLWRES_API
14084
s,@LIBLWRES_API@,,;t t
14085
CEOF
14086
14087
_ACEOF
14088
14089
  cat >>$CONFIG_STATUS <<\_ACEOF
14090
  # Split the substitutions into bite-sized pieces for seds with
14091
  # small command number limits, like on Digital OSF/1 and HP-UX.
14092
  ac_max_sed_lines=48
14093
  ac_sed_frag=1 # Number of current file.
14094
  ac_beg=1 # First line for current file.
14095
  ac_end=$ac_max_sed_lines # Line after last line for current file.
14096
  ac_more_lines=:
14097
  ac_sed_cmds=
14098
  while $ac_more_lines; do
14099
    if test $ac_beg -gt 1; then
14100
      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
14101
    else
14102
      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
14103
    fi
14104
    if test ! -s $tmp/subs.frag; then
14105
      ac_more_lines=false
14106
    else
14107
      # The purpose of the label and of the branching condition is to
14108
      # speed up the sed processing (if there are no `@' at all, there
14109
      # is no need to browse any of the substitutions).
14110
      # These are the two extra sed commands mentioned above.
14111
      (echo ':t
14112
  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
14113
      if test -z "$ac_sed_cmds"; then
14114
  	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
14115
      else
14116
  	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
14117
      fi
14118
      ac_sed_frag=`expr $ac_sed_frag + 1`
14119
      ac_beg=$ac_end
14120
      ac_end=`expr $ac_end + $ac_max_sed_lines`
14121
    fi
14122
  done
14123
  if test -z "$ac_sed_cmds"; then
14124
    ac_sed_cmds=cat
14125
  fi
14126
fi # test -n "$CONFIG_FILES"
14127
14128
_ACEOF
14129
cat >>$CONFIG_STATUS <<\_ACEOF
14130
for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
14131
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14132
  case $ac_file in
14133
  - | *:- | *:-:* ) # input from stdin
14134
        cat >$tmp/stdin
14135
        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14136
        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14137
  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14138
        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14139
  * )   ac_file_in=$ac_file.in ;;
14140
  esac
14141
14142
  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
14143
  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
14144
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14145
         X"$ac_file" : 'X\(//\)[^/]' \| \
14146
         X"$ac_file" : 'X\(//\)$' \| \
14147
         X"$ac_file" : 'X\(/\)' \| \
14148
         .     : '\(.\)' 2>/dev/null ||
14149
echo X"$ac_file" |
14150
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
14151
  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
14152
  	  /^X\(\/\/\)$/{ s//\1/; q; }
14153
  	  /^X\(\/\).*/{ s//\1/; q; }
14154
  	  s/.*/./; q'`
14155
  { case "$ac_dir" in
14156
  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
14157
  *)                      as_incr_dir=.;;
14158
esac
14159
as_dummy="$ac_dir"
14160
for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
14161
  case $as_mkdir_dir in
14162
    # Skip DOS drivespec
14163
    ?:) as_incr_dir=$as_mkdir_dir ;;
14164
    *)
14165
      as_incr_dir=$as_incr_dir/$as_mkdir_dir
14166
      test -d "$as_incr_dir" ||
14167
        mkdir "$as_incr_dir" ||
14168
	{ { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5
14169
echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
14170
   { (exit 1); exit 1; }; }
14171
    ;;
14172
  esac
14173
done; }
14174
14175
  ac_builddir=.
14176
14177
if test "$ac_dir" != .; then
14178
  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
14179
  # A "../" for each directory in $ac_dir_suffix.
14180
  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
14181
else
14182
  ac_dir_suffix= ac_top_builddir=
14183
fi
14184
14185
case $srcdir in
14186
  .)  # No --srcdir option.  We are building in place.
14187
    ac_srcdir=.
14188
    if test -z "$ac_top_builddir"; then
14189
       ac_top_srcdir=.
14190
    else
14191
       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
14192
    fi ;;
14193
  [\\/]* | ?:[\\/]* )  # Absolute path.
14194
    ac_srcdir=$srcdir$ac_dir_suffix;
14195
    ac_top_srcdir=$srcdir ;;
14196
  *) # Relative path.
14197
    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
14198
    ac_top_srcdir=$ac_top_builddir$srcdir ;;
14199
esac
14200
# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
14201
# absolute.
14202
ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
14203
ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
14204
ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
14205
ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
14206
14207
14208
  case $INSTALL in
14209
  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
14210
  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
14211
  esac
14212
14213
  if test x"$ac_file" != x-; then
14214
    { echo "$as_me:$LINENO: creating $ac_file" >&5
14215
echo "$as_me: creating $ac_file" >&6;}
14216
    rm -f "$ac_file"
14217
  fi
14218
  # Let's still pretend it is `configure' which instantiates (i.e., don't
14219
  # use $as_me), people would be surprised to read:
14220
  #    /* config.h.  Generated by config.status.  */
14221
  if test x"$ac_file" = x-; then
14222
    configure_input=
14223
  else
14224
    configure_input="$ac_file.  "
14225
  fi
14226
  configure_input=$configure_input"Generated from `echo $ac_file_in |
14227
                                     sed 's,.*/,,'` by configure."
14228
14229
  # First look for the input files in the build tree, otherwise in the
14230
  # src tree.
14231
  ac_file_inputs=`IFS=:
14232
    for f in $ac_file_in; do
14233
      case $f in
14234
      -) echo $tmp/stdin ;;
14235
      [\\/$]*)
14236
         # Absolute (can't be DOS-style, as IFS=:)
14237
         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
14238
echo "$as_me: error: cannot find input file: $f" >&2;}
14239
   { (exit 1); exit 1; }; }
14240
         echo $f;;
14241
      *) # Relative
14242
         if test -f "$f"; then
14243
           # Build tree
14244
           echo $f
14245
         elif test -f "$srcdir/$f"; then
14246
           # Source tree
14247
           echo $srcdir/$f
14248
         else
14249
           # /dev/null tree
14250
           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
14251
echo "$as_me: error: cannot find input file: $f" >&2;}
14252
   { (exit 1); exit 1; }; }
14253
         fi;;
14254
      esac
14255
    done` || { (exit 1); exit 1; }
14256
_ACEOF
14257
cat >>$CONFIG_STATUS <<_ACEOF
14258
  sed "$ac_vpsub
14259
$extrasub
14260
_ACEOF
14261
cat >>$CONFIG_STATUS <<\_ACEOF
14262
:t
14263
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
14264
s,@configure_input@,$configure_input,;t t
14265
s,@srcdir@,$ac_srcdir,;t t
14266
s,@abs_srcdir@,$ac_abs_srcdir,;t t
14267
s,@top_srcdir@,$ac_top_srcdir,;t t
14268
s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
14269
s,@builddir@,$ac_builddir,;t t
14270
s,@abs_builddir@,$ac_abs_builddir,;t t
14271
s,@top_builddir@,$ac_top_builddir,;t t
14272
s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
14273
s,@INSTALL@,$ac_INSTALL,;t t
14274
" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
14275
  rm -f $tmp/stdin
14276
  if test x"$ac_file" != x-; then
14277
    mv $tmp/out $ac_file
14278
  else
14279
    cat $tmp/out
14280
    rm -f $tmp/out
14281
  fi
14282
14283
done
14284
_ACEOF
14285
cat >>$CONFIG_STATUS <<\_ACEOF
14286
14287
#
14288
# CONFIG_HEADER section.
14289
#
14290
14291
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
14292
# NAME is the cpp macro being defined and VALUE is the value it is being given.
14293
#
14294
# ac_d sets the value in "#define NAME VALUE" lines.
14295
ac_dA='s,^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
14296
ac_dB='[ 	].*$,\1#\2'
14297
ac_dC=' '
14298
ac_dD=',;t'
14299
# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
14300
ac_uA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
14301
ac_uB='$,\1#\2define\3'
14302
ac_uC=' '
14303
ac_uD=',;t'
14304
14305
for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
14306
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14307
  case $ac_file in
14308
  - | *:- | *:-:* ) # input from stdin
14309
        cat >$tmp/stdin
14310
        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14311
        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14312
  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14313
        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14314
  * )   ac_file_in=$ac_file.in ;;
14315
  esac
14316
14317
  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
14318
echo "$as_me: creating $ac_file" >&6;}
14319
14320
  # First look for the input files in the build tree, otherwise in the
14321
  # src tree.
14322
  ac_file_inputs=`IFS=:
14323
    for f in $ac_file_in; do
14324
      case $f in
14325
      -) echo $tmp/stdin ;;
14326
      [\\/$]*)
14327
         # Absolute (can't be DOS-style, as IFS=:)
14328
         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
14329
echo "$as_me: error: cannot find input file: $f" >&2;}
14330
   { (exit 1); exit 1; }; }
14331
         echo $f;;
14332
      *) # Relative
14333
         if test -f "$f"; then
14334
           # Build tree
14335
           echo $f
14336
         elif test -f "$srcdir/$f"; then
14337
           # Source tree
14338
           echo $srcdir/$f
14339
         else
14340
           # /dev/null tree
14341
           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
14342
echo "$as_me: error: cannot find input file: $f" >&2;}
14343
   { (exit 1); exit 1; }; }
14344
         fi;;
14345
      esac
14346
    done` || { (exit 1); exit 1; }
14347
  # Remove the trailing spaces.
14348
  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
14349
14350
_ACEOF
14351
14352
# Transform confdefs.h into two sed scripts, `conftest.defines' and
14353
# `conftest.undefs', that substitutes the proper values into
14354
# config.h.in to produce config.h.  The first handles `#define'
14355
# templates, and the second `#undef' templates.
14356
# And first: Protect against being on the right side of a sed subst in
14357
# config.status.  Protect against being in an unquoted here document
14358
# in config.status.
14359
rm -f conftest.defines conftest.undefs
14360
# Using a here document instead of a string reduces the quoting nightmare.
14361
# Putting comments in sed scripts is not portable.
14362
#
14363
# `end' is used to avoid that the second main sed command (meant for
14364
# 0-ary CPP macros) applies to n-ary macro definitions.
14365
# See the Autoconf documentation for `clear'.
14366
cat >confdef2sed.sed <<\_ACEOF
14367
s/[\\&,]/\\&/g
14368
s,[\\$`],\\&,g
14369
t clear
14370
: clear
14371
s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	(][^ 	(]*\)\(([^)]*)\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
14372
t end
14373
s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
14374
: end
14375
_ACEOF
14376
# If some macros were called several times there might be several times
14377
# the same #defines, which is useless.  Nevertheless, we may not want to
14378
# sort them, since we want the *last* AC-DEFINE to be honored.
14379
uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
14380
sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
14381
rm -f confdef2sed.sed
14382
14383
# This sed command replaces #undef with comments.  This is necessary, for
14384
# example, in the case of _POSIX_SOURCE, which is predefined and required
14385
# on some systems where configure will not decide to define it.
14386
cat >>conftest.undefs <<\_ACEOF
14387
s,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
14388
_ACEOF
14389
14390
# Break up conftest.defines because some shells have a limit on the size
14391
# of here documents, and old seds have small limits too (100 cmds).
14392
echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
14393
echo '  if egrep "^[ 	]*#[ 	]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
14394
echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
14395
echo '  :' >>$CONFIG_STATUS
14396
rm -f conftest.tail
14397
while grep . conftest.defines >/dev/null
14398
do
14399
  # Write a limited-size here document to $tmp/defines.sed.
14400
  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
14401
  # Speed up: don't consider the non `#define' lines.
14402
  echo '/^[ 	]*#[ 	]*define/!b' >>$CONFIG_STATUS
14403
  # Work around the forget-to-reset-the-flag bug.
14404
  echo 't clr' >>$CONFIG_STATUS
14405
  echo ': clr' >>$CONFIG_STATUS
14406
  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
14407
  echo 'CEOF
14408
  sed -f $tmp/defines.sed $tmp/in >$tmp/out
14409
  rm -f $tmp/in
14410
  mv $tmp/out $tmp/in
14411
' >>$CONFIG_STATUS
14412
  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
14413
  rm -f conftest.defines
14414
  mv conftest.tail conftest.defines
14415
done
14416
rm -f conftest.defines
14417
echo '  fi # egrep' >>$CONFIG_STATUS
14418
echo >>$CONFIG_STATUS
14419
14420
# Break up conftest.undefs because some shells have a limit on the size
14421
# of here documents, and old seds have small limits too (100 cmds).
14422
echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
14423
rm -f conftest.tail
14424
while grep . conftest.undefs >/dev/null
14425
do
14426
  # Write a limited-size here document to $tmp/undefs.sed.
14427
  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
14428
  # Speed up: don't consider the non `#undef'
14429
  echo '/^[ 	]*#[ 	]*undef/!b' >>$CONFIG_STATUS
14430
  # Work around the forget-to-reset-the-flag bug.
14431
  echo 't clr' >>$CONFIG_STATUS
14432
  echo ': clr' >>$CONFIG_STATUS
14433
  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
14434
  echo 'CEOF
14435
  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
14436
  rm -f $tmp/in
14437
  mv $tmp/out $tmp/in
14438
' >>$CONFIG_STATUS
14439
  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
14440
  rm -f conftest.undefs
14441
  mv conftest.tail conftest.undefs
14442
done
14443
rm -f conftest.undefs
14444
14445
cat >>$CONFIG_STATUS <<\_ACEOF
14446
  # Let's still pretend it is `configure' which instantiates (i.e., don't
14447
  # use $as_me), people would be surprised to read:
14448
  #    /* config.h.  Generated by config.status.  */
14449
  if test x"$ac_file" = x-; then
14450
    echo "/* Generated by configure.  */" >$tmp/config.h
14451
  else
14452
    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
14453
  fi
14454
  cat $tmp/in >>$tmp/config.h
14455
  rm -f $tmp/in
14456
  if test x"$ac_file" != x-; then
14457
    if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
14458
      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
14459
echo "$as_me: $ac_file is unchanged" >&6;}
14460
    else
14461
      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
14462
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14463
         X"$ac_file" : 'X\(//\)[^/]' \| \
14464
         X"$ac_file" : 'X\(//\)$' \| \
14465
         X"$ac_file" : 'X\(/\)' \| \
14466
         .     : '\(.\)' 2>/dev/null ||
14467
echo X"$ac_file" |
14468
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
14469
  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
14470
  	  /^X\(\/\/\)$/{ s//\1/; q; }
14471
  	  /^X\(\/\).*/{ s//\1/; q; }
14472
  	  s/.*/./; q'`
14473
      { case "$ac_dir" in
14474
  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
14475
  *)                      as_incr_dir=.;;
14476
esac
14477
as_dummy="$ac_dir"
14478
for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
14479
  case $as_mkdir_dir in
14480
    # Skip DOS drivespec
14481
    ?:) as_incr_dir=$as_mkdir_dir ;;
14482
    *)
14483
      as_incr_dir=$as_incr_dir/$as_mkdir_dir
14484
      test -d "$as_incr_dir" ||
14485
        mkdir "$as_incr_dir" ||
14486
	{ { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5
14487
echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
14488
   { (exit 1); exit 1; }; }
14489
    ;;
14490
  esac
14491
done; }
14492
14493
      rm -f $ac_file
14494
      mv $tmp/config.h $ac_file
14495
    fi
14496
  else
14497
    cat $tmp/config.h
14498
    rm -f $tmp/config.h
14499
  fi
14500
done
14501
_ACEOF
14502
14503
cat >>$CONFIG_STATUS <<\_ACEOF
14504
14505
{ (exit 0); exit 0; }
14506
_ACEOF
14507
chmod +x $CONFIG_STATUS
14508
ac_clean_files=$ac_clean_files_save
14509
14510
14511
# configure is writing to config.log, and then calls config.status.
14512
# config.status does its own redirection, appending to config.log.
14513
# Unfortunately, on DOS this fails, as config.log is still kept open
14514
# by configure, so config.status won't be able to write to it; its
14515
# output is simply discarded.  So we exec the FD to /dev/null,
14516
# effectively closing config.log, so it can be properly (re)opened and
14517
# appended to by config.status.  When coming back to configure, we
14518
# need to make the FD available again.
14519
if test "$no_create" != yes; then
14520
  ac_cs_success=:
14521
  exec 5>/dev/null
14522
  $SHELL $CONFIG_STATUS || ac_cs_success=false
14523
  exec 5>>config.log
14524
  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
14525
  # would make configure fail if this is the last instruction.
14526
  $ac_cs_success || { (exit 1); exit 1; }
14527
fi
14528
14529
#
14530
# CONFIG_SUBDIRS section.
14531
#
14532
if test "$no_recursion" != yes; then
14533
14534
  # Remove --cache-file and --srcdir arguments so they do not pile up.
14535
  ac_sub_configure_args=
14536
  ac_prev=
14537
  for ac_arg in $ac_configure_args; do
14538
    if test -n "$ac_prev"; then
14539
      ac_prev=
14540
      continue
14541
    fi
14542
    case $ac_arg in
14543
    -cache-file | --cache-file | --cache-fil | --cache-fi \
14544
    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
14545
      ac_prev=cache_file ;;
14546
    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
14547
    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
14548
    | --c=*)
14549
      ;;
14550
    --config-cache | -C)
14551
      ;;
14552
    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
14553
      ac_prev=srcdir ;;
14554
    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
14555
      ;;
14556
    -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
14557
      ac_prev=prefix ;;
14558
    -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
14559
      ;;
14560
    *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
14561
    esac
14562
  done
14563
14564
  # Always prepend --prefix to ensure using the same prefix
14565
  # in subdir configurations.
14566
  ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args"
14567
14568
  ac_popdir=`pwd`
14569
  for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
14570
14571
    # Do not complain, so a configure script can configure whichever
14572
    # parts of a large source tree are present.
14573
    test -d $srcdir/$ac_dir || continue
14574
14575
    { echo "$as_me:$LINENO: configuring in $ac_dir" >&5
14576
echo "$as_me: configuring in $ac_dir" >&6;}
14577
    { case "$ac_dir" in
14578
  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
14579
  *)                      as_incr_dir=.;;
14580
esac
14581
as_dummy="$ac_dir"
14582
for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
14583
  case $as_mkdir_dir in
14584
    # Skip DOS drivespec
14585
    ?:) as_incr_dir=$as_mkdir_dir ;;
14586
    *)
14587
      as_incr_dir=$as_incr_dir/$as_mkdir_dir
14588
      test -d "$as_incr_dir" ||
14589
        mkdir "$as_incr_dir" ||
14590
	{ { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5
14591
echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
14592
   { (exit 1); exit 1; }; }
14593
    ;;
14594
  esac
14595
done; }
14596
14597
    ac_builddir=.
14598
14599
if test "$ac_dir" != .; then
14600
  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
14601
  # A "../" for each directory in $ac_dir_suffix.
14602
  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
14603
else
14604
  ac_dir_suffix= ac_top_builddir=
14605
fi
14606
14607
case $srcdir in
14608
  .)  # No --srcdir option.  We are building in place.
14609
    ac_srcdir=.
14610
    if test -z "$ac_top_builddir"; then
14611
       ac_top_srcdir=.
14612
    else
14613
       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
14614
    fi ;;
14615
  [\\/]* | ?:[\\/]* )  # Absolute path.
14616
    ac_srcdir=$srcdir$ac_dir_suffix;
14617
    ac_top_srcdir=$srcdir ;;
14618
  *) # Relative path.
14619
    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
14620
    ac_top_srcdir=$ac_top_builddir$srcdir ;;
14621
esac
14622
# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
14623
# absolute.
14624
ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
14625
ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
14626
ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
14627
ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
14628
14629
14630
    cd $ac_dir
14631
14632
    # Check for guested configure; otherwise get Cygnus style configure.
14633
    if test -f $ac_srcdir/configure.gnu; then
14634
      ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'"
14635
    elif test -f $ac_srcdir/configure; then
14636
      ac_sub_configure="$SHELL '$ac_srcdir/configure'"
14637
    elif test -f $ac_srcdir/configure.in; then
14638
      ac_sub_configure=$ac_configure
14639
    else
14640
      { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5
14641
echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
14642
      ac_sub_configure=
14643
    fi
14644
14645
    # The recursion is here.
14646
    if test -n "$ac_sub_configure"; then
14647
      # Make the cache file name correct relative to the subdirectory.
14648
      case $cache_file in
14649
      [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
14650
      *) # Relative path.
14651
        ac_sub_cache_file=$ac_top_builddir$cache_file ;;
14652
      esac
14653
14654
      { echo "$as_me:$LINENO: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
14655
echo "$as_me: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
14656
      # The eval makes quoting arguments work.
14657
      eval $ac_sub_configure $ac_sub_configure_args \
14658
           --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir ||
14659
        { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5
14660
echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;}
14661
   { (exit 1); exit 1; }; }
14662
    fi
14663
14664
    cd $ac_popdir
14665
  done
14666
fi
14667
14668
chmod a+x isc-config.sh
14669
14670
# Tell Emacs to edit this file in shell mode.
14671
# Local Variables:
14672
# mode: sh
14673
# End:
(-)bind-9.2.2-orig/configure.in (-1 / +384 lines)
Lines 272-277 Link Here
272
AC_C_BIGENDIAN
272
AC_C_BIGENDIAN
273
273
274
#
274
#
275
# Build DLZ support?
276
#
277
# The use_dlz flag is set to no.  If one of the DLZ drivers is selected
278
# for build the use_dlz flag will be set to yes
279
#
280
281
use_dlz=no
282
283
#
284
# was --with-dlz-postgres specified?
285
#
286
287
AC_MSG_CHECKING(for Postgres DLZ driver)
288
AC_ARG_WITH(dlz_postgres,
289
[  --with-dlz-postgres[=PATH]   Build with Postgres DLZ driver [yes|no|path].
290
                               (Required to use Postgres with DLZ)],
291
    use_dlz_postgres="$withval", use_dlz_postgres="no")
292
293
case "$use_dlz_postgres" in
294
	no)
295
		AC_MSG_RESULT(no)
296
		;;
297
	*)
298
		#set use_dlz = "yes" so the DLZ core will be built
299
		use_dlz=yes
300
		if test "$use_dlz_postgres" = "yes"
301
		then
302
			# User did not specify a path - guess it
303
			pgdirs="/usr /usr/local /usr/local/pgsql /usr/pkg"
304
			for d in $pgdirs
305
			do
306
				if test -f $d/include/libpq-fe.h
307
				then
308
					use_dlz_postgres=$d
309
					break
310
				fi
311
			done
312
			if test "$use_dlz_postgres" = "yes"
313
			then
314
				AC_MSG_RESULT(not found)
315
				AC_MSG_ERROR(
316
[PostgreSQL was not found in any of $pgdirs; use --with-dlz-postgres=/path])
317
			fi
318
		fi
319
		USE_DLZ_POSTGRES='-DDLZ_POSTGRES'
320
		DLZ_POSTGRES_INC="-I$use_dlz_postgres/include"
321
		DLZ_POSTGRES_LIBS="-L$use_dlz_postgres/lib  -lpq"
322
		AC_MSG_RESULT(
323
[using PostgreSQL from $use_dlz_postgres/lib and $use_dlz_postgres/include])
324
		;;
325
esac
326
327
328
AC_SUBST(DLZ_POSTGRES_INC)
329
AC_SUBST(DLZ_POSTGRES_LIBS)
330
AC_SUBST(USE_DLZ_POSTGRES)
331
332
333
#
334
# was --with-dlz-mysql specified?
335
#
336
337
AC_MSG_CHECKING(for MySQL DLZ driver)
338
AC_ARG_WITH(dlz_mysql,
339
[  --with-dlz-mysql[=PATH]   Build with MySQL DLZ driver [yes|no|path].
340
                               (Required to use MySQL with DLZ)],
341
    use_dlz_mysql="$withval", use_dlz_mysql="no")
342
343
case "$use_dlz_mysql" in
344
	no)
345
		AC_MSG_RESULT(no)
346
		;;
347
	*)
348
		#set use_dlz = "yes" so the DLZ core will be built
349
		use_dlz=yes
350
		if test "$use_dlz_mysql" = "yes"
351
		then
352
			# User did not specify a path - guess it
353
			mysqldirs="/usr /usr/local /usr/local/mysql /usr/pkg"
354
			for d in $mysqldirs
355
			do
356
				if test -f $d/include/mysql/mysql.h
357
				then
358
					use_dlz_mysql=$d
359
					break
360
				fi
361
			done
362
			if test "$use_dlz_mysql" = "yes"
363
			then
364
				AC_MSG_RESULT(not found)
365
				AC_MSG_ERROR(
366
[MySQL was not found in any of $mysqldirs; use --with-dlz-mysql=/path])
367
			fi
368
		fi
369
                USE_DLZ_MYSQL='-DDLZ_MYSQL'
370
                DLZ_MYSQL_INC="-I$use_dlz_mysql/include/mysql"
371
                DLZ_MYSQL_LIBS="-L$use_dlz_mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm"
372
                AC_MSG_RESULT(
373
[using mysql from $use_dlz_mysql/lib/mysql and $use_dlz_mysql/include/mysql])                
374
		;;
375
esac
376
377
AC_SUBST(DLZ_MYSQL_INC)
378
AC_SUBST(DLZ_MYSQL_LIBS)
379
AC_SUBST(USE_DLZ_MYSQL)
380
381
382
#
383
# was --with-dlz-bdb specified?
384
#
385
386
AC_MSG_CHECKING(for Berkeley DB DLZ driver)
387
AC_ARG_WITH(dlz_bdb,
388
[  --with-dlz-bdb[=PATH]   Build with Berkeley DB DLZ driver [yes|no|path].
389
                               (Required to use Berkeley DB with DLZ)],
390
    use_dlz_bdb="$withval", use_dlz_bdb="no")
391
392
case "$use_dlz_bdb" in
393
	no)
394
		AC_MSG_RESULT(no)
395
		;;
396
	*)
397
		#set use_dlz = "yes" so the DLZ core will be built
398
		use_dlz=yes
399
		#set DLZ_BDB_UTIL to "dlzbdb" so that it is built too
400
		DLZ_BDB_UTIL="dlzbdb"
401
		if test "$use_dlz_bdb" = "yes"
402
		then
403
			# User did not specify a path - guess it
404
			bdbdirs="/usr /usr/local /usr/pkg"
405
			for d in $bdbdirs
406
			do
407
				if test -f $d/include/db.h
408
				then
409
                                        use_dlz_bdb=$d
410
					DLZ_BDB_INCDIR=$use_dlz_bdb/include
411
                                        DLB_BDB_LIB="-ldb"                                        
412
                                        break                                  
413
				fi
414
			done
415
			if test "$use_dlz_bdb" = "yes"
416
			then
417
				AC_MSG_RESULT(not found)
418
				AC_MSG_ERROR(
419
[Berkeley DB was not found in any of $bdbdirs; use --with-dlz-bdb=/path])
420
			fi
421
                # if the user specified a path try a few variations of the path
422
                # for the include and library dirs
423
		elif test -d "$use_dlz_bdb"
424
                then
425
                        # set both to yes, so we can check them later
426
		        DLZ_BDB_INCDIR="yes"
427
                        DLZ_BDB_LIB="yes"
428
                        
429
                        # check other locations for includes.
430
                        bdb_incdirs="/ /db41/ /db4/ /db/"
431
			for d in $bdb_incdirs
432
                        do
433
				if test -f $use_dlz_bdb/include${d}db.h
434
                                then
435
					DLZ_BDB_INCDIR=$use_dlz_bdb/include${d}
436
                                        break
437
				fi
438
			done
439
                        
440
                        if test "$DLZ_BDB_INCDIR" = "yes"
441
                        then
442
                                AC_MSG_RESULT(not found)
443
                                AC_MSG_ERROR(
444
[Berkeley DB header was not found in $use_dlz_bdb/include, \
445
$use_dlz_bdb/include/db41, $use_dlz_bdb/include/db4 or $use_dlz_bdb/include/db])
446
                        fi
447
                        
448
			# look for libname other than libdb.so
449
                        bdb_libnames="db41 db-4.1 db"
450
			for d in $bdb_libnames
451
                        do
452
				if test -f $use_dlz_bdb/lib/lib${d}.so
453
                                then
454
					DLZ_BDB_LIB="-l${d}"
455
				fi
456
			done
457
                        
458
                        if test "$DLZ_BDB_LIB" = "yes"
459
                        then
460
                                AC_MSG_RESULT(not found)
461
                                AC_MSG_ERROR(
462
[Berkeley DB library libdb41.so, libdb-4.1.so or libdb.so could not be found \
463
in $use_dlz_bdb/lib])
464
                        fi                        
465
466
467
                else
468
                        AC_MSG_RESULT(not found)
469
                        AC_MSG_ERROR(
470
[Path $use_dlz_bdb does not exist])
471
472
		fi
473
                
474
                USE_DLZ_BDB='-DDLZ_BDB'
475
                DLZ_BDB_INC="-I$DLZ_BDB_INCDIR"
476
                DLZ_BDB_LIBS="-L${use_dlz_bdb}/lib ${DLZ_BDB_LIB}"
477
                AC_MSG_RESULT(
478
[using Berkeley DB from $use_dlz_bdb/lib and $DLZ_BDB_INCDIR])                
479
		;;
480
esac
481
482
AC_SUBST(DLZ_BDB_UTIL)
483
AC_SUBST(DLZ_BDB_INC)
484
AC_SUBST(DLZ_BDB_LIBS)
485
AC_SUBST(USE_DLZ_BDB)
486
487
488
#
489
# was --with-dlz-filesystem specified?
490
#
491
492
AC_MSG_CHECKING(for file system DLZ driver)
493
AC_ARG_WITH(dlz_filesystem,
494
[  --with-dlz-filesystem[=PATH]   Build with filesystem DLZ driver [yes|no].
495
                               (Required to use file system driver with DLZ)],
496
    use_dlz_filesystem="$withval", use_dlz_filesystem="no")
497
498
case "$use_dlz_filesystem" in
499
	no)
500
		AC_MSG_RESULT(no)
501
		;;
502
	*)
503
		#set use_dlz = "yes" so the DLZ core will be built
504
		use_dlz=yes
505
                USE_DLZ_FILESYSTEM='-DDLZ_FILESYSTEM'
506
                AC_MSG_RESULT(yes)
507
		;;
508
esac
509
510
AC_SUBST(USE_DLZ_FILESYSTEM)
511
512
513
#
514
# was --with-dlz-ldap specified?
515
#
516
517
AC_MSG_CHECKING(for LDAP DLZ driver)
518
AC_ARG_WITH(dlz_ldap,
519
[  --with-dlz-ldap[=PATH]   Build with LDAP DLZ driver [yes|no|path].
520
                               (Required to use LDAP with DLZ)],
521
    use_dlz_ldap="$withval", use_dlz_ldap="no")
522
523
case "$use_dlz_ldap" in
524
	no)
525
		AC_MSG_RESULT(no)
526
		;;
527
	*)
528
		#set use_dlz = "yes" so the DLZ core will be built
529
		use_dlz=yes
530
		if test "$use_dlz_ldap" = "yes"
531
		then
532
			# User did not specify a path - guess it
533
			ldapdirs="/usr /usr/local /usr/pkg"
534
			for d in $ldapdirs
535
			do
536
				if test -f $d/include/ldap.h
537
				then
538
					use_dlz_ldap=$d
539
					break
540
				fi
541
			done
542
			if test "$use_dlz_ldap" = "yes"
543
			then
544
				AC_MSG_RESULT(not found)
545
				AC_MSG_ERROR(
546
[LDAP headers were not found in any of $ldapdirs; use --with-dlz-ldap=/path])
547
			fi
548
		fi
549
		USE_DLZ_LDAP='-DDLZ_LDAP'
550
		DLZ_LDAP_INC="-I$use_dlz_ldap/include"
551
		DLZ_LDAP_LIBS="-L$use_dlz_ldap/lib -lldap -llber"
552
		AC_MSG_RESULT(
553
[using LDAP from $use_dlz_ldap/lib and $use_dlz_ldap/include])
554
		;;
555
esac
556
557
558
AC_SUBST(DLZ_LDAP_INC)
559
AC_SUBST(DLZ_LDAP_LIBS)
560
AC_SUBST(USE_DLZ_LDAP)
561
562
563
#
564
# was --with-dlz-odbc specified?
565
#
566
567
AC_MSG_CHECKING(for ODBC DLZ driver)
568
AC_ARG_WITH(dlz_odbc,
569
[  --with-dlz-odbc[=PATH]   Build with ODBC DLZ driver [yes|no|path].
570
                               (Required to use ODBC with DLZ)],
571
    use_dlz_odbc="$withval", use_dlz_odbc="no")
572
573
case "$use_dlz_odbc" in
574
	no)
575
		AC_MSG_RESULT(no)
576
		;;
577
	*)
578
		#set use_dlz = "yes" so the DLZ core will be built
579
		use_dlz=yes
580
		if test "$use_dlz_odbc" = "yes"
581
		then
582
			# User did not specify a path - guess it
583
			odbcdirs="/usr /usr/local /usr/pkg"
584
			for d in $odbcdirs
585
			do
586
				if test -f $d/include/sql.h
587
				then
588
					use_dlz_odbc=$d
589
					break
590
				fi
591
			done
592
			if test "$use_dlz_odbc" = "yes"
593
			then
594
				AC_MSG_RESULT(not found)
595
				AC_MSG_ERROR(
596
[ODBC headers were not found in any of $odbcdirs; use --with-dlz-odbc=/path])
597
			fi
598
		fi
599
		USE_DLZ_ODBC='-DDLZ_ODBC'
600
		DLZ_ODBC_INC="-I$use_dlz_odbc/include"
601
		DLZ_ODBC_LIBS="-L$use_dlz_odbc/lib -lodbc"
602
		AC_MSG_RESULT(
603
[using ODBC from $use_dlz_odbc/lib and $use_dlz_odbc/include])
604
		;;
605
esac
606
607
608
AC_SUBST(DLZ_ODBC_INC)
609
AC_SUBST(DLZ_ODBC_LIBS)
610
AC_SUBST(USE_DLZ_ODBC)
611
612
                                                                                     
613
#
614
# was --with-dlz-stub specified?
615
#
616
617
AC_MSG_CHECKING(for stub DLZ driver)
618
AC_ARG_WITH(dlz_stub,
619
[  --with-dlz-stub[=PATH]   Build with stub DLZ driver [yes|no].
620
                               (Required to use stub driver with DLZ)],
621
    use_dlz_stub="$withval", use_dlz_stub="no")
622
623
case "$use_dlz_stub" in
624
	no)
625
		AC_MSG_RESULT(no)
626
		;;
627
	*)
628
		#set use_dlz = "yes" so the DLZ core will be built
629
		use_dlz=yes
630
                USE_DLZ_STUB='-DDLZ_STUB'
631
                AC_MSG_RESULT(yes)
632
		;;
633
esac
634
635
AC_SUBST(USE_DLZ_STUB)
636
637
638
#
639
# If any DLZ driver is built, the DLZ core is built too.
640
#
641
642
AC_MSG_CHECKING(for DLZ)
643
644
# check if any DLZ driver was built
645
if test "$use_dlz" = "yes"
646
then
647
	AC_MSG_RESULT(yes)
648
	USE_DLZ="-DDLZ"
649
else
650
	AC_MSG_RESULT(no)
651
fi
652
653
AC_SUBST(USE_DLZ)
654
655
656
#
275
# was --with-openssl specified?
657
# was --with-openssl specified?
276
#
658
#
277
AC_MSG_CHECKING(for OpenSSL library)
659
AC_MSG_CHECKING(for OpenSSL library)
Lines 1732-1738 Link Here
1732
2114
1733
AC_OUTPUT(
2115
AC_OUTPUT(
1734
	make/rules
2116
	make/rules
1735
	make/includes
2117
        make/includes
1736
	Makefile
2118
	Makefile
1737
	make/Makefile
2119
	make/Makefile
1738
	make/mkdep
2120
	make/mkdep
Lines 1777-1782 Link Here
1777
	lib/tests/include/Makefile
2159
	lib/tests/include/Makefile
1778
	lib/tests/include/tests/Makefile
2160
	lib/tests/include/tests/Makefile
1779
	bin/Makefile
2161
	bin/Makefile
2162
        bin/dlzbdb/Makefile
1780
	bin/check/Makefile
2163
	bin/check/Makefile
1781
	bin/named/Makefile
2164
	bin/named/Makefile
1782
	bin/named/unix/Makefile
2165
	bin/named/unix/Makefile
(-)bind-9.2.2-orig/lib/dns/Makefile.in (-5 / +5 lines)
Lines 27-33 Link Here
27
27
28
CINCLUDES =	-I. ${DNS_INCLUDES} ${ISC_INCLUDES}
28
CINCLUDES =	-I. ${DNS_INCLUDES} ${ISC_INCLUDES}
29
29
30
CDEFINES =
30
CDEFINES =      @USE_DLZ@
31
CWARNINGS =
31
CWARNINGS =
32
32
33
LIBS =		@LIBS@
33
LIBS =		@LIBS@
Lines 46-58 Link Here
46
OBJS =		a6.@O@ acl.@O@ adb.@O@ byaddr.@O@ \
46
OBJS =		a6.@O@ acl.@O@ adb.@O@ byaddr.@O@ \
47
		cache.@O@ callbacks.@O@ compress.@O@ \
47
		cache.@O@ callbacks.@O@ compress.@O@ \
48
		db.@O@ dbiterator.@O@ dbtable.@O@ diff.@O@ dispatch.@O@ \
48
		db.@O@ dbiterator.@O@ dbtable.@O@ diff.@O@ dispatch.@O@ \
49
		dnssec.@O@ forward.@O@ journal.@O@ keytable.@O@ \
49
		dlz.@O@ dnssec.@O@ forward.@O@ journal.@O@ keytable.@O@ \
50
		lib.@O@ log.@O@ lookup.@O@ \
50
		lib.@O@ log.@O@ lookup.@O@ \
51
		master.@O@ masterdump.@O@ message.@O@ \
51
		master.@O@ masterdump.@O@ message.@O@ \
52
		name.@O@ ncache.@O@ nxt.@O@ peer.@O@ \
52
		name.@O@ ncache.@O@ nxt.@O@ peer.@O@ \
53
		rbt.@O@ rbtdb.@O@ rbtdb64.@O@ rdata.@O@ rdatalist.@O@ \
53
		rbt.@O@ rbtdb.@O@ rbtdb64.@O@ rdata.@O@ rdatalist.@O@ \
54
		rdataset.@O@ rdatasetiter.@O@ rdataslab.@O@ request.@O@ \
54
		rdataset.@O@ rdatasetiter.@O@ rdataslab.@O@ request.@O@ \
55
		resolver.@O@ result.@O@ rootns.@O@ sdb.@O@ soa.@O@ ssu.@O@ \
55
		resolver.@O@ result.@O@ rootns.@O@ sdb.@O@ sdlz.@O@ soa.@O@ ssu.@O@ \
56
		stats.@O@ tcpmsg.@O@ time.@O@ timer.@O@ tkey.@O@ \
56
		stats.@O@ tcpmsg.@O@ time.@O@ timer.@O@ tkey.@O@ \
57
		tsig.@O@ ttl.@O@ validator.@O@ \
57
		tsig.@O@ ttl.@O@ validator.@O@ \
58
		version.@O@ view.@O@ xfrin.@O@ zone.@O@ zonekey.@O@ zt.@O@ \
58
		version.@O@ view.@O@ xfrin.@O@ zone.@O@ zonekey.@O@ zt.@O@ \
Lines 62-74 Link Here
62
SRCS =		a6.c acl.c adb.c byaddr.c \
62
SRCS =		a6.c acl.c adb.c byaddr.c \
63
		cache.c callbacks.c compress.c \
63
		cache.c callbacks.c compress.c \
64
		db.c dbiterator.c dbtable.c diff.c dispatch.c \
64
		db.c dbiterator.c dbtable.c diff.c dispatch.c \
65
		dnssec.c forward.c journal.c keytable.c \
65
		dlz.c dnssec.c forward.c journal.c keytable.c \
66
		lib.c log.c lookup.c \
66
		lib.c log.c lookup.c \
67
		master.c masterdump.c message.c \
67
		master.c masterdump.c message.c \
68
		name.c ncache.c nxt.c peer.c \
68
		name.c ncache.c nxt.c peer.c \
69
		rbt.c rbtdb.c rbtdb64.c rdata.c rdatalist.c \
69
		rbt.c rbtdb.c rbtdb64.c rdata.c rdatalist.c \
70
		rdataset.c rdatasetiter.c rdataslab.c request.c \
70
		rdataset.c rdatasetiter.c rdataslab.c request.c \
71
		resolver.c result.c rootns.c sdb.c soa.c ssu.c \
71
		resolver.c result.c rootns.c sdb.c sdlz.c soa.c ssu.c \
72
		stats.c tcpmsg.c time.c timer.c tkey.c \
72
		stats.c tcpmsg.c time.c timer.c tkey.c \
73
		tsig.c ttl.c validator.c \
73
		tsig.c ttl.c validator.c \
74
		version.c view.c xfrin.c zone.c zonekey.c zt.c ${OTHERSRCS}
74
		version.c view.c xfrin.c zone.c zonekey.c zt.c ${OTHERSRCS}
(-)bind-9.2.2-orig/lib/dns/dlz.c (+480 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
/*
37
 * Copyright (C) 1999-2001  Internet Software Consortium.
38
 *
39
 * Permission to use, copy, modify, and distribute this software for any
40
 * purpose with or without fee is hereby granted, provided that the above
41
 * copyright notice and this permission notice appear in all copies.
42
 *
43
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
44
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
45
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
46
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
47
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
48
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
50
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
51
 */
52
53
54
/***
55
 *** Imports
56
 ***/
57
 
58
#ifdef DLZ
59
60
#include <config.h>
61
62
#include <dns/fixedname.h>
63
#include <dns/log.h>
64
#include <dns/master.h>
65
#include <dns/dlz.h>
66
67
68
#include <isc/buffer.h>
69
#include <isc/magic.h>
70
#include <isc/mem.h>
71
#include <isc/once.h>
72
#include <isc/rwlock.h>
73
#include <isc/string.h>
74
#include <isc/util.h>
75
76
/***
77
 *** Supported DLZ DB Implementations Registry
78
 ***/
79
80
static ISC_LIST(dns_dlzimplementation_t) dlz_implementations;
81
static isc_rwlock_t dlz_implock;
82
static isc_once_t once = ISC_ONCE_INIT;
83
84
static void
85
dlz_initialize(void) {
86
	RUNTIME_CHECK(isc_rwlock_init(&dlz_implock, 0, 0) == ISC_R_SUCCESS);
87
	ISC_LIST_INIT(dlz_implementations);
88
}
89
90
/* Searches the dlz_implementations list for a driver matching name */
91
static inline dns_dlzimplementation_t *
92
dlz_impfind(const char *name) {
93
	dns_dlzimplementation_t *imp;
94
95
	for (imp = ISC_LIST_HEAD(dlz_implementations); 
96
	     imp != NULL;
97
	     imp = ISC_LIST_NEXT(imp, link))
98
		if (strcasecmp(name, imp->name) == 0)
99
			return (imp);
100
	return (NULL);
101
}
102
103
/***
104
 *** Basic DLZ Methods
105
 ***/
106
/**/
107
isc_result_t
108
dns_dlzallowzonexfr(dns_view_t *view, dns_name_t *name,
109
                    isc_sockaddr_t *clientaddr, dns_db_t **dbp)
110
{
111
	isc_result_t result;
112
113
	/* Performs checks to make sure data is as we expect / require it to be. */
114
	REQUIRE(DNS_DLZ_VALID(view->dlzdatabase));
115
	REQUIRE(name != NULL);
116
	REQUIRE(dbp != NULL && *dbp == NULL);
117
118
	 /* ask driver if the zone is supported */
119
	result = view->dlzdatabase->implementation->methods->allowzonexfr(
120
							view->dlzdatabase->implementation->driverarg, 
121
							view->dlzdatabase->dbdata, view->dlzdatabase->mctx,
122
							view->rdclass, name, clientaddr, dbp);
123
124
	if(result == ISC_R_NOTIMPLEMENTED)
125
	    return (ISC_R_NOTFOUND);
126
	return result;
127
}
128
129
130
isc_result_t
131
dns_dlzcreate(isc_mem_t *mctx, const char *dlzname, const char *drivername, 
132
			  unsigned int argc, char *argv[], dns_dlzdb_t **dbp)
133
{
134
135
	dns_dlzimplementation_t *impinfo;
136
	isc_result_t result;
137
138
	/*
139
	 * initialize the dlz_implementations list, this is guaranteed
140
	 * to only really happen once.
141
	 */	
142
	RUNTIME_CHECK(isc_once_do(&once, dlz_initialize) == ISC_R_SUCCESS);
143
144
	/* Performs checks to make sure data is as we expect / require it to be. */
145
	REQUIRE(dbp != NULL && *dbp == NULL);
146
	REQUIRE(dlzname != NULL);
147
	REQUIRE(drivername != NULL);
148
	REQUIRE(mctx != NULL);
149
150
	/* write log message */
151
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
152
	      DNS_LOGMODULE_DLZ, ISC_LOG_INFO,
153
	      "Loading '%s' using driver %s", dlzname, drivername);
154
155
	/* lock the dlz_implementations list so we can search it. */
156
	RWLOCK(&dlz_implock, isc_rwlocktype_read);
157
158
	/* search for the driver implementation	 */
159
	impinfo = dlz_impfind(drivername);
160
	if (impinfo == NULL) {
161
		RWUNLOCK(&dlz_implock, isc_rwlocktype_read);
162
163
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
164
		      DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
165
		      "unsupported DLZ database driver '%s'.  %s not loaded.", 
166
			  drivername, dlzname);
167
168
		return (ISC_R_NOTFOUND);
169
	}
170
171
	/* Allocate memory to hold the DLZ database driver */
172
	(*dbp) = isc_mem_get(mctx, sizeof(dns_dlzdb_t));
173
	if((*dbp) == NULL){
174
		RWUNLOCK(&dlz_implock, isc_rwlocktype_read);
175
		return (ISC_R_NOMEMORY);
176
	}
177
178
	/* Make sure memory region is set to all 0's */
179
	memset((*dbp), 0, sizeof(dns_dlzdb_t));
180
181
	(*dbp)->implementation = impinfo;
182
183
	/* Create a new database using implementation 'drivername'. */
184
	result = ((impinfo->methods->create)(mctx, dlzname, argc, argv, 
185
				impinfo->driverarg, &(*dbp)->dbdata));
186
	
187
	/* mark the DLZ driver as valid */
188
	if(result == ISC_R_SUCCESS){
189
		RWUNLOCK(&dlz_implock, isc_rwlocktype_read);
190
		(*dbp)->magic = DNS_DLZ_MAGIC;
191
		isc_mem_attach(mctx, &(*dbp)->mctx);
192
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
193
		      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
194
		      "DLZ driver loaded successfully.");
195
		return (ISC_R_SUCCESS);
196
	} else {
197
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
198
		      DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
199
		      "DLZ driver failed to load.");
200
	}
201
202
	/* impinfo->methods->create failed. */
203
	RWUNLOCK(&dlz_implock, isc_rwlocktype_read);
204
	isc_mem_put(mctx, (*dbp), sizeof(dns_dlzdb_t));
205
	return (result);
206
}
207
208
void
209
dns_dlzdestroy(dns_dlzdb_t **dbp)
210
{
211
	isc_mem_t *mctx;
212
213
	/* Write debugging message to log */
214
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
215
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
216
	      "Unloading DLZ driver.");
217
218
	/* Perform checks to make sure data is as we expect / require it to be. */
219
	REQUIRE(dbp != NULL && DNS_DLZ_VALID(*dbp));
220
221
	/* call the drivers destroy method */
222
	if((*dbp) != NULL){
223
		mctx = (*dbp)->mctx;
224
		(*dbp)->implementation->methods->destroy((*dbp)->implementation->driverarg,
225
												(*dbp)->dbdata);
226
		/* return memory */
227
		isc_mem_put(mctx, (*dbp), sizeof(dns_dlzdb_t));
228
		isc_mem_detach(&mctx);
229
	}
230
231
	*dbp = NULL;
232
}
233
234
235
isc_result_t
236
dns_dlzfindzone(dns_view_t *view, dns_name_t *name, unsigned int minlabels,
237
				dns_db_t **dbp)
238
{
239
	dns_fixedname_t fname;
240
	dns_name_t *zonename;  
241
	unsigned int namelabels;
242
	unsigned int i;
243
	isc_result_t result;
244
245
	/* Performs checks to make sure data is as we expect / require it to be. */
246
	REQUIRE(DNS_DLZ_VALID(view->dlzdatabase));
247
	REQUIRE(name != NULL);
248
	REQUIRE(dbp != NULL && *dbp == NULL);
249
	
250
	/* setup a "fixed" dns name */
251
	dns_fixedname_init(&fname);
252
	zonename = dns_fixedname_name(&fname);
253
254
	/* count the number of labels in the name */
255
	namelabels = dns_name_countlabels(name);
256
257
	/* 
258
	 * loop through starting with the longest domain name and trying shorter names
259
	 * portions of the name until we find a match, have an error, or are below the
260
	 * 'minlabels' threshold.  minlabels is 0, if the standard database didn't have
261
	 * a zone name match.  Otherwise minlables is the number of labels in that name.
262
	 * We need to beat that for a "better" match for the DLZ database to be
263
	 * authoritative instead of the standard database.
264
	 */
265
	for(i = namelabels; i > minlabels && i > 1; i--){
266
		if(i == namelabels){
267
			result = dns_name_copy(name, zonename, NULL);
268
			if(result != ISC_R_SUCCESS)
269
				return result;
270
		} else{
271
			result = dns_name_splitatdepth(name, i, NULL, zonename);
272
			if(result != ISC_R_SUCCESS)
273
				return result;
274
		}
275
276
		 /* ask SDLZ driver if the zone is supported */
277
		result = view->dlzdatabase->implementation->methods->findzone(
278
								view->dlzdatabase->implementation->driverarg, 
279
								view->dlzdatabase->dbdata, view->dlzdatabase->mctx,
280
								view->rdclass, zonename, dbp);
281
		if(result != ISC_R_NOTFOUND)
282
			return result;
283
	}
284
	return (ISC_R_NOTFOUND);
285
}
286
287
/*
288
 * Registers a DLZ driver.  This basically just adds the dlz
289
 * driver to the list of available drivers in the dlz_implementations list.
290
 */
291
isc_result_t
292
dns_dlzregister(const char *drivername, const dns_dlzmethods_t *methods,
293
		 void *driverarg, isc_mem_t *mctx, dns_dlzimplementation_t **dlzimp)
294
{
295
296
	dns_dlzimplementation_t *dlz_imp;
297
298
	/* Write debugging message to log */
299
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
300
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
301
	      "Registering DLZ driver '%s'", drivername);
302
303
	/* Performs checks to make sure data is as we expect / require it to be. */
304
	REQUIRE(drivername != NULL);
305
	REQUIRE(methods != NULL);
306
	REQUIRE(methods->create != NULL);
307
	REQUIRE(methods->destroy != NULL);
308
	REQUIRE(methods->findzone != NULL);
309
	REQUIRE(mctx != NULL);
310
	REQUIRE(dlzimp != NULL && *dlzimp == NULL);
311
312
	/*
313
	 * initialize the dlz_implementations list, this is guaranteed
314
	 * to only really happen once.
315
	 */
316
	RUNTIME_CHECK(isc_once_do(&once, dlz_initialize) == ISC_R_SUCCESS);
317
318
	/* lock the dlz_implementations list so we can modify it. */
319
	RWLOCK(&dlz_implock, isc_rwlocktype_write);
320
321
	/* check that another already registered driver isn't using the same name */
322
	dlz_imp = dlz_impfind(drivername);
323
	if (dlz_imp != NULL) {
324
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
325
					DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
326
					"DLZ Driver '%s' already registered", drivername);
327
		RWUNLOCK(&dlz_implock, isc_rwlocktype_write);
328
		return (ISC_R_EXISTS);
329
	}
330
	
331
	/* Allocate memory for a dlz_implementation object.  Error if we cannot. */
332
	dlz_imp = isc_mem_get(mctx, sizeof(dns_dlzimplementation_t));
333
	if (dlz_imp == NULL) {
334
		RWUNLOCK(&dlz_implock, isc_rwlocktype_write);
335
		return (ISC_R_NOMEMORY);
336
	}
337
338
	/* Make sure memory region is set to all 0's */
339
	memset(dlz_imp, 0, sizeof(dns_dlzimplementation_t));
340
341
	/* Store the data passed into this method */ 
342
	dlz_imp->name = drivername;
343
	dlz_imp->methods = methods;
344
	dlz_imp->mctx = NULL;
345
	dlz_imp->driverarg = driverarg;
346
347
	/* attach the new dlz_implementation object to a memory context */
348
	isc_mem_attach(mctx, &dlz_imp->mctx);
349
350
	/*
351
	 * prepare the dlz_implementation object to be put in a list,
352
	 * and append it to the list
353
	 */
354
	ISC_LINK_INIT(dlz_imp, link);
355
	ISC_LIST_APPEND(dlz_implementations, dlz_imp, link);
356
357
	/* Unlock the dlz_implementations list.	 */
358
	RWUNLOCK(&dlz_implock, isc_rwlocktype_write);
359
360
	/* Pass back the dlz_implementation that we created. */
361
	*dlzimp = dlz_imp;
362
363
	return (ISC_R_SUCCESS);
364
}
365
366
/* Helper function for dns_dlzstrtoargv().  Pardon the gratuitous recursion. */
367
static isc_result_t
368
dns_dlzstrtoargvsub(isc_mem_t *mctx, char *s, unsigned int *argcp,
369
	     char ***argvp, unsigned int n)
370
{
371
	isc_result_t result;
372
373
restart:	
374
	/* Discard leading whitespace. */
375
	while (*s == ' ' || *s == '\t')
376
		s++;
377
	
378
	if (*s == '\0') {
379
		/* We have reached the end of the string. */
380
		*argcp = n;
381
		*argvp = isc_mem_get(mctx, n * sizeof(char *));
382
		if (*argvp == NULL)
383
			return (ISC_R_NOMEMORY);
384
	} else {
385
		char *p = s;
386
		while (*p != ' ' && *p != '\t' && *p != '\0' && *p != '{'){
387
			if(*p == '\n'){
388
				*p = ' ';
389
				goto restart;
390
			}
391
			p++;
392
		}
393
394
			/* do "grouping", items between { and } are one arg */
395
		if(*p == '{'){
396
			char *t = p;
397
				/* shift all characters to left by 1 to get rid of '{' */
398
			while (*t != '\0'){
399
				t++;
400
				*(t-1) = *t;
401
			}
402
			while (*p != '\0' && *p != '}'){
403
				p++;
404
			}
405
				/* get rid of '}' character */
406
			if (*p == '}'){
407
				*p = '\0';
408
				p++;
409
			}
410
			/* normal case, no "grouping" */
411
		} else if (*p != '\0')
412
			*p++ = '\0';
413
		
414
		result = dns_dlzstrtoargvsub(mctx, p, argcp, argvp, n + 1);
415
		if (result != ISC_R_SUCCESS)
416
			return (result);
417
		(*argvp)[n] = s;
418
	}
419
	return (ISC_R_SUCCESS);
420
}
421
422
/*
423
 * Tokenize the string "s" into whitespace-separated words,
424
 * return the number of words in '*argcp' and an array
425
 * of pointers to the words in '*argvp'.  The caller
426
 * must free the array using isc_mem_put().  The string
427
 * is modified in-place.
428
 */
429
isc_result_t
430
dns_dlzstrtoargv(isc_mem_t *mctx, char *s, unsigned int *argcp, char ***argvp) {
431
	return(dns_dlzstrtoargvsub(mctx, s, argcp, argvp, 0));	
432
}
433
434
/*
435
 * Unregisters a DLZ driver.  This basically just removes the dlz
436
 * driver from the list of available drivers in the dlz_implementations list.
437
 */
438
void
439
dns_dlzunregister(dns_dlzimplementation_t **dlzimp)
440
{
441
	dns_dlzimplementation_t *dlz_imp;
442
	isc_mem_t *mctx;
443
444
	/* Write debugging message to log */
445
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
446
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
447
	      "Unregistering DLZ driver.");
448
449
	/* Performs checks to make sure data is as we expect / require it to be. */
450
	REQUIRE(dlzimp != NULL && *dlzimp != NULL);
451
452
	/*
453
	 * initialize the dlz_implementations list, this is guaranteed
454
	 * to only really happen once.
455
	 */
456
	RUNTIME_CHECK(isc_once_do(&once, dlz_initialize) == ISC_R_SUCCESS);
457
458
	dlz_imp = *dlzimp;
459
460
	/* lock the dlz_implementations list so we can modify it. */
461
	RWLOCK(&dlz_implock, isc_rwlocktype_write);
462
463
	/* remove the dlz_implementation object from the list */
464
	ISC_LIST_UNLINK(dlz_implementations, dlz_imp, link);
465
	mctx = dlz_imp->mctx;
466
467
	/*
468
	 * return the memory back to the available memory pool and remove it from
469
	 * the memory context.
470
	 */
471
	isc_mem_put(mctx, dlz_imp, sizeof(dns_dlzimplementation_t));
472
	isc_mem_detach(&mctx);
473
474
	/* Unlock the dlz_implementations list. */
475
	RWUNLOCK(&dlz_implock, isc_rwlocktype_write);
476
477
}
478
479
#endif
480
(-)bind-9.2.2-orig/lib/dns/include/dns/dlz.h (+264 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
/*
37
 * Copyright (C) 1999-2001  Internet Software Consortium.
38
 *
39
 * Permission to use, copy, modify, and distribute this software for any
40
 * purpose with or without fee is hereby granted, provided that the above
41
 * copyright notice and this permission notice appear in all copies.
42
 *
43
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
44
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
45
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
46
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
47
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
48
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
50
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
51
 */
52
53
54
55
#ifndef DLZ_H
56
#define DLZ_H 1
57
58
/*****
59
 ***** Module Info
60
 *****/
61
62
/*
63
 * DLZ Interface
64
 *
65
 * The DLZ interface allows zones to be looked up using a driver instead of
66
 * Bind's default in memory zone table.
67
 *
68
 *
69
 * Reliability:
70
 *	No anticipated impact.
71
 *
72
 * Resources:
73
 *
74
 * Security:
75
 *	No anticipated impact.
76
 *
77
 * Standards:
78
 *	None.
79
 */
80
81
/*****
82
 ***** Imports
83
 *****/
84
85
#include <dns/name.h>
86
#include <dns/types.h>
87
#include <dns/view.h>
88
89
#include <isc/lang.h>
90
91
ISC_LANG_BEGINDECLS
92
93
/***
94
 *** Types
95
 ***/
96
97
#define DNS_DLZ_MAGIC		ISC_MAGIC('D','L','Z','D')
98
#define DNS_DLZ_VALID(dlz)	ISC_MAGIC_VALID(dlz, DNS_DLZ_MAGIC)
99
100
typedef isc_result_t
101
(*dns_dlzallowzonexfr_t)(void *driverarg, void *dbdata, isc_mem_t *mctx, 
102
					 dns_rdataclass_t rdclass, dns_name_t *name, isc_sockaddr_t *clientaddr, 
103
					 dns_db_t **dbp);
104
105
/* 
106
 * Method prototype.  Drivers implementing the DLZ interface MUST supply an
107
 * allow zone transfer method.  This method is called when the DNS server is performing
108
 * a zone transfer query.
109
 * The driver's method should return ISC_R_SUCCESS and a database pointer
110
 * to the name server if the zone is supported by the database, and zone transfer is allowed.
111
 * Otherwise it will return ISC_R_NOTFOUND if the zone is not supported by the database, or
112
 * ISC_R_NOPERM if zone transfers are not allowed.
113
 * If an error occurs it should return a result code indicating the type of error.
114
 */
115
116
typedef isc_result_t
117
(*dns_dlzcreate_t)(isc_mem_t *mctx, const char *dlzname, unsigned int argc,
118
				char *argv[], void *driverarg, void **dbdata);
119
120
/* 
121
 * Method prototype.  Drivers implementing the DLZ interface MUST supply a
122
 * create method.  This method is called when the DNS server is starting up
123
 * and creating drivers for use later.
124
 */
125
126
typedef void
127
(*dns_dlzdestroy_t)(void *driverarg, void **dbdata);
128
129
/* 
130
 * Method prototype.  Drivers implementing the DLZ interface MUST supply a
131
 * destroy method.  This method is called when the DNS server is shuting down
132
 * and no longer needs the driver.
133
 */
134
135
typedef isc_result_t
136
(*dns_dlzfindzone_t)(void *driverarg, void *dbdata, isc_mem_t *mctx, 
137
					 dns_rdataclass_t rdclass, dns_name_t *name, dns_db_t **dbp);
138
139
/* 
140
 * Method prototype.  Drivers implementing the DLZ interface MUST supply a
141
 * find zone method.  This method is called when the DNS server is performing a query.
142
 * The find zone method will be called with the longest possible name first, and continue
143
 * to be called with successively shorter domain names, until any of the following occur:
144
 *	1) a match is found, and the function returns (ISC_R_SUCCESS)
145
 *	2) a problem occurs, and the functions returns anything other than (ISC_R_NOTFOUND)
146
 *	3) we run out of domain name labels. I.E. we have tried the shortest domain name
147
 *	4) the number of labels in the domain name is less than min_lables for dns_dlzfindzone
148
 *
149
 * The driver's find zone method should return ISC_R_SUCCESS and a database pointer
150
 * to the name server if the zone is supported by the database.  Otherwise 
151
 * it will return ISC_R_NOTFOUND, and a null pointer if the zone is not supported.
152
 * If an error occurs it should return a result code indicating the type of error.
153
 */
154
155
 /* the methods supplied by a DLZ driver */
156
typedef struct dns_dlzmethods {
157
	dns_dlzcreate_t			create;
158
	dns_dlzdestroy_t		destroy;
159
	dns_dlzfindzone_t		findzone;
160
	dns_dlzallowzonexfr_t	allowzonexfr;
161
} dns_dlzmethods_t;
162
163
 /* information about a DLZ driver */
164
struct dns_dlzimplementation {
165
	const char				*name;
166
	const dns_dlzmethods_t	*methods;
167
	isc_mem_t				*mctx;
168
	void					*driverarg;
169
	ISC_LINK(dns_dlzimplementation_t)	link;
170
};
171
172
 /* an instance of a DLZ driver */
173
struct dns_dlzdb{
174
	unsigned int			magic;
175
	isc_mem_t				*mctx;
176
	dns_dlzimplementation_t	*implementation;
177
	void					*dbdata;
178
};
179
180
181
/***
182
 *** Method declarations
183
 ***/
184
185
isc_result_t
186
dns_dlzallowzonexfr(dns_view_t *view, dns_name_t *name, isc_sockaddr_t *clientaddr, dns_db_t **dbp);
187
188
/*
189
 * This method is called when the DNS server is performing a zone transfer query.  It will call
190
 * the DLZ driver's allow zone tranfer method.
191
 */
192
193
isc_result_t
194
dns_dlzcreate(isc_mem_t *mctx, const char *dlzname, const char *drivername, unsigned int argc,
195
		   char *argv[], dns_dlzdb_t **dbp);
196
197
/* 
198
 * This method is called when the DNS server is starting up and creating drivers for use later.
199
 * It will search the DLZ driver list for 'drivername' and return a DLZ driver via dbp if a match
200
 * is found.  If the DLZ driver supplies a create method, this function will call it.
201
 */
202
203
void
204
dns_dlzdestroy(dns_dlzdb_t **dbp);
205
206
/* 
207
 * This method is called when the DNS server is shuting down and no longer needs the driver. 
208
 * If the DLZ driver supplies a destroy methods, this function will call it.  
209
 */
210
211
isc_result_t
212
dns_dlzfindzone(dns_view_t *view, dns_name_t *name, unsigned int minlabels, dns_db_t **dbp);
213
214
/*
215
 * This method is called when the DNS server is performing a query.  It will call the DLZ
216
 * driver's find zone method.
217
 */
218
219
isc_result_t
220
dns_dlzregister(const char *drivername, const dns_dlzmethods_t *methods,
221
		 void *driverarg, isc_mem_t *mctx, dns_dlzimplementation_t **dlzimp);
222
223
/*
224
 * Register a dynamically loadable zones (DLZ) driver for the database type 'drivername',
225
 * implemented by the functions in '*methods'.
226
 *
227
 * dlzimp must point to a NULL dlz_implementation_t pointer.  That is,
228
 * dlzimp != NULL && *dlzimp == NULL.  It will be assigned a value that
229
 * will later be used to identify the driver when deregistering it.
230
 */
231
232
isc_result_t
233
dns_dlzstrtoargv(isc_mem_t *mctx, char *s, unsigned int *argcp, char ***argvp);
234
235
/*
236
 * This method is called when the name server is starting up to parse the DLZ driver
237
 * command line from named.conf.  Basically it splits up a string into and argc / argv.
238
 * The primary difference of this method is items between braces { } are considered
239
 * only 1 word.  for example the command line "this is { one grouped phrase } and this isn't"
240
 * would be parsed into:
241
 * argv[0]: "this"
242
 * argv[1]: "is"
243
 * argv{2]: " one grouped phrase "
244
 * argv[3]: "and"
245
 * argv[4]: "this"
246
 * argv{5}: "isn't"
247
 * braces should NOT be nested, more than one grouping in the command line is allowed.
248
 * Notice, argv[2] has an extra space at the beginning and end.  Extra spaces are not stripped
249
 * between a grouping.  You can do so in your driver if needed, or be sure not to put extra
250
 * spaces before / after the braces.
251
 */
252
253
void
254
dns_dlzunregister(dns_dlzimplementation_t **dlzimp);
255
256
/*
257
 * Removes the dlz driver from the list of registered dlz drivers.
258
 * There must be no active dlz drivers of this type when this function
259
 * is called.
260
 */
261
262
ISC_LANG_ENDDECLS
263
264
#endif /* DLZ_H */
(-)bind-9.2.2-orig/lib/dns/include/dns/log.h (+3 lines)
Lines 68-73 Link Here
68
#define DNS_LOGMODULE_SDB		(&dns_modules[22])
68
#define DNS_LOGMODULE_SDB		(&dns_modules[22])
69
#define DNS_LOGMODULE_DIFF		(&dns_modules[23])
69
#define DNS_LOGMODULE_DIFF		(&dns_modules[23])
70
#define DNS_LOGMODULE_HINTS		(&dns_modules[24])
70
#define DNS_LOGMODULE_HINTS		(&dns_modules[24])
71
#ifdef DLZ
72
#define DNS_LOGMODULE_DLZ       (&dns_modules[25])
73
#endif
71
74
72
ISC_LANG_BEGINDECLS
75
ISC_LANG_BEGINDECLS
73
76
(-)bind-9.2.2-orig/lib/dns/include/dns/sdlz.h (+244 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
/*
37
 * Copyright (C) 1999-2001  Internet Software Consortium.
38
 *
39
 * Permission to use, copy, modify, and distribute this software for any
40
 * purpose with or without fee is hereby granted, provided that the above
41
 * copyright notice and this permission notice appear in all copies.
42
 *
43
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
44
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
45
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
46
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
47
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
48
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
50
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
51
 */
52
53
#ifndef SDLZ_H
54
#define SDLZ_H 1
55
56
#include <dns/dlz.h>
57
58
ISC_LANG_BEGINDECLS
59
60
#define DNS_SDLZFLAG_THREADSAFE		0x00000001U
61
#define DNS_SDLZFLAG_RELATIVEOWNER	0x00000002U
62
#define DNS_SDLZFLAG_RELATIVERDATA	0x00000004U
63
64
 /* A simple DLZ database. */
65
typedef struct dns_sdlz_db dns_sdlz_db_t;
66
67
 /* A simple DLZ database lookup in progress. */
68
typedef struct dns_sdlzlookup dns_sdlzlookup_t;
69
70
 /* A simple DLZ database traversal in progress. */
71
typedef struct dns_sdlzallnodes dns_sdlzallnodes_t;
72
73
74
typedef isc_result_t
75
(*dns_sdlzallnodesfunc_t)(const char *zone, void *driverarg, void *dbdata,
76
			 dns_sdlzallnodes_t *allnodes);
77
78
/* 
79
 * Method prototype.  Drivers implementing the SDLZ interface may supply an
80
 * all nodes method.  This method is called when the DNS server is performing a 
81
 * zone transfer query, after the allow zone transfer method has been called.
82
 * This method is only called if the allow zone transfer method returned 
83
 * ISC_R_SUCCESS.  This method and the allow zone transfer method are both
84
 * required for zone transfers to be supported.  If the driver generates data
85
 * dynamically (instead of searching in a database for it) it should not implement
86
 * this function as a zone transfer would be meaningless.  A SDLZ driver does not
87
 * have to implement an all nodes method.
88
 */
89
90
typedef isc_result_t
91
(*dns_sdlzallowzonexfr_t)(void *driverarg, void *dbdata, const char *name,
92
                                                            const char *client);
93
94
/*
95
 * Method prototype.  Drivers implementing the SDLZ interface may supply an
96
 * allow zone transfer method.  This method is called when the DNS server is
97
 * performing a zone transfer query, before the all nodes method can be called.
98
 * This method and the all node method are both required for zone transfers to be
99
 * supported.  If the driver generates data dynamically (instead of searching in
100
 * a database for it) it should not implement this function as a zone transfer
101
 * would be meaningless.  A SDLZ driver does not have to implement an allow
102
 * zone transfer method.
103
 * This method should return ISC_R_SUCCESS if the zone is supported
104
 * by the database and a zone transfer is allowed for the specified client.
105
 * If the zone is supported by the database, but zone transfers are not allowed
106
 * for the specified client this method should return ISC_R_NOPERM..
107
 * Lastly the method should return ISC_R_NOTFOUND if the zone is not supported
108
 * by the database.  If an error occurs it should return a result code
109
 * indicating the type of error.
110
 */
111
112
113
typedef isc_result_t
114
(*dns_sdlzauthorityfunc_t)(const char *zone, void *driverarg, void *dbdata,
115
			  dns_sdlzlookup_t *lookup);
116
117
/* 
118
 * Method prototype.  Drivers implementing the SDLZ interface may supply an
119
 * authority method.  This method is called when the DNS server is performing a query,
120
 * after both the find zone and lookup methods have been called.  This method
121
 * is required if the lookup function does not supply authority information for
122
 * the dns record. A SDLZ driver does not have to implement an authority method.
123
 */
124
125
typedef isc_result_t
126
(*dns_sdlzcreate_t)(const char *dlzname, unsigned int argc, char *argv[],
127
				   void *driverarg, void **dbdata);
128
129
/* 
130
 * Method prototype.  Drivers implementing the SDLZ interface may supply a
131
 * create method.  This method is called when the DNS server is starting up
132
 * and creating drivers for use later. A SDLZ driver does not have to implement
133
 * a create method.
134
 */
135
136
typedef void
137
(*dns_sdlzdestroy_t)(void *driverarg, void *dbdata);
138
139
/* 
140
 * Method prototype.  Drivers implementing the SDLZ interface may supply a
141
 * destroy method.  This method is called when the DNS server is shuting down
142
 * and no longer needs the driver.  A SDLZ driver does not have to implement
143
 * a destroy method.
144
 */
145
146
typedef isc_result_t
147
(*dns_sdlzfindzone_t)(void *driverarg, void *dbdata, const char *name);
148
149
/* 
150
 * Method prototype.  Drivers implementing the SDLZ interface MUST supply a
151
 * find zone method.  This method is called when the DNS server is performing a
152
 * query to to determine if 'name' is a supported dns zone.
153
 * The find zone method will be called with the longest possible name first,
154
 * and continue to be called with successively shorter domain names, until
155
 * any of the following occur:
156
 *	1) the function returns (ISC_R_SUCCESS) indicating a zone name match.
157
 *	2) a problem occurs, and the functions returns anything other than (ISC_R_NOTFOUND)
158
 *	3) we run out of domain name labels. I.E. we have tried the shortest domain name
159
 *	4) the number of labels in the domain name is less than min_lables for dns_dlzfindzone
160
 *
161
 * The driver's find zone method should return ISC_R_SUCCESS if the zone is
162
 * supported by the database.  Otherwise it should return ISC_R_NOTFOUND, if 
163
 * the zone is not supported.  If an error occurs it should return a result
164
 * code indicating the type of error.
165
 */
166
167
typedef isc_result_t
168
(*dns_sdlzlookupfunc_t)(const char *zone, const char *name, void *driverarg, 
169
			void *dbdata, dns_sdlzlookup_t *lookup);
170
171
/* 
172
 * Method prototype.  Drivers implementing the SDLZ interface MUST supply a
173
 * lookup method.  This method is called when the DNS server is performing a query,
174
 * after the find zone and before any other methods have been called.  This function
175
 * returns record DNS record information using the dns_sdlz_putrr and dns_sdlz_putsoa
176
 * functions.  If this function supplies authority information for the DNS record
177
 * the authority method is not required.  If it does not, the authority function is
178
 * required.  A SDLZ driver must implement a lookup method.
179
 */
180
181
typedef struct dns_sdlzmethods {
182
	dns_sdlzcreate_t	create;
183
	dns_sdlzdestroy_t	destroy;
184
	dns_sdlzfindzone_t	findzone;
185
	dns_sdlzlookupfunc_t	lookup;
186
	dns_sdlzauthorityfunc_t	authority;
187
	dns_sdlzallnodesfunc_t	allnodes;
188
	dns_sdlzallowzonexfr_t	allowzonexfr;
189
} dns_sdlzmethods_t;
190
191
isc_result_t
192
dns_sdlzregister(const char *drivername, const dns_sdlzmethods_t *methods,
193
		 void *driverarg, unsigned int flags, isc_mem_t *mctx,
194
		 dns_sdlzimplementation_t **sdlzimp);
195
/*
196
 * Register a dynamically loadable zones (dlz) driver for the database type
197
 * 'drivername', implemented by the functions in '*methods'.
198
 *
199
 * sdlzimp must point to a NULL dns_sdlzimplementation_t pointer.  That is,
200
 * sdlzimp != NULL && *sdlzimp == NULL.  It will be assigned a value that
201
 * will later be used to identify the driver when deregistering it.
202
 */
203
204
void
205
dns_sdlzunregister(dns_sdlzimplementation_t **sdlzimp);
206
207
/*
208
 * Removes the sdlz driver from the list of registered sdlz drivers.
209
 * There must be no active sdlz drivers of this type when this function
210
 * is called.
211
 */
212
213
isc_result_t
214
dns_sdlz_putnamedrr(dns_sdlzallnodes_t *allnodes, const char *name,
215
		   const char *type, dns_ttl_t ttl, const char *data);
216
/*
217
 * Add a single resource record to the allnodes structure to be later
218
 * parsed into a zone transfer response.
219
 */
220
221
isc_result_t
222
dns_sdlz_putrr(dns_sdlzlookup_t *lookup, const char *type, dns_ttl_t ttl,
223
	      const char *data);
224
/*
225
 * Add a single resource record to the lookup structure to be later
226
 * parsed into a query response.
227
 */
228
229
isc_result_t
230
dns_sdlz_putsoa(dns_sdlzlookup_t *lookup, const char *mname, const char *rname,
231
	       isc_uint32_t serial);
232
/*
233
 * This function may optionally be called from the 'authority' callback
234
 * to simplify construction of the SOA record for 'zone'.  It will
235
 * provide a SOA listing 'mname' as as the master server and 'rname' as
236
 * the responsible person mailbox.  It is the responsibility of the
237
 * driver to increment the serial number between responses if necessary.
238
 * All other SOA fields will have reasonable default values.
239
 */
240
241
242
ISC_LANG_ENDDECLS
243
244
#endif /* SDLZ_H */
(-)bind-9.2.2-orig/lib/dns/include/dns/types.h (+5 lines)
Lines 51-56 Link Here
51
typedef void					dns_dbnode_t;
51
typedef void					dns_dbnode_t;
52
typedef struct dns_dbtable			dns_dbtable_t;
52
typedef struct dns_dbtable			dns_dbtable_t;
53
typedef void					dns_dbversion_t;
53
typedef void					dns_dbversion_t;
54
#ifdef DLZ
55
typedef struct dns_dlzimplementation	dns_dlzimplementation_t;
56
typedef struct dns_dlzdb				dns_dlzdb_t;
57
typedef struct dns_sdlzimplementation	dns_sdlzimplementation_t;
58
#endif
54
typedef struct dns_decompress			dns_decompress_t;
59
typedef struct dns_decompress			dns_decompress_t;
55
typedef struct dns_dispatch			dns_dispatch_t;
60
typedef struct dns_dispatch			dns_dispatch_t;
56
typedef struct dns_dispatchevent		dns_dispatchevent_t;
61
typedef struct dns_dispatchevent		dns_dispatchevent_t;
(-)bind-9.2.2-orig/lib/dns/include/dns/view.h (+3 lines)
Lines 82-87 Link Here
82
	dns_rdataclass_t		rdclass;
82
	dns_rdataclass_t		rdclass;
83
	char *				name;
83
	char *				name;
84
	dns_zt_t *			zonetable;
84
	dns_zt_t *			zonetable;
85
#ifdef DLZ
86
    dns_dlzdb_t *       dlzdatabase;
87
#endif
85
	dns_resolver_t *		resolver;
88
	dns_resolver_t *		resolver;
86
	dns_adb_t *			adb;
89
	dns_adb_t *			adb;
87
	dns_requestmgr_t *		requestmgr;
90
	dns_requestmgr_t *		requestmgr;
(-)bind-9.2.2-orig/lib/dns/log.c (+3 lines)
Lines 73-78 Link Here
73
	{ "dns/sdb",		0 },
73
	{ "dns/sdb",		0 },
74
	{ "dns/diff",		0 },
74
	{ "dns/diff",		0 },
75
	{ "dns/hints",		0 },
75
	{ "dns/hints",		0 },
76
#ifdef DLZ
77
    { "dns/dlz",        0 },
78
#endif
76
	{ NULL, 		0 }
79
	{ NULL, 		0 }
77
};
80
};
78
81
(-)bind-9.2.2-orig/lib/dns/sdlz.c (+1761 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
3
 * 
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the
6
 * above copyright notice and this permission notice appear in all
7
 * copies.
8
 * 
9
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
10
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
12
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
16
 * USE OR PERFORMANCE OF THIS SOFTWARE.
17
 * 
18
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
19
 * conceived and contributed by Rob Butler.
20
 * 
21
 * Permission to use, copy, modify, and distribute this software for any
22
 * purpose with or without fee is hereby granted, provided that the
23
 * above copyright notice and this permission notice appear in all
24
 * copies.
25
 * 
26
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
27
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
28
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
29
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
30
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
31
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
32
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
33
 * USE OR PERFORMANCE OF THIS SOFTWARE.
34
 */
35
36
/*
37
 * Copyright (C) 1999-2001  Internet Software Consortium.
38
 *
39
 * Permission to use, copy, modify, and distribute this software for any
40
 * purpose with or without fee is hereby granted, provided that the above
41
 * copyright notice and this permission notice appear in all copies.
42
 *
43
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
44
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
45
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
46
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
47
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
48
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
50
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
51
 */
52
53
#ifdef DLZ
54
55
#include <config.h>
56
#include <string.h>
57
58
#include <isc/buffer.h>
59
#include <isc/lex.h>
60
#include <isc/log.h>
61
#include <isc/rwlock.h>
62
#include <isc/string.h>
63
#include <isc/util.h>
64
#include <isc/magic.h>
65
#include <isc/mem.h>
66
#include <isc/once.h>
67
#include <isc/print.h>
68
#include <isc/region.h>
69
70
#include <dns/callbacks.h>
71
#include <dns/db.h>
72
#include <dns/dbiterator.h>
73
#include <dns/dlz.h>
74
#include <dns/fixedname.h>
75
#include <dns/log.h>
76
#include <dns/rdata.h>
77
#include <dns/rdatalist.h>
78
#include <dns/rdataset.h>
79
#include <dns/rdatasetiter.h>
80
#include <dns/rdatatype.h>
81
#include <dns/result.h>
82
#include <dns/master.h>
83
#include <dns/sdlz.h>
84
#include <dns/types.h>
85
86
#include "rdatalist_p.h"
87
88
/***
89
 *** Private Types
90
 ***/
91
92
struct dns_sdlzimplementation {
93
	const dns_sdlzmethods_t		*methods;
94
	isc_mem_t					*mctx;
95
	void						*driverarg;
96
	unsigned int				flags;
97
	isc_mutex_t					driverlock;
98
	dns_dlzimplementation_t		*dlz_imp;
99
};
100
101
struct dns_sdlz_db {
102
    /* Unlocked */
103
	dns_db_t					common;  
104
	void						*dbdata;
105
	dns_sdlzimplementation_t	*dlzimp;
106
	isc_mutex_t					refcnt_lock;
107
	/* Locked */
108
	unsigned int				references;
109
};
110
111
struct dns_sdlzlookup {
112
	/* Unlocked */
113
	unsigned int				magic;
114
	dns_sdlz_db_t				*sdlz;
115
	ISC_LIST(dns_rdatalist_t)	lists;
116
	ISC_LIST(isc_buffer_t)		buffers;
117
	dns_name_t					*name;
118
	ISC_LINK(dns_sdlzlookup_t)	link;
119
	isc_mutex_t					lock;
120
	dns_rdatacallbacks_t		callbacks;
121
	/* Locked */
122
	unsigned int				references;
123
};
124
125
typedef struct dns_sdlzlookup dns_sdlznode_t;
126
127
struct dns_sdlzallnodes {
128
	dns_dbiterator_t			common;
129
	ISC_LIST(dns_sdlznode_t)	nodelist;
130
	dns_sdlznode_t				*current;
131
	dns_sdlznode_t				*origin;
132
};
133
134
typedef dns_sdlzallnodes_t sdlz_dbiterator_t;
135
136
typedef struct sdlz_rdatasetiter {
137
	dns_rdatasetiter_t			common;
138
	dns_rdatalist_t				*current;
139
} sdlz_rdatasetiter_t;
140
141
142
#define SDLZDB_MAGIC		ISC_MAGIC('D', 'L', 'Z', 'S')
143
144
/*
145
 * Note that "impmagic" is not the first four bytes of the struct, so
146
 * ISC_MAGIC_VALID cannot be used.
147
 */
148
149
#define VALID_SDLZDB(sdlzdb)		((sdlzdb) != NULL && \
150
				 (sdlzdb)->common.impmagic == SDLZDB_MAGIC)
151
152
#define SDLZLOOKUP_MAGIC		ISC_MAGIC('D','L','Z','L')
153
#define VALID_SDLZLOOKUP(sdlzl)	ISC_MAGIC_VALID(sdlzl, SDLZLOOKUP_MAGIC)
154
#define VALID_SDLZNODE(sdlzn)	VALID_SDLZLOOKUP(sdlzn)
155
156
/* These values are taken from RFC 1537 */
157
#define SDLZ_DEFAULT_REFRESH	(60 * 60 * 8)
158
#define SDLZ_DEFAULT_RETRY	    (60 * 60 * 2)
159
#define SDLZ_DEFAULT_EXPIRE	    (60 * 60 * 24 * 7)
160
#define SDLZ_DEFAULT_MINIMUM	(60 * 60 * 24)
161
162
/* This is a reasonable value */
163
#define SDLZ_DEFAULT_TTL		(60 * 60 * 24)
164
165
void dns_sdlz_tolower(char *str);
166
167
isc_result_t
168
dns_sdlzcreateDBP(isc_mem_t *mctx, void *driverarg, void *dbdata,
169
	  dns_name_t *name, dns_rdataclass_t rdclass, dns_db_t **dbp);
170
171
isc_result_t
172
dns_sdlzallowzonexfr(void *driverarg, void *dbdata, isc_mem_t *mctx, 
173
			 dns_rdataclass_t rdclass, dns_name_t *name,
174
        	         isc_sockaddr_t *clientaddr, dns_db_t **dbp);
175
176
isc_result_t
177
dns_sdlzcreate(isc_mem_t *mctx, const char *dlzname, unsigned int argc,
178
			char *argv[], void *driverarg, void **dbdata);
179
180
void
181
dns_sdlzdestroy(void *driverdata, void **dbdata);
182
183
isc_result_t
184
dns_sdlzfindzone(void *driverarg, void *dbdata, isc_mem_t *mctx, 
185
	 dns_rdataclass_t rdclass, dns_name_t *name, dns_db_t **dbp);
186
187
static int dummy;              
188
189
static isc_result_t findrdataset(dns_db_t *db, dns_dbnode_t *node,
190
				 dns_dbversion_t *version,
191
				 dns_rdatatype_t type, dns_rdatatype_t covers,
192
				 isc_stdtime_t now, dns_rdataset_t *rdataset,
193
				 dns_rdataset_t *sigrdataset);
194
195
static isc_result_t createnode(dns_sdlz_db_t *sdlz, dns_sdlznode_t **nodep);
196
197
static void destroynode(dns_sdlznode_t *node);
198
199
static void detachnode(dns_db_t *db, dns_dbnode_t **targetp);
200
201
202
static void list_tordataset(dns_rdatalist_t *rdatalist,
203
			    dns_db_t *db, dns_dbnode_t *node,
204
			    dns_rdataset_t *rdataset);
205
206
static void		dbiterator_destroy(dns_dbiterator_t **iteratorp);
207
static isc_result_t	dbiterator_first(dns_dbiterator_t *iterator);
208
static isc_result_t	dbiterator_last(dns_dbiterator_t *iterator);
209
static isc_result_t	dbiterator_seek(dns_dbiterator_t *iterator,
210
					dns_name_t *name);
211
static isc_result_t	dbiterator_prev(dns_dbiterator_t *iterator);
212
static isc_result_t	dbiterator_next(dns_dbiterator_t *iterator);
213
static isc_result_t	dbiterator_current(dns_dbiterator_t *iterator,
214
					   dns_dbnode_t **nodep,
215
					   dns_name_t *name);
216
static isc_result_t	dbiterator_pause(dns_dbiterator_t *iterator);
217
static isc_result_t	dbiterator_origin(dns_dbiterator_t *iterator,
218
					  dns_name_t *name);
219
220
static dns_dbiteratormethods_t dbiterator_methods = {
221
	dbiterator_destroy,
222
	dbiterator_first,
223
	dbiterator_last,
224
	dbiterator_seek,
225
	dbiterator_prev,
226
	dbiterator_next,
227
	dbiterator_current,
228
	dbiterator_pause,
229
	dbiterator_origin
230
};
231
232
static void		rdatasetiter_destroy(dns_rdatasetiter_t **iteratorp);
233
static isc_result_t	rdatasetiter_first(dns_rdatasetiter_t *iterator);
234
static isc_result_t	rdatasetiter_next(dns_rdatasetiter_t *iterator);
235
static void		rdatasetiter_current(dns_rdatasetiter_t *iterator,
236
					     dns_rdataset_t *rdataset);
237
238
static dns_rdatasetitermethods_t rdatasetiter_methods = {
239
	rdatasetiter_destroy,
240
	rdatasetiter_first,
241
	rdatasetiter_next,
242
	rdatasetiter_current
243
};
244
245
#define MAYBE_LOCK(imp)												\
246
		do {														\
247
				unsigned int flags = imp->flags;					\
248
				if((flags & DNS_SDLZFLAG_THREADSAFE) == 0)			\
249
					LOCK(&imp->driverlock);							\
250
		} while(0)
251
252
#define MAYBE_UNLOCK(imp)											\
253
		do {														\
254
				unsigned int flags = imp->flags;					\
255
				if((flags & DNS_SDLZFLAG_THREADSAFE) == 0)			\
256
					UNLOCK(&imp->driverlock);						\
257
		} while(0)
258
259
/***
260
 *** Functions
261
 ***/
262
    
263
    /* Converts the input string to lowercase, in place. */
264
265
void
266
dns_sdlz_tolower(char *str) {
267
268
    unsigned int len = strlen(str);
269
	 unsigned int i;
270
271
    for(i = 0; i < len; i++){
272
        if(str[i] >= 'A' && str[i] <= 'Z')
273
            str[i] += 32;
274
    }
275
276
}
277
278
static inline unsigned int
279
initial_size(const char *data) {
280
/*	unsigned int len = strlen(data);
281
	unsigned int size;
282
	for (size = 64; size < (64 * 1024); size *= 2)
283
		if (len < size)
284
			return (size);
285
	return (64 * 1024);
286
*/
287
   unsigned int len = (strlen(data) / 64) + 1;
288
	return len * 64 + 64;
289
}
290
291
isc_result_t
292
dns_sdlz_putrr(dns_sdlzlookup_t *lookup, const char *type, dns_ttl_t ttl,
293
	      const char *data)
294
{
295
	dns_rdatalist_t *rdatalist;
296
	dns_rdata_t *rdata;
297
	dns_rdatatype_t typeval;
298
	isc_consttextregion_t r;
299
	isc_buffer_t b;
300
	isc_buffer_t *rdatabuf;
301
	isc_lex_t *lex;
302
	isc_result_t result;
303
	unsigned int size;
304
	isc_mem_t *mctx;
305
	dns_name_t *origin;
306
307
	REQUIRE(VALID_SDLZLOOKUP(lookup));
308
	REQUIRE(type != NULL);
309
	REQUIRE(data != NULL);
310
311
	mctx = lookup->sdlz->common.mctx;
312
313
	r.base = type;
314
	r.length = strlen(type);
315
	result = dns_rdatatype_fromtext(&typeval, (isc_textregion_t *)&r);
316
	if (result != ISC_R_SUCCESS)
317
		return (result);
318
319
	rdatalist = ISC_LIST_HEAD(lookup->lists);
320
	while (rdatalist != NULL) {
321
		if (rdatalist->type == typeval)
322
			break;
323
		rdatalist = ISC_LIST_NEXT(rdatalist, link);
324
	}
325
326
	if (rdatalist == NULL) {
327
		rdatalist = isc_mem_get(mctx, sizeof(dns_rdatalist_t));
328
		if (rdatalist == NULL)
329
			return (ISC_R_NOMEMORY);
330
		rdatalist->rdclass = lookup->sdlz->common.rdclass;
331
		rdatalist->type = typeval;
332
		rdatalist->covers = 0;
333
		rdatalist->ttl = ttl;
334
		ISC_LIST_INIT(rdatalist->rdata);
335
		ISC_LINK_INIT(rdatalist, link);
336
		ISC_LIST_APPEND(lookup->lists, rdatalist, link);
337
	} else 
338
		if (rdatalist->ttl != ttl)
339
			return (DNS_R_BADTTL);
340
341
	rdata = isc_mem_get(mctx, sizeof(dns_rdata_t));
342
	if (rdata == NULL)
343
		return (ISC_R_NOMEMORY);
344
	dns_rdata_init(rdata);
345
346
	if ((lookup->sdlz->dlzimp->flags & DNS_SDLZFLAG_RELATIVERDATA) != 0)
347
		origin = &lookup->sdlz->common.origin;
348
	else
349
		origin = dns_rootname;
350
351
	lex = NULL;
352
	result = isc_lex_create(mctx, 64, &lex);
353
	if (result != ISC_R_SUCCESS)
354
		goto failure;
355
356
	size = initial_size(data);
357
	do {
358
		isc_buffer_init(&b, data, strlen(data));
359
		isc_buffer_add(&b, strlen(data));
360
361
		result = isc_lex_openbuffer(lex, &b);
362
		if (result != ISC_R_SUCCESS)
363
			goto failure;
364
365
		rdatabuf = NULL;
366
		result = isc_buffer_allocate(mctx, &rdatabuf, size);
367
		if (result != ISC_R_SUCCESS)
368
			goto failure;
369
370
		result = dns_rdata_fromtext(rdata, rdatalist->rdclass,
371
					    rdatalist->type, lex,
372
					    origin, ISC_FALSE,
373
					    mctx, rdatabuf,
374
					    &lookup->callbacks);
375
		if (result != ISC_R_SUCCESS)
376
			isc_buffer_free(&rdatabuf);
377
		size *= 2;
378
	} while (result == ISC_R_NOSPACE);
379
380
	if (result != ISC_R_SUCCESS)
381
		goto failure;
382
383
	ISC_LIST_APPEND(rdatalist->rdata, rdata, link);
384
	ISC_LIST_APPEND(lookup->buffers, rdatabuf, link);
385
386
	if (lex != NULL)
387
		isc_lex_destroy(&lex);
388
389
	return (ISC_R_SUCCESS);
390
391
 failure:
392
393
 	if (rdatabuf != NULL)
394
		isc_buffer_free(&rdatabuf);
395
	if (lex != NULL)
396
		isc_lex_destroy(&lex);
397
	isc_mem_put(mctx, rdata, sizeof(dns_rdata_t));
398
399
	return (result);
400
}
401
402
isc_result_t
403
dns_sdlz_putnamedrr(dns_sdlzallnodes_t *allnodes, const char *name,
404
		   const char *type, dns_ttl_t ttl, const char *data)
405
{
406
	dns_name_t *newname, *origin;
407
	dns_fixedname_t fnewname;
408
	dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)allnodes->common.db;
409
	dns_sdlznode_t *sdlznode;
410
	isc_mem_t *mctx = sdlz->common.mctx;
411
	isc_buffer_t b;
412
	isc_result_t result;
413
414
	dns_fixedname_init(&fnewname);
415
	newname = dns_fixedname_name(&fnewname);
416
417
	if ((sdlz->dlzimp->flags & DNS_SDLZFLAG_RELATIVERDATA) != 0)
418
		origin = &sdlz->common.origin;
419
	else
420
		origin = dns_rootname;
421
	isc_buffer_init(&b, name, strlen(name));
422
	isc_buffer_add(&b, strlen(name));
423
424
	result = dns_name_fromtext(newname, &b, origin, ISC_FALSE, NULL);
425
	if (result != ISC_R_SUCCESS)
426
		return (result);
427
428
	if (allnodes->common.relative_names) {
429
		/* All names are relative to the root */
430
		unsigned int nlabels = dns_name_countlabels(newname);
431
		dns_name_getlabelsequence(newname, 0, nlabels - 1, newname);
432
	}
433
434
	sdlznode = ISC_LIST_HEAD(allnodes->nodelist);
435
	if (sdlznode == NULL || !dns_name_equal(sdlznode->name, newname)) {
436
		sdlznode = NULL;
437
		result = createnode(sdlz, &sdlznode);
438
		if (result != ISC_R_SUCCESS)
439
			return (result);
440
		sdlznode->name = isc_mem_get(mctx, sizeof(dns_name_t));
441
		if (sdlznode->name == NULL) {
442
			destroynode(sdlznode);
443
			return (ISC_R_NOMEMORY);
444
		}
445
		dns_name_init(sdlznode->name, NULL);
446
		result = dns_name_dup(newname, mctx, sdlznode->name);
447
		if (result != ISC_R_SUCCESS) {
448
			isc_mem_put(mctx, sdlznode->name, sizeof(dns_name_t));
449
			destroynode(sdlznode);
450
			return (result);
451
		}
452
		ISC_LIST_PREPEND(allnodes->nodelist, sdlznode, link);
453
		if (allnodes->origin == NULL &&
454
		    dns_name_equal(newname, &sdlz->common.origin))
455
			allnodes->origin = sdlznode;
456
	}
457
	return (dns_sdlz_putrr(sdlznode, type, ttl, data));
458
459
}
460
461
isc_result_t
462
dns_sdlz_putsoa(dns_sdlzlookup_t *lookup, const char *mname, const char *rname,
463
	       isc_uint32_t serial)
464
{
465
	char str[2 * DNS_NAME_MAXTEXT + 5 * (sizeof("2147483647")) + 7];
466
	int n;
467
468
	REQUIRE(mname != NULL);
469
	REQUIRE(rname != NULL);
470
471
	n = snprintf(str, sizeof str, "%s %s %u %u %u %u %u",
472
		     mname, rname, serial,
473
		     SDLZ_DEFAULT_REFRESH, SDLZ_DEFAULT_RETRY,
474
		     SDLZ_DEFAULT_EXPIRE, SDLZ_DEFAULT_MINIMUM);
475
	if (n >= (int)sizeof(str) || n < 0)
476
		return (ISC_R_NOSPACE);
477
	return (dns_sdlz_putrr(lookup, "SOA", SDLZ_DEFAULT_TTL, str));
478
}
479
480
/*
481
 * DB routines. These methods were "borrowed" from the SDB driver interface.
482
 * See the SDB driver interface documentation for more info.
483
 */
484
485
static void
486
attach(dns_db_t *source, dns_db_t **targetp) {
487
	dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *) source;
488
489
	REQUIRE(VALID_SDLZDB(sdlz));
490
491
	LOCK(&sdlz->refcnt_lock);
492
	REQUIRE(sdlz->references > 0);
493
	sdlz->references++;
494
	UNLOCK(&sdlz->refcnt_lock);
495
496
	*targetp = source;
497
}
498
499
static void
500
destroy(dns_sdlz_db_t *sdlz) {
501
	isc_mem_t *mctx;
502
	mctx = sdlz->common.mctx;
503
504
	sdlz->common.magic = 0;
505
	sdlz->common.impmagic = 0;
506
	
507
	isc_mutex_destroy(&sdlz->refcnt_lock);
508
509
	dns_name_free(&sdlz->common.origin, mctx);
510
511
	isc_mem_put(mctx, sdlz, sizeof(dns_sdlz_db_t));
512
	isc_mem_detach(&mctx);
513
}
514
515
static void
516
detach(dns_db_t **dbp) {
517
	dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)(*dbp);
518
	isc_boolean_t need_destroy = ISC_FALSE;
519
520
	REQUIRE(VALID_SDLZDB(sdlz));
521
	LOCK(&sdlz->refcnt_lock);
522
	REQUIRE(sdlz->references > 0);
523
	sdlz->references--;
524
	if (sdlz->references == 0)
525
		need_destroy = ISC_TRUE;
526
	UNLOCK(&sdlz->refcnt_lock);
527
528
	if (need_destroy)
529
		destroy(sdlz);
530
531
	*dbp = NULL;
532
}
533
534
static isc_result_t
535
beginload(dns_db_t *db, dns_addrdatasetfunc_t *addp, dns_dbload_t **dbloadp) {
536
	UNUSED(db);
537
	UNUSED(addp);
538
	UNUSED(dbloadp);
539
	return (ISC_R_NOTIMPLEMENTED);
540
}
541
542
static isc_result_t
543
endload(dns_db_t *db, dns_dbload_t **dbloadp) {
544
	UNUSED(db);
545
	UNUSED(dbloadp);
546
	return (ISC_R_NOTIMPLEMENTED);
547
}
548
549
static isc_result_t
550
dump(dns_db_t *db, dns_dbversion_t *version, const char *filename) {
551
	UNUSED(db);
552
	UNUSED(version);
553
	UNUSED(filename);
554
	return (ISC_R_NOTIMPLEMENTED);
555
}
556
557
static void
558
currentversion(dns_db_t *db, dns_dbversion_t **versionp) {
559
	REQUIRE(versionp != NULL && *versionp == NULL);
560
561
	UNUSED(db);
562
563
	*versionp = (void *) &dummy;
564
	return;
565
}
566
567
static isc_result_t
568
newversion(dns_db_t *db, dns_dbversion_t **versionp) {
569
	UNUSED(db);
570
	UNUSED(versionp);
571
572
	return (ISC_R_NOTIMPLEMENTED);
573
}
574
575
static void
576
attachversion(dns_db_t *db, dns_dbversion_t *source, 
577
	      dns_dbversion_t **targetp)
578
{
579
	REQUIRE(source != NULL && source == (void *) &dummy);
580
581
	UNUSED(db);
582
	UNUSED(source);
583
	UNUSED(targetp);
584
	return;
585
}
586
587
static void
588
closeversion(dns_db_t *db, dns_dbversion_t **versionp, isc_boolean_t commit) {
589
	REQUIRE(versionp != NULL && *versionp == (void *) &dummy);
590
	REQUIRE(commit == ISC_FALSE);
591
592
	UNUSED(db);
593
	UNUSED(commit);
594
595
	*versionp = NULL;
596
}
597
598
static isc_result_t
599
createnode(dns_sdlz_db_t *sdlz, dns_sdlznode_t **nodep) {
600
	dns_sdlznode_t *node;
601
	isc_result_t result;
602
603
	node = isc_mem_get(sdlz->common.mctx, sizeof(dns_sdlznode_t));
604
	if (node == NULL)
605
		return (ISC_R_NOMEMORY);
606
607
	node->sdlz = NULL;
608
	attach((dns_db_t *)sdlz, (dns_db_t **)&node->sdlz);
609
	ISC_LIST_INIT(node->lists);
610
	ISC_LIST_INIT(node->buffers);
611
	ISC_LINK_INIT(node, link);
612
	node->name = NULL;
613
	result = isc_mutex_init(&node->lock);
614
	if (result != ISC_R_SUCCESS) {
615
		UNEXPECTED_ERROR(__FILE__, __LINE__,
616
				 "isc_mutex_init() failed: %s",
617
				 isc_result_totext(result));
618
		isc_mem_put(sdlz->common.mctx, node, sizeof(dns_sdlznode_t));
619
		return (ISC_R_UNEXPECTED);
620
	}
621
	dns_rdatacallbacks_init(&node->callbacks);
622
	node->references = 1;
623
	node->magic = SDLZLOOKUP_MAGIC;
624
625
	*nodep = node;
626
	return (ISC_R_SUCCESS);
627
}
628
629
static void
630
destroynode(dns_sdlznode_t *node) {
631
	dns_rdatalist_t *list;
632
	dns_rdata_t *rdata;
633
	isc_buffer_t *b;
634
	dns_sdlz_db_t *sdlz;
635
	isc_mem_t *mctx;
636
637
	sdlz = node->sdlz;
638
	mctx = sdlz->common.mctx;
639
640
	while (!ISC_LIST_EMPTY(node->lists)) {
641
		list = ISC_LIST_HEAD(node->lists);
642
		while (!ISC_LIST_EMPTY(list->rdata)) {
643
			rdata = ISC_LIST_HEAD(list->rdata);
644
			ISC_LIST_UNLINK(list->rdata, rdata, link);
645
			isc_mem_put(mctx, rdata, sizeof(dns_rdata_t));
646
		}
647
		ISC_LIST_UNLINK(node->lists, list, link);
648
		isc_mem_put(mctx, list, sizeof(dns_rdatalist_t));
649
	}
650
651
	while (!ISC_LIST_EMPTY(node->buffers)) {
652
		b = ISC_LIST_HEAD(node->buffers);
653
		ISC_LIST_UNLINK(node->buffers, b, link);
654
		isc_buffer_free(&b);
655
	}
656
657
	if (node->name != NULL) {
658
		dns_name_free(node->name, mctx);
659
		isc_mem_put(mctx, node->name, sizeof(dns_name_t));
660
	}
661
	DESTROYLOCK(&node->lock);
662
	node->magic = 0;
663
	isc_mem_put(mctx, node, sizeof(dns_sdlznode_t));
664
	detach((dns_db_t **)&sdlz);
665
}
666
667
static isc_result_t
668
findnode(dns_db_t *db, dns_name_t *name, isc_boolean_t create,
669
	 dns_dbnode_t **nodep)
670
{
671
	dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
672
	dns_sdlznode_t *node = NULL;
673
	isc_result_t result;
674
	isc_buffer_t b;
675
	char namestr[DNS_NAME_MAXTEXT + 1];
676
	isc_buffer_t b2;
677
	char zonestr[DNS_NAME_MAXTEXT + 1];
678
	isc_boolean_t isorigin;
679
680
	REQUIRE(VALID_SDLZDB(sdlz));
681
	REQUIRE(create == ISC_FALSE);
682
	REQUIRE(nodep != NULL && *nodep == NULL);
683
684
	UNUSED(name);
685
	UNUSED(create);
686
687
    isc_buffer_init(&b, namestr, sizeof(namestr));
688
	if ((sdlz->dlzimp->flags & DNS_SDLZFLAG_RELATIVEOWNER) != 0) {
689
		dns_name_t relname;
690
		unsigned int labels;
691
692
		labels = dns_name_countlabels(name) -
693
			 dns_name_countlabels(&db->origin);
694
		dns_name_init(&relname, NULL);
695
		dns_name_getlabelsequence(name, 0, labels, &relname);
696
		result = dns_name_totext(&relname, ISC_TRUE, &b);
697
		if (result != ISC_R_SUCCESS)
698
			return (result);
699
	} else {
700
		result = dns_name_totext(name, ISC_TRUE, &b);
701
		if (result != ISC_R_SUCCESS)
702
			return (result);
703
	}
704
	isc_buffer_putuint8(&b, 0);
705
706
	isc_buffer_init(&b2, zonestr, sizeof(zonestr));
707
	result = dns_name_totext(&sdlz->common.origin, ISC_TRUE, &b2);
708
	if (result != ISC_R_SUCCESS)
709
		return (result);
710
	isc_buffer_putuint8(&b2, 0);
711
712
	result = createnode(sdlz, &node);
713
	if (result != ISC_R_SUCCESS)
714
		return (result);
715
716
	isorigin = dns_name_equal(name, &sdlz->common.origin);
717
718
       // make sure strings are always lowercase
719
    dns_sdlz_tolower(zonestr);
720
    dns_sdlz_tolower(namestr);
721
722
	MAYBE_LOCK(sdlz->dlzimp);
723
724
		// try to lookup the host (namestr)
725
	result = sdlz->dlzimp->methods->lookup(zonestr, namestr,
726
					sdlz->dlzimp->driverarg, sdlz->dbdata, node);
727
728
		// if the host (namestr) was not found, try to lookup a "wildcard" host.
729
	if(result != ISC_R_SUCCESS){
730
		result = sdlz->dlzimp->methods->lookup(zonestr, "*",
731
						sdlz->dlzimp->driverarg, sdlz->dbdata, node);
732
	}
733
734
	MAYBE_UNLOCK(sdlz->dlzimp);
735
736
	if (result != ISC_R_SUCCESS && !isorigin) {
737
		destroynode(node);
738
		return (result);
739
	}
740
741
	if (isorigin && sdlz->dlzimp->methods->authority != NULL) {
742
		MAYBE_LOCK(sdlz->dlzimp);
743
		result = sdlz->dlzimp->methods->authority(zonestr,
744
					sdlz->dlzimp->driverarg,  sdlz->dbdata, node);
745
		MAYBE_UNLOCK(sdlz->dlzimp);
746
		if (result != ISC_R_SUCCESS && result != ISC_R_NOTIMPLEMENTED) {
747
			destroynode(node);
748
			return (result);
749
		}
750
	}
751
	
752
	*nodep = node;
753
	return (ISC_R_SUCCESS);
754
}
755
756
static isc_result_t
757
find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
758
     dns_rdatatype_t type, unsigned int options, isc_stdtime_t now,
759
     dns_dbnode_t **nodep, dns_name_t *foundname,
760
     dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
761
{
762
	dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
763
	dns_dbnode_t *node = NULL;
764
	dns_fixedname_t fname;
765
	dns_rdataset_t xrdataset;
766
	dns_name_t *xname;
767
	unsigned int nlabels, olabels;
768
	isc_result_t result;
769
	unsigned int i;
770
771
	REQUIRE(VALID_SDLZDB(sdlz));
772
	REQUIRE(nodep == NULL || *nodep == NULL);
773
	REQUIRE(version == NULL || version == (void *) &dummy);
774
775
	UNUSED(options);
776
	UNUSED(sdlz);
777
778
	if (!dns_name_issubdomain(name, &db->origin))
779
		return (DNS_R_NXDOMAIN);
780
781
	olabels = dns_name_countlabels(&db->origin);
782
	nlabels = dns_name_countlabels(name);
783
784
	dns_fixedname_init(&fname);
785
	xname = dns_fixedname_name(&fname);
786
787
	if (rdataset == NULL)
788
		rdataset = &xrdataset;
789
790
	result = DNS_R_NXDOMAIN;
791
792
	for (i = olabels; i <= nlabels; i++) {
793
		/*
794
		 * Unless this is an explicit lookup at the origin, don't
795
		 * look at the origin.
796
		 */
797
		if (i == olabels && i != nlabels)
798
			continue;
799
800
		/*
801
		 * Look up the next label.
802
		 */
803
		dns_name_getlabelsequence(name, nlabels - i, i, xname);
804
		result = findnode(db, xname, ISC_FALSE, &node);
805
		if (result != ISC_R_SUCCESS) {
806
			result = DNS_R_NXDOMAIN;
807
			continue;
808
		}
809
810
		/*
811
		 * Look for a DNAME at the current label, unless this is
812
		 * the qname.
813
		 */
814
		if (i < nlabels) {
815
			result = findrdataset(db, node, version,
816
					      dns_rdatatype_dname,
817
					      0, now, rdataset, sigrdataset);
818
			if (result == ISC_R_SUCCESS) {
819
				result = DNS_R_DNAME;
820
				break;
821
			}
822
		}
823
824
		/*
825
		 * Look for an NS at the current label, unless this is the
826
		 * origin or glue is ok.
827
		 */
828
		if (i != olabels && (options & DNS_DBFIND_GLUEOK) == 0) {
829
			result = findrdataset(db, node, version,
830
					      dns_rdatatype_ns,
831
					      0, now, rdataset, sigrdataset);
832
			if (result == ISC_R_SUCCESS) {
833
				if (i == nlabels && type == dns_rdatatype_any)
834
				{
835
					result = DNS_R_ZONECUT;
836
					dns_rdataset_disassociate(rdataset);
837
					if (sigrdataset != NULL)
838
						dns_rdataset_disassociate
839
								(sigrdataset);
840
				} else
841
					result = DNS_R_DELEGATION;
842
				break;
843
			}
844
		}
845
846
		/*
847
		 * If the current name is not the qname, add another label
848
		 * and try again.
849
		 */
850
		if (i < nlabels) {
851
			destroynode(node);
852
			node = NULL;
853
			continue;
854
		}
855
856
		/*
857
		 * If we're looking for ANY, we're done.
858
		 */
859
		if (type == dns_rdatatype_any) {
860
			result = ISC_R_SUCCESS;
861
			break;
862
		}
863
864
		/*
865
		 * Look for the qtype.
866
		 */
867
		result = findrdataset(db, node, version, type,
868
				      0, now, rdataset, sigrdataset);
869
		if (result == ISC_R_SUCCESS)
870
			break;
871
872
		/*
873
		 * Look for a CNAME
874
		 */
875
		if (type != dns_rdatatype_cname) {
876
			result = findrdataset(db, node, version,
877
					      dns_rdatatype_cname,
878
					      0, now, rdataset, sigrdataset);
879
			if (result == ISC_R_SUCCESS) {
880
				result = DNS_R_CNAME;
881
				break;
882
			}
883
		}
884
885
		result = DNS_R_NXRRSET;
886
		break;
887
	}
888
889
	if (rdataset == &xrdataset && dns_rdataset_isassociated(rdataset))
890
		dns_rdataset_disassociate(rdataset);
891
892
	if (foundname != NULL) {
893
		isc_result_t xresult;
894
895
		xresult = dns_name_copy(xname, foundname, NULL);
896
		if (xresult != ISC_R_SUCCESS) {
897
			destroynode(node);
898
			if (dns_rdataset_isassociated(rdataset))
899
				dns_rdataset_disassociate(rdataset);
900
			return (DNS_R_BADDB);
901
		}
902
	}
903
904
	if (nodep != NULL)
905
		*nodep = node;
906
	else if (node != NULL)
907
		detachnode(db, &node);
908
909
	return (result);
910
}
911
912
static isc_result_t
913
findzonecut(dns_db_t *db, dns_name_t *name, unsigned int options,
914
	    isc_stdtime_t now, dns_dbnode_t **nodep, dns_name_t *foundname,
915
	    dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
916
{
917
	UNUSED(db);
918
	UNUSED(name);
919
	UNUSED(options);
920
	UNUSED(now);
921
	UNUSED(nodep);
922
	UNUSED(foundname);
923
	UNUSED(rdataset);
924
	UNUSED(sigrdataset);
925
926
	return (ISC_R_NOTIMPLEMENTED);
927
}
928
929
static void
930
attachnode(dns_db_t *db, dns_dbnode_t *source, dns_dbnode_t **targetp) {
931
	dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
932
	dns_sdlznode_t *node = (dns_sdlznode_t *)source;
933
934
	REQUIRE(VALID_SDLZDB(sdlz));
935
936
	UNUSED(sdlz);
937
938
	LOCK(&node->lock);
939
	INSIST(node->references > 0);
940
	node->references++;
941
	INSIST(node->references != 0);		/* Catch overflow. */
942
	UNLOCK(&node->lock);
943
944
	*targetp = source;
945
}
946
947
static void
948
detachnode(dns_db_t *db, dns_dbnode_t **targetp) {
949
	dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
950
	dns_sdlznode_t *node;
951
	isc_boolean_t need_destroy = ISC_FALSE;
952
953
	REQUIRE(VALID_SDLZDB(sdlz));
954
	REQUIRE(targetp != NULL && *targetp != NULL);
955
956
	UNUSED(sdlz);
957
958
	node = (dns_sdlznode_t *)(*targetp);
959
960
	LOCK(&node->lock);
961
	INSIST(node->references > 0);
962
	node->references--;
963
	if (node->references == 0)
964
		need_destroy = ISC_TRUE;
965
	UNLOCK(&node->lock);
966
967
	if (need_destroy)
968
		destroynode(node);
969
970
	*targetp = NULL;
971
}
972
973
static isc_result_t
974
expirenode(dns_db_t *db, dns_dbnode_t *node, isc_stdtime_t now) {
975
	UNUSED(db);
976
	UNUSED(node);
977
	UNUSED(now);
978
	INSIST(0);
979
	return (ISC_R_UNEXPECTED);
980
}
981
982
static void
983
printnode(dns_db_t *db, dns_dbnode_t *node, FILE *out) {
984
	UNUSED(db);
985
	UNUSED(node);
986
	UNUSED(out);
987
	return;
988
}
989
990
static isc_result_t
991
createiterator(dns_db_t *db, isc_boolean_t relative_names,
992
	       dns_dbiterator_t **iteratorp)
993
{
994
	dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
995
	sdlz_dbiterator_t *sdlziter;
996
	isc_result_t result;
997
	isc_buffer_t b;
998
	char zonestr[DNS_NAME_MAXTEXT + 1];
999
1000
	REQUIRE(VALID_SDLZDB(sdlz));
1001
1002
	if (sdlz->dlzimp->methods->allnodes == NULL)
1003
		return (ISC_R_NOTIMPLEMENTED);
1004
1005
	isc_buffer_init(&b, zonestr, sizeof(zonestr));
1006
	result = dns_name_totext(&sdlz->common.origin, ISC_TRUE, &b);
1007
	if (result != ISC_R_SUCCESS)
1008
		return (result);
1009
	isc_buffer_putuint8(&b, 0);
1010
1011
	sdlziter = isc_mem_get(sdlz->common.mctx, sizeof(sdlz_dbiterator_t));
1012
	if (sdlziter == NULL)
1013
		return (ISC_R_NOMEMORY);
1014
1015
	sdlziter->common.methods = &dbiterator_methods;
1016
	sdlziter->common.db = NULL;
1017
	dns_db_attach(db, &sdlziter->common.db);
1018
	sdlziter->common.relative_names = relative_names;
1019
	sdlziter->common.magic = DNS_DBITERATOR_MAGIC;
1020
	ISC_LIST_INIT(sdlziter->nodelist);
1021
	sdlziter->current = NULL;
1022
	sdlziter->origin = NULL;
1023
1024
        // make sure strings are always lowercase
1025
    dns_sdlz_tolower(zonestr);
1026
1027
	MAYBE_LOCK(sdlz->dlzimp);
1028
	result = sdlz->dlzimp->methods->allnodes(zonestr, sdlz->dlzimp->driverarg,
1029
							sdlz->dbdata, sdlziter);
1030
	MAYBE_UNLOCK(sdlz->dlzimp);
1031
	if (result != ISC_R_SUCCESS) {
1032
		dbiterator_destroy((dns_dbiterator_t **)&sdlziter);
1033
		return (result);
1034
	}
1035
1036
	if (sdlziter->origin != NULL) {
1037
		ISC_LIST_UNLINK(sdlziter->nodelist, sdlziter->origin, link);
1038
		ISC_LIST_PREPEND(sdlziter->nodelist, sdlziter->origin, link);
1039
	}
1040
1041
	*iteratorp = (dns_dbiterator_t *)sdlziter;
1042
1043
	return (ISC_R_SUCCESS);
1044
}
1045
1046
static isc_result_t
1047
findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
1048
	     dns_rdatatype_t type, dns_rdatatype_t covers,
1049
	     isc_stdtime_t now, dns_rdataset_t *rdataset,
1050
	     dns_rdataset_t *sigrdataset)
1051
{
1052
	dns_rdatalist_t *list;
1053
	dns_sdlznode_t *sdlznode = (dns_sdlznode_t *)node;
1054
1055
	REQUIRE(VALID_SDLZNODE(node));
1056
1057
	UNUSED(db);
1058
	UNUSED(version);
1059
	UNUSED(covers);
1060
	UNUSED(now);
1061
	UNUSED(sigrdataset);
1062
1063
	if (type == dns_rdatatype_sig)
1064
		return (ISC_R_NOTIMPLEMENTED);
1065
1066
	list = ISC_LIST_HEAD(sdlznode->lists);
1067
	while (list != NULL) {
1068
		if (list->type == type)
1069
			break;
1070
		list = ISC_LIST_NEXT(list, link);
1071
	}
1072
	if (list == NULL)
1073
		return (ISC_R_NOTFOUND);
1074
1075
	list_tordataset(list, db, node, rdataset);
1076
1077
	return (ISC_R_SUCCESS);
1078
}
1079
1080
static isc_result_t
1081
allrdatasets(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
1082
	     isc_stdtime_t now, dns_rdatasetiter_t **iteratorp)
1083
{
1084
	sdlz_rdatasetiter_t *iterator;
1085
1086
	REQUIRE(version == NULL || version == &dummy);
1087
	
1088
	UNUSED(version);
1089
	UNUSED(now);
1090
1091
	iterator = isc_mem_get(db->mctx, sizeof(sdlz_rdatasetiter_t));
1092
	if (iterator == NULL)
1093
		return (ISC_R_NOMEMORY);
1094
1095
	iterator->common.magic = DNS_RDATASETITER_MAGIC;
1096
	iterator->common.methods = &rdatasetiter_methods;
1097
	iterator->common.db = db;
1098
	iterator->common.node = NULL;
1099
	attachnode(db, node, &iterator->common.node);
1100
	iterator->common.version = version;
1101
	iterator->common.now = now;
1102
1103
	*iteratorp = (dns_rdatasetiter_t *)iterator;
1104
1105
	return (ISC_R_SUCCESS);
1106
}
1107
1108
static isc_result_t
1109
addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
1110
	    isc_stdtime_t now, dns_rdataset_t *rdataset, unsigned int options,
1111
	    dns_rdataset_t *addedrdataset)
1112
{
1113
	UNUSED(db);
1114
	UNUSED(node);
1115
	UNUSED(version);
1116
	UNUSED(now);
1117
	UNUSED(rdataset);
1118
	UNUSED(options);
1119
	UNUSED(addedrdataset);
1120
1121
	return (ISC_R_NOTIMPLEMENTED);
1122
}
1123
1124
static isc_result_t
1125
subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
1126
		 dns_rdataset_t *rdataset, unsigned int options,
1127
		 dns_rdataset_t *newrdataset)
1128
{
1129
	UNUSED(db);
1130
	UNUSED(node);
1131
	UNUSED(version);
1132
	UNUSED(rdataset);
1133
	UNUSED(options);
1134
	UNUSED(newrdataset);
1135
1136
	return (ISC_R_NOTIMPLEMENTED);
1137
}
1138
1139
static isc_result_t
1140
deleterdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
1141
	       dns_rdatatype_t type, dns_rdatatype_t covers)
1142
{
1143
	UNUSED(db);
1144
	UNUSED(node);
1145
	UNUSED(version);
1146
	UNUSED(type);
1147
	UNUSED(covers);
1148
1149
	return (ISC_R_NOTIMPLEMENTED);
1150
}
1151
1152
static isc_boolean_t
1153
issecure(dns_db_t *db) {
1154
	UNUSED(db);
1155
1156
	return (ISC_FALSE);
1157
}
1158
1159
static unsigned int
1160
nodecount(dns_db_t *db) {
1161
	UNUSED(db);
1162
1163
	return (0);
1164
}
1165
1166
static isc_boolean_t
1167
ispersistent(dns_db_t *db) {
1168
	UNUSED(db);
1169
	return (ISC_TRUE);
1170
}
1171
1172
static void
1173
overmem(dns_db_t *db, isc_boolean_t overmem) {
1174
	UNUSED(db);
1175
	UNUSED(overmem);
1176
}
1177
1178
1179
static dns_dbmethods_t sdlzdb_methods = {
1180
	attach,
1181
	detach,
1182
	beginload,
1183
	endload,
1184
	dump,
1185
	currentversion,
1186
	newversion,
1187
	attachversion,
1188
	closeversion,
1189
	findnode,
1190
	find,
1191
	findzonecut,
1192
	attachnode,
1193
	detachnode,
1194
	expirenode,
1195
	printnode,
1196
	createiterator,
1197
	findrdataset,
1198
	allrdatasets,
1199
	addrdataset,
1200
	subtractrdataset,
1201
	deleterdataset,
1202
	issecure,
1203
	nodecount,
1204
	ispersistent,
1205
	overmem
1206
};
1207
1208
1209
/*
1210
 * Rdataset Methods. These methods were "borrowed" from the SDB driver
1211
 * interface.  See the SDB driver interface documentation for more info.
1212
 */
1213
1214
static void
1215
disassociate(dns_rdataset_t *rdataset) {
1216
	dns_dbnode_t *node = rdataset->private5;
1217
	dns_sdlznode_t *sdlznode = (dns_sdlznode_t *) node;
1218
	dns_db_t *db = (dns_db_t *) sdlznode->sdlz;
1219
1220
	detachnode(db, &node);
1221
	isc__rdatalist_disassociate(rdataset);
1222
}
1223
1224
static void
1225
rdataset_clone(dns_rdataset_t *source, dns_rdataset_t *target) {
1226
	dns_dbnode_t *node = source->private5;
1227
	dns_sdlznode_t *sdlznode = (dns_sdlznode_t *) node;
1228
	dns_db_t *db = (dns_db_t *) sdlznode->sdlz;
1229
	dns_dbnode_t *tempdb = NULL;
1230
1231
	isc__rdatalist_clone(source, target);
1232
	attachnode(db, node, &tempdb);
1233
	source->private5 = tempdb;
1234
}
1235
1236
static dns_rdatasetmethods_t methods = {
1237
	disassociate,
1238
	isc__rdatalist_first,
1239
	isc__rdatalist_next,
1240
	isc__rdatalist_current,
1241
	rdataset_clone,
1242
	isc__rdatalist_count
1243
};
1244
1245
static void
1246
list_tordataset(dns_rdatalist_t *rdatalist,
1247
		dns_db_t *db, dns_dbnode_t *node,
1248
		dns_rdataset_t *rdataset)
1249
{
1250
	/*
1251
	 * The sdlz rdataset is an rdatalist with some additions.
1252
	 *	- private1 & private2 are used by the rdatalist.
1253
	 *	- private3 & private 4 are unused.
1254
	 *	- private5 is the node.
1255
	 */
1256
1257
	/* This should never fail. */
1258
	RUNTIME_CHECK(dns_rdatalist_tordataset(rdatalist, rdataset) ==
1259
		      ISC_R_SUCCESS);
1260
1261
	rdataset->methods = &methods;
1262
	dns_db_attachnode(db, node, &rdataset->private5);
1263
}
1264
1265
/*
1266
 * Database Iterator Methods.  These methods were "borrowed" from the SDB
1267
 * driver interface.  See the SDB driver interface documentation for more info.
1268
 */
1269
static void
1270
dbiterator_destroy(dns_dbiterator_t **iteratorp) {
1271
	sdlz_dbiterator_t *sdlziter = (sdlz_dbiterator_t *)(*iteratorp);
1272
	dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)sdlziter->common.db;
1273
1274
	while (!ISC_LIST_EMPTY(sdlziter->nodelist)) {
1275
		dns_sdlznode_t *node;
1276
		node = ISC_LIST_HEAD(sdlziter->nodelist);
1277
		ISC_LIST_UNLINK(sdlziter->nodelist, node, link);
1278
		destroynode(node);
1279
	}
1280
1281
	dns_db_detach(&sdlziter->common.db);
1282
	isc_mem_put(sdlz->common.mctx, sdlziter, sizeof(sdlz_dbiterator_t));
1283
1284
	*iteratorp = NULL;
1285
}
1286
1287
static isc_result_t
1288
dbiterator_first(dns_dbiterator_t *iterator) {
1289
	sdlz_dbiterator_t *sdlziter = (sdlz_dbiterator_t *)iterator;
1290
1291
	sdlziter->current = ISC_LIST_HEAD(sdlziter->nodelist);
1292
	if (sdlziter->current == NULL)
1293
		return (ISC_R_NOMORE);
1294
	else
1295
		return (ISC_R_SUCCESS);
1296
}
1297
1298
static isc_result_t
1299
dbiterator_last(dns_dbiterator_t *iterator) {
1300
	sdlz_dbiterator_t *sdlziter = (sdlz_dbiterator_t *)iterator;
1301
1302
	sdlziter->current = ISC_LIST_TAIL(sdlziter->nodelist);
1303
	if (sdlziter->current == NULL)
1304
		return (ISC_R_NOMORE);
1305
	else
1306
		return (ISC_R_SUCCESS);
1307
}
1308
1309
static isc_result_t
1310
dbiterator_seek(dns_dbiterator_t *iterator, dns_name_t *name) {
1311
	sdlz_dbiterator_t *sdlziter = (sdlz_dbiterator_t *)iterator;
1312
1313
	sdlziter->current = ISC_LIST_HEAD(sdlziter->nodelist);
1314
	while (sdlziter->current != NULL)
1315
		if (dns_name_equal(sdlziter->current->name, name))
1316
			return (ISC_R_SUCCESS);
1317
	return (ISC_R_NOTFOUND);
1318
}
1319
1320
static isc_result_t
1321
dbiterator_prev(dns_dbiterator_t *iterator) {
1322
	sdlz_dbiterator_t *sdlziter = (sdlz_dbiterator_t *)iterator;
1323
1324
	sdlziter->current = ISC_LIST_PREV(sdlziter->current, link);
1325
	if (sdlziter->current == NULL)
1326
		return (ISC_R_NOMORE);
1327
	else
1328
		return (ISC_R_SUCCESS);
1329
}
1330
1331
static isc_result_t
1332
dbiterator_next(dns_dbiterator_t *iterator) {
1333
	sdlz_dbiterator_t *sdlziter = (sdlz_dbiterator_t *)iterator;
1334
1335
	sdlziter->current = ISC_LIST_NEXT(sdlziter->current, link);
1336
	if (sdlziter->current == NULL)
1337
		return (ISC_R_NOMORE);
1338
	else
1339
		return (ISC_R_SUCCESS);
1340
}
1341
1342
static isc_result_t
1343
dbiterator_current(dns_dbiterator_t *iterator, dns_dbnode_t **nodep,
1344
		   dns_name_t *name)
1345
{
1346
	sdlz_dbiterator_t *sdlziter = (sdlz_dbiterator_t *)iterator;
1347
1348
	attachnode(iterator->db, sdlziter->current, nodep);
1349
	if (name != NULL)
1350
		return (dns_name_copy(sdlziter->current->name, name, NULL));
1351
	return (ISC_R_SUCCESS);
1352
}
1353
1354
static isc_result_t
1355
dbiterator_pause(dns_dbiterator_t *iterator) {
1356
	UNUSED(iterator);
1357
	return (ISC_R_SUCCESS);
1358
}
1359
1360
static isc_result_t
1361
dbiterator_origin(dns_dbiterator_t *iterator, dns_name_t *name) {
1362
	UNUSED(iterator);
1363
	return (dns_name_copy(dns_rootname, name, NULL));
1364
}
1365
1366
/*
1367
 * Rdataset Iterator Methods. These methods were "borrowed" from the SDB
1368
 * driver interface.  See the SDB driver interface documentation for more info.
1369
 */
1370
1371
static void
1372
rdatasetiter_destroy(dns_rdatasetiter_t **iteratorp) {
1373
	sdlz_rdatasetiter_t *sdlziterator = (sdlz_rdatasetiter_t *)(*iteratorp);
1374
	detachnode(sdlziterator->common.db, &sdlziterator->common.node);
1375
	isc_mem_put(sdlziterator->common.db->mctx, sdlziterator,
1376
		    sizeof(sdlz_rdatasetiter_t));
1377
	*iteratorp = NULL;
1378
}
1379
1380
static isc_result_t
1381
rdatasetiter_first(dns_rdatasetiter_t *iterator) {
1382
	sdlz_rdatasetiter_t *sdlziterator = (sdlz_rdatasetiter_t *)iterator;
1383
	dns_sdlznode_t *sdlznode = (dns_sdlznode_t *)iterator->node;
1384
1385
	if (ISC_LIST_EMPTY(sdlznode->lists))
1386
		return (ISC_R_NOMORE);
1387
	sdlziterator->current = ISC_LIST_HEAD(sdlznode->lists);
1388
	return (ISC_R_SUCCESS);
1389
}
1390
1391
static isc_result_t
1392
rdatasetiter_next(dns_rdatasetiter_t *iterator) {
1393
	sdlz_rdatasetiter_t *sdlziterator = (sdlz_rdatasetiter_t *)iterator;
1394
1395
	sdlziterator->current = ISC_LIST_NEXT(sdlziterator->current, link);
1396
	if (sdlziterator->current == NULL)
1397
		return (ISC_R_NOMORE);
1398
	else
1399
		return (ISC_R_SUCCESS);
1400
}
1401
1402
static void
1403
rdatasetiter_current(dns_rdatasetiter_t *iterator, dns_rdataset_t *rdataset) {
1404
	sdlz_rdatasetiter_t *sdlziterator = (sdlz_rdatasetiter_t *)iterator;
1405
1406
	list_tordataset(sdlziterator->current, iterator->db, iterator->node,
1407
			rdataset);
1408
}
1409
1410
1411
/*
1412
 * SDLZ core methods. This is the core of the new DLZ functionality.  
1413
 */
1414
	
1415
/* 
1416
 * Build a 'bind' database driver structure to be returned by
1417
 * either the find zone or the allow zone transfer method.
1418
 * This method is only available in this source file, it is
1419
 * not made available anywhere else.
1420
 */
1421
1422
isc_result_t
1423
dns_sdlzcreateDBP(isc_mem_t *mctx, void *driverarg, void *dbdata,
1424
				  dns_name_t *name, dns_rdataclass_t rdclass, dns_db_t **dbp)
1425
{
1426
1427
	isc_result_t result;
1428
	dns_sdlz_db_t *sdlzdb;
1429
	dns_sdlzimplementation_t *imp;
1430
1431
	/* check that things are as we expect */
1432
	REQUIRE(dbp != NULL && *dbp == NULL);
1433
	REQUIRE(name != NULL);
1434
1435
	imp = (dns_sdlzimplementation_t *) driverarg;
1436
1437
	/* allocate and zero memory for driver structure */
1438
	sdlzdb = isc_mem_get(mctx, sizeof(dns_sdlz_db_t));
1439
	if (sdlzdb == NULL)
1440
		return (ISC_R_NOMEMORY);
1441
	memset(sdlzdb, 0, sizeof(dns_sdlz_db_t));
1442
1443
	/* initialize and set origin */
1444
	dns_name_init(&sdlzdb->common.origin, NULL);
1445
	result = dns_name_dupwithoffsets(name, mctx, &sdlzdb->common.origin);
1446
	if (result != ISC_R_SUCCESS)
1447
		goto mem_cleanup;
1448
1449
	/* initialize the reference count mutex */
1450
	result = isc_mutex_init(&sdlzdb->refcnt_lock);
1451
	if (result != ISC_R_SUCCESS)
1452
		goto name_cleanup;
1453
1454
	/* set the rest of the database structure attributes */
1455
	sdlzdb->dlzimp = imp;
1456
	sdlzdb->common.methods = &sdlzdb_methods;
1457
	sdlzdb->common.attributes = 0;
1458
	sdlzdb->common.rdclass = rdclass;
1459
	sdlzdb->common.mctx = NULL;
1460
	sdlzdb->dbdata = dbdata;
1461
	sdlzdb->references = 1;
1462
1463
	/* attach to the memory context */
1464
	isc_mem_attach(mctx, &sdlzdb->common.mctx);
1465
1466
	/* mark structure as valid */
1467
	sdlzdb->common.magic = DNS_DB_MAGIC;
1468
	sdlzdb->common.impmagic = SDLZDB_MAGIC;
1469
	*dbp = (dns_db_t *) sdlzdb;
1470
1471
	return result;
1472
1473
	/* reference count mutex could not be initialized, clean up name memory */
1474
name_cleanup:
1475
	dns_name_free(&sdlzdb->common.origin, mctx);
1476
mem_cleanup:
1477
	isc_mem_put(mctx, sdlzdb, sizeof(dns_sdlz_db_t));
1478
	return result;
1479
}
1480
1481
isc_result_t
1482
dns_sdlzallowzonexfr(void *driverarg, void *dbdata, isc_mem_t *mctx, 
1483
					 dns_rdataclass_t rdclass, dns_name_t *name,
1484
                     isc_sockaddr_t *clientaddr, dns_db_t **dbp)
1485
{
1486
1487
	isc_buffer_t b;
1488
	isc_buffer_t b2;
1489
	char namestr[DNS_NAME_MAXTEXT + 1];
1490
	char clientstr[(sizeof "xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255") + 1];
1491
	isc_netaddr_t netaddr;
1492
	isc_result_t result;
1493
	dns_sdlzimplementation_t *imp;
1494
1495
	/* Perform checks to make sure data is as we expect / require it to be. */
1496
	REQUIRE(driverarg != NULL);
1497
	REQUIRE(name != NULL);
1498
	REQUIRE(clientaddr != NULL);
1499
	REQUIRE(dbp != NULL && *dbp == NULL);
1500
1501
	imp = (dns_sdlzimplementation_t *) driverarg;
1502
1503
	/* Convert DNS name to ascii text */
1504
	isc_buffer_init(&b, namestr, sizeof(namestr));
1505
	result = dns_name_totext(name, ISC_TRUE, &b);
1506
	if (result != ISC_R_SUCCESS)
1507
		return result;
1508
	isc_buffer_putuint8(&b, 0);
1509
1510
	/* convert client address to ascii text */
1511
	isc_buffer_init(&b2, clientstr, sizeof(clientstr));
1512
	isc_netaddr_fromsockaddr(&netaddr, clientaddr);
1513
	result = isc_netaddr_totext(&netaddr, &b2);
1514
	if (result != ISC_R_SUCCESS)
1515
		return result;
1516
	isc_buffer_putuint8(&b2, 0);
1517
1518
        // make sure strings are always lowercase
1519
    dns_sdlz_tolower(namestr);
1520
    dns_sdlz_tolower(clientstr);
1521
1522
	/* Call SDLZ driver's find zone method */
1523
	if(imp->methods->allowzonexfr != NULL){
1524
		MAYBE_LOCK(imp);
1525
		result = imp->methods->allowzonexfr(imp->driverarg, dbdata, namestr, clientstr);
1526
		MAYBE_UNLOCK(imp);
1527
		 /* if zone is supported and transfers allowed build a 'bind' database driver */
1528
		if(result == ISC_R_SUCCESS)
1529
			result = dns_sdlzcreateDBP(mctx, driverarg, dbdata, name, rdclass, dbp);
1530
		return result;		
1531
	}
1532
1533
	return ISC_R_NOTIMPLEMENTED;
1534
}
1535
1536
isc_result_t
1537
dns_sdlzcreate(isc_mem_t *mctx, const char *dlzname, unsigned int argc,
1538
				char *argv[], void *driverarg, void **dbdata)
1539
{
1540
	dns_sdlzimplementation_t *imp;
1541
	isc_result_t result = ISC_R_NOTFOUND;
1542
1543
	/* Write debugging message to log */
1544
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1545
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
1546
	      "Loading SDLZ driver.");
1547
1548
	/* Performs checks to make sure data is as we expect / require it to be. */
1549
	REQUIRE(driverarg != NULL);
1550
	REQUIRE(dlzname != NULL);
1551
	REQUIRE(dbdata != NULL);
1552
	UNUSED(mctx);
1553
1554
	imp = driverarg;
1555
	
1556
	/* If the create method exists, call it. */
1557
	if(imp->methods->create != NULL){
1558
		MAYBE_LOCK(imp);
1559
		result = imp->methods->create(dlzname, argc, argv, imp->driverarg, dbdata);
1560
		MAYBE_UNLOCK(imp);
1561
	}
1562
1563
	/* Write debugging message to log */
1564
	if(result == ISC_R_SUCCESS){
1565
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1566
				DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
1567
				"SDLZ driver loaded successfully.");
1568
   } else {
1569
		isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1570
				DNS_LOGMODULE_DLZ, ISC_LOG_ERROR,
1571
				"SDLZ driver failed to load.");
1572
	}
1573
1574
	return result;
1575
}
1576
1577
void
1578
dns_sdlzdestroy(void *driverdata, void **dbdata)
1579
{
1580
	
1581
	dns_sdlzimplementation_t *imp;
1582
1583
	/* Write debugging message to log */
1584
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1585
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
1586
	      "Unloading SDLZ driver.");
1587
1588
	imp = driverdata;
1589
1590
	/* If the destroy method exists, call it. */
1591
	if(imp->methods->destroy != NULL){
1592
		MAYBE_LOCK(imp);
1593
		imp->methods->destroy(imp->driverarg, dbdata);
1594
		MAYBE_UNLOCK(imp);
1595
	}
1596
}
1597
1598
isc_result_t
1599
dns_sdlzfindzone(void *driverarg, void *dbdata, isc_mem_t *mctx, 
1600
					 dns_rdataclass_t rdclass, dns_name_t *name, dns_db_t **dbp)
1601
{
1602
	isc_buffer_t b;
1603
	char namestr[DNS_NAME_MAXTEXT + 1];
1604
	isc_result_t result;
1605
	dns_sdlzimplementation_t *imp;
1606
1607
	/* Perform checks to make sure data is as we expect / require it to be. */
1608
	REQUIRE(driverarg != NULL);
1609
	REQUIRE(name != NULL);
1610
	REQUIRE(dbp != NULL && *dbp == NULL);
1611
1612
	imp = (dns_sdlzimplementation_t *) driverarg;
1613
1614
	/* Convert DNS name to ascii text */
1615
	isc_buffer_init(&b, namestr, sizeof(namestr));
1616
	result = dns_name_totext(name, ISC_TRUE, &b);
1617
	if (result != ISC_R_SUCCESS)
1618
		return result;
1619
	isc_buffer_putuint8(&b, 0);
1620
1621
        // make sure strings are always lowercase
1622
    dns_sdlz_tolower(namestr);
1623
1624
	/* Call SDLZ driver's find zone method */
1625
	MAYBE_LOCK(imp);
1626
	result = imp->methods->findzone(imp->driverarg, dbdata, namestr);
1627
	MAYBE_UNLOCK(imp);
1628
1629
	 /* if zone is supported build a 'bind' database driver structure to return */
1630
	if(result == ISC_R_SUCCESS)
1631
		result = dns_sdlzcreateDBP(mctx, driverarg, dbdata, name, rdclass, dbp);
1632
1633
	return result;
1634
}
1635
1636
static dns_dlzmethods_t sdlzmethods = {dns_sdlzcreate, dns_sdlzdestroy, dns_sdlzfindzone,
1637
										dns_sdlzallowzonexfr};
1638
1639
isc_result_t
1640
dns_sdlzregister(const char *drivername, const dns_sdlzmethods_t *methods,
1641
		 void *driverarg, unsigned int flags, isc_mem_t *mctx,
1642
		 dns_sdlzimplementation_t **sdlzimp)
1643
{
1644
1645
	dns_sdlzimplementation_t *imp;
1646
	isc_result_t result;
1647
1648
	/* Performs checks to make sure data is as we expect / require it to be. */
1649
	REQUIRE(drivername != NULL);
1650
	REQUIRE(methods != NULL);
1651
	REQUIRE(methods->findzone != NULL);
1652
	REQUIRE(methods->lookup != NULL);
1653
	REQUIRE(mctx != NULL);
1654
	REQUIRE(sdlzimp != NULL && *sdlzimp == NULL);
1655
	REQUIRE((flags & ~(DNS_SDLZFLAG_RELATIVEOWNER |
1656
			   DNS_SDLZFLAG_RELATIVERDATA |
1657
			   DNS_SDLZFLAG_THREADSAFE)) == 0);
1658
1659
	/* Write debugging message to log */
1660
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1661
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
1662
	      "Registering SDLZ driver '%s'", drivername);
1663
1664
	/* Allocate memory for a sdlz_implementation object.  Error if we cannot. */
1665
	imp = isc_mem_get(mctx, sizeof(dns_sdlzimplementation_t));
1666
	if (imp == NULL)
1667
		return (ISC_R_NOMEMORY);
1668
	
1669
	/* Make sure memory region is set to all 0's */
1670
	memset(imp, 0, sizeof(dns_sdlzimplementation_t));
1671
1672
	/* Store the data passed into this method */ 
1673
	imp->methods = methods;
1674
	imp->driverarg = driverarg;
1675
	imp->flags = flags;
1676
	imp->mctx = NULL;
1677
1678
	/* attach the new sdlz_implementation object to a memory context */
1679
	isc_mem_attach(mctx, &imp->mctx);
1680
	
1681
	/*
1682
	 * initialize the driver lock, error if we cannot
1683
	 * (used if a driver does not support multiple threads)
1684
	 */
1685
	result = isc_mutex_init(&imp->driverlock);
1686
	if (result != ISC_R_SUCCESS) {
1687
		UNEXPECTED_ERROR(__FILE__, __LINE__,
1688
				 "isc_mutex_init() failed: %s",
1689
				 isc_result_totext(result));
1690
		goto cleanup_mctx;
1691
	}
1692
1693
	imp->dlz_imp = NULL;
1694
1695
	/*
1696
	 * register the DLZ driver.  Pass in our "extra" sdlz information as
1697
	 * a driverarg.  (that's why we stored the passed in driver arg in our
1698
	 * sdlz_implementation structure)  Also, store the dlz_implementation
1699
	 * structure in our sdlz_implementation.
1700
	 */
1701
	result = dns_dlzregister(drivername, &sdlzmethods, imp, mctx,
1702
				 &imp->dlz_imp);
1703
	
1704
	/* if registration fails, cleanup and get outta here. */
1705
	if (result != ISC_R_SUCCESS)
1706
		goto cleanup_mutex;
1707
1708
	*sdlzimp = imp;
1709
1710
	return (ISC_R_SUCCESS);
1711
1712
 cleanup_mutex:
1713
	/* destroy the driver lock, we don't need it anymore */
1714
	DESTROYLOCK(&imp->driverlock);
1715
1716
 cleanup_mctx:
1717
	/*
1718
	 * return the memory back to the available memory pool and remove it from
1719
	 * the memory context.
1720
	 */
1721
	isc_mem_put(mctx, imp, sizeof(dns_sdlzimplementation_t));
1722
	isc_mem_detach(&mctx);
1723
	return (result);
1724
}
1725
1726
void
1727
dns_sdlzunregister(dns_sdlzimplementation_t **sdlzimp) {
1728
1729
	dns_sdlzimplementation_t *imp;
1730
	isc_mem_t *mctx;
1731
1732
	/* Write debugging message to log */
1733
	isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
1734
	      DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
1735
	      "Unregistering SDLZ driver.");
1736
1737
	/* Performs checks to make sure data is as we expect / require it to be. */
1738
	REQUIRE(sdlzimp != NULL && *sdlzimp != NULL);
1739
1740
	imp = *sdlzimp;
1741
1742
	/* Unregister the DLZ driver implementation */
1743
	dns_dlzunregister(&imp->dlz_imp);
1744
1745
	/* destroy the driver lock, we don't need it anymore */
1746
	DESTROYLOCK(&imp->driverlock);
1747
1748
	mctx = imp->mctx;
1749
1750
	/*
1751
	 * return the memory back to the available memory pool and remove it from
1752
	 * the memory context.
1753
	 */
1754
	isc_mem_put(mctx, imp, sizeof(dns_sdlzimplementation_t));
1755
	isc_mem_detach(&mctx);
1756
1757
	*sdlzimp = NULL;
1758
}
1759
1760
#endif
1761
(-)bind-9.2.2-orig/lib/dns/view.c (+10 lines)
Lines 27-32 Link Here
27
#include <dns/adb.h>
27
#include <dns/adb.h>
28
#include <dns/cache.h>
28
#include <dns/cache.h>
29
#include <dns/db.h>
29
#include <dns/db.h>
30
#ifdef DLZ
31
#include <dns/dlz.h>
32
#endif
30
#include <dns/events.h>
33
#include <dns/events.h>
31
#include <dns/forward.h>
34
#include <dns/forward.h>
32
#include <dns/keytable.h>
35
#include <dns/keytable.h>
Lines 118-123 Link Here
118
121
119
	view->cache = NULL;
122
	view->cache = NULL;
120
	view->cachedb = NULL;
123
	view->cachedb = NULL;
124
#ifdef DLZ
125
	view->dlzdatabase = NULL;
126
#endif
121
	view->hints = NULL;
127
	view->hints = NULL;
122
	view->resolver = NULL;
128
	view->resolver = NULL;
123
	view->adb = NULL;
129
	view->adb = NULL;
Lines 239-244 Link Here
239
		isc_task_detach(&view->task);
245
		isc_task_detach(&view->task);
240
	if (view->hints != NULL)
246
	if (view->hints != NULL)
241
		dns_db_detach(&view->hints);
247
		dns_db_detach(&view->hints);
248
#ifdef DLZ
249
	if (view->dlzdatabase != NULL)
250
		dns_dlzdestroy(&view->dlzdatabase);
251
#endif
242
	if (view->cachedb != NULL)
252
	if (view->cachedb != NULL)
243
		dns_db_detach(&view->cachedb);
253
		dns_db_detach(&view->cachedb);
244
	if (view->cache != NULL)
254
	if (view->cache != NULL)
(-)bind-9.2.2-orig/lib/dns/win32/libdns.def (+12 lines)
Lines 715-717 Link Here
715
dst_lib_initmsgcat
715
dst_lib_initmsgcat
716
dst_result_totext
716
dst_result_totext
717
dst_result_register
717
dst_result_register
718
dns_dlzregister
719
dns_dlzunregister
720
dns_dlzallowzonexfr
721
dns_dlzcreate
722
dns_dlzdestroy
723
dns_dlzstrtoargv
724
dns_dlzfindzone
725
dns_sdlzregister
726
dns_sdlzunregister
727
dns_sdlz_putnamedrr
728
dns_sdlz_putrr
729
dns_sdlz_putsoa
(-)bind-9.2.2-orig/lib/isc/unix/dir.c (+19 lines)
Lines 56-65 Link Here
56
 */
56
 */
57
isc_result_t
57
isc_result_t
58
isc_dir_open(isc_dir_t *dir, const char *dirname) {
58
isc_dir_open(isc_dir_t *dir, const char *dirname) {
59
    char *p;
59
	isc_result_t result = ISC_R_SUCCESS;
60
	isc_result_t result = ISC_R_SUCCESS;
60
61
61
	REQUIRE(VALID_DIR(dir));
62
	REQUIRE(VALID_DIR(dir));
62
	REQUIRE(dirname != NULL);
63
	REQUIRE(dirname != NULL);
64
65
	/*
66
	 * Copy directory name.  Need to have enough space for the name,
67
	 * a possible path separator, the wildcard, and the final NUL.
68
	 */
69
	if (strlen(dirname) + 3 > sizeof(dir->dirname))
70
		/* XXXDCL ? */
71
		return (ISC_R_NOSPACE);
72
	strcpy(dir->dirname, dirname);
73
74
	/*
75
	 * Append path separator, if needed, and "*".
76
	 */
77
	p = dir->dirname + strlen(dir->dirname);
78
	if (dir->dirname < p && *(p - 1) != '/')
79
		*p++ = '/';
80
	*p++ = '*';
81
	*p++ = '\0';
63
82
64
	/*
83
	/*
65
	 * Open stream.
84
	 * Open stream.
(-)bind-9.2.2-orig/lib/isccfg/Makefile.in (-1 / +1 lines)
Lines 27-33 Link Here
27
27
28
CINCLUDES =	-I. ${DNS_INCLUDES} ${ISC_INCLUDES} ${ISCCFG_INCLUDES}
28
CINCLUDES =	-I. ${DNS_INCLUDES} ${ISC_INCLUDES} ${ISCCFG_INCLUDES}
29
29
30
CDEFINES =
30
CDEFINES =      @USE_DLZ@
31
CWARNINGS =
31
CWARNINGS =
32
32
33
ISCLIBS =	../../lib/isc/libisc.@A@
33
ISCLIBS =	../../lib/isc/libisc.@A@
(-)bind-9.2.2-orig/lib/isccfg/check.c (+49 lines)
Lines 340-345 Link Here
340
	return (result);
340
	return (result);
341
}
341
}
342
342
343
#ifdef DLZ
344
static isc_result_t
345
check_dynamically_loadable_zones_conf(cfg_obj_t *DLZconfig, isc_log_t *logctx) {
346
	
347
	isc_result_t result;
348
	const char *DLZname;
349
	cfg_obj_t *DLZoptions;
350
	cfg_obj_t *obj;
351
352
	DLZname = cfg_obj_asstring(cfg_tuple_get(DLZconfig, "name"));
353
354
	DLZoptions = cfg_tuple_get(DLZconfig, "options");
355
356
	obj = NULL;
357
	result = cfg_map_get(DLZoptions, "database", &obj);
358
359
	if(obj == NULL){
360
		cfg_obj_log(DLZconfig, logctx, ISC_LOG_ERROR,
361
			"dynamically loadable zones (DLZ) '%s': database not present", DLZname);
362
		return(ISC_R_FAILURE);
363
	}else if (strlen(cfg_obj_asstring(obj)) < 1) {
364
              cfg_obj_log(DLZconfig, logctx, ISC_LOG_ERROR,
365
                  "dynamically loadable zones (DLZ) database command string is zero length.");
366
        return(ISC_R_FAILURE);
367
    }
368
	return(ISC_R_SUCCESS);
369
}
370
371
#endif
372
343
isc_result_t
373
isc_result_t
344
cfg_check_key(cfg_obj_t *key, isc_log_t *logctx) {
374
cfg_check_key(cfg_obj_t *key, isc_log_t *logctx) {
345
	cfg_obj_t *algobj = NULL;
375
	cfg_obj_t *algobj = NULL;
Lines 437-442 Link Here
437
	cfg_obj_t *servers = NULL;
467
	cfg_obj_t *servers = NULL;
438
	cfg_obj_t *zones = NULL;
468
	cfg_obj_t *zones = NULL;
439
	cfg_obj_t *keys = NULL;
469
	cfg_obj_t *keys = NULL;
470
#ifdef DLZ
471
	cfg_obj_t *dynamically_loadable_zones = NULL;
472
#endif
440
	cfg_listelt_t *element;
473
	cfg_listelt_t *element;
441
	isc_symtab_t *symtab = NULL;
474
	isc_symtab_t *symtab = NULL;
442
	isc_result_t result = ISC_R_SUCCESS;
475
	isc_result_t result = ISC_R_SUCCESS;
Lines 467-472 Link Here
467
	}
500
	}
468
501
469
	isc_symtab_destroy(&symtab);
502
	isc_symtab_destroy(&symtab);
503
504
#ifdef DLZ
505
	/*
506
	 * Check that all dynamically loadable zone statements are syntactically correct.
507
	 */
508
509
	if (vconfig != NULL)
510
		(void)cfg_map_get(vconfig, "dlz", &dynamically_loadable_zones);
511
	else
512
		(void)cfg_map_get(config, "dlz", &dynamically_loadable_zones);
513
	
514
	if(dynamically_loadable_zones != NULL)
515
		if (check_dynamically_loadable_zones_conf(dynamically_loadable_zones, logctx) != ISC_R_SUCCESS)
516
			return (ISC_R_FAILURE);
517
518
#endif
470
519
471
	/*
520
	/*
472
	 * Check that all key statements are syntactically correct and
521
	 * Check that all key statements are syntactically correct and
(-)bind-9.2.2-orig/lib/isccfg/parser.c (+49 lines)
Lines 448-453 Link Here
448
static cfg_type_t cfg_type_netprefix;
448
static cfg_type_t cfg_type_netprefix;
449
static cfg_type_t cfg_type_zone;
449
static cfg_type_t cfg_type_zone;
450
static cfg_type_t cfg_type_zoneopts;
450
static cfg_type_t cfg_type_zoneopts;
451
#ifdef DLZ
452
static cfg_type_t cfg_type_dynamically_loadable_zones;
453
static cfg_type_t cfg_type_dynamically_loadable_zones_opts;
454
#endif
451
static cfg_type_t cfg_type_logging;
455
static cfg_type_t cfg_type_logging;
452
static cfg_type_t cfg_type_optional_facility;
456
static cfg_type_t cfg_type_optional_facility;
453
static cfg_type_t cfg_type_void;
457
static cfg_type_t cfg_type_void;
Lines 634-639 Link Here
634
static cfg_type_t cfg_type_zone = {
638
static cfg_type_t cfg_type_zone = {
635
	"zone", parse_tuple, print_tuple, &cfg_rep_tuple, zone_fields };
639
	"zone", parse_tuple, print_tuple, &cfg_rep_tuple, zone_fields };
636
640
641
#ifdef DLZ
642
/*
643
 * A dynamically loadable zones statement.
644
 */
645
static cfg_tuplefielddef_t dynamically_loadable_zones_fields[] = {
646
	{ "name", &cfg_type_astring, 0 },
647
	{ "options", &cfg_type_dynamically_loadable_zones_opts, 0 },
648
	{ NULL, NULL, 0 }
649
};
650
static cfg_type_t cfg_type_dynamically_loadable_zones = {
651
	"dlz", parse_tuple, print_tuple, &cfg_rep_tuple, dynamically_loadable_zones_fields};
652
653
#endif
654
637
/*
655
/*
638
 * A "category" clause in the "logging" statement.
656
 * A "category" clause in the "logging" statement.
639
 */
657
 */
Lines 798-803 Link Here
798
namedconf_or_view_clauses[] = {
816
namedconf_or_view_clauses[] = {
799
	{ "key", &cfg_type_key, CFG_CLAUSEFLAG_MULTI },
817
	{ "key", &cfg_type_key, CFG_CLAUSEFLAG_MULTI },
800
	{ "zone", &cfg_type_zone, CFG_CLAUSEFLAG_MULTI },
818
	{ "zone", &cfg_type_zone, CFG_CLAUSEFLAG_MULTI },
819
#ifdef DLZ
820
	{ "dlz", &cfg_type_dynamically_loadable_zones, 0 },     // only 1 DLZ per view allowed
821
#endif
801
	{ "server", &cfg_type_server, CFG_CLAUSEFLAG_MULTI },
822
	{ "server", &cfg_type_server, CFG_CLAUSEFLAG_MULTI },
802
#ifdef ISC_RFC2535
823
#ifdef ISC_RFC2535
803
	{ "trusted-keys", &cfg_type_trustedkeys, CFG_CLAUSEFLAG_MULTI },
824
	{ "trusted-keys", &cfg_type_trustedkeys, CFG_CLAUSEFLAG_MULTI },
Lines 963-968 Link Here
963
	{ NULL, NULL, 0 }
984
	{ NULL, NULL, 0 }
964
};
985
};
965
986
987
#ifdef DLZ
988
989
/*
990
 * Clauses that can be found in a 'dynamically loadable zones' statement
991
 */
992
static cfg_clausedef_t
993
dynamically_loadable_zones_clauses[] = {
994
	{ "database", &cfg_type_astring, 0 },
995
	{ NULL, NULL, 0 }
996
};
997
998
#endif
966
999
967
/* The top-level named.conf syntax. */
1000
/* The top-level named.conf syntax. */
968
1001
Lines 998-1003 Link Here
998
	namedconf_or_view_clauses,
1031
	namedconf_or_view_clauses,
999
	view_clauses,
1032
	view_clauses,
1000
	zone_clauses,
1033
	zone_clauses,
1034
#ifdef DLZ
1035
	dynamically_loadable_zones_clauses,
1036
#endif
1001
	NULL
1037
	NULL
1002
};
1038
};
1003
static cfg_type_t cfg_type_viewopts = {
1039
static cfg_type_t cfg_type_viewopts = {
Lines 1013-1018 Link Here
1013
};
1049
};
1014
static cfg_type_t cfg_type_zoneopts = {
1050
static cfg_type_t cfg_type_zoneopts = {
1015
	"zoneopts", parse_map, print_map, &cfg_rep_map, zone_clausesets };
1051
	"zoneopts", parse_map, print_map, &cfg_rep_map, zone_clausesets };
1052
1053
#ifdef DLZ
1054
/* The "dynamically loadable zones" statement syntax. */
1055
1056
static cfg_clausedef_t *
1057
dynamically_loadable_zones_clausesets[] = {
1058
	dynamically_loadable_zones_clauses,
1059
	NULL
1060
};
1061
static cfg_type_t cfg_type_dynamically_loadable_zones_opts = {
1062
	"dynamically_loadable_zones_opts", parse_map, print_map, &cfg_rep_map, dynamically_loadable_zones_clausesets };
1063
1064
#endif
1016
1065
1017
/*
1066
/*
1018
 * Clauses that can be found within the 'key' statement.
1067
 * Clauses that can be found within the 'key' statement.

Return to bug 45254