Codebase list getdns / upstream/1.6.0
New upstream version 1.6.0 Roger Shimizu 3 years ago
139 changed file(s) with 6535 addition(s) and 30432 deletion(s). Raw diff Collapse all Expand all
0 cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
1
2 if (POLICY CMP0075)
3 cmake_policy(SET CMP0075 NEW)
4 endif ()
5
6 # The following must be set BEFORE doing project() or enable_language().
7 if (NOT CMAKE_BUILD_TYPE)
8 message(STATUS "No build type defined; defaulting to 'Debug'")
9 set(CMAKE_BUILD_TYPE "Debug" CACHE STRING
10 "The type of build. Possible values are: Debug, Release, RelWithDebInfo and MinSizeRel.")
11 endif ()
12
13 set(PACKAGE "getdns")
14 set(PACKAGE_NAME "getdns")
15 set(PACKAGE_VERSION "1.6.0")
16 set(PACKAGE_BUGREPORT "team@getdnsapi.net")
17 set(PACKAGE_URL "https://getdnsapi.net")
18
19 # Dont forget to put a dash in front of the release candidate!!!
20 # That is how it is done with semantic versioning!
21 set(RELEASE_CANDIDATE "")
22
23 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}${RELEASE_CANDIDATE}")
24 set(PACKAGE_TARNAME "${PACKAGE}-${PACKAGE_VERSION}${RELEASE_CANDIDATE}")
25
26 set(GETDNS_VERSION "${PACKAGE_VERSION}${RELEASE_CANDIDATE}")
27 set(GETDNS_NUMERIC_VERSION 0x01060000)
28 set(API_VERSION "December 2015")
29 set(API_NUMERIC_VERSION 0x07df0c00)
30
31
32 # Library version
33 # ---------------
34 # current:revision:age
35 # (binary-api-number):(which-binary-api-version):(how-many-nrs-backwardscompat)
36 # if source code changes increment revision
37 # if any interfaces have been added/removed/changed since last update then
38 # increment current and set revision to 0
39 # if any interfaces have been added since the last public release then increment age
40 # if any interfaces have been removed or changed since the last public release then
41 # set age to 0
42 #
43 # getdns-0.1.4 had libversion 0:0:0
44 # getdns-0.1.5 had libversion 1:0:0
45 # getdns-0.1.6 had libversion 1:1:0
46 # getdns-0.1.7 had libversion 1:2:1 (but should have had 2:0:1)
47 # getdns-0.1.8 had libversion 1:3:0 (but should have had 2:1:1)
48 # getdns-0.2.0 had libversion 2:2:1
49 # getdns-0.3.0 had libversion 3:3:2
50 # getdns-0.3.1 had libversion 3:4:2
51 # getdns-0.3.2 had libversion 3:5:2
52 # getdns-0.3.3 had libversion 3:6:2
53 # getdns-0.5.0 had libversion 4:0:3
54 # getdns-0.5.1 had libversion 4:1:3 (but should have been getdns-0.6.0)
55 # getdns-0.9.0 had libversion 5:0:4
56 # getdns-1.0.0 had libversion 5:1:4
57 # getdns-1.1.0 had libversion 6:0:0
58 # getdns-1.1.1 had libversion 6:1:0
59 # getdns-1.1.2 had libversion 7:0:1
60 # getdns-1.1.3 had libversion 7:1:1
61 # getdns-1.2.0 had libversion 8:0:2
62 # getdns-1.2.1 had libversion 8:1:2
63 # getdns-1.3.0 had libversion 9:0:3
64 # getdns-1.4.0 had libversion 10:0:0
65 # getdns-1.4.1 had libversion 10:1:0
66 # getdns-1.4.2 had libversion 10:2:0
67 # getdns-1.5.0 had libversion 11:0:1
68 # getdns-1.5.1 had libversion 11:1:1
69 # getdns-1.5.2 had libversion 11:2:1
70 # getdns-1.6.0 has libversion 11:3:1
71 set(GETDNS_VERSION_CURRENT 11)
72 set(GETDNS_VERSION_REVISION 3)
73 set(GETDNS_VERSION_AGE 1)
74
75 project(getdns VERSION ${PACKAGE_VERSION} LANGUAGES C)
76
77 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
78
79 include(CheckCSourceRuns)
80 include(CheckFunctionExists)
81 include(CheckIncludeFile)
82 include(CheckLibraryExists)
83 include(CheckSymbolExists)
84 include(CheckTypeSize)
85 include(CMakeDependentOption)
86 include(CTest)
87 include(GNUInstallDirs)
88 include(TestBigEndian)
89
90 include(TargetSharedLibraryExports)
91 include(TargetSharedLibraryVersion)
92
93 # Target Platform
94 if (WIN32 OR MINGW OR MSYS OR CYGWIN)
95 set(HOSTOS "windows")
96 set(GETDNS_ON_WINDOWS 1)
97 set(USE_WINSOCK 1)
98 elseif (APPLE)
99 set(HOSTOS "macos")
100 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_DARWIN_C_SOURCE")
101 elseif (UNIX)
102 set(HOSTOS "unix")
103
104 if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
105 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600")
106 endif ()
107 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
108 set(LINUX 1)
109 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_BSD_SOURCE -D_DEFAULT_SOURCE")
110 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Solaris")
111 set(SOLARIS 1)
112 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS_")
113 endif ()
114 endif ()
115
116 test_big_endian(TARGET_IS_BIG_ENDIAN)
117 set(HAVE_TARGET_ENDIANNESS 1)
118
119 # Options.
120 option(ENABLE_SHARED "Build shared libraries." ON)
121 option(ENABLE_STATIC "Build static libraries." ON)
122 if ((NOT ENABLE_SHARED) AND (NOT ENABLE_STATIC))
123 message(FATAL_ERROR "You must build either static or shared libraries.")
124 endif ()
125
126 option(ENABLE_DEBUG_ALL "Enable all debugging messages.")
127 cmake_dependent_option(ENABLE_DEBUG_REQ "Enable request debugging messages." OFF "NOT ENABLE_DEBUG_ALL" ON)
128 cmake_dependent_option(ENABLE_DEBUG_SCHED "Enable scheduling debugging messages." OFF "NOT ENABLE_DEBUG_ALL" ON)
129 cmake_dependent_option(ENABLE_DEBUG_STUB "Enable stub debugging messages." OFF "NOT ENABLE_DEBUG_ALL" ON)
130 cmake_dependent_option(ENABLE_DEBUG_DAEMON "Enable daemon debugging messages." OFF "NOT ENABLE_DEBUG_ALL" ON)
131 cmake_dependent_option(ENABLE_DEBUG_DNSSEC "Enable DNSSEC debugging messages." OFF "NOT ENABLE_DEBUG_ALL" ON)
132 cmake_dependent_option(ENABLE_DEBUG_SERVER "Enable server debugging messages." OFF "NOT ENABLE_DEBUG_ALL" ON)
133 cmake_dependent_option(ENABLE_DEBUG_ANCHOR "Enable anchor debugging messages." OFF "NOT ENABLE_DEBUG_ALL" ON)
134
135 option(ENABLE_SHA1 "Enable SHA1 RRSIG support." ON)
136 option(ENABLE_SHA2 "Enable SHA256 and SHA512 RRSIG support." ON)
137 option(ENABLE_GOST "Enable GOST support." ON)
138 option(ENABLE_ECDSA "Enable ECDSA support." ON)
139 option(ENABLE_DSA "Enable DSA support." ON)
140 option(ENABLE_ED25519 "Enable ED25519 support." ON)
141 option(ENABLE_ED448 "Enable ED448 support." ON)
142
143 option(ENABLE_DRAFT_MDNS_SUPPORT "Enable draft mdns client support.")
144 option(ENABLE_EDNS_COOKIES "Enable EDNS cookies." ON)
145 option(ENABLE_NATIVE_STUB_DNSSEC "Enable native stub DNSSEC support." ON)
146 option(ENABLE_POLL_EVENTLOOP "Enable default eventloop based on poll." ON)
147 if (WIN32)
148 option(ENABLE_STUB_ONLY "Restrict resolution modes to STUB." ON)
149 else()
150 option(ENABLE_STUB_ONLY "Restrict resolution modes to STUB." OFF)
151 endif()
152 option(ENABLE_TCP_FAST_OPEN "Enable use of TCP Fast Open." ON)
153 option(ENABLE_UNBOUND_EVENT_API "Enable usage of libunbound's event API." ON)
154
155 option(BUILD_DOXYGEN "Build source documentation." OFF)
156 option(BUILD_EXAMPLES "Compile the example programs." OFF)
157 option(BUILD_GETDNS_QUERY "Compile and install the getdns_query tool." ON)
158 option(BUILD_GETDNS_SERVER_MON "Compile and install the getdns_server_mon tool." ON)
159 option(BUILD_STUBBY "Compile and install stubby, the (stub) resolver daemon." OFF)
160
161 option(BUILD_LIBEV "Build libev support library if available." ON)
162 option(BUILD_LIBEVENT2 "Build libevent2 support library if available." ON)
163 option(BUILD_LIBUV "Build libuv support library available." ON)
164
165 option(USE_LIBIDN2 "Use libidn2 if available." ON)
166 option(USE_GNUTLS "Use GnuTLS for TLS connections." OFF)
167
168 # Above names chosen for user consistency. Now define substituted names.
169 set(REQ_DEBUG ${ENABLE_DEBUG_REQ})
170 set(SCHED_DEBUG ${ENABLE_DEBUG_SCHED})
171 set(STUB_DEBUG ${ENABLE_DEBUG_STUB})
172 set(DAEMON_DEBUG ${ENABLE_DEBUG_DAEMON})
173 set(SEC_DEBUG ${ENABLE_DEBUG_DNSSEC})
174 set(SERVER_DEBUG ${ENABLE_DEBUG_SERVER})
175 set(ANCHOR_DEBUG ${ENABLE_DEBUG_ANCHOR})
176 set(EDNS_COOKIES ${ENABLE_EDNS_COOKIES})
177
178 set(USE_SHA1 ${ENABLE_SHA1})
179 set(USE_SHA2 ${ENABLE_SHA2})
180 set(USE_GOST ${ENABLE_GOST})
181 set(USE_ECDSA ${ENABLE_ECDSA})
182 set(USE_DSA ${ENABLE_DSA})
183 set(USE_ED25519 ${ENABLE_ED25519})
184 set(USE_ED448 ${ENABLE_ED448})
185
186 set(HAVE_MDNS_SUPPORT ${ENABLE_DRAFT_MDNS_SUPPORT})
187 set(STUB_NATIVE_DNSSEC ${ENABLE_NATIVE_STUB_DNSSEC})
188
189 set(USE_LIBEV ${BUILD_LIBEV})
190 set(USE_LIBEVENT2 ${BUILD_LIBEVENT2})
191 set(USE_LIBUV ${BUILD_LIBUV})
192
193 option(ENABLE_DEBUG_KEEP_CONNECTIONS_OPEN "Disable connection idle timeout. Do not enable.")
194 mark_as_advanced(ENABLE_DEBUG_KEEP_CONNECTIONS_OPEN)
195 set(KEEP_CONNECTIONS_OPEN_DEBUG ${ENABLE_DEBUG_KEEP_CONNECTIONS_OPEN})
196
197 # Options variables.
198 string(TIMESTAMP timestamp "%Y-%m-%dT%H:%M:%SZ")
199 set(CURRENT_DATE "${timestamp}" CACHE STRING "Current date of the compilation, set to fixed date for reproducible builds.")
200 set(DNSSEC_ROADBLOCK_AVOIDANCE ON CACHE BOOL "Enable/disable DNSSEC roadblock avoidance.")
201 set(FD_SETSIZE "" CACHE STRING "Set maximum file descriptor number that can be used by select.")
202 set(MAX_UDP_BACKOFF 1000 CACHE STRING "Set the maximum number of messages that can be sent to other upstreams before the upstream which has previously timed out will be tried again.")
203 if (WIN32)
204 # BUG! Don't hardcode the Windows directory and drive.
205 set(hostsfile "C:/Windows/System32/Drivers/etc/hosts")
206 else ()
207 set(hostsfile "/etc/hosts")
208 endif ()
209 set(PATH_HOSTS "${hostsfile}" CACHE STRING "Set the static table lookup for hostnames path.")
210 set(PATH_RESOLVCONF "/etc/resolv.conf" CACHE STRING "Set the resolver configuration file path. Not used on Windows, where values are retrieved via GetNetworkParams().")
211 set(PATH_TRUST_ANCHOR_FILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/unbound/getdns-root.key" CACHE STRING "Default location of the trust anchor file.")
212
213 # Ensure option variables in config.h that get values from the above are
214 # defined, and so will actually appear in config.h.
215 set(GETDNS_FN_HOSTS 1)
216 set(GETDNS_FN_RESOLVCONF 1)
217 set(TRUST_ANCHOR_FILE 1)
218 set(UDP_MAX_BACKOFF 1)
219
220 # Options not exposed in autoconf.
221 set(DRAFT_RRTYPES 1)
222 set(EDNS_COOKIE_OPCODE 10)
223 set(EDNS_COOKIE_ROLLOVER_TIME "(24*60*60)")
224 set(EDNS_PADDING_OPCODE 12)
225 set(MAX_CNAME_REFERRALS 100)
226 set(MAXIMUM_UPSTREAM_OPTION_SPACE 3000)
227
228 # Values derived from options.
229 set(GETDNS_COMPILATION_COMMENT "${PACKAGE_NAME} ${GETDNS_VERSION} configured on ${CURRENT_DATE} for the ${API_VERSION} version of the API")
230
231 # Compiler flags
232 if (MSVC)
233 # The Visual Studio C compiler is C90 with some of C99 and C11.
234 # So full on warnings are not appropriate.
235 add_compile_options(/W2)
236 else ()
237 add_compile_options(-Wall -Wextra -Wpedantic)
238 endif ()
239
240 # Windows. Uh-oh.
241 set(getdns_system_libs "")
242 set(static_lib_suffix "")
243 if (DEFINED GETDNS_ON_WINDOWS)
244 set(static_lib_suffix "_static")
245 list(APPEND getdns_system_libs
246 "ws2_32"
247 "crypt32"
248 "gdi32"
249 "iphlpapi"
250 "psapi"
251 "userenv"
252 )
253 endif ()
254
255 # Check for include files
256 check_include_file(assert.h HAVE_ASSERT_H)
257 check_include_file(inttypes.h HAVE_INTTYPES_H)
258 check_include_file(limits.h HAVE_LIMITS_H)
259 check_include_file(sys/limits.h HAVE_SYS_LIMITS_H)
260 check_include_file(stdarg.h HAVE_STDARG_H)
261 check_include_file(stdint.h HAVE_STDINT_H)
262 check_include_file(stdio.h HAVE_STDIO_H)
263 check_include_file(stdlib.h HAVE_STDLIB_H)
264 check_include_file(string.h HAVE_STRING_H)
265 check_include_file(strings.h HAVE_STRINGS_H)
266 check_include_file(time.h HAVE_TIME_H)
267 check_include_file(unistd.h HAVE_UNISTD_H)
268
269 check_include_file(fcntl.h HAVE_FCNTL_H)
270
271 check_include_file(signal.h HAVE_SIGNAL_H)
272 check_include_file(sys/poll.h HAVE_SYS_POLL_H)
273 check_include_file(poll.h HAVE_POLL_H)
274 check_include_file(resource.h HAVE_RESOURCE_H)
275 check_include_file(sys/types.h HAVE_SYS_TYPES_H)
276 check_include_file(sys/stat.h HAVE_SYS_STAT_H)
277
278 check_include_file(endian.h HAVE_ENDIAN_H)
279 check_include_file(netdb.h HAVE_NETDB_H)
280 check_include_file(arpa/inet.h HAVE_ARPA_INET_H)
281 check_include_file(netinet/in.h HAVE_NETINET_IN_H)
282 check_include_file(sys/select.h HAVE_SYS_SELECT_H)
283 check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
284 check_include_file(sys/sysctl.h HAVE_SYS_SYSCTL_H)
285 check_include_file(sys/time.h HAVE_SYS_TIME_H)
286 check_include_file(sys/wait.h HAVE_SYS_WAIT_H)
287
288 check_include_file(windows.h HAVE_WINDOWS_H)
289 check_include_file(winsock.h HAVE_WINSOCK_H)
290 check_include_file(winsock2.h HAVE_WINSOCK2_H)
291 check_include_file(ws2tcpip.h HAVE_WS2TCPIP_H)
292
293 # Check for include declarations
294 check_symbol_exists(getentropy unistd.h HAVE_DECL_GETENTROPY)
295 if (DEFINED GETDNS_ON_WINDOWS)
296 set(CMAKE_REQUIRED_LIBRARIES ${getdns_system_libs})
297 check_symbol_exists(inet_pton ws2tcpip.h HAVE_DECL_INET_PTON)
298 check_symbol_exists(inet_ntop ws2tcpip.h HAVE_DECL_INET_NTOP)
299 else ()
300 check_symbol_exists(inet_pton arpa/inet.h HAVE_DECL_INET_PTON)
301 check_symbol_exists(inet_ntop arpa/inet.h HAVE_DECL_INET_NTOP)
302 endif ()
303 check_symbol_exists(mkstemp stdlib.h HAVE_DECL_MKSTEMP)
304 check_symbol_exists(sigemptyset signal.h HAVE_DECL_SIGEMPTYSET)
305 check_symbol_exists(sigfillset signal.h HAVE_DECL_SIGFILLSET)
306 check_symbol_exists(sigaddset signal.h HAVE_DECL_SIGADDSET)
307 check_symbol_exists(strptime time.h HAVE_DECL_STRPTIME)
308
309 # Check for functions
310 check_function_exists(fcntl HAVE_FCNTL)
311 check_function_exists(getauxval HAVE_GETAUXVAL)
312 check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
313 check_function_exists(ioctlsocket HAVE_IOCTLSOCKET)
314 check_function_exists(sigemptyset HAVE_SIGEMPTYSET)
315 check_function_exists(sigfillset HAVE_SIGFILLSET)
316 check_function_exists(sigaddset HAVE_SIGADDSET)
317 check_function_exists(strptime HAVE_STRPTIME)
318
319 # Check for types
320 check_type_size(sigset_t SIGSET_T)
321 check_type_size(_sigset_t _SIGSET_T)
322
323 # SSL library
324 find_package(OpenSSL "1.0.2" REQUIRED)
325
326 set(HAVE_SSL 1)
327 set(tlsdir "openssl")
328
329 set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
330 check_include_file(openssl/ssl.h HAVE_OPENSSL_SSL_H)
331 check_include_file(openssl/evp.h HAVE_OPENSSL_EVP_H)
332 check_include_file(openssl/err.h HAVE_OPENSSL_ERR_H)
333 check_include_file(openssl/rand.h HAVE_OPENSSL_RAND_H)
334 check_include_file(openssl/conf.h HAVE_OPENSSL_CONF_H)
335 check_include_file(openssl/engine.h HAVE_OPENSSL_ENGINE_H)
336
337 set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
338 check_function_exists(DSA_SIG_set0 HAVE_DSA_SIG_SET0)
339 check_function_exists(DSA_set0_pqg HAVE_DSA_SET0_PQG)
340 check_function_exists(DSA_set0_key HAVE_DSA_SET0_KEY)
341
342 check_function_exists(RSA_set0_key HAVE_RSA_SET0_KEY)
343
344 check_function_exists(EVP_md5 HAVE_EVP_MD5)
345 check_function_exists(EVP_sha1 HAVE_EVP_SHA1)
346 check_function_exists(EVP_sha224 HAVE_EVP_SHA224)
347 check_function_exists(EVP_sha256 HAVE_EVP_SHA256)
348 check_function_exists(EVP_sha384 HAVE_EVP_SHA384)
349 check_function_exists(EVP_sha512 HAVE_EVP_SHA512)
350
351 check_function_exists(EVP_dss1 HAVE_EVP_DSS1)
352 check_function_exists(EVP_DigestVerify HAVE_EVP_DIGESTVERIFY)
353
354 check_function_exists(EVP_MD_CTX_new HAVE_EVP_MD_CTX_NEW)
355
356 check_function_exists(HMAC_CTX_new HAVE_HMAC_CTX_NEW)
357
358 check_function_exists(OpenSSL_version_num HAVE_OPENSSL_VERSION_NUM)
359 check_function_exists(OpenSSL_version HAVE_OPENSSL_VERSION)
360
361 check_function_exists(SSL_CTX_dane_enable HAVE_SSL_CTX_DANE_ENABLE)
362
363 check_function_exists(SSL_CTX_set_ciphersuites HAVE_SSL_CTX_SET_CIPHERSUITES)
364 check_function_exists(SSL_set_ciphersuites HAVE_SSL_SET_CIPHERSUITES)
365
366 check_function_exists(OPENSSL_init_crypto HAVE_OPENSSL_INIT_CRYPTO)
367
368 check_symbol_exists(SSL_dane_enable "openssl/ssl.h" HAVE_SSL_DANE_ENABLE)
369 check_symbol_exists(SSL_CTX_set1_curves_list "openssl/ssl.h" HAVE_DECL_SSL_CTX_SET1_CURVES_LIST)
370 check_symbol_exists(SSL_set1_curves_list "openssl/ssl.h" HAVE_DECL_SSL_SET1_CURVES_LIST)
371 check_symbol_exists(SSL_set_min_proto_version "openssl/ssl.h" HAVE_DECL_SSL_SET_MIN_PROTO_VERSION)
372 check_symbol_exists(TLS_client_method "openssl/ssl.h" HAVE_TLS_CLIENT_METHOD)
373 check_symbol_exists(X509_get_notAfter "openssl/x509.h" HAVE_X509_GET_NOTAFTER)
374 check_symbol_exists(X509_get0_notAfter "openssl/x509.h" HAVE_X509_GET0_NOTAFTER)
375
376 check_symbol_exists(NID_ED25519 "openssl/obj_mac.h" HAVE_SSL_ED25519)
377 check_symbol_exists(NID_ED448 "openssl/obj_mac.h" HAVE_SSL_ED448)
378
379 # Threading library
380 set(THREADS_PREFER_PTHREAD_FLAG ON)
381 find_package(Threads REQUIRED)
382
383 if (CMAKE_USE_PTHREADS_INIT)
384 set(HAVE_PTHREAD 1)
385 elseif (CMAKE_USE_WIN32_THREADS_INIT)
386 set(HAVE_WINDOWS_THREADS 1)
387 else ()
388 message(WARNING "Neither pthreads nor Windows threading available.")
389 endif ()
390
391 # Libidn2
392 if (USE_LIBIDN2)
393 find_package(Libidn2 "2.0.0" REQUIRED)
394 if (Libidn2_FOUND)
395 set(HAVE_LIBIDN2 1)
396 else()
397 message(FATAL_ERROR "Libidn2 required but not found. Disable with USE_LIBIDN2 option.")
398 endif()
399 endif()
400
401 # GnuTLS and Nettle. If using GnuTLS, we need the Nettle dev stuff to
402 # handle digital signature algorithms. GnuTLS uses Nettle internally.
403 if (USE_GNUTLS)
404 find_package(GnuTLS "3.5.0" REQUIRED)
405 find_package(Nettle "3.2" REQUIRED)
406
407 set(tlsdir "gnutls")
408 set(HAVE_NETTLE 1)
409
410 set(CMAKE_REQUIRED_INCLUDES ${NETTLE_INCLUDE_DIR})
411 set(CMAKE_REQUIRED_LIBRARIES ${NETTLE_LIBRARIES})
412 check_include_file(nettle/dsa-compat.h HAVE_NETTLE_DSA_COMPAT_H)
413 check_include_file(nettle/eddsa.h HAVE_NETTLE_EDDSA_H)
414
415 # API change in Nettle 3.4.
416 check_symbol_exists(nettle_get_secp_256r1 "nettle/ecc-curve.h" HAVE_NETTLE_GET_SECP_256R1)
417 check_symbol_exists(nettle_get_secp_384r1 "nettle/ecc-curve.h" HAVE_NETTLE_GET_SECP_384R1)
418 endif()
419
420 # Sort out what signature algorithms can be used.
421 if (USE_ED25519)
422 if (USE_GNUTLS)
423 if (NOT HAVE_NETTLE_EDDSA_H)
424 message(WARNING "ED25519 enabled and Nettle does not support it. Disabled.")
425 unset(USE_ED25519)
426 endif ()
427 elseif (NOT HAVE_SSL_ED25519)
428 message(WARNING "ED25519 enabled and OpenSSL does not support it. Disabled.")
429 unset(USE_ED25519)
430 endif ()
431 endif ()
432
433 if (USE_ED448)
434 if (USE_GNUTLS)
435 message(WARNING "ED448 enabled and Nettle support not implemented. Disabled.")
436 unset(USE_ED448)
437 elseif (NOT HAVE_SSL_ED448)
438 message(WARNING "ED448 enabled and OpenSSL does not support it. Disabled.")
439 unset(USE_ED448)
440 endif ()
441 endif ()
442
443 # Stuff that might be in a BSD library
444 check_symbol_exists(strlcpy string.h HAVE_DECL_STRLCPY)
445 check_symbol_exists(arc4random stdlib.h HAVE_DECL_ARC4RANDOM)
446 check_symbol_exists(arc4random_uniform stdlib.h HAVE_DECL_ARC4RANDOM_UNIFORM)
447
448 check_function_exists(strlcpy HAVE_STRLCPY)
449 check_function_exists(arc4random HAVE_ARC4RANDOM)
450 check_function_exists(arc4random_uniform HAVE_ARC4RANDOM_UNIFORM)
451
452 if (NOT
453 (HAVE_STRLCPY AND HAVE_DECL_STRLCPY AND
454 HAVE_ARC4RANDOM AND HAVE_DECL_ARC4RANDOM AND
455 HAVE_ARC4RANDOM_UNIFORM AND HAVE_DECL_ARC4RANDOM_UNIFORM))
456 find_library(BSD_LIBRARY bsd)
457 if (BSD_LIBRARY)
458 unset(CMAKE_REQUIRED_LIBRARIES)
459 set(CMAKE_REQUIRED_LIBRARIES ${BSD_LIBRARY})
460 mark_as_advanced(BSD_LIBRARY)
461 list(APPEND getdns_system_libs ${BSD_LIBRARY})
462
463 check_include_file(bsd/stdlib.h HAVE_BSD_STDLIB_H)
464 check_include_file(bsd/string.h HAVE_BSD_STRING_H)
465
466 check_symbol_exists(strlcpy "bsd/string.h" HAVE_BSD_DECL_STRLCPY)
467 set(HAVE_DECL_STRLCPY ${HAVE_BSD_DECL_STRLCPY})
468 check_symbol_exists(arc4random "bsd/stdlib.h" HAVE_BSD_DECL_ARC4RANDOM)
469 set(HAVE_DECL_ARC4RANDOM ${HAVE_BSD_DECL_ARC4RANDOM})
470 check_symbol_exists(arc4random_uniform "bsd/stdlib.h" HAVE_BSD_DECL_ARC4RANDOM_UNIFORM)
471 set(HAVE_DECL_ARC4RANDOM_UNIFORM ${HAVE_BSD_DECL_ARC4RANDOM_UNIFORM})
472
473 check_function_exists(strlcpy HAVE_BSD_STRLCPY)
474 set(HAVE_STRLCPY ${HAVE_BSD_STRLCPY})
475 check_function_exists(arc4random HAVE_BSD_ARC4RANDOM)
476 set(HAVE_ARC4RANDOM ${HAVE_BSD_ARC4RANDOM})
477 check_function_exists(arc4random_uniform HAVE_BSD_ARC4RANDOM_UNIFORM)
478 set(HAVE_ARC4RANDOM_UNIFORM ${HAVE_BSD_ARC4RANDOM_UNIFORM})
479 endif ()
480 endif ()
481 mark_as_advanced(BSD_LIBRARY)
482
483 # If we're not stub only, we need libunbound.
484 if (NOT ENABLE_STUB_ONLY)
485 find_package(Libunbound "1.5.9" REQUIRED)
486 set(HAVE_LIBUNBOUND 1)
487 list(APPEND getdns_system_libs Libunbound::Libunbound)
488
489 set(CMAKE_REQUIRED_INCLUDES ${LIBUNBOUND_INCLUDE_DIR})
490 set(CMAKE_REQUIRED_LIBRARIES ${LIBUNBOUND_LIBRARIES})
491 check_include_file(unbound-event.h HAVE_UNBOUND_EVENT_H)
492 check_symbol_exists(ub_ctx_create_ub_event "unbound-event.h" HAVE_UNBOUND_EVENT_API)
493 check_symbol_exists(ub_ctx_set_stub "unbound-event.h" HAVE_UB_CTX_SET_STUB)
494 endif ()
495
496 # Event loop extension
497 set(DEFAULT_EVENTLOOP "select_eventloop")
498 if (ENABLE_POLL_EVENTLOOP)
499 if (HAVE_SYS_POLL_H)
500 set(TEST_CFLAG "-DHAVE_SYS_POLL_H=1")
501 endif ()
502 try_compile(USE_POLL_DEFAULT_EVENTLOOP
503 ${CMAKE_CURRENT_BINARY_DIR}
504 ${CMAKE_CURRENT_SOURCE_DIR}/cmake/tests/test_poll.c
505 COMPILE_DEFINITIONS "${TEST_CFLAG}"
506 )
507 if (USE_POLL_DEFAULT_EVENTLOOP)
508 set(DEFAULT_EVENTLOOP "poll_eventloop")
509 endif ()
510 endif ()
511
512 # Custom checks
513 set(STRPTIME_TEST_SOURCE "\n
514 #define _XOPEN_SOURCE 600\n
515 #include <time.h>\n
516 int main(void) { struct tm tm; char *res;\n
517 res = strptime(\"2010-07-15T00:00:00+00:00\", \"%t%Y%t-%t%m%t-%t%d%tT%t%H%t:%t%M%t:%t%S%t\", &tm);\n
518 if (!res) return 2;\n
519 res = strptime(\"20070207111842\", \"%Y%m%d%H%M%S\", &tm);\n
520 if (!res) return 1; return 0; }")
521
522 if (HAVE_STRPTIME)
523 check_c_source_runs("${STRPTIME_TEST_SOURCE}" STRPTIME_WORKS)
524 endif ()
525
526 try_compile(HAVE___FUNC__
527 ${CMAKE_CURRENT_BINARY_DIR}
528 ${CMAKE_CURRENT_SOURCE_DIR}/cmake/tests/test___func__.c
529 )
530
531 # TCP Fast Open.
532 if (NOT ENABLE_TCP_FAST_OPEN)
533 message(WARNING "TCP Fast Open disabled.")
534 else ()
535 if (APPLE AND HAVE_SYS_SOCKET_H)
536 check_symbol_exists(CONNECT_RESUME_ON_READ_WRITE "sys/socket.h" USE_OSX_TCP_FASTOPEN)
537 if (NOT USE_OSX_TCP_FASTOPEN)
538 message(WARNING "TCP Fast Open not available, continuing without.")
539 endif ()
540 else ()
541 check_include_file(netinet/tcp.h HAVE_NETINET_TCP_H)
542 check_symbol_exists(TCP_FASTOPEN "sys/socket.h;netinet/tcp.h" HAVE_DECL_TCP_FASTOPEN)
543 check_symbol_exists(TCP_FASTOPEN_CONNECT "sys/socket.h;netinet/tcp.h" HAVE_DECL_TCP_FASTOPEN_CONNECT)
544 check_symbol_exists(MSG_FASTOPEN "sys/socket.h;netinet/tcp.h" HAVE_DECL_MSG_FASTOPEN)
545 if (NOT HAVE_DECL_TCP_FASTOPEN)
546 message(WARNING "TCP Fast Open not available, continuing without.")
547 endif ()
548 endif ()
549 endif ()
550
551 # Main library
552 add_library(getdns_objects OBJECT
553 src/anchor.c
554 src/const-info.c
555 src/convert.c
556 src/context.c
557 src/dict.c
558 src/dnssec.c
559 src/general.c
560 src/list.c
561 src/request-internal.c
562 src/mdns.c
563 src/platform.c
564 src/pubkey-pinning.c
565 src/rr-dict.c
566 src/rr-iter.c
567 src/server.c
568 src/stub.c
569 src/sync.c
570 src/ub_loop.c
571 src/util-internal.c
572
573 src/extension/${DEFAULT_EVENTLOOP}.c
574
575 src/gldns/keyraw.c
576 src/gldns/gbuffer.c
577 src/gldns/wire2str.c
578 src/gldns/parse.c
579 src/gldns/parseutil.c
580 src/gldns/rrdef.c
581 src/gldns/str2wire.c
582
583 src/util/rbtree.c
584 src/util/lruhash.c
585 src/util/lookup3.c
586 src/util/locks.c
587
588 src/jsmn/jsmn.c
589
590 src/yxml/yxml.c
591
592 src/tls/val_secalgo.c
593 src/tls/anchor-internal.c
594
595 src/${tlsdir}/tls.c
596 src/${tlsdir}/pubkey-pinning-internal.c
597 src/${tlsdir}/keyraw-internal.c
598
599 ${CMAKE_CURRENT_BINARY_DIR}/version.c
600 )
601 if (NOT HAVE_GETTIMEOFDAY)
602 target_sources(getdns_objects PRIVATE src/compat/gettimeofday.c)
603 endif ()
604 if (NOT HAVE_DECL_INET_PTON)
605 target_sources(getdns_objects PRIVATE src/compat/inet_pton.c)
606 endif ()
607 if (NOT HAVE_DECL_INET_NTOP)
608 target_sources(getdns_objects PRIVATE src/compat/inet_ntop.c)
609 endif ()
610 if (NOT HAVE_DECL_MKSTEMP)
611 target_sources(getdns_objects PRIVATE src/compat/mkstemp.c)
612 endif ()
613 if (NOT HAVE_DECL_STRLCPY)
614 target_sources(getdns_objects PRIVATE src/compat/strlcpy.c)
615 endif ()
616 if (NOT HAVE_DECL_ARC4RANDOM)
617 target_sources(getdns_objects PRIVATE
618 src/compat/arc4random.c
619 src/compat/explicit_bzero.c
620 src/compat/arc4_lock.c
621 )
622
623 if (NOT HAVE_DECL_GETENTROPY)
624 if (DEFINED GETDNS_ON_WINDOWS)
625 target_sources(getdns_objects PRIVATE src/compat/getentropy_win.c)
626 elseif (APPLE)
627 target_sources(getdns_objects PRIVATE src/compat/getentropy_osx.c)
628 elseif (DEFINED LINUX)
629 target_sources(getdns_objects PRIVATE src/compat/getentropy_linux.c)
630 endif ()
631 endif ()
632 endif ()
633 if (NOT HAVE_DECL_ARC4RANDOM_UNIFORM)
634 target_sources(getdns_objects PRIVATE src/compat/arc4random_uniform.c)
635 endif ()
636 if (NOT STRPTIME_WORKS)
637 target_sources(getdns_objects PRIVATE src/compat/strptime.c)
638 endif ()
639 target_include_directories(getdns_objects
640 PUBLIC
641 src
642
643 PRIVATE
644 src/util/auxiliary
645 src/${tlsdir}
646 src/tls
647 src/yxml
648
649 ${CMAKE_CURRENT_BINARY_DIR}
650
651 # Note - CMake 3.5 doesn't like target_link_libraries on objects,
652 # which would be preferred way to add an include dependency.
653 ${OPENSSL_INCLUDE_DIR}
654 )
655 target_compile_definitions(getdns_objects PRIVATE JSMN_GETDNS YXML_GETDNS)
656 if (NOT HAVE_SSL_DANE_ENABLE)
657 target_sources(getdns_objects PRIVATE src/ssl_dane/danessl.c)
658 target_include_directories(getdns_objects PRIVATE src/ssl_dane)
659 set(USE_DANESSL 1)
660 endif ()
661 if (Libidn_FOUND)
662 target_include_directories(getdns_objects PRIVATE ${LIBIDN_INCLUDE_DIR})
663 endif ()
664 if (Libidn2_FOUND)
665 target_include_directories(getdns_objects PRIVATE ${LIBIDN2_INCLUDE_DIR})
666 endif ()
667 if (Libunbound_FOUND)
668 target_include_directories(getdns_objects PRIVATE ${LIBUNBOUND_INCLUDE_DIR})
669 endif ()
670 if (GnuTLS_FOUND)
671 target_include_directories(getdns_objects PRIVATE ${GNUTLS_INCLUDE_DIR})
672 endif ()
673
674 # Don't compile separate objects for shared and static libraries.
675 # Yes, -fPIC is slightly suboptimal for static libraries, but it looks
676 # to me that it's the behaviour the autoconf build follows.
677 set_property(TARGET getdns_objects PROPERTY POSITION_INDEPENDENT_CODE 1)
678 set_property(TARGET getdns_objects PROPERTY C_STANDARD 11)
679
680 # Static library version of main library.
681 if (ENABLE_STATIC)
682 add_library(getdns STATIC $<TARGET_OBJECTS:getdns_objects>)
683 target_include_directories(getdns PUBLIC
684 "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
685 ${CMAKE_CURRENT_BINARY_DIR}
686 )
687 target_link_libraries(getdns
688 PUBLIC
689 OpenSSL::SSL
690 OpenSSL::Crypto
691 Threads::Threads
692 ${getdns_system_libs}
693 )
694 if (Libunbound_FOUND)
695 target_link_libraries(getdns PUBLIC Libunbound::Libunbound)
696 endif ()
697 if (Libidn_FOUND)
698 target_link_libraries(getdns PUBLIC Libidn::Libidn)
699 endif ()
700 if (Libidn2_FOUND)
701 target_link_libraries(getdns PUBLIC Libidn2::Libidn2)
702 endif ()
703 if (GnuTLS_FOUND)
704 target_link_libraries(getdns PUBLIC GnuTLS::GnuTLS GnuTLS::Dane)
705 endif ()
706 if (Nettle_FOUND)
707 target_link_libraries(getdns PUBLIC Nettle::Nettle Nettle::Hogweed)
708 endif ()
709 set_target_properties(getdns PROPERTIES OUTPUT_NAME getdns${static_lib_suffix})
710 endif ()
711
712 # Shared library version of main library.
713 if (ENABLE_SHARED)
714 add_library(getdns_shared SHARED $<TARGET_OBJECTS:getdns_objects>)
715 target_include_directories(getdns_shared PUBLIC
716 "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
717 ${CMAKE_CURRENT_BINARY_DIR}
718 )
719 target_link_libraries(getdns_shared
720 PUBLIC
721 OpenSSL::SSL
722 OpenSSL::Crypto
723 Threads::Threads
724 ${getdns_system_libs}
725 )
726 if (Libunbound_FOUND)
727 target_link_libraries(getdns_shared PUBLIC Libunbound::Libunbound)
728 endif ()
729 if (Libidn_FOUND)
730 target_link_libraries(getdns_shared PUBLIC Libidn::Libidn)
731 endif ()
732 if (Libidn2_FOUND)
733 target_link_libraries(getdns_shared PUBLIC Libidn2::Libidn2)
734 endif ()
735 if (GnuTLS_FOUND)
736 target_link_libraries(getdns_shared PUBLIC GnuTLS::GnuTLS GnuTLS::Dane)
737 endif ()
738 if (Nettle_FOUND)
739 target_link_libraries(getdns_shared PUBLIC Nettle::Nettle Nettle::Hogweed)
740 endif ()
741 set_target_properties(getdns_shared PROPERTIES OUTPUT_NAME getdns)
742 target_shared_library_version(getdns_shared ${GETDNS_VERSION_CURRENT} ${GETDNS_VERSION_REVISION} ${GETDNS_VERSION_AGE})
743
744 # Generate platform-specific link file with the export symbols.
745 file(STRINGS src/libgetdns.symbols symbols)
746 target_shared_library_exports(getdns_shared getdns "${symbols}")
747
748 # If we're not building a static library, use this wherever we use
749 # the static library in tool and test builds.
750 if (NOT ENABLE_STATIC)
751 add_library(getdns ALIAS getdns_shared)
752 endif ()
753 endif ()
754
755 # libev extension.
756 if (USE_LIBEV)
757 find_package(Libev)
758 if (Libev_FOUND)
759 # Copy module header to getdns include dir.
760 file(COPY src/getdns/getdns_ext_libev.h DESTINATION getdns)
761
762 add_library(ev_objects OBJECT src/extension/libev.c)
763 target_include_directories(ev_objects
764 PRIVATE
765 src
766 ${CMAKE_CURRENT_BINARY_DIR}
767 ${LIBEV_INCLUDE_DIR}
768 )
769 set_property(TARGET ev_objects PROPERTY POSITION_INDEPENDENT_CODE 1)
770 set_property(TARGET ev_objects PROPERTY C_STANDARD 11)
771 if (ENABLE_STATIC)
772 add_library(getdns_ex_ev STATIC $<TARGET_OBJECTS:ev_objects>)
773 target_include_directories(getdns_ex_ev PRIVATE Libev::Libev)
774 target_link_libraries(getdns_ex_ev PUBLIC getdns Libev::Libev)
775 if (Libunbound_FOUND)
776 target_link_libraries(getdns_ex_ev PUBLIC Libunbound::Libunbound)
777 endif ()
778 set_target_properties(getdns_ex_ev PROPERTIES OUTPUT_NAME getdns_ex_ev${static_lib_suffix})
779 endif ()
780 if (ENABLE_SHARED)
781 add_library(getdns_ex_ev_shared SHARED $<TARGET_OBJECTS:ev_objects>)
782 target_include_directories(getdns_ex_ev_shared PRIVATE Libev::Libev)
783 target_link_libraries(getdns_ex_ev_shared PUBLIC getdns_shared Libev::Libev)
784 if (Libunbound_FOUND)
785 target_link_libraries(getdns_ex_ev_shared PUBLIC Libunbound::Libunbound)
786 endif ()
787 set_target_properties(getdns_ex_ev_shared PROPERTIES OUTPUT_NAME getdns_ex_ev)
788 target_shared_library_version(getdns_ex_ev_shared ${GETDNS_VERSION_CURRENT} ${GETDNS_VERSION_REVISION} ${GETDNS_VERSION_AGE})
789 file(STRINGS src/extension/libev.symbols symbols)
790 target_shared_library_exports(getdns_ex_ev_shared getdns_ex_ev "${symbols}")
791 if (NOT ENABLE_STATIC)
792 add_library(getdns_ex_ev ALIAS getdns_ex_ev_shared)
793 endif ()
794 endif ()
795 else ()
796 message(WARNING "Libev support library build requested, but libev not found. Disabled.")
797 unset(USE_LIBEV)
798 endif ()
799 endif ()
800
801 # libevent2 extension.
802 if (USE_LIBEVENT2)
803 find_package(Libevent2)
804 if (Libevent2_FOUND)
805 # Given libevent2, set defines required by source.
806 set(HAVE_EVENT2_EVENT_H 1)
807 set(HAVE_EVENT_BASE_FREE 1)
808 set(HAVE_EVENT_BASE_NEW 1)
809
810 # Copy module header to getdns include dir.
811 file(COPY src/getdns/getdns_ext_libevent.h DESTINATION getdns)
812
813 add_library(event2_objects OBJECT src/extension/libevent.c)
814 target_include_directories(event2_objects
815 PRIVATE
816 src
817 ${CMAKE_CURRENT_BINARY_DIR}
818 ${LIBEVENT2_INCLUDE_DIR}
819 )
820 set_property(TARGET event2_objects PROPERTY POSITION_INDEPENDENT_CODE 1)
821 set_property(TARGET event2_objects PROPERTY C_STANDARD 11)
822 if (ENABLE_STATIC)
823 add_library(getdns_ex_event STATIC $<TARGET_OBJECTS:event2_objects>)
824 target_include_directories(getdns_ex_event PRIVATE Libevent2::Libevent_code)
825 target_link_libraries(getdns_ex_event PUBLIC getdns Libevent2::Libevent_core)
826 if (Libunbound_FOUND)
827 target_link_libraries(getdns_ex_event PUBLIC Libunbound::Libunbound)
828 endif ()
829 set_target_properties(getdns_ex_event PROPERTIES OUTPUT_NAME getdns_ex_event${static_lib_suffix})
830 endif ()
831 if (ENABLE_SHARED)
832 add_library(getdns_ex_event_shared SHARED $<TARGET_OBJECTS:event2_objects>)
833 target_include_directories(getdns_ex_event_shared PRIVATE Libevent2::Libevent_code)
834 target_link_libraries(getdns_ex_event_shared PUBLIC getdns_shared Libevent2::Libevent_core)
835 if (Libunbound_FOUND)
836 target_link_libraries(getdns_ex_event_shared PUBLIC Libunbound::Libunbound)
837 endif ()
838 set_target_properties(getdns_ex_event_shared PROPERTIES OUTPUT_NAME getdns_ex_event)
839 target_shared_library_version(getdns_ex_event_shared ${GETDNS_VERSION_CURRENT} ${GETDNS_VERSION_REVISION} ${GETDNS_VERSION_AGE})
840 file(STRINGS src/extension/libevent.symbols symbols)
841 target_shared_library_exports(getdns_ex_event_shared getdns_ex_event "${symbols}")
842 if (NOT ENABLE_STATIC)
843 add_library(getdns_ex_event ALIAS getdns_ex_event_shared)
844 endif ()
845 endif ()
846 else ()
847 message(WARNING "Libevent2 support library build requested, but libevent2 not found. Disabled.")
848 unset(USE_LIBEVENT2)
849 endif ()
850 endif ()
851
852 # libuv extension.
853 if (USE_LIBUV)
854 find_package(Libuv)
855 if (Libuv_FOUND)
856 # Check for new-style callbacks.
857 try_compile(HAVE_NEW_UV_TIMER_CB
858 ${CMAKE_CURRENT_BINARY_DIR}
859 ${CMAKE_CURRENT_SOURCE_DIR}/cmake/tests/test_uv_cb.c
860 )
861
862 # Copy module header to getdns include dir.
863 file(COPY src/getdns/getdns_ext_libuv.h DESTINATION getdns)
864
865 add_library(uv_objects OBJECT src/extension/libuv.c)
866 target_include_directories(uv_objects
867 PRIVATE
868 src
869 ${CMAKE_CURRENT_BINARY_DIR}
870 ${LIBUV_INCLUDE_DIR}
871 )
872 set_property(TARGET uv_objects PROPERTY POSITION_INDEPENDENT_CODE 1)
873 set_property(TARGET uv_objects PROPERTY C_STANDARD 11)
874 if (ENABLE_STATIC)
875 add_library(getdns_ex_uv STATIC $<TARGET_OBJECTS:uv_objects>)
876 target_include_directories(getdns_ex_uv PRIVATE Libuv::Libuv)
877 target_link_libraries(getdns_ex_uv PUBLIC getdns Libuv::Libuv)
878 if (Libunbound_FOUND)
879 target_link_libraries(getdns_ex_uv PUBLIC Libunbound::Libunbound)
880 endif ()
881 set_target_properties(getdns_ex_uv PROPERTIES OUTPUT_NAME getdns_ex_uv${static_lib_suffix})
882 endif ()
883 if (ENABLE_SHARED)
884 add_library(getdns_ex_uv_shared SHARED $<TARGET_OBJECTS:uv_objects>)
885 target_include_directories(getdns_ex_uv_shared PRIVATE Libuv::Libuv)
886 target_link_libraries(getdns_ex_uv_shared PUBLIC getdns_shared Libuv::Libuv)
887 if (Libunbound_FOUND)
888 target_link_libraries(getdns_ex_uv_shared PUBLIC Libunbound::Libunbound)
889 endif ()
890 set_target_properties(getdns_ex_uv_shared PROPERTIES OUTPUT_NAME getdns_ex_uv)
891 target_shared_library_version(getdns_ex_uv_shared ${GETDNS_VERSION_CURRENT} ${GETDNS_VERSION_REVISION} ${GETDNS_VERSION_AGE})
892 file(STRINGS src/extension/libuv.symbols symbols)
893 target_shared_library_exports(getdns_ex_uv_shared getdns_ex_uv "${symbols}")
894 if (NOT ENABLE_STATIC)
895 add_library(getdns_ex_uv ALIAS getdns_ex_uv_shared)
896 endif ()
897 endif ()
898 else ()
899 message(WARNING "Libuv support library build requested, but libuv not found. Disabled.")
900 unset(USE_LIBUV)
901 endif ()
902 endif ()
903
904 # The tools.
905 if (BUILD_GETDNS_QUERY)
906 add_executable(getdns_query src/tools/getdns_query.c)
907 if (NOT HAVE_GETTIMEOFDAY)
908 target_sources(getdns_query PRIVATE src/compat/gettimeofday.c)
909 endif ()
910 target_link_libraries(getdns_query PRIVATE getdns)
911 if (Libunbound_FOUND)
912 target_link_libraries(getdns_query PUBLIC Libunbound::Libunbound)
913 endif ()
914 set_property(TARGET getdns_query PROPERTY C_STANDARD 11)
915 endif ()
916
917 if (BUILD_GETDNS_SERVER_MON)
918 add_executable(getdns_server_mon src/tools/getdns_server_mon.c)
919 target_link_libraries(getdns_server_mon
920 PUBLIC
921 OpenSSL::SSL
922 OpenSSL::Crypto
923 PRIVATE
924 getdns
925 )
926 if (Libunbound_FOUND)
927 target_link_libraries(getdns_server_mon PUBLIC Libunbound::Libunbound)
928 endif ()
929 set_property(TARGET getdns_server_mon PROPERTY C_STANDARD 11)
930 endif ()
931
932 if (BUILD_TESTING)
933 if (WIN32)
934 message(WARNING "Test programs require libcheck and so do not build on Windows, skipping.")
935 else ()
936 find_package(Check "0.9.6" REQUIRED)
937 set(GETDNS_TEST_SOURCE_FILES
938 src/test/check_getdns_common.c
939 src/test/check_getdns_context_set_timeout.c
940 src/test/check_getdns_transport.c
941 src/test/check_getdns_selectloop.c
942 src/test/check_getdns.c)
943 set(GETDNS_TEST_LINK_LIBS
944 getdns
945 Check::Check
946 Threads::Threads)
947
948 add_executable(check_getdns ${GETDNS_TEST_SOURCE_FILES})
949 target_link_libraries(check_getdns PRIVATE ${GETDNS_TEST_LINK_LIBS})
950 add_test(NAME test_noeventloop COMMAND check_getdns)
951 set_property(TEST test_noeventloop PROPERTY
952 ENVIRONMENT "GETDNS_TEST_PORT=43210;CK_TIMEOUT_MULTIPLIER=2;CK_LOG_FILE_NAME=check_getdns.log"
953 )
954
955 if (USE_LIBEVENT2)
956 add_executable(check_getdns_event ${GETDNS_TEST_SOURCE_FILES})
957 target_link_libraries(check_getdns_event PRIVATE ${GETDNS_TEST_LINK_LIBS} getdns_ex_event)
958 add_test(NAME test_libevent COMMAND check_getdns_event)
959 set_property(TEST test_libevent PROPERTY
960 ENVIRONMENT "GETDNS_TEST_PORT=44321;CK_TIMEOUT_MULTIPLIER=2;CK_LOG_FILE_NAME=check_getdns_event.log"
961 )
962 endif()
963
964 if (USE_LIBEV)
965 add_executable(check_getdns_ev ${GETDNS_TEST_SOURCE_FILES})
966 target_link_libraries(check_getdns_ev PRIVATE ${GETDNS_TEST_LINK_LIBS} getdns_ex_ev)
967 add_test(NAME test_libev COMMAND check_getdns_ev)
968 set_property(TEST test_libev PROPERTY
969 ENVIRONMENT "GETDNS_TEST_PORT=45321;CK_TIMEOUT_MULTIPLIER=2;CK_LOG_FILE_NAME=check_getdns_ev.log"
970 )
971 endif()
972
973 if (USE_LIBUV)
974 add_executable(check_getdns_uv ${GETDNS_TEST_SOURCE_FILES})
975 target_link_libraries(check_getdns_uv PRIVATE ${GETDNS_TEST_LINK_LIBS} getdns_ex_uv)
976 add_test(NAME test_libuv COMMAND check_getdns_uv)
977 set_property(TEST test_libuv PROPERTY
978 ENVIRONMENT "GETDNS_TEST_PORT=46321;CK_TIMEOUT_MULTIPLIER=2;CK_LOG_FILE_NAME=check_getdns_uv.log"
979 )
980 endif()
981
982 add_executable(tests_dict
983 src/test/tests_dict.c
984 src/test/testmessages.c
985 )
986 target_link_libraries(tests_dict PRIVATE getdns Check::Check)
987
988 add_executable(tests_list
989 src/test/tests_list.c
990 src/test/testmessages.c
991 )
992 target_link_libraries(tests_list PRIVATE getdns Check::Check)
993
994 add_executable(tests_namespaces src/test/tests_namespaces.c)
995 target_link_libraries(tests_namespaces PRIVATE getdns Check::Check)
996
997 add_executable(tests_stub_async
998 src/test/tests_stub_async.c
999 src/test/testmessages.c
1000 )
1001 target_link_libraries(tests_stub_async PRIVATE getdns Check::Check)
1002
1003 add_executable(tests_stub_sync src/test/tests_stub_sync.c)
1004 target_link_libraries(tests_stub_sync PRIVATE getdns Check::Check)
1005 endif()
1006 endif ()
1007
1008 # Substitutions in files.
1009 configure_file(cmake/include/cmakeconfig.h.in config.h)
1010 configure_file(src/getdns/getdns.h.in getdns/getdns.h)
1011 configure_file(src/getdns/getdns_extra.h.in getdns/getdns_extra.h)
1012 configure_file(src/version.c.in version.c)
1013
1014 set(version ${PACKAGE_VERSION})
1015 set(date ${API_VERSION})
1016 file(GLOB mans doc/*.3.in)
1017 file(MAKE_DIRECTORY man3)
1018 foreach (man ${mans})
1019 get_filename_component(out ${man} NAME_WE)
1020 configure_file(${man} man3/${out}.3 @ONLY)
1021
1022 # Look through the page and make copies of the page for all APIs
1023 # defined in that page. Defined means listed in a line ".B <name>"
1024 # between lines ".SH NAME" and ".SH LIBRARY". Ignore terminating ","
1025 # or spaces in .B line.
1026 file(STRINGS ${man} manpage REGEX "^\\.(SH +NAME|SH +LIBRARY|B )")
1027 set(in_list 0)
1028 foreach (line ${manpage})
1029 if ("${line}" MATCHES "^\\.SH +NAME")
1030 set(in_list 1)
1031 elseif ("${line}" MATCHES "^\\.SH +LIBRARY")
1032 set(in_list 0)
1033 elseif (${in_list})
1034 string(REGEX REPLACE ".B +([^ ,]+).*" "\\1" alt "${line}")
1035 configure_file(${man} man3/${alt}.3 @ONLY)
1036 endif ()
1037 endforeach()
1038 endforeach()
1039
1040 set(prefix ${CMAKE_INSTALL_PREFIX})
1041 configure_file(getdns.pc.in getdns.pc @ONLY)
1042
1043 # Installing.
1044 if (ENABLE_STATIC)
1045 install(TARGETS getdns LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
1046 if (USE_LIBEV)
1047 install(TARGETS getdns_ex_ev LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
1048 endif ()
1049 if (USE_LIBEVENT2)
1050 install(TARGETS getdns_ex_event LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
1051 endif ()
1052 if (USE_LIBUV)
1053 install(TARGETS getdns_ex_uv LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
1054 endif ()
1055 endif ()
1056 if (ENABLE_SHARED)
1057 install(TARGETS getdns_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
1058 if (USE_LIBEV)
1059 install(TARGETS getdns_ex_ev_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
1060 endif ()
1061 if (USE_LIBEVENT2)
1062 install(TARGETS getdns_ex_event_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
1063 endif ()
1064 if (USE_LIBUV)
1065 install(TARGETS getdns_ex_uv_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
1066 endif ()
1067 endif ()
1068 if (BUILD_GETDNS_QUERY)
1069 install(TARGETS getdns_query RUNTIME DESTINATION bin)
1070 endif ()
1071 if (BUILD_GETDNS_SERVER_MON)
1072 install(TARGETS getdns_server_mon RUNTIME DESTINATION bin)
1073 endif ()
1074
1075 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/getdns DESTINATION include)
1076 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man3 DESTINATION share/man)
1077
1078 set(docdir share/doc/getdns)
1079 install(FILES AUTHORS ChangeLog COPYING LICENSE NEWS README.md DESTINATION ${docdir})
1080 install(FILES spec/index.html DESTINATION ${docdir}/spec)
1081 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/getdns.pc DESTINATION lib/pkgconfig)
1082
1083 install(CODE "message(\"\
1084 ***\n\
1085 *** !!! IMPORTANT !!!!\n\
1086 ***\n\
1087 *** From release 1.2.0, getdns comes with built-in DNSSEC\n\
1088 *** trust anchor management. External trust anchor management,\n\
1089 *** for example with unbound-anchor, is no longer necessary\n\
1090 *** and no longer recommended.\n\
1091 ***\n\
1092 *** Previously installed trust anchors, in the default location -\n\
1093 ***\n\
1094 *** /etc/unbound/getdns-root.key\n\
1095 ***\n\
1096 *** - will be preferred and used for DNSSEC validation, however\n\
1097 *** getdns will fallback to trust-anchors obtained via built-in\n\
1098 *** trust anchor management when the anchors from the default\n\
1099 *** location fail to validate the root DNSKEY rrset.\n\
1100 ***\n\
1101 *** To prevent expired DNSSEC trust anchors to be used for\n\
1102 *** validation, we strongly recommend removing the trust anchors\n\
1103 *** on the default location when there is no active external\n\
1104 *** trust anchor management keeping it up-to-date.\n\
1105 ***\")")
1106
1107 if (BUILD_STUBBY)
1108 add_subdirectory(stubby)
1109 endif ()
1110
1111 if (BUILD_EXAMPLES)
1112 add_executable(example-all-functions spec/example/example-all-functions.c)
1113 target_include_directories(example-all-functions PRIVATE spec/example)
1114 target_link_libraries(example-all-functions PRIVATE getdns)
1115 set_property(TARGET example-all-functions PROPERTY C_STANDARD 11)
1116
1117 add_executable(example-synchronous spec/example/example-synchronous.c)
1118 target_include_directories(example-synchronous PRIVATE spec/example)
1119 target_link_libraries(example-synchronous PRIVATE getdns)
1120 set_property(TARGET example-synchronous PROPERTY C_STANDARD 11)
1121
1122 if (USE_LIBEVENT2)
1123 add_executable(example-simple-answers spec/example/example-simple-answers.c)
1124 target_include_directories(example-simple-answers PRIVATE spec/example)
1125 target_link_libraries(example-simple-answers PRIVATE getdns getdns_ex_event)
1126 set_property(TARGET example-simple-answers PROPERTY C_STANDARD 11)
1127
1128 add_executable(example-tree spec/example/example-tree.c)
1129 target_include_directories(example-tree PRIVATE spec/example)
1130 target_link_libraries(example-tree PRIVATE getdns getdns_ex_event)
1131 set_property(TARGET example-tree PROPERTY C_STANDARD 11)
1132
1133 add_executable(example-reverse spec/example/example-reverse.c)
1134 target_include_directories(example-reverse PRIVATE spec/example)
1135 target_link_libraries(example-reverse PRIVATE getdns getdns_ex_event)
1136 set_property(TARGET example-reverse PROPERTY C_STANDARD 11)
1137 else ()
1138 message(WARNING "\
1139 Three examples from the specification need libevent. \
1140 libevent was not found or usable at compile time. \
1141 To compile and run all examples from the spec, make sure \
1142 libevent is available and usable during configuration.")
1143 endif ()
1144 endif ()
1145
1146 if (BUILD_DOXYGEN)
1147 find_package(Doxygen REQUIRED)
1148
1149 set(srcdir ${CMAKE_CURRENT_SOURCE_DIR}/src)
1150 configure_file(src/Doxyfile.in Doxyfile @ONLY)
1151 add_custom_command(OUTPUT doc/html/index.html
1152 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
1153 MAIN_DEPENDENCY Doxyfile
1154 COMMENT "Generating Doxygen docs.")
1155 add_custom_target(doc ALL DEPENDS doc/html/index.html)
1156 endif ()
+0
-24
COPYING less more
0 Copyright (c) 2013, Verisign, Inc., NLnet Labs
1 All rights reserved.
2
3 Redistribution and use in source and binary forms, with or without
4 modification, are permitted provided that the following conditions are met:
5 * Redistributions of source code must retain the above copyright
6 notice, this list of conditions and the following disclaimer.
7 * Redistributions in binary form must reproduce the above copyright
8 notice, this list of conditions and the following disclaimer in the
9 documentation and/or other materials provided with the distribution.
10 * Neither the names of the copyright holders nor the
11 names of its contributors may be used to endorse or promote products
12 derived from this software without specific prior written permission.
13
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
18 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0 LICENSE
0 * 2020-02-28: Version 1.6.0
1 * Issues #457, #458, #461: New symbols with libnettle >= 3.4.
2 Thanks hanvinke & kometchtech for testing & reporting.
3 * Issue #432: answer_ipv4_address and answer_ipv6_address in reply
4 and response dicts.
5 * Issue #430: Record and guard UDP max payload size with servers.
6 * Issue #407: Run only offline-tests option with:
7 src/test/tpkg/run-offline-only.sh (only with git checkouts).
8 * Issue #175: Include the packet the stub resolver sent to the
9 upstream the call_reporting dict. Thanks Tom Pusateri
10 * Issue #169: Build eventloop support libraries if event libraries
11 are available. Thanks Tom Pusateri
12
13 * 2019-12-20: Version 1.6.0-beta.1
14 * Migration of build system to cmake. Build now works on Ubuntu,
15 Windows 10 and macOS.
16 Some notes on minor differences in the new cmake build:
17 * OpenSSL 1.0.2 or higher is now required
18 * libunbound 1.5.9 is now required
19 * Only libidn2 2.0.0 and later is supported (not libidn)
20 * Windows uses ENABLE_STUB_ONLY=ON as the default
21 * Unit and regression tests work on Linux/macOS
22 (but not Windows yet)
23
024 * 2019-04-03: Version 1.5.2
125 * PR #424: Two small trust anchor fetcher fixes
226 Thanks Maciej S. Szmigiero
+0
-401
INSTALL less more
0 Installation Instructions
1 *************************
2
3 Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation,
4 Inc.
5
6 Copying and distribution of this file, with or without modification,
7 are permitted in any medium without royalty provided the copyright
8 notice and this notice are preserved. This file is offered as-is,
9 without warranty of any kind.
10
11 (Options specific to getdns are listed at the end of this document.)
12
13 Basic Installation
14 ==================
15
16 Briefly, the shell commands `./configure; make; make install' should
17 configure, build, and install this package. The following
18 more-detailed instructions are generic; see the `README' file for
19 instructions specific to this package. Some packages provide this
20 `INSTALL' file but do not implement all of the features documented
21 below. The lack of an optional feature in a given package is not
22 necessarily a bug. More recommendations for GNU packages can be found
23 in *note Makefile Conventions: (standards)Makefile Conventions.
24
25 The `configure' shell script attempts to guess correct values for
26 various system-dependent variables used during compilation. It uses
27 those values to create a `Makefile' in each directory of the package.
28 It may also create one or more `.h' files containing system-dependent
29 definitions. Finally, it creates a shell script `config.status' that
30 you can run in the future to recreate the current configuration, and a
31 file `config.log' containing compiler output (useful mainly for
32 debugging `configure').
33
34 It can also use an optional file (typically called `config.cache'
35 and enabled with `--cache-file=config.cache' or simply `-C') that saves
36 the results of its tests to speed up reconfiguring. Caching is
37 disabled by default to prevent problems with accidental use of stale
38 cache files.
39
40 If you need to do unusual things to compile the package, please try
41 to figure out how `configure' could check whether to do them, and mail
42 diffs or instructions to the address given in the `README' so they can
43 be considered for the next release. If you are using the cache, and at
44 some point `config.cache' contains results you don't want to keep, you
45 may remove or edit it.
46
47 The file `configure.ac' (or `configure.in') is used to create
48 `configure' by a program called `autoconf'. You need `configure.ac' if
49 you want to change it or regenerate `configure' using a newer version
50 of `autoconf'.
51
52 The simplest way to compile this package is:
53
54 1. `cd' to the directory containing the package's source code and type
55 `./configure' to configure the package for your system.
56
57 Running `configure' might take a while. While running, it prints
58 some messages telling which features it is checking for.
59
60 2. Type `make' to compile the package.
61
62 3. Optionally, type `make check' to run any self-tests that come with
63 the package, generally using the just-built uninstalled binaries.
64
65 4. Type `make install' to install the programs and any data files and
66 documentation. When installing into a prefix owned by root, it is
67 recommended that the package be configured and built as a regular
68 user, and only the `make install' phase executed with root
69 privileges.
70
71 5. Optionally, type `make installcheck' to repeat any self-tests, but
72 this time using the binaries in their final installed location.
73 This target does not install anything. Running this target as a
74 regular user, particularly if the prior `make install' required
75 root privileges, verifies that the installation completed
76 correctly.
77
78 6. You can remove the program binaries and object files from the
79 source code directory by typing `make clean'. To also remove the
80 files that `configure' created (so you can compile the package for
81 a different kind of computer), type `make distclean'. There is
82 also a `make maintainer-clean' target, but that is intended mainly
83 for the package's developers. If you use it, you may have to get
84 all sorts of other programs in order to regenerate files that came
85 with the distribution.
86
87 7. Often, you can also type `make uninstall' to remove the installed
88 files again. In practice, not all packages have tested that
89 uninstallation works correctly, even though it is required by the
90 GNU Coding Standards.
91
92 8. Some packages, particularly those that use Automake, provide `make
93 distcheck', which can by used by developers to test that all other
94 targets like `make install' and `make uninstall' work correctly.
95 This target is generally not run by end users.
96
97 Compilers and Options
98 =====================
99
100 Some systems require unusual options for compilation or linking that
101 the `configure' script does not know about. Run `./configure --help'
102 for details on some of the pertinent environment variables.
103
104 You can give `configure' initial values for configuration parameters
105 by setting variables in the command line or in the environment. Here
106 is an example:
107
108 ./configure CC=c99 CFLAGS=-g LIBS=-lposix
109
110 *Note Defining Variables::, for more details.
111
112 Compiling For Multiple Architectures
113 ====================================
114
115 You can compile the package for more than one kind of computer at the
116 same time, by placing the object files for each architecture in their
117 own directory. To do this, you can use GNU `make'. `cd' to the
118 directory where you want the object files and executables to go and run
119 the `configure' script. `configure' automatically checks for the
120 source code in the directory that `configure' is in and in `..'. This
121 is known as a "VPATH" build.
122
123 With a non-GNU `make', it is safer to compile the package for one
124 architecture at a time in the source code directory. After you have
125 installed the package for one architecture, use `make distclean' before
126 reconfiguring for another architecture.
127
128 On MacOS X 10.5 and later systems, you can create libraries and
129 executables that work on multiple system types--known as "fat" or
130 "universal" binaries--by specifying multiple `-arch' options to the
131 compiler but only a single `-arch' option to the preprocessor. Like
132 this:
133
134 ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
135 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
136 CPP="gcc -E" CXXCPP="g++ -E"
137
138 This is not guaranteed to produce working output in all cases, you
139 may have to build one architecture at a time and combine the results
140 using the `lipo' tool if you have problems.
141
142 Installation Names
143 ==================
144
145 By default, `make install' installs the package's commands under
146 `/usr/local/bin', include files under `/usr/local/include', etc. You
147 can specify an installation prefix other than `/usr/local' by giving
148 `configure' the option `--prefix=PREFIX', where PREFIX must be an
149 absolute file name.
150
151 You can specify separate installation prefixes for
152 architecture-specific files and architecture-independent files. If you
153 pass the option `--exec-prefix=PREFIX' to `configure', the package uses
154 PREFIX as the prefix for installing programs and libraries.
155 Documentation and other data files still use the regular prefix.
156
157 In addition, if you use an unusual directory layout you can give
158 options like `--bindir=DIR' to specify different values for particular
159 kinds of files. Run `configure --help' for a list of the directories
160 you can set and what kinds of files go in them. In general, the
161 default for these options is expressed in terms of `${prefix}', so that
162 specifying just `--prefix' will affect all of the other directory
163 specifications that were not explicitly provided.
164
165 The most portable way to affect installation locations is to pass the
166 correct locations to `configure'; however, many packages provide one or
167 both of the following shortcuts of passing variable assignments to the
168 `make install' command line to change installation locations without
169 having to reconfigure or recompile.
170
171 The first method involves providing an override variable for each
172 affected directory. For example, `make install
173 prefix=/alternate/directory' will choose an alternate location for all
174 directory configuration variables that were expressed in terms of
175 `${prefix}'. Any directories that were specified during `configure',
176 but not in terms of `${prefix}', must each be overridden at install
177 time for the entire installation to be relocated. The approach of
178 makefile variable overrides for each directory variable is required by
179 the GNU Coding Standards, and ideally causes no recompilation.
180 However, some platforms have known limitations with the semantics of
181 shared libraries that end up requiring recompilation when using this
182 method, particularly noticeable in packages that use GNU Libtool.
183
184 The second method involves providing the `DESTDIR' variable. For
185 example, `make install DESTDIR=/alternate/directory' will prepend
186 `/alternate/directory' before all installation names. The approach of
187 `DESTDIR' overrides is not required by the GNU Coding Standards, and
188 does not work on platforms that have drive letters. On the other hand,
189 it does better at avoiding recompilation issues, and works well even
190 when some directory options were not specified in terms of `${prefix}'
191 at `configure' time.
192
193 Optional Features
194 =================
195
196 If the package supports it, you can cause programs to be installed
197 with an extra prefix or suffix on their names by giving `configure' the
198 option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
199
200 Some packages pay attention to `--enable-FEATURE' options to
201 `configure', where FEATURE indicates an optional part of the package.
202 They may also pay attention to `--with-PACKAGE' options, where PACKAGE
203 is something like `gnu-as' or `x' (for the X Window System). The
204 `README' should mention any `--enable-' and `--with-' options that the
205 package recognizes.
206
207 For packages that use the X Window System, `configure' can usually
208 find the X include and library files automatically, but if it doesn't,
209 you can use the `configure' options `--x-includes=DIR' and
210 `--x-libraries=DIR' to specify their locations.
211
212 Some packages offer the ability to configure how verbose the
213 execution of `make' will be. For these packages, running `./configure
214 --enable-silent-rules' sets the default to minimal output, which can be
215 overridden with `make V=1'; while running `./configure
216 --disable-silent-rules' sets the default to verbose, which can be
217 overridden with `make V=0'.
218
219 Particular systems
220 ==================
221
222 On HP-UX, the default C compiler is not ANSI C compatible. If GNU
223 CC is not installed, it is recommended to use the following options in
224 order to use an ANSI C compiler:
225
226 ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
227
228 and if that doesn't work, install pre-built binaries of GCC for HP-UX.
229
230 HP-UX `make' updates targets which have the same time stamps as
231 their prerequisites, which makes it generally unusable when shipped
232 generated files such as `configure' are involved. Use GNU `make'
233 instead.
234
235 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
236 parse its `<wchar.h>' header file. The option `-nodtk' can be used as
237 a workaround. If GNU CC is not installed, it is therefore recommended
238 to try
239
240 ./configure CC="cc"
241
242 and if that doesn't work, try
243
244 ./configure CC="cc -nodtk"
245
246 On Solaris, don't put `/usr/ucb' early in your `PATH'. This
247 directory contains several dysfunctional programs; working variants of
248 these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
249 in your `PATH', put it _after_ `/usr/bin'.
250
251 On Haiku, software installed for all users goes in `/boot/common',
252 not `/usr/local'. It is recommended to use the following options:
253
254 ./configure --prefix=/boot/common
255
256 On Mac OSX getdns will not build against the version of OpenSSL shipped with
257 OSX. If you link against a self-complied version of OpenSSL then manual
258 configuration of certificates into the default OpenSSL directory
259 /usr/local/etc/openssl/certs is currently required for TLS authentication to work.
260 However if linking against the version of OpenSSL installed via Homebrew TLS
261 authentication will work out of the box.
262
263 Specifying the System Type
264 ==========================
265
266 There may be some features `configure' cannot figure out
267 automatically, but needs to determine by the type of machine the package
268 will run on. Usually, assuming the package is built to be run on the
269 _same_ architectures, `configure' can figure that out, but if it prints
270 a message saying it cannot guess the machine type, give it the
271 `--build=TYPE' option. TYPE can either be a short name for the system
272 type, such as `sun4', or a canonical name which has the form:
273
274 CPU-COMPANY-SYSTEM
275
276 where SYSTEM can have one of these forms:
277
278 OS
279 KERNEL-OS
280
281 See the file `config.sub' for the possible values of each field. If
282 `config.sub' isn't included in this package, then this package doesn't
283 need to know the machine type.
284
285 If you are _building_ compiler tools for cross-compiling, you should
286 use the option `--target=TYPE' to select the type of system they will
287 produce code for.
288
289 If you want to _use_ a cross compiler, that generates code for a
290 platform different from the build platform, you should specify the
291 "host" platform (i.e., that on which the generated programs will
292 eventually be run) with `--host=TYPE'.
293
294 Sharing Defaults
295 ================
296
297 If you want to set default values for `configure' scripts to share,
298 you can create a site shell script called `config.site' that gives
299 default values for variables like `CC', `cache_file', and `prefix'.
300 `configure' looks for `PREFIX/share/config.site' if it exists, then
301 `PREFIX/etc/config.site' if it exists. Or, you can set the
302 `CONFIG_SITE' environment variable to the location of the site script.
303 A warning: not all `configure' scripts look for a site script.
304
305 Defining Variables
306 ==================
307
308 Variables not defined in a site shell script can be set in the
309 environment passed to `configure'. However, some packages may run
310 configure again during the build, and the customized values of these
311 variables may be lost. In order to avoid this problem, you should set
312 them in the `configure' command line, using `VAR=value'. For example:
313
314 ./configure CC=/usr/local2/bin/gcc
315
316 causes the specified `gcc' to be used as the C compiler (unless it is
317 overridden in the site shell script).
318
319 Unfortunately, this technique does not work for `CONFIG_SHELL' due to
320 an Autoconf limitation. Until the limitation is lifted, you can use
321 this workaround:
322
323 CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
324
325 `configure' Invocation
326 ======================
327
328 `configure' recognizes the following options to control how it
329 operates.
330
331 `--help'
332 `-h'
333 Print a summary of all of the options to `configure', and exit.
334
335 `--help=short'
336 `--help=recursive'
337 Print a summary of the options unique to this package's
338 `configure', and exit. The `short' variant lists options used
339 only in the top level, while the `recursive' variant lists options
340 also present in any nested packages.
341
342 `--version'
343 `-V'
344 Print the version of Autoconf used to generate the `configure'
345 script, and exit.
346
347 `--cache-file=FILE'
348 Enable the cache: use and save the results of the tests in FILE,
349 traditionally `config.cache'. FILE defaults to `/dev/null' to
350 disable caching.
351
352 `--config-cache'
353 `-C'
354 Alias for `--cache-file=config.cache'.
355
356 `--quiet'
357 `--silent'
358 `-q'
359 Do not print messages saying which checks are being made. To
360 suppress all normal output, redirect it to `/dev/null' (any error
361 messages will still be shown).
362
363 `--srcdir=DIR'
364 Look for the package's source code in directory DIR. Usually
365 `configure' can determine that directory automatically.
366
367 `--prefix=DIR'
368 Use DIR as the installation prefix. *note Installation Names::
369 for more details, including other options available for fine-tuning
370 the installation locations.
371
372 `--no-create'
373 `-n'
374 Run the configure checks, but stop before creating any output
375 files.
376
377 `configure' also accepts some other, not widely useful, options. Run
378 `configure --help' for more details.
379
380 getdns-specific Options
381 =======================
382
383 `--with-libidn=pathname'
384 path to libidn (default: search /usr/local ..)
385
386 `--with-libunbound=pathname'
387 path to libunbound (default: search /usr/local ..)
388
389 `--with-libevent'
390 path to libevent (default: search /usr/local ..)
391
392 `--with-libuv'
393 path to libuv (default: search /usr/local ..)
394
395 `--with-libev'
396 path to libev (default: search /usr/local ..)
397
398 `--with-trust-anchor=KEYFILE'
399 Default location of the trust anchor file.
400 [default=SYSCONFDIR/unbound/getdns-root.key]
+0
-328
Makefile.in less more
0 #
1 # @configure_input@
2 #
3 #
4 # Copyright (c) 2013, Verisign, Inc., NLnet Labs
5 # All rights reserved.
6 #
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions are met:
9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # * Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
14 # * Neither the names of the copyright holders nor the
15 # names of its contributors may be used to endorse or promote products
16 # derived from this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 # DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
22 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 package = @PACKAGE_NAME@
30 version = @PACKAGE_VERSION@@RELEASE_CANDIDATE@
31 tarname = @PACKAGE_TARNAME@
32 PACKAGE_TARNAME = @PACKAGE_TARNAME@
33 distdir = $(tarname)-$(version)
34 bintar = $(distdir)-bin.tar.gz
35
36 prefix = @prefix@
37 datarootdir=@datarootdir@
38 exec_prefix = @exec_prefix@
39 bindir = @bindir@
40 docdir = @docdir@
41 libdir = @libdir@
42
43 srcdir = @srcdir@
44 INSTALL = @INSTALL@
45
46 all : default @GETDNS_QUERY@ @GETDNS_SERVER_MON@
47
48 everything: default
49 cd src/test && $(MAKE)
50
51 default:
52 cd src && $(MAKE) $@
53
54 install-lib:
55 cd src && $(MAKE) install
56
57 install: getdns.pc getdns_ext_event.pc install-lib @INSTALL_GETDNS_QUERY@ @INSTALL_GETDNS_SERVER_MON@
58 $(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
59 $(INSTALL) -m 644 $(srcdir)/AUTHORS $(DESTDIR)$(docdir)
60 $(INSTALL) -m 644 $(srcdir)/ChangeLog $(DESTDIR)$(docdir)
61 $(INSTALL) -m 644 $(srcdir)/COPYING $(DESTDIR)$(docdir)
62 $(INSTALL) -m 644 $(srcdir)/INSTALL $(DESTDIR)$(docdir)
63 $(INSTALL) -m 644 $(srcdir)/LICENSE $(DESTDIR)$(docdir)
64 $(INSTALL) -m 644 $(srcdir)/NEWS $(DESTDIR)$(docdir)
65 $(INSTALL) -m 644 $(srcdir)/README.md $(DESTDIR)$(docdir)
66 $(INSTALL) -m 755 -d $(DESTDIR)$(libdir)/pkgconfig
67 $(INSTALL) -m 644 getdns.pc $(DESTDIR)$(libdir)/pkgconfig
68 $(INSTALL) -m 644 getdns_ext_event.pc $(DESTDIR)$(libdir)/pkgconfig
69 $(INSTALL) -m 755 -d $(DESTDIR)$(docdir)/spec
70 $(INSTALL) -m 644 $(srcdir)/spec/index.html $(DESTDIR)$(docdir)/spec
71 cd doc && $(MAKE) install
72 @echo "***"
73 @echo "*** !!! IMPORTANT !!!!"
74 @echo "***"
75 @echo "*** From release 1.2.0, getdns comes with built-in DNSSEC"
76 @echo "*** trust anchor management. External trust anchor management,"
77 @echo "*** for example with unbound-anchor, is no longer necessary"
78 @echo "*** and no longer recommended."
79 @echo "***"
80 @echo "*** Previously installed trust anchors, in the default location -"
81 @echo "***"
82 @echo "*** @TRUST_ANCHOR_FILE@"
83 @echo "***"
84 @echo "*** - will be preferred and used for DNSSEC validation, however"
85 @echo "*** getdns will fallback to trust-anchors obtained via built-in"
86 @echo "*** trust anchor management when the anchors from the default"
87 @echo "*** location fail to validate the root DNSKEY rrset."
88 @echo "***"
89 @echo "*** To prevent expired DNSSEC trust anchors to be used for"
90 @echo "*** validation, we strongly recommend removing the trust anchors"
91 @echo "*** on the default location when there is no active external"
92 @echo "*** trust anchor management keeping it up-to-date."
93 @echo "***"
94
95 uninstall: @UNINSTALL_GETDNS_QUERY@ @UNINSTALL_GETDNS_SERVER_MON@
96 rm -rf $(DESTDIR)$(docdir)
97 cd doc && $(MAKE) $@
98 cd src && $(MAKE) $@
99
100 doc: FORCE
101 cd doc && $(MAKE) $@
102
103 example:
104 cd spec/example && $(MAKE) $@
105
106 test: default
107 cd src/test && $(MAKE) $@
108
109 getdns_query: default
110 cd src/tools && $(MAKE) $@
111
112 getdns_server_mon: default
113 cd src/tools && $(MAKE) $@
114
115 stubby:
116 cd src && $(MAKE) $@
117
118 scratchpad: default
119 cd src/test && $(MAKE) $@
120
121 pad: scratchpad
122 src/test/scratchpad || ./libtool exec gdb src/test/scratchpad
123
124 install-getdns_query: install-lib
125 cd src/tools && $(MAKE) $@
126
127 uninstall-getdns_query:
128 cd src/tools && $(MAKE) $@
129
130 install-getdns_server_mon: install-lib @INSTALL_GETDNS_QUERY@
131 cd src/tools && $(MAKE) $@
132
133 uninstall-getdns_server_mon:
134 cd src/tools && $(MAKE) $@
135
136 install-stubby:
137 cd src && $(MAKE) $@
138
139 uninstall-stubby:
140 cd src && $(MAKE) $@
141
142 clean:
143 cd src && $(MAKE) $@
144 cd doc && $(MAKE) $@
145 cd spec/example && $(MAKE) $@
146 rm -f *.o *.pc
147
148 depend:
149 cd src && $(MAKE) $@
150 cd spec/example && $(MAKE) $@
151
152 distclean:
153 cd src && $(MAKE) $@
154 rmdir src 2>/dev/null || true
155 cd doc && $(MAKE) $@
156 rmdir doc 2>/dev/null || true
157 cd spec/example && $(MAKE) $@
158 rmdir spec/example 2>/dev/null || true
159 rmdir spec 2>/dev/null || true
160 rm -f config.log config.status Makefile libtool getdns.pc getdns_ext_event.pc
161 rm -fR autom4te.cache
162 rm -f m4/libtool.m4
163 rm -f m4/lt~obsolete.m4
164 rm -f m4/ltoptions.m4
165 rm -f m4/ltsugar.m4
166 rm -f m4/ltversion.m4
167 rm -f $(distdir).tar.gz $(distdir).tar.gz.sha256 $(distdir).tar.gz.sha1
168 rm -f $(distdir).tar.gz.md5 $(distdir).tar.gz.asc
169
170 megaclean:
171 cd $(srcdir) && rm -fr * .dir-locals.el .gitignore .indent.pro .travis.yml && git reset --hard && git submodule update --init
172
173 autoclean: megaclean
174 libtoolize -ci
175 autoreconf -fi
176
177 dist: $(distdir).tar.gz
178
179 pub: $(distdir).tar.gz.sha256 $(distdir).tar.gz.md5 $(distdir).tar.gz.asc $(distdir).tar.gz.sha1
180
181 $(distdir).tar.gz.sha256: $(distdir).tar.gz
182 openssl sha256 $(distdir).tar.gz >$@
183
184 $(distdir).tar.gz.sha1: $(distdir).tar.gz
185 openssl sha1 $(distdir).tar.gz >$@
186
187 $(distdir).tar.gz.md5: $(distdir).tar.gz
188 openssl md5 $(distdir).tar.gz >$@
189
190 $(distdir).tar.gz.asc: $(distdir).tar.gz
191 gpg --armor --detach-sig $(distdir).tar.gz
192
193 bindist: $(bintar)
194
195 $(bintar): $(distdir)
196 chown -R 0:0 $(distdir) 2>/dev/null || true
197 cd $(distdir); ./configure; make
198 tar chof - $(distdir) | gzip -9 -c > $@
199 rm -rf $(distdir)
200
201 $(distdir).tar.gz: $(distdir)
202 chown -R 0:0 $(distdir) 2>/dev/null || true
203 tar chof - $(distdir) | gzip -9 -c > $@
204 rm -rf $(distdir)
205
206 $(distdir):
207 mkdir -p $(distdir)/m4
208 mkdir -p $(distdir)/src
209 mkdir -p $(distdir)/src/getdns
210 mkdir -p $(distdir)/src/test
211 mkdir -p $(distdir)/src/extension
212 mkdir -p $(distdir)/src/compat
213 mkdir -p $(distdir)/src/util
214 mkdir -p $(distdir)/src/gldns
215 mkdir -p $(distdir)/src/tls/validator
216 mkdir -p $(distdir)/src/gnutls
217 mkdir -p $(distdir)/src/openssl
218 mkdir -p $(distdir)/src/tools
219 mkdir -p $(distdir)/src/jsmn
220 mkdir -p $(distdir)/src/yxml
221 mkdir -p $(distdir)/src/ssl_dane
222 mkdir -p $(distdir)/doc
223 mkdir -p $(distdir)/spec
224 mkdir -p $(distdir)/spec/example
225 mkdir -p $(distdir)/stubby
226 mkdir -p $(distdir)/stubby/src
227 mkdir -p $(distdir)/stubby/src/yaml
228 mkdir -p $(distdir)/stubby/doc
229 mkdir -p $(distdir)/stubby/systemd
230 mkdir -p $(distdir)/stubby/contrib/upstart
231 cp $(srcdir)/configure.ac $(distdir)
232 cp $(srcdir)/configure $(distdir)
233 cp $(srcdir)/AUTHORS $(distdir)
234 cp $(srcdir)/ChangeLog $(distdir)
235 cp $(srcdir)/COPYING $(distdir)
236 cp $(srcdir)/INSTALL $(distdir)
237 cp $(srcdir)/LICENSE $(distdir)
238 cp $(srcdir)/NEWS $(distdir)
239 cp $(srcdir)/README.md $(distdir)
240 cp $(srcdir)/Makefile.in $(distdir)
241 cp $(srcdir)/install-sh $(distdir)
242 cp $(srcdir)/config.sub $(distdir)
243 cp $(srcdir)/config.guess $(distdir)
244 cp $(srcdir)/getdns.pc.in $(distdir)
245 cp $(srcdir)/getdns_ext_event.pc.in $(distdir)
246 cp libtool $(distdir)
247 cp $(srcdir)/ltmain.sh $(distdir)
248 cp $(srcdir)/m4/*.m4 $(distdir)/m4
249 cp $(srcdir)/src/*.in $(distdir)/src
250 cp $(srcdir)/src/*.[ch] $(distdir)/src
251 cp $(srcdir)/src/*.symbols $(distdir)/src
252 cp $(srcdir)/src/extension/*.[ch] $(distdir)/src/extension
253 cp $(srcdir)/src/extension/*.symbols $(distdir)/src/extension
254 cp $(srcdir)/src/getdns/*.in $(distdir)/src/getdns
255 cp $(srcdir)/src/getdns/getdns_*.h $(distdir)/src/getdns
256 cp $(srcdir)/src/test/Makefile.in $(distdir)/src/test
257 cp $(srcdir)/src/test/*.[ch] $(distdir)/src/test
258 cp $(srcdir)/src/test/*.sh $(distdir)/src/test
259 cp $(srcdir)/src/test/*.good $(distdir)/src/test
260 cp $(srcdir)/src/compat/*.[ch] $(distdir)/src/compat
261 cp $(srcdir)/src/util/*.[ch] $(distdir)/src/util
262 cp -r $(srcdir)/src/util/orig-headers $(distdir)/src/util
263 cp -r $(srcdir)/src/util/auxiliary $(distdir)/src/util
264 cp $(srcdir)/src/gldns/*.[ch] $(distdir)/src/gldns
265 cp $(srcdir)/src/tls/*.[ch] $(distdir)/src/tls
266 cp $(srcdir)/src/tls/validator/*.[ch] $(distdir)/src/tls/validator
267 cp $(srcdir)/src/gnutls/*.[ch] $(distdir)/src/gnutls
268 cp $(srcdir)/src/openssl/*.[ch] $(distdir)/src/openssl
269 cp $(srcdir)/doc/Makefile.in $(distdir)/doc
270 cp $(srcdir)/doc/*.in $(distdir)/doc
271 cp $(srcdir)/doc/manpgaltnames $(distdir)/doc
272 cp $(srcdir)/spec/*.html $(distdir)/spec
273 cp $(srcdir)/spec/example/Makefile.in $(distdir)/spec/example
274 cp $(srcdir)/spec/example/*.[ch] $(distdir)/spec/example
275 cp $(srcdir)/src/tools/Makefile.in $(distdir)/src/tools
276 cp $(srcdir)/src/tools/*.[ch] $(distdir)/src/tools
277 cp $(srcdir)/stubby/stubby.yml.example $(distdir)/stubby
278 cp $(srcdir)/stubby/macos/stubby-setdns-macos.sh $(distdir)/stubby
279 cp $(srcdir)/stubby/src/*.[ch] $(distdir)/stubby/src
280 cp $(srcdir)/stubby/src/yaml/*.[ch] $(distdir)/stubby/src/yaml
281 cp $(srcdir)/stubby/COPYING $(distdir)/stubby
282 cp $(srcdir)/stubby/README.md $(distdir)/stubby
283 cp $(srcdir)/stubby/doc/stubby.1.in $(distdir)/stubby/doc
284 cp $(srcdir)/stubby/systemd/README.md $(distdir)/stubby/systemd
285 cp $(srcdir)/stubby/systemd/stubby.conf $(distdir)/stubby/systemd
286 cp $(srcdir)/stubby/systemd/stubby.service $(distdir)/stubby/systemd
287 cp $(srcdir)/stubby/contrib/upstart/stubby.conf $(distdir)/stubby/contrib/upstart
288 cp $(srcdir)/src/jsmn/*.[ch] $(distdir)/src/jsmn
289 cp $(srcdir)/src/jsmn/LICENSE $(distdir)/src/jsmn
290 cp $(srcdir)/src/jsmn/README.md $(distdir)/src/jsmn
291 cp $(srcdir)/src/yxml/*.[ch] $(distdir)/src/yxml
292 cp $(srcdir)/src/yxml/COPYING $(distdir)/src/yxml
293 cp $(srcdir)/src/yxml/yxml.pod $(distdir)/src/yxml
294 cp $(srcdir)/src/ssl_dane/danessl.[ch] $(distdir)/src/ssl_dane
295 cp $(srcdir)/src/ssl_dane/README.md $(distdir)/src/ssl_dane
296 rm -f $(distdir)/Makefile $(distdir)/src/Makefile $(distdir)/src/getdns/getdns.h $(distdir)/spec/example/Makefile $(distdir)/src/test/Makefile $(distdir)/doc/Makefile $(distdir)/src/config.h
297
298 distcheck: $(distdir).tar.gz
299 gzip -cd $(distdir).tar.gz | tar xvf -
300 cd $(distdir) && ./configure
301 cd $(distdir) && $(MAKE) all
302 cd $(distdir) && $(MAKE) check
303 cd $(distdir) && $(MAKE) DESTDIR=$${PWD}/_inst install
304 cd $(distdir) && $(MAKE) DESTDIR=$${PWD}/_inst uninstall
305 @remaining="`find $${PWD}/$(distdir)/_inst -type f | wc -l`"; \
306 if test "$${remaining}" -ne 0; then
307 echo "@@@ $${remaining} file(s) remaining in stage directory!"; \
308 exit 1; \
309 fi
310 cd $(distdir) && $(MAKE) clean
311 rm -rf $(distdir)
312 @echo "*** Package $(distdir).tar.gz is ready for distribution"
313
314 getdns.pc: $(srcdir)/getdns.pc.in
315 ./config.status $@
316
317 getdns_ext_event.pc: $(srcdir)/getdns_ext_event.pc.in
318 ./config.status $@
319
320 Makefile: $(srcdir)/Makefile.in config.status
321 ./config.status $@
322
323 configure.status: configure
324 ./config.status --recheck
325
326 .PHONY: all distclean clean default doc test
327 FORCE:
3636 =========================================
3737 The project home page at [getdnsapi.net](https://getdnsapi.net) provides documentation, binary downloads, and news regarding the getdns API implementation. This README file captures the goals and direction of the project and the current state of the implementation.
3838
39 If you are just getting started with the library take a look at the section below that describes building and handling external dependencies for the library.
39 If you are just getting started with the library take a look at the section below that describes building and handling external dependencies for the library.
4040
4141 ### Examples
42 Once it is built you should take a look at src/examples to see how the library is used.
42 Once it is built you should take a look at `spec/example` to see how the library is used.
4343
4444
4545 # Download
4949 the checksums (SHA1 or MD5) or using gpg to verify the signature. Our keys are
5050 available from the [pgp keyservers](https://keyserver.pgp.com)
5151
52 * willem@nlnetlabs.nl, key id E5F8F8212F77A498
52 * `willem@nlnetlabs.nl`, key id E5F8F8212F77A498
5353
5454 # Releases
5555
5858
5959 The following requirements were met as conditions for the present release:
6060
61 * code compiles cleanly on at least the primary target platforms: OSX, RHEL/CentOS Linux, FreeBSD
61 * code compiles cleanly on at least the primary target platforms: OSX, Linux (RHEL/CentOS, Ubuntu), FreeBSD
6262 * examples must compile and run cleanly
6363 * there must be clear documentation of supported and unsupported elements of the API
6464
65 # Building and External Dependencies
66
67 If you are installing from packages, you have to install the library and also the library-devel (or -dev) for your package management system to get the the necessary compile time files.
68
69 External dependencies are linked outside the getdns API build tree (we rely on configure to find them). We would like to keep the dependency tree short. Please refer to section for building on Windows for separate dependency and build instructions for that platform.
70
71 * [libunbound from NLnet Labs](https://unbound.net/) version 1.4.16 or later.
72 * [libidn from the FSF](https://www.gnu.org/software/libidn/) version 1 or 2 (from version 2.0.0 and higher). (Note that the libidn version means the conversions between A-labels and U-labels may permit conversion of formally invalid labels under IDNA2008.)
73 * [libssl and libcrypto from the OpenSSL Project](https://www.openssl.org/) version 0.9.7 or later. (Note: version 1.0.1 or later is required for TLS support, version 1.0.2 or later is required for TLS hostname authentication)
74 * Doxygen is used to generate documentation; while this is not technically necessary for the build it makes things a lot more pleasant.
75
76 For example, to build on a recent version of Ubuntu, you would need the following packages:
77
78 # apt install build-essential libunbound-dev libidn2-dev libssl-dev libtool m4 autoconf
65 # External Dependencies
66
67 If you are installing from packages, you have to install the library and also the library-devel (or -dev) for your package management system to get the the necessary compile time files.
68
69 External dependencies are linked outside the getdns API build tree (we rely on CMake to find them). We would like to keep the dependency tree short, see [Minimising Dependancies](#minimizing-dependancies) for more details.
70
71 Required for all builds:
72
73 * [libssl and libcrypto from the OpenSSL Project](https://www.openssl.org/) version 1.0.2 or later. Using OpenSSL 1.1 is recommended due to TSL 1.3 support.
74
75 Required for all builds that include recursive functionality:
76
77 * [libunbound from NLnet Labs](https://unbound.net/) version 1.5.9 or later. (Note: linking to libunbound is not yet supported on Windows, see [Windows 10](#microsoft-windows-10))
78
79 Required for all builds that include IDN functionality:
80
81 * [libidn2 from the FSF](https://www.gnu.org/software/libidn/) version 2.0.0 and higher.
82
83 Required to build the documentation:
84
85 * [Doxygen](http://www.doxygen.nl) is used to generate documentation; while this is not technically necessary for the build it makes things a lot more pleasant.
86
87 For example, to build on Ubuntu 18.04 or later, you would need the following packages for a full build:
88
89 # apt install build-essential libunbound-dev libidn2-dev libssl-dev cmake
90
91 # Building
7992
8093 If you are building from git, you need to do the following before building:
8194
82
8395 # git submodule update --init
8496
85 # libtoolize -ci # (use glibtoolize for OS X, libtool is installed as glibtool to avoid name conflict on OS X)
86 # autoreconf -fi
87
88
89 As well as building the getdns library three other tools may be installed:
90
91 * getdns_query: a command line test script wrapper for getdns
92 * stubby: an experimental DNS Privacy enabled client
97 From release 1.6.0 getdns uses CMake (previous versions used autoconf/libtool). To build from this release and later use:
98
99 # cmake .
100 # make
101
102 If you are unfamiliar with CMake, see our [CMake Quick Start](https://getdnsapi.net/quick-start/cmake-quick-start/) for how to use CMake options to customise the getdns build.
103
104 As well as building the getdns library two other tools are installed by default:
105
106 * getdns_query: a command line test script wrapper for getdns. This can be used to quickly check the functionality of the library, see (#using-getdnsquery)
93107 * getdns_server_mon: test DNS server function and capabilities
94108
95 Note: If you only want to build stubby, then use the `--with-stubby` option when running 'configure'.
109 Additionally `Stubby` a DNS Privacy enabled client can also be built and installed by using the `BUILD_STUBBY` option when running `cmake`, see [Stubby](#stubby).
96110
97111
98112 ## Minimizing dependencies
99113
100 * getdns can be configured for stub resolution mode only with the `--enable-stub-only` option to configure. This removes the dependency on `libunbound`.
101 * Currently getdns only offers two helper functions to deal with IDN: `getdns_convert_ulabel_to_alabel` and `getdns_convert_alabel_to_ulabel`. If you do not need these functions, getdns can be configured to compile without them with the `--without-libidn` and `--without-libidn2` options to configure.
102 * When `--enable-stub-only`, `--without-libidn` and `--without-libidn2` options are used, getdns has only one dependency left, which is OpenSSL.
114 * getdns can be configured for stub resolution mode only with the `ENABLE_STUB_ONLY` option to `cmake`. This removes the dependency on `libunbound`.
115 * Currently getdns only offers two helper functions to deal with IDN: `getdns_convert_ulabel_to_alabel` and `getdns_convert_alabel_to_ulabel`. If you do not need these functions, getdns can be configured to compile without them by setting the`USE_LIBIDN2` option to `cmake` to OFF.
116 * When `ENABLE_STUB_ONLY` is ON, and `USE_LIBIDN2` is OFF, getdns has only one dependency left, which is OpenSSL.
103117
104118 ## Extensions and Event loop dependencies
105119
106120 The implementation works with a variety of event loops, each built as a separate shared library. See [this Doxygen page](https://getdnsapi.net/doxygen/group__eventloops.html) and [this man page](https://getdnsapi.net/documentation/manpages/#ASYNCHRONOUS USE) for more details.
107121
108 * [libevent](http://libevent.org). Note: the examples *require* this and should work with either libevent 1.x or 2.x. 2.x is preferred.
109 * [libuv](https://github.com/joyent/libuv)
122 * [libevent](http://libevent.org). Note: the examples *require* this. libevent 2.x is required.
123 * [libuv](https://libuv.org/)
110124 * [libev](http://software.schmorp.de/pkg/libev.html)
111125
126 ## Using getdns_query
127
128 Example test queries using `getdns_query` (pointed at Google Public DNS) and requesting the `call_reporting` extension which provides information on the transport and query time:
129
130 getdns_query -s example.com A @8.8.8.8 +return_call_reporting (UDP)
131 getdns_query -s example.com A @8.8.8.8 -T +return_call_reporting (TCP)
132 getdns_query -s example.com A @8.8.8.8 -L +return_call_reporting (TLS without authentication)
133 getdns_query -s getdnsapi.net A +dnssec_return_status +return_call_reporting (DNSSEC)
134
112135 ## Stubby
113136
114 * Stubby is an experimental implementation of a DNS Privacy enabled stub resolver than encrypts DNS queries using TLS. It is currently suitable for advanced/technical users - all feedback is welcome!
137 * Stubby is an implementation of a DNS Privacy enabled stub resolver that encrypts DNS queries using TLS. It is currently suitable for advanced/technical users - all feedback is welcome!
115138 * Details on how to use Stubby can be found in the [Stubby Reference Guide](https://dnsprivacy.org/wiki/x/JYAT).
116139 * Also see [dnsprivacy.org](https://dnsprivacy.org) for more information on DNS Privacy.
140
141 ## Experimental support for GnuTLS
142
143 A project to allow user selection of either OpenSSL or GnuTLS is currently a work in progress. At present a user may select to use GnuTLS for the majority of the supported functionality, however, OpenSSL is still required for some cryptographic functions.
117144
118145 ## Regression Tests
119146
120147 A suite of regression tests are included with the library, if you make changes or just
121148 want to sanity check things on your system take a look at src/test. You will need
122149 to install [libcheck](https://libcheck.github.io/check/). The check library is also available from many of the package repositories for the more popular operating systems.
150 Note: The tests currently do not run on Windows because of a dependancy on bash.
123151
124152 ## DNSSEC dependencies
125153
129157 or more `DS` or `DNSKEY` resource records in presentation (i.e. zone file)
130158 format. Note that this is different than the format of BIND.keys.
131159
132 ##$ Zero configuration DNSSEC
160 ## Zero configuration DNSSEC
133161
134162 When the root trust anchor is not installed in the default location and a DNSSEC query is done, getdns will try to use the trust anchors published here: http://data.iana.org/root-anchors/root-anchors.xml .
135163 It will validate these anchors with the ICANN Certificate Authority certificate following the procedure described in [RFC7958].
145173
146174 ## Mailing lists
147175
148 We have a [getdns users list](https://getdnsapi.net/mailman/listinfo/users) for this implementation.
149
150 The [getdns-api mailing list](https://getdnsapi.net/mailman/listinfo/spec) is a good place to engage in discussions regarding the design of the API.
176 We have a [getdns users list](https://lists.getdnsapi.net/mailman/listinfo/users) for this implementation.
151177
152178 ## Tickets and Bug Reports
153179
161187 The goals of this implementation of the getdns API are:
162188
163189 * Provide an open source implementation, in C, of the formally described getdns API by getdns API team at <https://getdnsapi.net/spec.html>
164 * Support FreeBSD, OSX, Linux (CentOS/RHEL, Ubuntu) via functional "configure" script
165 * Support Windows 8.1
190 * Support FreeBSD, OSX, Linux (CentOS/RHEL, Ubuntu)
191 * Support Windows 10
166192 * Include examples and tests as part of the build
167193 * Document code using doxygen
168194 * Leverage github as much as possible for project coordination
203229
204230 # Supported Platforms
205231
206 The primary platforms targeted are Linux and FreeBSD, other platform are supported as we get time. The names listed here are intended to help ensure that we catch platform specific breakage, not to limit the work that folks are doing.
207
208 * RHEL/CentOS 6.4
209 * OSX 10.8
210 * Ubuntu 16.04
211 * Microsoft Windows 8.1
212
213 We intend to add Android and other platforms to future releases as we have time to port it.
214
215
216 ## Platform Specific Build Reports
232 The platforms listed here are intended to help ensure that we catch platform specific breakage prior to release.
233
234 * Ubuntu 18.04 LTS and newer LTS releases
235 * Microsoft Windows 10
236 * FreeBSD 11.3 and newer
237 * RHEL/CentOS 8
238 * OSX 10.14 and 10.15
239
240
241 ### Platform Specific Build Notes
217242
218243 [![Build Status](https://travis-ci.org/getdnsapi/getdns.png?branch=master)](https://travis-ci.org/getdnsapi/getdns)
219244
220 ### FreeBSD
245 ## FreeBSD
221246
222247 If you're using [FreeBSD](https://www.freebsd.org/), you may install getdns via the [ports tree](https://www.freshports.org/dns/getdns/) by running: `cd /usr/ports/dns/getdns && make install clean`
223248
224249 If you are using FreeBSD 10 getdns can be intalled via 'pkg install getdns'.
225250
226 ### CentOS and RHEL 6.5
227
228 We rely on the most excellent package manager fpm to build the linux packages, which
229 means that the packaging platform requires ruby 2.1.0. There are other ways to
230 build the packages; this is simply the one we chose to use.
231
232 # cat /etc/redhat-release
233 CentOS release 6.5 (Final)
234 # uname -a
235 Linux host-10-1-1-6 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
236 # cd getdns-0.2.0rc1
237 # ./configure --prefix=/home/deploy/build
238 # make; make install
239 # cd /home/deploy/build
240 # mv lib lib64
241 # . /usr/local/rvm/config/alias
242 # fpm -x "*.la" -a native -s dir -t rpm -n getdns -v 0.2.0rc1 -d "unbound" -d "libevent" -d "libidn" --prefix /usr --vendor "Verisign Inc., NLnet Labs" --license "BSD New" --url "https://getdnsapi.net" --description "Modern asynchronous API to the DNS" .
243
244 ### OSX
245
246 # sw_vers
247 ProductName: Mac OS X
248 ProductVersion: 10.8.5
249 BuildVersion: 12F45
250
251 Built using PackageMaker, libevent2.
252
253 # ./configure --with-libevent --prefix=$HOME/getdnsosx/export
254 # make
255 # make install
256
257 edit/fix hardcoded paths in lib/*.la to reference /usr/local
258
259 update getdns.pmdoc to match release info
260
261 build package using PackageMaker
262
263 create dmg
264
265 A self-compiled version of OpenSSL or the version installed via Homebrew is required.
266 Note: If using a self-compiled version, manual configuration of certificates into /usr/local/etc/openssl/certs is required for TLS authentication to work.
267
268 #### Homebrew
251 ## Ubuntu
252
253 getdns should also work on Ubuntu 16.04, however if you require IDN functionality you will have to install a recent version of libidn2 via a ppa e.g. from https://launchpad.net/~ondrej/+archive/ubuntu/php
254
255 You will also have to build Unbound from source code to provide libunbound at version >= 1.5.9.
256
257 ## OSX
258
259 A self-compiled version of OpenSSL or the version installed via Homebrew is required and the options OPENSSL_ROOT_DIR, OPENSSL_CRYPTO_LIBRARY and OPENSSL_SSL_LIBRARY can be used to specify the location of the libraries.
260 Note: If using a self-compiled version, manual configuration of certificates into /usr/local/etc/openssl/certs is required for TLS authentication to work.
261
262 ### Homebrew
269263
270264 If you're using [Homebrew](http://brew.sh/), you may run `brew install getdns`. By default, this will only build the core library without any 3rd party event loop support.
271265
273267
274268 Note that in order to compile the examples, the `--with-libevent` switch is required.
275269
276 Additionally, the OpenSSL library installed by Homebrew is linked against. Note that the Homebrew OpenSSL installation clones the Keychain certificates to the default OpenSSL location so TLS certificate authentication should work out of the box.
277
278 ### Microsoft Windows 8.1
279
280 The build has been tested using the following:
281 32 bit only Mingw: [Mingw(3.21.0) and Msys 1.0](http://www.mingw.org/) on Windows 8.1
282 32 bit build on a 64 bit Mingw [Download latest from: http://mingw-w64.org/doku.php/download/mingw-builds and http://msys2.github.io/]. IMPORTANT: Install tested ONLY on the "x86_64" for 64-bit installer of msys2.
283
284 #### Dependencies
285 The following dependencies are
286 * openssl-1.0.2j
287 * libidn
288
289 Instructions to build openssl-1.0.2j:
290 Open the mingw32_shell.bat from msys2 in order to build:
291
292 If necessary, install the following using pacman:
293
294 pacman -S pkg-config libtool automake
295 pacman -S autoconf automake-wrapper
296
297 tar -xvf openssl-1.0.2j.tar
298 cd openssl-1.0.2j/
299 ./Configure --prefix=${LOCALDESTDIR} --openssldir=${LOCALDESTDIR}/etc/ssl --libdir=lib shared zlib-dynamic mingw
300 make
301 make install
302
303 To configure:
304
305 ./configure --enable-stub-only --with-trust-anchor="c:\\\MinGW\\\msys\\\1.0\\\etc\\\unbound\\\getdns-root.key" --with-ssl=<location of openssl from above> --with-getdns_query
306
307 The trust anchor is also installed by unbound on `c:\program Files (X86)\unbound\root.key` and can be referenced from there
308 or anywhere else that the user chooses to configure it.
309
310 After configuring, do a `make` and `make install` to build getdns for Windows.
311
312 Example test queries:
313
314 ./getdns_query.exe -s gmadkat.com A @64.6.64.6 +return_call_reporting (UDP)
315 ./getdns_query.exe -s gmadkat.com A @64.6.64.6 -T +return_call_reporting (TCP)
316 ./getdns_query.exe -s gmadkat.com A -l L @185.49.141.37 +return_call_reporting (TLS without authentication)
317 ./getdns_query.exe -s www.huque.com A +dnssec_return_status +return_call_reporting (DNSSEC)
270 Additionally, getdns is linked against the the OpenSSL library installed by Homebrew. Note that the Homebrew OpenSSL installation clones the Keychain certificates to the default OpenSSL location so TLS certificate authentication should work out of the box.
271
272 ## Microsoft Windows 10
273
274 You will need CMake for Windows. Installers can be downloaded from https://cmake.org/download/.
275
276 Windows versions of the following libraries are available using [the vcpkg package manager](https://docs.microsoft.com/en-us/cpp/build/vcpkg).
277
278 * OpenSSL
279 * libevent
280 * libiconv (required for libidn2)
281 * libidn2
282 * libyaml
283 * libuv
284
285 Once these are installed, set CMake variables CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH to the vcpkg include and library directories e.g. `../vcpkg/installed/x64-windows/include` and `../vcpkg/installed/x64-windows/lib`.
286
287 To generate a project suitable for use in Visual Studio, select the appropriate Visual Studio generator in CMake. Once generated, the cmake-gui Open Project button can be used to load the project into Visual Studio.
288
289 ### Limitations on Windows
290
291 Full support for Windows is a work in progress. The following limitations will be addresses in future:
292
293 * At present, no native Windows DLL version of libunbound exists; support for linking against libunbound is not currently available. The default build option for ENABLE_STUB_ONLY_ is ON for Windows.
294
295 * The getdns unit tests (built with `make test`) require libcheck which is not currently available for Windows and so cannot be built.
296
297 * The getdns tpkg test suite is not currently supported on Windows.
298
299 * The detection of the location of the `/etc/hosts` file should be optimised - it currently assumes Windows is installed in the default directory on the C: drive
300
318301
319302 Contributors
320303 ============
367350
368351 Acknowledgements
369352 ================
370 The development team explicitly acknowledges Paul Hoffman for his initiative and efforts to develop a consensus based DNS API. We would like to thank the participants of the [mailing list](https://getdnsapi.net/mailman/listinfo/spec) for their contributions.
353 The development team explicitly acknowledges Paul Hoffman for his initiative and efforts to develop a consensus based DNS API. We would like to thank the participants of the getdns-api mailing list (discontinued) for their contributions.
0 #ifndef CONFIG_H
1 #define CONFIG_H
2
3 #cmakedefine PACKAGE "@PACKAGE@"
4 #cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"
5 #cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
6 #cmakedefine PACKAGE_URL "@PACKAGE_URL@"
7 #cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
8
9 #cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
10 #cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@"
11
12 #cmakedefine HAVE_ASSERT_H 1
13 #cmakedefine HAVE_INTTYPES_H 1
14 #cmakedefine HAVE_LIMITS_H 1
15 #cmakedefine HAVE_SYS_LIMITS_H 1
16 #cmakedefine HAVE_STDARG_H 1
17 #cmakedefine HAVE_STDINT_H 1
18 #cmakedefine HAVE_STDIO_H 1
19 #cmakedefine HAVE_STDLIB_H 1
20 #cmakedefine HAVE_STRING_H 1
21 #cmakedefine HAVE_TIME_H 1
22 #cmakedefine HAVE_UNISTD_H 1
23
24 #cmakedefine HAVE_FCNTL_H 1
25
26 #cmakedefine HAVE_SIGNAL_H 1
27 #cmakedefine HAVE_SYS_POLL_H 1
28 #cmakedefine HAVE_POLL_H 1
29 #cmakedefine HAVE_RESOURCE_H 1
30 #cmakedefine HAVE_SYS_TYPES_H 1
31 #cmakedefine HAVE_SYS_STAT_H 1
32
33 #cmakedefine HAVE_ENDIAN_H 1
34 #cmakedefine HAVE_NETDB_H 1
35 #cmakedefine HAVE_ARPA_INET_H 1
36 #cmakedefine HAVE_NETINET_IN_H 1
37 #cmakedefine HAVE_NETINET_TCP_H 1
38 #cmakedefine HAVE_SYS_SELECT_H 1
39 #cmakedefine HAVE_SYS_SOCKET_H 1
40 #cmakedefine HAVE_SYS_SYSCTL_H 1
41 #cmakedefine HAVE_SYS_TIME_H 1
42 #cmakedefine HAVE_SYS_WAIT_H 1
43
44 #cmakedefine HAVE_WINDOWS_H 1
45 #cmakedefine HAVE_WINSOCK_H 1
46 #cmakedefine HAVE_WINSOCK2_H 1
47 #cmakedefine HAVE_WS2TCPIP_H 1
48 #cmakedefine GETDNS_ON_WINDOWS 1
49 #cmakedefine USE_WINSOCK 1
50
51 #cmakedefine HAVE_SSL 1
52 #cmakedefine USE_DANESSL 1
53
54 #cmakedefine HAVE_OPENSSL_SSL_H 1
55 #cmakedefine HAVE_OPENSSL_EVP_H 1
56 #cmakedefine HAVE_OPENSSL_ERR_H 1
57 #cmakedefine HAVE_OPENSSL_RAND_H 1
58 #cmakedefine HAVE_OPENSSL_CONF_H 1
59 #cmakedefine HAVE_OPENSSL_ENGINE_H 1
60
61 #cmakedefine HAVE_DSA_SIG_SET0 1
62 #cmakedefine HAVE_DSA_SET0_PQG 1
63 #cmakedefine HAVE_DSA_SET0_KEY 1
64
65 #cmakedefine HAVE_RSA_SET0_KEY 1
66
67 #cmakedefine HAVE_EVP_MD5 1
68 #cmakedefine HAVE_EVP_SHA1 1
69 #cmakedefine HAVE_EVP_SHA224 1
70 #cmakedefine HAVE_EVP_SHA256 1
71 #cmakedefine HAVE_EVP_SHA384 1
72 #cmakedefine HAVE_EVP_SHA512 1
73
74 #cmakedefine HAVE_EVP_DSS1 1
75 #cmakedefine HAVE_EVP_DIGESTVERIFY 1
76
77 #cmakedefine HAVE_EVP_MD_CTX_NEW 1
78
79 #cmakedefine HAVE_HMAC_CTX_NEW 1
80
81 #cmakedefine HAVE_NETTLE_GET_SECP_256R1 1
82 #cmakedefine HAVE_NETTLE_GET_SECP_384R1 1
83
84 #cmakedefine HAVE_TLS_CLIENT_METHOD 1
85
86 #cmakedefine HAVE_OPENSSL_VERSION_NUM 1
87 #cmakedefine HAVE_OPENSSL_VERSION 1
88
89 #cmakedefine HAVE_SSL_CTX_DANE_ENABLE 1
90 #cmakedefine HAVE_SSL_CTX_SET_CIPHERSUITS 1
91 #cmakedefine HAVE_SSL_SET_CIPHERSUITS 1
92
93 #cmakedefine HAVE_OPENSSL_INIT_CRYPTO 1
94
95 #cmakedefine HAVE_SSL_DANE_ENABLE 1
96 #cmakedefine HAVE_DECL_SSL_CTX_SET1_CURVES_LIST 1
97 #cmakedefine HAVE_DECL_SSL_SET1_CURVES_LIST 1
98 #cmakedefine HAVE_DECL_SSL_SET_MIN_PROTO_VERSION 1
99 #cmakedefine HAVE_X509_GET_NOTAFTER 1
100 #cmakedefine HAVE_X509_GET0_NOTAFTER 1
101
102 #cmakedefine HAVE_PTHREAD 1
103 #cmakedefine HAVE_WINDOWS_THREADS 1
104
105 #cmakedefine RUNSTATEDIR "@RUNSTATEDIR@"
106 #cmakedefine TRUST_ANCHOR_FILE "@PATH_TRUST_ANCHOR_FILE@"
107 #cmakedefine GETDNS_FN_RESOLVCONF "@PATH_RESOLVCONF@"
108 #cmakedefine GETDNS_FN_HOSTS "@PATH_HOSTS@"
109
110 #cmakedefine DNSSEC_ROADBLOCK_AVOIDANCE 1
111 #cmakedefine HAVE_MDNS_SUPPORT 1
112 #cmakedefine STUB_NATIVE_DNSSEC 1
113 #cmakedefine MAXIMUM_UPSTREAM_OPTION_SPACE @MAXIMUM_UPSTREAM_OPTION_SPACE@
114 #cmakedefine EDNS_PADDING_OPCODE @EDNS_PADDING_OPCODE@
115 #cmakedefine MAX_CNAME_REFERRALS @MAX_CNAME_REFERRALS@
116 #cmakedefine DRAFT_RRTYPES @DRAFT_RRTYPES@
117 #cmakedefine EDNS_COOKIES 1
118 #cmakedefine EDNS_COOKIE_OPCODE @EDNS_COOKIE_OPCODE@
119 #cmakedefine EDNS_COOKIE_ROLLOVER_TIME @EDNS_COOKIE_ROLLOVER_TIME@
120 #cmakedefine UDP_MAX_BACKOFF @MAX_UDP_BACKOFF@
121
122 #cmakedefine HAVE_DECL_GETENTROPY 1
123 #cmakedefine HAVE_DECL_INET_PTON 1
124 #cmakedefine HAVE_DECL_INET_NTOP 1
125 #cmakedefine HAVE_WIN_DECL_INET_PTON 1
126 #cmakedefine HAVE_WIN_DECL_INET_NTOP 1
127 #cmakedefine HAVE_DECL_MKSTEMP 1
128 #cmakedefine HAVE_DECL_SIGEMPTYSET 1
129 #cmakedefine HAVE_DECL_SIGFILLSET 1
130 #cmakedefine HAVE_DECL_SIGADDSET 1
131 #cmakedefine HAVE_DECL_STRPTIME 1
132
133 #cmakedefine HAVE_DECL_TCP_FASTOPEN 1
134 #cmakedefine HAVE_DECL_TCP_FASTOPEN_CONNECT 1
135 #cmakedefine HAVE_DECL_MSG_FASTOPEN 1
136
137 #if defined(HAVE_DECL_INET_PTON) || defined(HAVE_WIN_DECL_INET_PTON)
138 #undef HAVE_DECL_INET_PTON
139 #define HAVE_DECL_INET_PTON 1
140 #endif
141 #if defined(HAVE_DECL_INET_NTOP) || defined(HAVE_WIN_DECL_INET_NTOP)
142 #undef HAVE_DECL_INET_NTOP
143 #define HAVE_DECL_INET_NTOP 1
144 #endif
145
146 #cmakedefine HAVE_FCNTL 1
147 #cmakedefine HAVE_GETTIMEOFDAY 1
148 #cmakedefine HAVE_IOCTLSOCKET 1
149 #cmakedefine HAVE_SIGEMPTYSET 1
150 #cmakedefine HAVE_SIGFILLSET 1
151 #cmakedefine HAVE_SIGADDSET 1
152 #cmakedefine HAVE_STRPTIME 1
153
154 #cmakedefine HAVE_SIGSET_T 1
155 #cmakedefine HAVE__SIGSET_T 1
156
157 #cmakedefine HAVE_BSD_STDLIB_H 1
158 #cmakedefine HAVE_BSD_STRING_H 1
159
160 #cmakedefine HAVE_DECL_STRLCPY 1
161 #cmakedefine HAVE_DECL_ARC4RANDOM 1
162 #cmakedefine HAVE_DECL_ARC4RANDOM_UNIFORM 1
163 #cmakedefine HAVE_BSD_DECL_STRLCPY 1
164 #cmakedefine HAVE_BSD_DECL_ARC4RANDOM 1
165 #cmakedefine HAVE_BSD_DECL_ARC4RANDOM_UNIFORM 1
166
167 #cmakedefine HAVE_STRLCPY 1
168 #cmakedefine HAVE_ARC4RANDOM 1
169 #cmakedefine HAVE_ARC4RANDOM_UNIFORM 1
170
171 #cmakedefine HAVE_LIBUNBOUND 1
172 #cmakedefine HAVE_UNBOUND_EVENT_H 1
173 #cmakedefine HAVE_UNBOUND_EVENT_API 1
174 #cmakedefine HAVE_UB_CTX_SET_STUB 1
175
176 #cmakedefine HAVE_LIBIDN 1
177 #cmakedefine HAVE_LIBIDN2 1
178
179 #cmakedefine HAVE_NETTLE 1
180 #cmakedefine HAVE_NETTLE_DSA_COMPAT_H 1
181 #cmakedefine HAVE_NETTLE_EDDSA_H 1
182
183 #cmakedefine HAVE_EVENT2_EVENT_H 1
184 #cmakedefine HAVE_EVENT_BASE_NEW 1
185 #cmakedefine HAVE_EVENT_BASE_FREE 1
186
187 #cmakedefine DEFAULT_EVENTLOOP "@DEFAULT_EVENTLOOP@"
188 #cmakedefine USE_POLL_DEFAULT_EVENTLOOP 1
189
190 #cmakedefine STRPTIME_WORKS 1
191
192 #cmakedefine FD_SETSIZE @FD_SETSIZE@
193
194 #cmakedefine REQ_DEBUG 1
195 #cmakedefine SCHED_DEBUG 1
196 #cmakedefine STUB_DEBUG 1
197 #cmakedefine DAEMON_DEBUG 1
198 #cmakedefine SEC_DEBUG 1
199 #cmakedefine SERVER_DEBUG 1
200 #cmakedefine ANCHOR_DEBUG 1
201 #cmakedefine KEEP_CONNECTIONS_OPEN_DEBUG 1
202
203 #cmakedefine USE_SHA1 1
204 #cmakedefine USE_SHA2 1
205 #cmakedefine USE_GOST 1
206 #cmakedefine USE_ECDSA 1
207 #cmakedefine USE_DSA 1
208 #cmakedefine USE_ED25519 1
209 #cmakedefine USE_ED448 1
210
211 #cmakedefine USE_OSX_TCP_FASTOPEN 1
212
213 #cmakedefine HAVE_NEW_UV_TIMER_CB 1
214
215 #cmakedefine HAVE_TARGET_ENDIANNESS
216 #cmakedefine TARGET_IS_BIG_ENDIAN
217
218 #cmakedefine HAVE___FUNC__ 1
219
220 #ifdef HAVE___FUNC__
221 #define __FUNC__ __func__
222 #else
223 #define __FUNC__ __FUNCTION__
224 #endif
225
226 #ifdef GETDNS_ON_WINDOWS
227 /* On windows it is allowed to increase the FD_SETSIZE
228 * (and nescessary to make our custom eventloop work)
229 * See: https://support.microsoft.com/en-us/kb/111855
230 */
231 # ifndef FD_SETSIZE
232 # define FD_SETSIZE 1024
233 # endif
234
235 /* the version of the windows API enabled */
236 # ifndef WINVER
237 # define WINVER 0x0600 // 0x0502
238 # endif
239 # ifndef _WIN32_WINNT
240 # define _WIN32_WINNT 0x0600 // 0x0502
241 # endif
242 # ifdef HAVE_WS2TCPIP_H
243 # include <ws2tcpip.h>
244 # endif
245
246 # ifdef _MSC_VER
247 # if _MSC_VER >= 1800
248 # define PRIsz "zu"
249 # else
250 # define PRIsz "Iu"
251 # endif
252 # include <BaseTsd.h>
253 typedef SSIZE_T ssize_t;
254 # else
255 # define PRIsz "Iu"
256 # endif
257
258 # ifdef HAVE_WINSOCK2_H
259 # include <winsock2.h>
260 # endif
261
262 /* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
263 # ifdef HAVE_WINSOCK2_H
264 # define FD_SET_T (u_int)
265 # else
266 # define FD_SET_T
267 # endif
268
269 /* Windows wants us to use _strdup instead of strdup */
270 # ifndef strdup
271 # define strdup _strdup
272 # endif
273
274 /* Windows doesn't have strcasecmp and strncasecmp. */
275 # define strcasecmp _stricmp
276 # define strncasecmp _strnicmp
277 #else
278 # define PRIsz "zu"
279 #endif
280
281 #ifdef HAVE_STDINT_H
282 #include <stdint.h>
283 #endif
284
285 #ifdef HAVE_STDIO_H
286 #include <stdio.h>
287 #endif
288
289 #ifdef HAVE_UNISTD_H
290 #include <unistd.h>
291 #endif
292
293 #ifdef HAVE_ASSERT_H
294 #include <assert.h>
295 #endif
296
297 #ifdef HAVE_STRING_H
298 #include <string.h>
299 #endif
300
301 #ifdef __cplusplus
302 extern "C" {
303 #endif
304
305 #if STDC_HEADERS
306 #include <stdlib.h>
307 #include <stddef.h>
308 #endif
309
310 #ifdef HAVE_BSD_STDLIB_H
311 #include <bsd/stdlib.h>
312 #endif
313
314 #ifdef HAVE_BSD_STRING_H
315 #include <bsd/string.h>
316 #endif
317
318 #if !defined(HAVE_STRLCPY) || !HAVE_DECL_STRLCPY || !defined(strlcpy)
319 size_t strlcpy(char *dst, const char *src, size_t siz);
320 #else
321 #ifndef __BSD_VISIBLE
322 #define __BSD_VISIBLE 1
323 #endif
324 #endif
325 #if !defined(HAVE_ARC4RANDOM) || !HAVE_DECL_ARC4RANDOM
326 uint32_t arc4random(void);
327 #endif
328 #if !defined(HAVE_ARC4RANDOM_UNIFORM) || !HAVE_DECL_ARC4RANDOM_UNIFORM
329 uint32_t arc4random_uniform(uint32_t upper_bound);
330 #endif
331 #ifndef HAVE_ARC4RANDOM
332 void explicit_bzero(void* buf, size_t len);
333 int getentropy(void* buf, size_t len);
334 void arc4random_buf(void* buf, size_t n);
335 void _ARC4_LOCK(void);
336 void _ARC4_UNLOCK(void);
337 #endif
338 #ifdef COMPAT_SHA512
339 #ifndef SHA512_DIGEST_LENGTH
340 #define SHA512_BLOCK_LENGTH 128
341 #define SHA512_DIGEST_LENGTH 64
342 #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
343 typedef struct _SHA512_CTX {
344 uint64_t state[8];
345 uint64_t bitcount[2];
346 uint8_t buffer[SHA512_BLOCK_LENGTH];
347 } SHA512_CTX;
348 #endif /* SHA512_DIGEST_LENGTH */
349 void SHA512_Init(SHA512_CTX*);
350 void SHA512_Update(SHA512_CTX*, void*, size_t);
351 void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
352 unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
353 #endif /* COMPAT_SHA512 */
354
355 #ifdef USE_WINSOCK
356 # ifndef _CUSTOM_VSNPRINTF
357 # define _CUSTOM_VSNPRINTF
358 static inline int _gldns_custom_vsnprintf(char *str, size_t size, const char *format, va_list ap)
359 { int r = vsnprintf(str, size, format, ap); return r == -1 ? _vscprintf(format, ap) : r; }
360 # define vsnprintf _gldns_custom_vsnprintf
361 # endif
362 #endif
363
364 #ifdef __cplusplus
365 }
366 #endif
367
368 /** Use on-board gldns */
369 #define USE_GLDNS 1
370 #ifdef HAVE_SSL
371 # define GLDNS_BUILD_CONFIG_HAVE_SSL 1
372 #endif
373
374 #ifdef HAVE_STDARG_H
375 #include <stdarg.h>
376 #endif
377
378 #include <errno.h>
379
380 #ifdef HAVE_SYS_SOCKET_H
381 #include <sys/socket.h>
382 #endif
383
384 #ifdef HAVE_SYS_SELECT_H
385 #include <sys/select.h>
386 #endif
387
388 #ifdef HAVE_SYS_TYPES_H
389 #include <sys/types.h>
390 #endif
391
392 #ifdef HAVE_SYS_STAT_H
393 #include <sys/stat.h>
394 #endif
395
396 #ifdef HAVE_NETINET_IN_H
397 #include <netinet/in.h>
398 #endif
399
400 #ifdef HAVE_NETINET_TCP_H
401 #include <netinet/tcp.h>
402 #endif
403
404 #ifdef HAVE_ARPA_INET_H
405 #include <arpa/inet.h>
406 #endif
407
408 #ifdef HAVE_SIGNAL_H
409 #include <signal.h>
410 #endif
411
412 #ifdef HAVE_SYS_TYPES_H
413 #include <sys/types.h>
414 #endif
415
416 #ifdef HAVE_INTTYPES_H
417 #include <inttypes.h>
418 #endif
419
420 #ifdef HAVE_LIMITS_H
421 #include <limits.h>
422 #endif
423
424 #ifdef HAVE_SYS_LIMITS_H
425 #include <sys/limits.h>
426 #endif
427
428 #ifdef PATH_MAX
429 #define _GETDNS_PATH_MAX PATH_MAX
430 #else
431 #define _GETDNS_PATH_MAX 2048
432 #endif
433
434 #ifndef PRIu64
435 #define PRIu64 "llu"
436 #endif
437
438 #ifdef HAVE_ATTR_FORMAT
439 # define ATTR_FORMAT(archetype, string_index, first_to_check) \
440 __attribute__ ((format (archetype, string_index, first_to_check)))
441 #else /* !HAVE_ATTR_FORMAT */
442 # define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
443 #endif /* !HAVE_ATTR_FORMAT */
444
445 #if defined(DOXYGEN)
446 # define ATTR_UNUSED(x) x
447 #elif defined(__cplusplus)
448 # define ATTR_UNUSED(x)
449 #elif defined(HAVE_ATTR_UNUSED)
450 # define ATTR_UNUSED(x) x __attribute__((unused))
451 #else /* !HAVE_ATTR_UNUSED */
452 # define ATTR_UNUSED(x) x
453 #endif /* !HAVE_ATTR_UNUSED */
454
455 #ifdef TIME_WITH_SYS_TIME
456 # include <sys/time.h>
457 # include <time.h>
458 #else
459 # ifdef HAVE_SYS_TIME_H
460 # include <sys/time.h>
461 # else
462 # include <time.h>
463 # endif
464 #endif
465
466 #ifdef __cplusplus
467 extern "C" {
468 #endif
469
470 #if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
471 #define strptime unbound_strptime
472 struct tm;
473 char *strptime(const char *s, const char *format, struct tm *tm);
474 #endif
475
476 #if !defined(HAVE_SIGSET_T) && defined(HAVE__SIGSET_T)
477 typedef _sigset_t sigset_t;
478 #endif
479 #if !defined(HAVE_SIGEMPTYSET)
480 # define sigemptyset(pset) (*(pset) = 0)
481 #endif
482 #if !defined(HAVE_SIGFILLSET)
483 # define sigfillset(pset) (*(pset) = (sigset_t)-1)
484 #endif
485 #if !defined(HAVE_SIGADDSET)
486 # define sigaddset(pset, num) (*(pset) |= (1L<<(num)))
487 #endif
488
489 #ifdef HAVE_LIBUNBOUND
490 # include <unbound.h>
491 # ifdef HAVE_UNBOUND_EVENT_H
492 # include <unbound-event.h>
493 # else
494 # ifdef HAVE_UNBOUND_EVENT_API
495 # ifndef _UB_EVENT_PRIMITIVES
496 # define _UB_EVENT_PRIMITIVES
497 struct ub_event_base;
498 struct ub_ctx* ub_ctx_create_ub_event(struct ub_event_base* base);
499 typedef void (*ub_event_callback_t)(void*, int, void*, int, int, char*);
500 int ub_resolve_event(struct ub_ctx* ctx, const char* name, int rrtype,
501 int rrclass, void* mydata, ub_event_callback_t callback, int* async_id);
502 # endif
503 # endif
504 # endif
505 #endif
506
507 #ifndef HAVE_DECL_INET_PTON
508 int inet_pton(int af, const char* src, void* dst);
509 #endif
510
511 #ifndef HAVE_DECL_INET_NTOP
512 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
513 #endif
514
515 #ifndef HAVE_DECL_MKSTEMP
516 int mkstemp(char *template);
517 #endif
518
519 #ifndef HAVE_GETTIMEOFDAY
520 int gettimeofday(struct timeval* tv, void* tz);
521 #endif
522
523 #ifdef __cplusplus
524 }
525 #endif
526
527 #endif /* CONFIG_H */
0 1 VERSIONINFO
1 FILEVERSION @version_current@,@version_revision@,@version_age@,0
2 PRODUCTVERSION @version_current@,@version_revision@,0,0
3 FILEOS 4
4 FILETYPE 2
5 FILESUBTYPE 0
6 BEGIN
7 BLOCK "StringFileInfo"
8 BEGIN
9 BLOCK "040904e4"
10 BEGIN
11 VALUE "CompanyName", "getdns project\0"
12 VALUE "ProductName", "getdns\0"
13 VALUE "FileVersion", "@version_current@.@version_revision@\0"
14 VALUE "ProductVersion", "@version_current@.@version_revision@\0"
15 VALUE "LegalCopyright", "NLnet Labs, Sinodun, No Mountain Software. New BSD licence.\0"
16 END
17 END
18 END
0 #[=======================================================================[.rst:
1 FindCheck
2 --------
3
4 Find the Check (Unit Testing Framework for C) library
5
6 Imported targets
7 ^^^^^^^^^^^^^^^^
8
9 This module defines the following :prop_tgt:`IMPORTED` targets:
10
11 ``Check::Check``
12 The Check library, if found.
13
14 Result variables
15 ^^^^^^^^^^^^^^^^
16
17 This module will set the following variables in your project:
18
19 ``Check_FOUND``
20 If false, do not try to use Check.
21 ``CHECK_INCLUDE_DIR``
22 where to find check.h, etc.
23 ``CHECK_LIBRARIES``
24 the libraries needed to use Check.
25 ``CHECK_VERSION``
26 the version of the Check library found
27
28 #]=======================================================================]
29
30 find_path(CHECK_INCLUDE_DIR check.h
31 HINTS
32 "${CHECK_DIR}"
33 "${CHECK_DIR}/include"
34 )
35
36 # Check for PIC and non-PIC libraries. If PIC present, use that
37 # in preference (as per Debian check.pc).
38 find_library(CHECK_LIBRARY NAMES check_pic libcheck_pic
39 HINTS
40 "${CHECK_DIR}"
41 "${CHECK_DIR}/lib"
42 )
43
44 if (NOT CHECK_LIBRARY)
45 find_library(CHECK_LIBRARY NAMES check libcheck
46 HINTS
47 "${CHECK_DIR}"
48 "${CHECK_DIR}/lib"
49 )
50 endif ()
51
52 set(CHECK_LIBRARIES "")
53
54 # Check may need the math, subunit and rt libraries on Unix
55 if (UNIX)
56 find_library(CHECK_MATH_LIBRARY m)
57 find_library(CHECK_RT_LIBRARY rt)
58 find_library(CHECK_SUBUNIT_LIBRARY subunit)
59
60 if (CHECK_MATH_LIBRARY)
61 list(APPEND CHECK_LIBRARIES "${CHECK_MATH_LIBRARY}")
62 endif ()
63 if (CHECK_RT_LIBRARY)
64 list(APPEND CHECK_LIBRARIES "${CHECK_RT_LIBRARY}")
65 endif ()
66 if (CHECK_SUBUNIT_LIBRARY)
67 list(APPEND CHECK_LIBRARIES "${CHECK_SUBUNIT_LIBRARY}")
68 endif ()
69 endif()
70
71 if (CHECK_INCLUDE_DIR AND CHECK_LIBRARY)
72 if (NOT TARGET Check::Check)
73 add_library(Check::Check UNKNOWN IMPORTED)
74 set_target_properties(Check::Check PROPERTIES
75 INTERFACE_INCLUDE_DIRECTORIES "${CHECK_INCLUDE_DIR}"
76 INTERFACE_LINK_LIBRARIES "${CHECK_LIBRARIES}"
77 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
78 IMPORTED_LOCATION "${CHECK_LIBRARY}"
79 )
80 endif ()
81
82 if (NOT CHECK_VERSION AND CHECK_INCLUDE_DIR AND EXISTS "${CHECK_INCLUDE_DIR}/check.h")
83 file(STRINGS "${CHECK_INCLUDE_DIR}/check.h" CHECK_H REGEX "^#define CHECK_M[A-Z]+_VERSION")
84 string(REGEX REPLACE "^.*\(([0-9]+)\).*\(([0-9]+)\).*\(([0-9]+)\).*$" "\\1.\\2.\\3" CHECK_VERSION "${CHECK_H}")
85 endif ()
86 endif()
87
88 list(APPEND CHECK_LIBRARIES "${CHECK_LIBRARY}")
89
90 include(FindPackageHandleStandardArgs)
91 find_package_handle_standard_args(Check
92 REQUIRED_VARS CHECK_LIBRARIES CHECK_INCLUDE_DIR
93 VERSION_VAR CHECK_VERSION
94 )
95
96 mark_as_advanced(CHECK_INCLUDE_DIR CHECK_LIBRARIES CHECK_LIBRARY
97 CHECK_MATH_LIBRARY CHECK_RT_LIBRARY CHECK_SUBUNIT_LIBRARY)
0 #[=======================================================================[.rst:
1 FindGnuTLS
2 ----------
3
4 Find the GnuTLS library.
5
6 Imported targets
7 ^^^^^^^^^^^^^^^^
8
9 This module defines the following :prop_tgt:`IMPORTED` targets:
10
11 ``GnuTLS::GnuTLS``
12 The GnuTLS library, if found.
13 ``GnuTLS::Dane``
14 The GnuTLS DANE library, if found.
15
16 Result variables
17 ^^^^^^^^^^^^^^^^
18
19 This module will set the following variables in your project:
20
21 ``GnuTLS_FOUND``
22 If false, do not try to use GnuTLS.
23 ``GNUTLS_INCLUDE_DIR``
24 where to find GnuTLS headers.
25 ``GNUTLS_LIBRARIES``
26 the libraries needed to use GnuTLS.
27 ``GNUTLS_VERSION``
28 the version of the GnuTLS library found
29
30 #]=======================================================================]
31
32 find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h
33 HINTS
34 "${GNUTLS_DIR}"
35 "${GNUTLS_DIR}/include"
36 )
37
38 find_library(GNUTLS_LIBRARY NAMES gnutls libgnutls
39 HINTS
40 "${GNUTLS_DIR}"
41 "${GNUTLS_DIR}/lib"
42 )
43
44 find_library(GNUTLS_DANE_LIBRARY NAMES gnutls-dane libgnutls-dane
45 HINTS
46 "${GNUTLS_DIR}"
47 "${GNUTLS_DIR}/lib"
48 )
49
50 set(GNUTLS_LIBRARIES "")
51
52 if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY AND GNUTLS_DANE_LIBRARY)
53 if (NOT TARGET GnuTLS::GnuTLS)
54 add_library(GnuTLS::GnuTLS UNKNOWN IMPORTED)
55 set_target_properties(GnuTLS::GnuTLS PROPERTIES
56 INTERFACE_INCLUDE_DIRECTORIES "${GNUTLS_INCLUDE_DIR}"
57 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
58 IMPORTED_LOCATION "${GNUTLS_LIBRARY}"
59 )
60 endif ()
61 if (NOT TARGET GnuTLS::Dane)
62 add_library(GnuTLS::Dane UNKNOWN IMPORTED)
63 set_target_properties(GnuTLS::Dane PROPERTIES
64 INTERFACE_INCLUDE_DIRECTORIES "${GNUTLS_INCLUDE_DIR}"
65 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
66 IMPORTED_LOCATION "${GNUTLS_DANE_LIBRARY}"
67 )
68 endif ()
69
70 if (NOT GNUTLS_VERSION AND GNUTLS_INCLUDE_DIR)
71 file(STRINGS "${GNUTLS_INCLUDE_DIR}/gnutls/gnutls.h" GNUTLS_VER_H REGEX "^#define GNUTLS_VERSION_(MAJOR|MINOR|PATCH) ")
72 string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*_PATCH ([0-9]+).*$" "\\1.\\2.\\3c" GNUTLS_VERSION "${GNUTLS_VER_H}")
73 endif ()
74 endif()
75
76 list(APPEND GNUTLS_LIBRARIES "${GNUTLS_LIBRARY}" "${GNUTLS_DANE_LIBRARY}")
77
78 include(FindPackageHandleStandardArgs)
79 find_package_handle_standard_args(GnuTLS
80 REQUIRED_VARS GNUTLS_LIBRARIES GNUTLS_INCLUDE_DIR
81 VERSION_VAR GNUTLS_VERSION
82 )
83
84 mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARIES GNUTLS_LIBRARY GNUTLS_DANE_LIBRARY)
0 #[=======================================================================[.rst:
1 FindLibev
2 ---------
3
4 Find the Libev library.
5
6 Imported targets
7 ^^^^^^^^^^^^^^^^
8
9 This module defines the following :prop_tgt:`IMPORTED` targets:
10
11 ``Libev::Libev``
12 The Libev library, if found.
13
14 Result variables
15 ^^^^^^^^^^^^^^^^
16
17 This module will set the following variables in your project:
18
19 ``Libev_FOUND``
20 If false, do not try to use Libev.
21 ``LIBEV_INCLUDE_DIR``
22 where to find libev headers.
23 ``LIBEV_LIBRARIES``
24 the libraries needed to use Libev.
25 ``LIBEV_VERSION``
26 the version of the Libev library found
27
28 #]=======================================================================]
29
30 find_path(LIBEV_INCLUDE_DIR ev.h
31 HINTS
32 "${LIBEV_DIR}"
33 "${LIBEV_DIR}/include"
34 )
35
36 find_library(LIBEV_LIBRARY NAMES ev libev
37 HINTS
38 "${LIBEV_DIR}"
39 "${LIBEV_DIR}/lib"
40 )
41
42 set(LIBEV_LIBRARIES "")
43
44 if (LIBEV_INCLUDE_DIR AND LIBEV_LIBRARY)
45 if (NOT TARGET Libev::Libev)
46 add_library(Libev::Libev UNKNOWN IMPORTED)
47 set_target_properties(Libev::Libev PROPERTIES
48 INTERFACE_INCLUDE_DIRECTORIES "${LIBEV_INCLUDE_DIR}"
49 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
50 IMPORTED_LOCATION "${LIBEV_LIBRARY}"
51 )
52 endif ()
53 endif()
54
55 list(APPEND LIBEV_LIBRARIES "${LIBEV_LIBRARY}")
56
57 include(FindPackageHandleStandardArgs)
58 find_package_handle_standard_args(Libev
59 REQUIRED_VARS LIBEV_LIBRARIES LIBEV_INCLUDE_DIR
60 )
61
62 mark_as_advanced(LIBEV_INCLUDE_DIR LIBEV_LIBRARIES LIBEV_LIBRARY)
0 #[=======================================================================[.rst:
1 FindLibevent2
2 -------------
3
4 Find the Libevent2 library. For now this finds the core library only.
5
6 Imported targets
7 ^^^^^^^^^^^^^^^^
8
9 This module defines the following :prop_tgt:`IMPORTED` targets:
10
11 ``Libevent2::Libevent_core``
12 The Libevent2 library, if found.
13
14 Result variables
15 ^^^^^^^^^^^^^^^^
16
17 This module will set the following variables in your project:
18
19 ``Libevent2_FOUND``
20 If false, do not try to use Libevent2.
21 ``LIBEVENT2_INCLUDE_DIR``
22 where to find libevent headers.
23 ``LIBEVENT2_LIBRARIES``
24 the libraries needed to use Libevent2.
25 ``LIBEVENT2_VERSION``
26 the version of the Libevent2 library found
27
28 #]=======================================================================]
29
30 find_path(LIBEVENT2_INCLUDE_DIR event2/event.h
31 HINTS
32 "${LIBEVENT2_DIR}"
33 "${LIBEVENT2_DIR}/include"
34 )
35
36 find_library(LIBEVENT2_LIBRARY NAMES event_core libevent_core
37 HINTS
38 "${LIBEVENT2_DIR}"
39 "${LIBEVENT2_DIR}/lib"
40 )
41
42 set(LIBEVENT2_LIBRARIES "")
43
44 if (LIBEVENT2_INCLUDE_DIR AND LIBEVENT2_LIBRARY)
45 if (NOT TARGET Libevent2::Libevent_core)
46 add_library(Libevent2::Libevent_core UNKNOWN IMPORTED)
47 set_target_properties(Libevent2::Libevent_core PROPERTIES
48 INTERFACE_INCLUDE_DIRECTORIES "${LIBEVENT2_INCLUDE_DIR}"
49 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
50 IMPORTED_LOCATION "${LIBEVENT2_LIBRARY}"
51 )
52 endif ()
53
54 if (NOT LIBEVENT2_VERSION AND LIBEVENT2_INCLUDE_DIR AND EXISTS "${LIBEVENT2_INCLUDE_DIR}/event2/event.h")
55 file(STRINGS "${LIBEVENT2_INCLUDE_DIR}/event2/event-config.h" LIBEVENT2_H REGEX "^#define _?EVENT_+VERSION ")
56 string(REGEX REPLACE "^.*EVENT_+VERSION \"([^\"]+)\".*$" "\\1" LIBEVENT2_VERSION "${LIBEVENT2_H}")
57 endif ()
58 endif()
59
60 list(APPEND LIBEVENT2_LIBRARIES "${LIBEVENT2_LIBRARY}")
61
62 include(FindPackageHandleStandardArgs)
63 find_package_handle_standard_args(Libevent2
64 REQUIRED_VARS LIBEVENT2_LIBRARIES LIBEVENT2_INCLUDE_DIR
65 VERSION_VAR LIBEVENT2_VERSION
66 )
67
68 mark_as_advanced(LIBEVENT2_INCLUDE_DIR LIBEVENT2_LIBRARIES LIBEVENT2_LIBRARY)
0 #[=======================================================================[.rst:
1 FindLibidn2
2 -----------
3
4 Find the Libidn2 library
5
6 Imported targets
7 ^^^^^^^^^^^^^^^^
8
9 This module defines the following :prop_tgt:`IMPORTED` targets:
10
11 ``Libidn2::Libidn2``
12 The Libidn2 library, if found.
13
14 Result variables
15 ^^^^^^^^^^^^^^^^
16
17 This module will set the following variables in your project:
18
19 ``Libidn2_FOUND``
20 If false, do not try to use Libidn2.
21 ``LIBIDN2_INCLUDE_DIR``
22 where to find libidn2 headers.
23 ``LIBIDN2_LIBRARIES``
24 the libraries needed to use Libidn2.
25 ``LIBIDN2_VERSION``
26 the version of the Libidn2 library found
27
28 #]=======================================================================]
29
30 find_path(LIBIDN2_INCLUDE_DIR idn2.h
31 HINTS
32 "${LIBIDN2_DIR}"
33 "${LIBIDN2_DIR}/include"
34 )
35
36 find_library(LIBIDN2_LIBRARY NAMES idn2 libidn2
37 HINTS
38 "${LIBIDN2_DIR}"
39 "${LIBIDN2_DIR}/lib"
40 )
41
42 set(LIBIDN2_LIBRARIES "")
43
44 if (LIBIDN2_INCLUDE_DIR AND LIBIDN2_LIBRARY)
45 if (NOT TARGET Libidn2::Libidn2)
46 add_library(Libidn2::Libidn2 UNKNOWN IMPORTED)
47 set_target_properties(Libidn2::Libidn2 PROPERTIES
48 INTERFACE_INCLUDE_DIRECTORIES "${LIBIDN2_INCLUDE_DIR}"
49 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
50 IMPORTED_LOCATION "${LIBIDN2_LIBRARY}"
51 )
52 endif ()
53
54 if (NOT LIBIDN2_VERSION AND LIBIDN2_INCLUDE_DIR AND EXISTS "${LIBIDN2_INCLUDE_DIR}/unbound.h")
55 file(STRINGS "${LIBIDN2_INCLUDE_DIR}/idn2.h" LIBIDN2_H REGEX "^#define IDN2_VERSION ")
56 string(REGEX REPLACE "^.*IDN2_VERSION \"([0-9.]+)\".*$" "\\1" LIBIDN2_VERSION "${LIBIDN2_H}")
57 endif ()
58 endif()
59
60 list(APPEND LIBIDN2_LIBRARIES "${LIBIDN2_LIBRARY}")
61
62 include(FindPackageHandleStandardArgs)
63 find_package_handle_standard_args(Libidn2
64 REQUIRED_VARS LIBIDN2_LIBRARIES LIBIDN2_INCLUDE_DIR
65 VERSION_VAR LIBIDN2_VERSION
66 )
67
68 mark_as_advanced(LIBIDN2_INCLUDE_DIR LIBIDN2_LIBRARIES LIBIDN2_LIBRARY)
0 #[=======================================================================[.rst:
1 FindLibunbound
2 --------------
3
4 Find the Libunbound library
5
6 Imported targets
7 ^^^^^^^^^^^^^^^^
8
9 This module defines the following :prop_tgt:`IMPORTED` targets:
10
11 ``Libunbound::Libunbound``
12 The Libunbound library, if found.
13
14 Result variables
15 ^^^^^^^^^^^^^^^^
16
17 This module will set the following variables in your project:
18
19 ``Libunbound_FOUND``
20 If false, do not try to use Libunbound.
21 ``LIBUNBOUND_INCLUDE_DIR``
22 where to find libunbound headers.
23 ``LIBUNBOUND_LIBRARIES``
24 the libraries needed to use Libunbound.
25 ``LIBUNBOUND_VERSION``
26 the version of the Libunbound library found
27
28 #]=======================================================================]
29
30 find_path(LIBUNBOUND_INCLUDE_DIR unbound.h
31 HINTS
32 "${LIBUNBOUND_DIR}"
33 "${LIBUNBOUND_DIR}/include"
34 )
35
36 find_library(LIBUNBOUND_LIBRARY NAMES unbound
37 HINTS
38 "${LIBUNBOUND_DIR}"
39 "${LIBUNBOUND_DIR}/lib"
40 )
41
42 set(LIBUNBOUND_LIBRARIES "")
43
44 if (UNIX)
45 find_package(Threads REQUIRED)
46 find_package(OpenSSL REQUIRED)
47
48 list(APPEND LIBUNBOUND_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
49 list(APPEND LIBUNBOUND_LIBRARIES "${OPENSSL_LIBRARIES}")
50 endif()
51
52 if (LIBUNBOUND_INCLUDE_DIR AND LIBUNBOUND_LIBRARY)
53 if (NOT TARGET Libunbound::Libunbound)
54 add_library(Libunbound::Libunbound UNKNOWN IMPORTED)
55 set_target_properties(Libunbound::Libunbound PROPERTIES
56 INTERFACE_INCLUDE_DIRECTORIES "${LIBUNBOUND_INCLUDE_DIR}"
57 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
58 IMPORTED_LOCATION "${LIBUNBOUND_LIBRARY}"
59 )
60
61 if(UNIX AND TARGET Threads::Threads)
62 set_property(TARGET Libunbound::Libunbound APPEND PROPERTY
63 INTERFACE_LINK_LIBRARIES Threads::Threads)
64 endif ()
65 if(UNIX AND TARGET OpenSSL::SSL)
66 set_property(TARGET Libunbound::Libunbound APPEND PROPERTY
67 INTERFACE_LINK_LIBRARIES OpenSSL::SSL)
68 endif ()
69 if(UNIX AND TARGET OpenSSL::Crypto)
70 set_property(TARGET Libunbound::Libunbound APPEND PROPERTY
71 INTERFACE_LINK_LIBRARIES OpenSSL::Crypto)
72 endif ()
73 endif ()
74
75 if (NOT LIBUNBOUND_VERSION AND LIBUNBOUND_INCLUDE_DIR AND EXISTS "${LIBUNBOUND_INCLUDE_DIR}/unbound.h")
76 file(STRINGS "${LIBUNBOUND_INCLUDE_DIR}/unbound.h" LIBUNBOUND_H REGEX "^#define UNBOUND_VERSION_M[A-Z]+")
77 string(REGEX REPLACE "^.*MAJOR ([0-9]+).*MINOR ([0-9]+).*MICRO ([0-9]+).*$" "\\1.\\2.\\3" LIBUNBOUND_VERSION "${LIBUNBOUND_H}")
78 endif ()
79 endif()
80
81 list(APPEND LIBUNBOUND_LIBRARIES "${LIBUNBOUND_LIBRARY}")
82
83 include(FindPackageHandleStandardArgs)
84 find_package_handle_standard_args(Libunbound
85 REQUIRED_VARS LIBUNBOUND_LIBRARIES LIBUNBOUND_INCLUDE_DIR
86 VERSION_VAR LIBUNBOUND_VERSION
87 )
88
89 mark_as_advanced(LIBUNBOUND_INCLUDE_DIR LIBUNBOUND_LIBRARIES LIBUNBOUND_LIBRARY)
0 #[=======================================================================[.rst:
1 FindLibuv
2 ---------
3
4 Find the Libuv library.
5
6 Imported targets
7 ^^^^^^^^^^^^^^^^
8
9 This module defines the following :prop_tgt:`IMPORTED` targets:
10
11 ``Libuv::Libuv``
12 The Libuv library, if found.
13
14 Result variables
15 ^^^^^^^^^^^^^^^^
16
17 This module will set the following variables in your project:
18
19 ``Libuv_FOUND``
20 If false, do not try to use Libuv.
21 ``LIBUV_INCLUDE_DIR``
22 where to find libuv headers.
23 ``LIBUV_LIBRARIES``
24 the libraries needed to use Libuv.
25 ``LIBUV_VERSION``
26 the version of the Libuv library found
27
28 #]=======================================================================]
29
30 find_path(LIBUV_INCLUDE_DIR uv.h
31 HINTS
32 "${LIBUV_DIR}"
33 "${LIBUV_DIR}/include"
34 )
35
36 find_library(LIBUV_LIBRARY NAMES uv libuv
37 HINTS
38 "${LIBUV_DIR}"
39 "${LIBUV_DIR}/lib"
40 )
41
42 set(LIBUV_LIBRARIES "")
43
44 if (LIBUV_INCLUDE_DIR AND LIBUV_LIBRARY)
45 if (NOT TARGET Libuv::Libuv)
46 add_library(Libuv::Libuv UNKNOWN IMPORTED)
47 set_target_properties(Libuv::Libuv PROPERTIES
48 INTERFACE_INCLUDE_DIRECTORIES "${LIBUV_INCLUDE_DIR}"
49 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
50 IMPORTED_LOCATION "${LIBUV_LIBRARY}"
51 )
52 endif ()
53
54 if (NOT LIBUV_VERSION AND LIBUV_INCLUDE_DIR)
55 if (EXISTS "${LIBUV_INCLUDE_DIR}/uv-version.h")
56 file(STRINGS "${LIBUV_INCLUDE_DIR}/uv-version.h" LIBUV_VER_H REGEX "^#define UV_VERSION_(MAJOR|MINOR|PATCH) ")
57 elseif (EXISTS "${LIBUV_INCLUDE_DIR}/uv/version.h")
58 file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" LIBUV_VER_H REGEX "^#define UV_VERSION_(MAJOR|MINOR|PATCH) ")
59 endif ()
60 string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*_PATCH ([0-9]+).*$" "\\1.\\2.\\3" LIBUV_VERSION "${LIBUV_VER_H}")
61 endif ()
62 endif()
63
64 list(APPEND LIBUV_LIBRARIES "${LIBUV_LIBRARY}")
65
66 include(FindPackageHandleStandardArgs)
67 find_package_handle_standard_args(Libuv
68 REQUIRED_VARS LIBUV_LIBRARIES LIBUV_INCLUDE_DIR
69 VERSION_VAR LIBUV_VERSION
70 )
71
72 mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARIES LIBUV_LIBRARY)
0 #[=======================================================================[.rst:
1 FindNettle
2 ----------
3
4 Find the Nettle library.
5
6 Imported targets
7 ^^^^^^^^^^^^^^^^
8
9 This module defines the following :prop_tgt:`IMPORTED` targets:
10
11 ``Nettle::Nettle``
12 The Nettle library, if found.
13 ``Nettle::Hogweed``
14 The Hogweed library, if found.
15
16 Result variables
17 ^^^^^^^^^^^^^^^^
18
19 This module will set the following variables in your project:
20
21 ``Nettle_FOUND``
22 If false, do not try to use Nettle.
23 ``NETTLE_INCLUDE_DIR``
24 where to find Nettle headers.
25 ``NETTLE_LIBRARIES``
26 the libraries needed to use Nettle.
27 ``NETTLE_VERSION``
28 the version of the Nettle library found
29
30 #]=======================================================================]
31
32 find_path(NETTLE_INCLUDE_DIR nettle/version.h
33 HINTS
34 "${NETTLE_DIR}"
35 "${NETTLE_DIR}/include"
36 )
37
38 find_library(NETTLE_LIBRARY NAMES nettle libnettle
39 HINTS
40 "${NETTLE_DIR}"
41 "${NETTLE_DIR}/lib"
42 )
43
44 find_library(HOGWEED_LIBRARY NAMES hogweed libhogweed
45 HINTS
46 "${NETTLE_DIR}"
47 "${NETTLE_DIR}/lib"
48 )
49
50 set(NETTLE_LIBRARIES "")
51
52 # May need gmp library on Unix.
53 if (UNIX)
54 find_library(NETTLE_GMP_LIBRARY gmp)
55
56 if (NETTLE_GMP_LIBRARY)
57 list(APPEND NETTLE_LIBRARIES "${NETTLE_GMP_LIBRARY}")
58 endif ()
59 endif ()
60
61 if (NETTLE_INCLUDE_DIR AND NETTLE_LIBRARY AND HOGWEED_LIBRARY)
62 if (NOT TARGET Nettle::Nettle)
63 add_library(Nettle::Nettle UNKNOWN IMPORTED)
64 set_target_properties(Nettle::Nettle PROPERTIES
65 INTERFACE_INCLUDE_DIRECTORIES "${NETTLE_INCLUDE_DIR}"
66 INTERFACE_LINK_LIBRARIES "${NETTLE_LIBRARIES}"
67 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
68 IMPORTED_LOCATION "${NETTLE_LIBRARY}"
69 )
70 endif ()
71 if (NOT TARGET Nettle::Hogweed)
72 add_library(Nettle::Hogweed UNKNOWN IMPORTED)
73 set_target_properties(Nettle::Hogweed PROPERTIES
74 INTERFACE_INCLUDE_DIRECTORIES "${NETTLE_INCLUDE_DIR}"
75 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
76 IMPORTED_LOCATION "${HOGWEED_LIBRARY}"
77 )
78 endif ()
79
80 if (NOT NETTLE_VERSION AND NETTLE_INCLUDE_DIR)
81 file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h" NETTLE_VER_H REGEX "^#define NETTLE_VERSION_(MAJOR|MINOR) ")
82 string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*$" "\\1.\\2" NETTLE_VERSION "${NETTLE_VER_H}")
83 endif ()
84 endif()
85
86 list(APPEND NETTLE_LIBRARIES "${NETTLE_LIBRARY}" "${HOGWEED_LIBRARY}")
87
88 include(FindPackageHandleStandardArgs)
89 find_package_handle_standard_args(Nettle
90 REQUIRED_VARS NETTLE_LIBRARIES NETTLE_INCLUDE_DIR
91 VERSION_VAR NETTLE_VERSION
92 )
93
94 mark_as_advanced(NETTLE_INCLUDE_DIR NETTLE_LIBRARIES NETTLE_LIBRARY HOGWEED_LIBRARY)
0 # Export only named entry points from shared library.
1 function(target_shared_library_exports lib libname symbols)
2 if (WIN32)
3 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${libname}.def" "LIBRARY ${libname}\n EXPORTS\n")
4 foreach (symbol IN LISTS symbols)
5 file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/${libname}.def" " ${symbol}\n")
6 endforeach ()
7 target_sources(${lib} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${libname}.def")
8 elseif (APPLE)
9 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${libname}.syms" "")
10 foreach (symbol IN LISTS symbols)
11 file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/${libname}.syms" "_${symbol}\n")
12 endforeach ()
13 target_sources(${lib} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${libname}.syms")
14 target_link_libraries(${lib} PRIVATE "-exported_symbols_list ${libname}.syms")
15 elseif (UNIX)
16 # Assume GNU ld.
17 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${libname}.ver" "{ global:\n")
18 foreach (symbol IN LISTS symbols)
19 file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/${libname}.ver" " ${symbol};\n")
20 endforeach ()
21 file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/${libname}.ver" "local:\n *;\n};\n")
22 target_link_libraries(${lib} PRIVATE "-Wl,--version-script=getdns.ver")
23 else ()
24 message(WARNING "Unknown platform, ${lib} exports not set.")
25 endif ()
26 endfunction ()
0 # Add version to given shared library linkage.
1 function(target_shared_library_version lib version_current version_revision version_age)
2 if (APPLE)
3 # Follow libtool. Add one to major version, as version 0 doesn't work.
4 # But tag dynlib name with current-age.
5 math(EXPR major_version "${version_current}+1")
6 math(EXPR dynlib_version "${version_current}-${version_age}")
7 set_target_properties(${lib} PROPERTIES VERSION "${dynlib_version}")
8 target_link_libraries(${lib} PRIVATE "-compatibility_version ${major_version}")
9 target_link_libraries(${lib} PRIVATE "-current_version ${major_version}.${version_revision}")
10 elseif (UNIX OR MINGW OR MSYS OR CYGWIN)
11 # Assume GNU ld, and again follow libtool. Major version is current-age.
12 math(EXPR compat_version "${version_current}-${version_age}")
13 set_target_properties(${lib} PROPERTIES VERSION "${compat_version}.${version_age}.${version_revision}" SOVERSION "${compat_version}")
14 elseif (WIN32)
15 set(rc_template "${CMAKE_CURRENT_SOURCE_DIR}/cmake/include/${lib}_version.rc.in")
16 if (EXISTS ${rc_template})
17 configure_file(${rc_template} ${lib}.rc @ONLY)
18 target_sources(${lib} PRIVATE ${lib}.rc)
19 endif ()
20 target_link_libraries(${lib} PRIVATE "-VERSION:${version_current}.${version_revision}")
21 else ()
22 message(WARNING "Unknown platform, ${lib} will not be versioned.")
23 endif ()
24 endfunction ()
0 int main (int ac, char *av[])
1 {
2 char *s = __func__;
3 }
0 #ifdef HAVE_SYS_POLL_H
1 #include <sys/poll.h>
2 #else
3 #include <poll.h>
4 #endif
5
6 int main (int ac, char *av[])
7 {
8 int rc;
9 rc = poll((struct pollfd *)(0), 0, 0);
10 }
0 #include <uv.h>
1
2 void test_cb(uv_timer_t *handle)
3 {
4 (void) handle;
5 }
6
7 int main(int ac, char *av[])
8 {
9 uv_timer_cb cb = test_cb;
10 (*cb)(0);
11 }
+0
-1480
config.guess less more
0 #! /bin/sh
1 # Attempt to guess a canonical system name.
2 # Copyright 1992-2018 Free Software Foundation, Inc.
3
4 timestamp='2018-02-24'
5
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <https://www.gnu.org/licenses/>.
18 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program that contains a
21 # configuration script generated by Autoconf, you may include it under
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
25 #
26 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
27 #
28 # You can get the latest version of this script from:
29 # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
30 #
31 # Please send patches to <config-patches@gnu.org>.
32
33
34 me=`echo "$0" | sed -e 's,.*/,,'`
35
36 usage="\
37 Usage: $0 [OPTION]
38
39 Output the configuration name of the system \`$me' is run on.
40
41 Options:
42 -h, --help print this help, then exit
43 -t, --time-stamp print date of last modification, then exit
44 -v, --version print version number, then exit
45
46 Report bugs and patches to <config-patches@gnu.org>."
47
48 version="\
49 GNU config.guess ($timestamp)
50
51 Originally written by Per Bothner.
52 Copyright 1992-2018 Free Software Foundation, Inc.
53
54 This is free software; see the source for copying conditions. There is NO
55 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
56
57 help="
58 Try \`$me --help' for more information."
59
60 # Parse command line
61 while test $# -gt 0 ; do
62 case $1 in
63 --time-stamp | --time* | -t )
64 echo "$timestamp" ; exit ;;
65 --version | -v )
66 echo "$version" ; exit ;;
67 --help | --h* | -h )
68 echo "$usage"; exit ;;
69 -- ) # Stop option processing
70 shift; break ;;
71 - ) # Use stdin as input.
72 break ;;
73 -* )
74 echo "$me: invalid option $1$help" >&2
75 exit 1 ;;
76 * )
77 break ;;
78 esac
79 done
80
81 if test $# != 0; then
82 echo "$me: too many arguments$help" >&2
83 exit 1
84 fi
85
86 trap 'exit 1' 1 2 15
87
88 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
89 # compiler to aid in system detection is discouraged as it requires
90 # temporary files to be created and, as you can see below, it is a
91 # headache to deal with in a portable fashion.
92
93 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
94 # use `HOST_CC' if defined, but it is deprecated.
95
96 # Portable tmp directory creation inspired by the Autoconf team.
97
98 set_cc_for_build='
99 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
100 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
101 : ${TMPDIR=/tmp} ;
102 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
103 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
104 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
105 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
106 dummy=$tmp/dummy ;
107 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
108 case $CC_FOR_BUILD,$HOST_CC,$CC in
109 ,,) echo "int x;" > "$dummy.c" ;
110 for c in cc gcc c89 c99 ; do
111 if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
112 CC_FOR_BUILD="$c"; break ;
113 fi ;
114 done ;
115 if test x"$CC_FOR_BUILD" = x ; then
116 CC_FOR_BUILD=no_compiler_found ;
117 fi
118 ;;
119 ,,*) CC_FOR_BUILD=$CC ;;
120 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
121 esac ; set_cc_for_build= ;'
122
123 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
124 # (ghazi@noc.rutgers.edu 1994-08-24)
125 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
126 PATH=$PATH:/.attbin ; export PATH
127 fi
128
129 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
130 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
131 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
132 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
133
134 case "$UNAME_SYSTEM" in
135 Linux|GNU|GNU/*)
136 # If the system lacks a compiler, then just pick glibc.
137 # We could probably try harder.
138 LIBC=gnu
139
140 eval "$set_cc_for_build"
141 cat <<-EOF > "$dummy.c"
142 #include <features.h>
143 #if defined(__UCLIBC__)
144 LIBC=uclibc
145 #elif defined(__dietlibc__)
146 LIBC=dietlibc
147 #else
148 LIBC=gnu
149 #endif
150 EOF
151 eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
152
153 # If ldd exists, use it to detect musl libc.
154 if command -v ldd >/dev/null && \
155 ldd --version 2>&1 | grep -q ^musl
156 then
157 LIBC=musl
158 fi
159 ;;
160 esac
161
162 # Note: order is significant - the case branches are not exclusive.
163
164 case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
165 *:NetBSD:*:*)
166 # NetBSD (nbsd) targets should (where applicable) match one or
167 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
168 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
169 # switched to ELF, *-*-netbsd* would select the old
170 # object file format. This provides both forward
171 # compatibility and a consistent mechanism for selecting the
172 # object file format.
173 #
174 # Note: NetBSD doesn't particularly care about the vendor
175 # portion of the name. We always set it to "unknown".
176 sysctl="sysctl -n hw.machine_arch"
177 UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
178 "/sbin/$sysctl" 2>/dev/null || \
179 "/usr/sbin/$sysctl" 2>/dev/null || \
180 echo unknown)`
181 case "$UNAME_MACHINE_ARCH" in
182 armeb) machine=armeb-unknown ;;
183 arm*) machine=arm-unknown ;;
184 sh3el) machine=shl-unknown ;;
185 sh3eb) machine=sh-unknown ;;
186 sh5el) machine=sh5le-unknown ;;
187 earmv*)
188 arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
189 endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
190 machine="${arch}${endian}"-unknown
191 ;;
192 *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
193 esac
194 # The Operating System including object format, if it has switched
195 # to ELF recently (or will in the future) and ABI.
196 case "$UNAME_MACHINE_ARCH" in
197 earm*)
198 os=netbsdelf
199 ;;
200 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
201 eval "$set_cc_for_build"
202 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
203 | grep -q __ELF__
204 then
205 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
206 # Return netbsd for either. FIX?
207 os=netbsd
208 else
209 os=netbsdelf
210 fi
211 ;;
212 *)
213 os=netbsd
214 ;;
215 esac
216 # Determine ABI tags.
217 case "$UNAME_MACHINE_ARCH" in
218 earm*)
219 expr='s/^earmv[0-9]/-eabi/;s/eb$//'
220 abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
221 ;;
222 esac
223 # The OS release
224 # Debian GNU/NetBSD machines have a different userland, and
225 # thus, need a distinct triplet. However, they do not need
226 # kernel version information, so it can be replaced with a
227 # suitable tag, in the style of linux-gnu.
228 case "$UNAME_VERSION" in
229 Debian*)
230 release='-gnu'
231 ;;
232 *)
233 release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
234 ;;
235 esac
236 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
237 # contains redundant information, the shorter form:
238 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
239 echo "$machine-${os}${release}${abi}"
240 exit ;;
241 *:Bitrig:*:*)
242 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
243 echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
244 exit ;;
245 *:OpenBSD:*:*)
246 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
247 echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
248 exit ;;
249 *:LibertyBSD:*:*)
250 UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
251 echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
252 exit ;;
253 *:MidnightBSD:*:*)
254 echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
255 exit ;;
256 *:ekkoBSD:*:*)
257 echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
258 exit ;;
259 *:SolidBSD:*:*)
260 echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
261 exit ;;
262 macppc:MirBSD:*:*)
263 echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
264 exit ;;
265 *:MirBSD:*:*)
266 echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
267 exit ;;
268 *:Sortix:*:*)
269 echo "$UNAME_MACHINE"-unknown-sortix
270 exit ;;
271 *:Redox:*:*)
272 echo "$UNAME_MACHINE"-unknown-redox
273 exit ;;
274 mips:OSF1:*.*)
275 echo mips-dec-osf1
276 exit ;;
277 alpha:OSF1:*:*)
278 case $UNAME_RELEASE in
279 *4.0)
280 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
281 ;;
282 *5.*)
283 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
284 ;;
285 esac
286 # According to Compaq, /usr/sbin/psrinfo has been available on
287 # OSF/1 and Tru64 systems produced since 1995. I hope that
288 # covers most systems running today. This code pipes the CPU
289 # types through head -n 1, so we only detect the type of CPU 0.
290 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
291 case "$ALPHA_CPU_TYPE" in
292 "EV4 (21064)")
293 UNAME_MACHINE=alpha ;;
294 "EV4.5 (21064)")
295 UNAME_MACHINE=alpha ;;
296 "LCA4 (21066/21068)")
297 UNAME_MACHINE=alpha ;;
298 "EV5 (21164)")
299 UNAME_MACHINE=alphaev5 ;;
300 "EV5.6 (21164A)")
301 UNAME_MACHINE=alphaev56 ;;
302 "EV5.6 (21164PC)")
303 UNAME_MACHINE=alphapca56 ;;
304 "EV5.7 (21164PC)")
305 UNAME_MACHINE=alphapca57 ;;
306 "EV6 (21264)")
307 UNAME_MACHINE=alphaev6 ;;
308 "EV6.7 (21264A)")
309 UNAME_MACHINE=alphaev67 ;;
310 "EV6.8CB (21264C)")
311 UNAME_MACHINE=alphaev68 ;;
312 "EV6.8AL (21264B)")
313 UNAME_MACHINE=alphaev68 ;;
314 "EV6.8CX (21264D)")
315 UNAME_MACHINE=alphaev68 ;;
316 "EV6.9A (21264/EV69A)")
317 UNAME_MACHINE=alphaev69 ;;
318 "EV7 (21364)")
319 UNAME_MACHINE=alphaev7 ;;
320 "EV7.9 (21364A)")
321 UNAME_MACHINE=alphaev79 ;;
322 esac
323 # A Pn.n version is a patched version.
324 # A Vn.n version is a released version.
325 # A Tn.n version is a released field test version.
326 # A Xn.n version is an unreleased experimental baselevel.
327 # 1.2 uses "1.2" for uname -r.
328 echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
329 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
330 exitcode=$?
331 trap '' 0
332 exit $exitcode ;;
333 Amiga*:UNIX_System_V:4.0:*)
334 echo m68k-unknown-sysv4
335 exit ;;
336 *:[Aa]miga[Oo][Ss]:*:*)
337 echo "$UNAME_MACHINE"-unknown-amigaos
338 exit ;;
339 *:[Mm]orph[Oo][Ss]:*:*)
340 echo "$UNAME_MACHINE"-unknown-morphos
341 exit ;;
342 *:OS/390:*:*)
343 echo i370-ibm-openedition
344 exit ;;
345 *:z/VM:*:*)
346 echo s390-ibm-zvmoe
347 exit ;;
348 *:OS400:*:*)
349 echo powerpc-ibm-os400
350 exit ;;
351 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
352 echo arm-acorn-riscix"$UNAME_RELEASE"
353 exit ;;
354 arm*:riscos:*:*|arm*:RISCOS:*:*)
355 echo arm-unknown-riscos
356 exit ;;
357 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
358 echo hppa1.1-hitachi-hiuxmpp
359 exit ;;
360 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
361 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
362 if test "`(/bin/universe) 2>/dev/null`" = att ; then
363 echo pyramid-pyramid-sysv3
364 else
365 echo pyramid-pyramid-bsd
366 fi
367 exit ;;
368 NILE*:*:*:dcosx)
369 echo pyramid-pyramid-svr4
370 exit ;;
371 DRS?6000:unix:4.0:6*)
372 echo sparc-icl-nx6
373 exit ;;
374 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
375 case `/usr/bin/uname -p` in
376 sparc) echo sparc-icl-nx7; exit ;;
377 esac ;;
378 s390x:SunOS:*:*)
379 echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
380 exit ;;
381 sun4H:SunOS:5.*:*)
382 echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
383 exit ;;
384 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
385 echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
386 exit ;;
387 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
388 echo i386-pc-auroraux"$UNAME_RELEASE"
389 exit ;;
390 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
391 eval "$set_cc_for_build"
392 SUN_ARCH=i386
393 # If there is a compiler, see if it is configured for 64-bit objects.
394 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
395 # This test works for both compilers.
396 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
397 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
398 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
399 grep IS_64BIT_ARCH >/dev/null
400 then
401 SUN_ARCH=x86_64
402 fi
403 fi
404 echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
405 exit ;;
406 sun4*:SunOS:6*:*)
407 # According to config.sub, this is the proper way to canonicalize
408 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
409 # it's likely to be more like Solaris than SunOS4.
410 echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
411 exit ;;
412 sun4*:SunOS:*:*)
413 case "`/usr/bin/arch -k`" in
414 Series*|S4*)
415 UNAME_RELEASE=`uname -v`
416 ;;
417 esac
418 # Japanese Language versions have a version number like `4.1.3-JL'.
419 echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
420 exit ;;
421 sun3*:SunOS:*:*)
422 echo m68k-sun-sunos"$UNAME_RELEASE"
423 exit ;;
424 sun*:*:4.2BSD:*)
425 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
426 test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
427 case "`/bin/arch`" in
428 sun3)
429 echo m68k-sun-sunos"$UNAME_RELEASE"
430 ;;
431 sun4)
432 echo sparc-sun-sunos"$UNAME_RELEASE"
433 ;;
434 esac
435 exit ;;
436 aushp:SunOS:*:*)
437 echo sparc-auspex-sunos"$UNAME_RELEASE"
438 exit ;;
439 # The situation for MiNT is a little confusing. The machine name
440 # can be virtually everything (everything which is not
441 # "atarist" or "atariste" at least should have a processor
442 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
443 # to the lowercase version "mint" (or "freemint"). Finally
444 # the system name "TOS" denotes a system which is actually not
445 # MiNT. But MiNT is downward compatible to TOS, so this should
446 # be no problem.
447 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
448 echo m68k-atari-mint"$UNAME_RELEASE"
449 exit ;;
450 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
451 echo m68k-atari-mint"$UNAME_RELEASE"
452 exit ;;
453 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
454 echo m68k-atari-mint"$UNAME_RELEASE"
455 exit ;;
456 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
457 echo m68k-milan-mint"$UNAME_RELEASE"
458 exit ;;
459 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
460 echo m68k-hades-mint"$UNAME_RELEASE"
461 exit ;;
462 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
463 echo m68k-unknown-mint"$UNAME_RELEASE"
464 exit ;;
465 m68k:machten:*:*)
466 echo m68k-apple-machten"$UNAME_RELEASE"
467 exit ;;
468 powerpc:machten:*:*)
469 echo powerpc-apple-machten"$UNAME_RELEASE"
470 exit ;;
471 RISC*:Mach:*:*)
472 echo mips-dec-mach_bsd4.3
473 exit ;;
474 RISC*:ULTRIX:*:*)
475 echo mips-dec-ultrix"$UNAME_RELEASE"
476 exit ;;
477 VAX*:ULTRIX*:*:*)
478 echo vax-dec-ultrix"$UNAME_RELEASE"
479 exit ;;
480 2020:CLIX:*:* | 2430:CLIX:*:*)
481 echo clipper-intergraph-clix"$UNAME_RELEASE"
482 exit ;;
483 mips:*:*:UMIPS | mips:*:*:RISCos)
484 eval "$set_cc_for_build"
485 sed 's/^ //' << EOF > "$dummy.c"
486 #ifdef __cplusplus
487 #include <stdio.h> /* for printf() prototype */
488 int main (int argc, char *argv[]) {
489 #else
490 int main (argc, argv) int argc; char *argv[]; {
491 #endif
492 #if defined (host_mips) && defined (MIPSEB)
493 #if defined (SYSTYPE_SYSV)
494 printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
495 #endif
496 #if defined (SYSTYPE_SVR4)
497 printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
498 #endif
499 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
500 printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
501 #endif
502 #endif
503 exit (-1);
504 }
505 EOF
506 $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
507 dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
508 SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
509 { echo "$SYSTEM_NAME"; exit; }
510 echo mips-mips-riscos"$UNAME_RELEASE"
511 exit ;;
512 Motorola:PowerMAX_OS:*:*)
513 echo powerpc-motorola-powermax
514 exit ;;
515 Motorola:*:4.3:PL8-*)
516 echo powerpc-harris-powermax
517 exit ;;
518 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
519 echo powerpc-harris-powermax
520 exit ;;
521 Night_Hawk:Power_UNIX:*:*)
522 echo powerpc-harris-powerunix
523 exit ;;
524 m88k:CX/UX:7*:*)
525 echo m88k-harris-cxux7
526 exit ;;
527 m88k:*:4*:R4*)
528 echo m88k-motorola-sysv4
529 exit ;;
530 m88k:*:3*:R3*)
531 echo m88k-motorola-sysv3
532 exit ;;
533 AViiON:dgux:*:*)
534 # DG/UX returns AViiON for all architectures
535 UNAME_PROCESSOR=`/usr/bin/uname -p`
536 if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
537 then
538 if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
539 [ "$TARGET_BINARY_INTERFACE"x = x ]
540 then
541 echo m88k-dg-dgux"$UNAME_RELEASE"
542 else
543 echo m88k-dg-dguxbcs"$UNAME_RELEASE"
544 fi
545 else
546 echo i586-dg-dgux"$UNAME_RELEASE"
547 fi
548 exit ;;
549 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
550 echo m88k-dolphin-sysv3
551 exit ;;
552 M88*:*:R3*:*)
553 # Delta 88k system running SVR3
554 echo m88k-motorola-sysv3
555 exit ;;
556 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
557 echo m88k-tektronix-sysv3
558 exit ;;
559 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
560 echo m68k-tektronix-bsd
561 exit ;;
562 *:IRIX*:*:*)
563 echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
564 exit ;;
565 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
566 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
567 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
568 i*86:AIX:*:*)
569 echo i386-ibm-aix
570 exit ;;
571 ia64:AIX:*:*)
572 if [ -x /usr/bin/oslevel ] ; then
573 IBM_REV=`/usr/bin/oslevel`
574 else
575 IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
576 fi
577 echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
578 exit ;;
579 *:AIX:2:3)
580 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
581 eval "$set_cc_for_build"
582 sed 's/^ //' << EOF > "$dummy.c"
583 #include <sys/systemcfg.h>
584
585 main()
586 {
587 if (!__power_pc())
588 exit(1);
589 puts("powerpc-ibm-aix3.2.5");
590 exit(0);
591 }
592 EOF
593 if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
594 then
595 echo "$SYSTEM_NAME"
596 else
597 echo rs6000-ibm-aix3.2.5
598 fi
599 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
600 echo rs6000-ibm-aix3.2.4
601 else
602 echo rs6000-ibm-aix3.2
603 fi
604 exit ;;
605 *:AIX:*:[4567])
606 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
607 if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
608 IBM_ARCH=rs6000
609 else
610 IBM_ARCH=powerpc
611 fi
612 if [ -x /usr/bin/lslpp ] ; then
613 IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
614 awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
615 else
616 IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
617 fi
618 echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
619 exit ;;
620 *:AIX:*:*)
621 echo rs6000-ibm-aix
622 exit ;;
623 ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
624 echo romp-ibm-bsd4.4
625 exit ;;
626 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
627 echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
628 exit ;; # report: romp-ibm BSD 4.3
629 *:BOSX:*:*)
630 echo rs6000-bull-bosx
631 exit ;;
632 DPX/2?00:B.O.S.:*:*)
633 echo m68k-bull-sysv3
634 exit ;;
635 9000/[34]??:4.3bsd:1.*:*)
636 echo m68k-hp-bsd
637 exit ;;
638 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
639 echo m68k-hp-bsd4.4
640 exit ;;
641 9000/[34678]??:HP-UX:*:*)
642 HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
643 case "$UNAME_MACHINE" in
644 9000/31?) HP_ARCH=m68000 ;;
645 9000/[34]??) HP_ARCH=m68k ;;
646 9000/[678][0-9][0-9])
647 if [ -x /usr/bin/getconf ]; then
648 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
649 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
650 case "$sc_cpu_version" in
651 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
652 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
653 532) # CPU_PA_RISC2_0
654 case "$sc_kernel_bits" in
655 32) HP_ARCH=hppa2.0n ;;
656 64) HP_ARCH=hppa2.0w ;;
657 '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
658 esac ;;
659 esac
660 fi
661 if [ "$HP_ARCH" = "" ]; then
662 eval "$set_cc_for_build"
663 sed 's/^ //' << EOF > "$dummy.c"
664
665 #define _HPUX_SOURCE
666 #include <stdlib.h>
667 #include <unistd.h>
668
669 int main ()
670 {
671 #if defined(_SC_KERNEL_BITS)
672 long bits = sysconf(_SC_KERNEL_BITS);
673 #endif
674 long cpu = sysconf (_SC_CPU_VERSION);
675
676 switch (cpu)
677 {
678 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
679 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
680 case CPU_PA_RISC2_0:
681 #if defined(_SC_KERNEL_BITS)
682 switch (bits)
683 {
684 case 64: puts ("hppa2.0w"); break;
685 case 32: puts ("hppa2.0n"); break;
686 default: puts ("hppa2.0"); break;
687 } break;
688 #else /* !defined(_SC_KERNEL_BITS) */
689 puts ("hppa2.0"); break;
690 #endif
691 default: puts ("hppa1.0"); break;
692 }
693 exit (0);
694 }
695 EOF
696 (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
697 test -z "$HP_ARCH" && HP_ARCH=hppa
698 fi ;;
699 esac
700 if [ "$HP_ARCH" = hppa2.0w ]
701 then
702 eval "$set_cc_for_build"
703
704 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
705 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
706 # generating 64-bit code. GNU and HP use different nomenclature:
707 #
708 # $ CC_FOR_BUILD=cc ./config.guess
709 # => hppa2.0w-hp-hpux11.23
710 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
711 # => hppa64-hp-hpux11.23
712
713 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
714 grep -q __LP64__
715 then
716 HP_ARCH=hppa2.0w
717 else
718 HP_ARCH=hppa64
719 fi
720 fi
721 echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
722 exit ;;
723 ia64:HP-UX:*:*)
724 HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
725 echo ia64-hp-hpux"$HPUX_REV"
726 exit ;;
727 3050*:HI-UX:*:*)
728 eval "$set_cc_for_build"
729 sed 's/^ //' << EOF > "$dummy.c"
730 #include <unistd.h>
731 int
732 main ()
733 {
734 long cpu = sysconf (_SC_CPU_VERSION);
735 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
736 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
737 results, however. */
738 if (CPU_IS_PA_RISC (cpu))
739 {
740 switch (cpu)
741 {
742 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
743 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
744 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
745 default: puts ("hppa-hitachi-hiuxwe2"); break;
746 }
747 }
748 else if (CPU_IS_HP_MC68K (cpu))
749 puts ("m68k-hitachi-hiuxwe2");
750 else puts ("unknown-hitachi-hiuxwe2");
751 exit (0);
752 }
753 EOF
754 $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
755 { echo "$SYSTEM_NAME"; exit; }
756 echo unknown-hitachi-hiuxwe2
757 exit ;;
758 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
759 echo hppa1.1-hp-bsd
760 exit ;;
761 9000/8??:4.3bsd:*:*)
762 echo hppa1.0-hp-bsd
763 exit ;;
764 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
765 echo hppa1.0-hp-mpeix
766 exit ;;
767 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
768 echo hppa1.1-hp-osf
769 exit ;;
770 hp8??:OSF1:*:*)
771 echo hppa1.0-hp-osf
772 exit ;;
773 i*86:OSF1:*:*)
774 if [ -x /usr/sbin/sysversion ] ; then
775 echo "$UNAME_MACHINE"-unknown-osf1mk
776 else
777 echo "$UNAME_MACHINE"-unknown-osf1
778 fi
779 exit ;;
780 parisc*:Lites*:*:*)
781 echo hppa1.1-hp-lites
782 exit ;;
783 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
784 echo c1-convex-bsd
785 exit ;;
786 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
787 if getsysinfo -f scalar_acc
788 then echo c32-convex-bsd
789 else echo c2-convex-bsd
790 fi
791 exit ;;
792 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
793 echo c34-convex-bsd
794 exit ;;
795 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
796 echo c38-convex-bsd
797 exit ;;
798 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
799 echo c4-convex-bsd
800 exit ;;
801 CRAY*Y-MP:*:*:*)
802 echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
803 exit ;;
804 CRAY*[A-Z]90:*:*:*)
805 echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
806 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
807 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
808 -e 's/\.[^.]*$/.X/'
809 exit ;;
810 CRAY*TS:*:*:*)
811 echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
812 exit ;;
813 CRAY*T3E:*:*:*)
814 echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
815 exit ;;
816 CRAY*SV1:*:*:*)
817 echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
818 exit ;;
819 *:UNICOS/mp:*:*)
820 echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
821 exit ;;
822 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
823 FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
824 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
825 FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
826 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
827 exit ;;
828 5000:UNIX_System_V:4.*:*)
829 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
830 FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
831 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
832 exit ;;
833 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
834 echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
835 exit ;;
836 sparc*:BSD/OS:*:*)
837 echo sparc-unknown-bsdi"$UNAME_RELEASE"
838 exit ;;
839 *:BSD/OS:*:*)
840 echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
841 exit ;;
842 *:FreeBSD:*:*)
843 UNAME_PROCESSOR=`/usr/bin/uname -p`
844 case "$UNAME_PROCESSOR" in
845 amd64)
846 UNAME_PROCESSOR=x86_64 ;;
847 i386)
848 UNAME_PROCESSOR=i586 ;;
849 esac
850 echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
851 exit ;;
852 i*:CYGWIN*:*)
853 echo "$UNAME_MACHINE"-pc-cygwin
854 exit ;;
855 *:MINGW64*:*)
856 echo "$UNAME_MACHINE"-pc-mingw64
857 exit ;;
858 *:MINGW*:*)
859 echo "$UNAME_MACHINE"-pc-mingw32
860 exit ;;
861 *:MSYS*:*)
862 echo "$UNAME_MACHINE"-pc-msys
863 exit ;;
864 i*:PW*:*)
865 echo "$UNAME_MACHINE"-pc-pw32
866 exit ;;
867 *:Interix*:*)
868 case "$UNAME_MACHINE" in
869 x86)
870 echo i586-pc-interix"$UNAME_RELEASE"
871 exit ;;
872 authenticamd | genuineintel | EM64T)
873 echo x86_64-unknown-interix"$UNAME_RELEASE"
874 exit ;;
875 IA64)
876 echo ia64-unknown-interix"$UNAME_RELEASE"
877 exit ;;
878 esac ;;
879 i*:UWIN*:*)
880 echo "$UNAME_MACHINE"-pc-uwin
881 exit ;;
882 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
883 echo x86_64-unknown-cygwin
884 exit ;;
885 prep*:SunOS:5.*:*)
886 echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
887 exit ;;
888 *:GNU:*:*)
889 # the GNU system
890 echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
891 exit ;;
892 *:GNU/*:*:*)
893 # other systems with GNU libc and userland
894 echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
895 exit ;;
896 i*86:Minix:*:*)
897 echo "$UNAME_MACHINE"-pc-minix
898 exit ;;
899 aarch64:Linux:*:*)
900 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
901 exit ;;
902 aarch64_be:Linux:*:*)
903 UNAME_MACHINE=aarch64_be
904 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
905 exit ;;
906 alpha:Linux:*:*)
907 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
908 EV5) UNAME_MACHINE=alphaev5 ;;
909 EV56) UNAME_MACHINE=alphaev56 ;;
910 PCA56) UNAME_MACHINE=alphapca56 ;;
911 PCA57) UNAME_MACHINE=alphapca56 ;;
912 EV6) UNAME_MACHINE=alphaev6 ;;
913 EV67) UNAME_MACHINE=alphaev67 ;;
914 EV68*) UNAME_MACHINE=alphaev68 ;;
915 esac
916 objdump --private-headers /bin/sh | grep -q ld.so.1
917 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
918 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
919 exit ;;
920 arc:Linux:*:* | arceb:Linux:*:*)
921 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
922 exit ;;
923 arm*:Linux:*:*)
924 eval "$set_cc_for_build"
925 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
926 | grep -q __ARM_EABI__
927 then
928 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
929 else
930 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
931 | grep -q __ARM_PCS_VFP
932 then
933 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
934 else
935 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
936 fi
937 fi
938 exit ;;
939 avr32*:Linux:*:*)
940 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
941 exit ;;
942 cris:Linux:*:*)
943 echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
944 exit ;;
945 crisv32:Linux:*:*)
946 echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
947 exit ;;
948 e2k:Linux:*:*)
949 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
950 exit ;;
951 frv:Linux:*:*)
952 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
953 exit ;;
954 hexagon:Linux:*:*)
955 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
956 exit ;;
957 i*86:Linux:*:*)
958 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
959 exit ;;
960 ia64:Linux:*:*)
961 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
962 exit ;;
963 k1om:Linux:*:*)
964 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
965 exit ;;
966 m32r*:Linux:*:*)
967 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
968 exit ;;
969 m68*:Linux:*:*)
970 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
971 exit ;;
972 mips:Linux:*:* | mips64:Linux:*:*)
973 eval "$set_cc_for_build"
974 sed 's/^ //' << EOF > "$dummy.c"
975 #undef CPU
976 #undef ${UNAME_MACHINE}
977 #undef ${UNAME_MACHINE}el
978 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
979 CPU=${UNAME_MACHINE}el
980 #else
981 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
982 CPU=${UNAME_MACHINE}
983 #else
984 CPU=
985 #endif
986 #endif
987 EOF
988 eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
989 test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
990 ;;
991 mips64el:Linux:*:*)
992 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
993 exit ;;
994 openrisc*:Linux:*:*)
995 echo or1k-unknown-linux-"$LIBC"
996 exit ;;
997 or32:Linux:*:* | or1k*:Linux:*:*)
998 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
999 exit ;;
1000 padre:Linux:*:*)
1001 echo sparc-unknown-linux-"$LIBC"
1002 exit ;;
1003 parisc64:Linux:*:* | hppa64:Linux:*:*)
1004 echo hppa64-unknown-linux-"$LIBC"
1005 exit ;;
1006 parisc:Linux:*:* | hppa:Linux:*:*)
1007 # Look for CPU level
1008 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1009 PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
1010 PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
1011 *) echo hppa-unknown-linux-"$LIBC" ;;
1012 esac
1013 exit ;;
1014 ppc64:Linux:*:*)
1015 echo powerpc64-unknown-linux-"$LIBC"
1016 exit ;;
1017 ppc:Linux:*:*)
1018 echo powerpc-unknown-linux-"$LIBC"
1019 exit ;;
1020 ppc64le:Linux:*:*)
1021 echo powerpc64le-unknown-linux-"$LIBC"
1022 exit ;;
1023 ppcle:Linux:*:*)
1024 echo powerpcle-unknown-linux-"$LIBC"
1025 exit ;;
1026 riscv32:Linux:*:* | riscv64:Linux:*:*)
1027 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1028 exit ;;
1029 s390:Linux:*:* | s390x:Linux:*:*)
1030 echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
1031 exit ;;
1032 sh64*:Linux:*:*)
1033 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1034 exit ;;
1035 sh*:Linux:*:*)
1036 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1037 exit ;;
1038 sparc:Linux:*:* | sparc64:Linux:*:*)
1039 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1040 exit ;;
1041 tile*:Linux:*:*)
1042 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1043 exit ;;
1044 vax:Linux:*:*)
1045 echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
1046 exit ;;
1047 x86_64:Linux:*:*)
1048 if objdump -f /bin/sh | grep -q elf32-x86-64; then
1049 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32
1050 else
1051 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
1052 fi
1053 exit ;;
1054 xtensa*:Linux:*:*)
1055 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1056 exit ;;
1057 i*86:DYNIX/ptx:4*:*)
1058 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1059 # earlier versions are messed up and put the nodename in both
1060 # sysname and nodename.
1061 echo i386-sequent-sysv4
1062 exit ;;
1063 i*86:UNIX_SV:4.2MP:2.*)
1064 # Unixware is an offshoot of SVR4, but it has its own version
1065 # number series starting with 2...
1066 # I am not positive that other SVR4 systems won't match this,
1067 # I just have to hope. -- rms.
1068 # Use sysv4.2uw... so that sysv4* matches it.
1069 echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
1070 exit ;;
1071 i*86:OS/2:*:*)
1072 # If we were able to find `uname', then EMX Unix compatibility
1073 # is probably installed.
1074 echo "$UNAME_MACHINE"-pc-os2-emx
1075 exit ;;
1076 i*86:XTS-300:*:STOP)
1077 echo "$UNAME_MACHINE"-unknown-stop
1078 exit ;;
1079 i*86:atheos:*:*)
1080 echo "$UNAME_MACHINE"-unknown-atheos
1081 exit ;;
1082 i*86:syllable:*:*)
1083 echo "$UNAME_MACHINE"-pc-syllable
1084 exit ;;
1085 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1086 echo i386-unknown-lynxos"$UNAME_RELEASE"
1087 exit ;;
1088 i*86:*DOS:*:*)
1089 echo "$UNAME_MACHINE"-pc-msdosdjgpp
1090 exit ;;
1091 i*86:*:4.*:*)
1092 UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
1093 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1094 echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
1095 else
1096 echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
1097 fi
1098 exit ;;
1099 i*86:*:5:[678]*)
1100 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1101 case `/bin/uname -X | grep "^Machine"` in
1102 *486*) UNAME_MACHINE=i486 ;;
1103 *Pentium) UNAME_MACHINE=i586 ;;
1104 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1105 esac
1106 echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
1107 exit ;;
1108 i*86:*:3.2:*)
1109 if test -f /usr/options/cb.name; then
1110 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1111 echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
1112 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1113 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1114 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1115 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1116 && UNAME_MACHINE=i586
1117 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1118 && UNAME_MACHINE=i686
1119 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1120 && UNAME_MACHINE=i686
1121 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
1122 else
1123 echo "$UNAME_MACHINE"-pc-sysv32
1124 fi
1125 exit ;;
1126 pc:*:*:*)
1127 # Left here for compatibility:
1128 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1129 # the processor, so we play safe by assuming i586.
1130 # Note: whatever this is, it MUST be the same as what config.sub
1131 # prints for the "djgpp" host, or else GDB configure will decide that
1132 # this is a cross-build.
1133 echo i586-pc-msdosdjgpp
1134 exit ;;
1135 Intel:Mach:3*:*)
1136 echo i386-pc-mach3
1137 exit ;;
1138 paragon:*:*:*)
1139 echo i860-intel-osf1
1140 exit ;;
1141 i860:*:4.*:*) # i860-SVR4
1142 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1143 echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
1144 else # Add other i860-SVR4 vendors below as they are discovered.
1145 echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
1146 fi
1147 exit ;;
1148 mini*:CTIX:SYS*5:*)
1149 # "miniframe"
1150 echo m68010-convergent-sysv
1151 exit ;;
1152 mc68k:UNIX:SYSTEM5:3.51m)
1153 echo m68k-convergent-sysv
1154 exit ;;
1155 M680?0:D-NIX:5.3:*)
1156 echo m68k-diab-dnix
1157 exit ;;
1158 M68*:*:R3V[5678]*:*)
1159 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1160 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1161 OS_REL=''
1162 test -r /etc/.relid \
1163 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1164 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1165 && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1166 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1167 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1168 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1169 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1170 && { echo i486-ncr-sysv4; exit; } ;;
1171 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1172 OS_REL='.3'
1173 test -r /etc/.relid \
1174 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1175 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1176 && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1177 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1178 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
1179 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1180 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1181 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1182 echo m68k-unknown-lynxos"$UNAME_RELEASE"
1183 exit ;;
1184 mc68030:UNIX_System_V:4.*:*)
1185 echo m68k-atari-sysv4
1186 exit ;;
1187 TSUNAMI:LynxOS:2.*:*)
1188 echo sparc-unknown-lynxos"$UNAME_RELEASE"
1189 exit ;;
1190 rs6000:LynxOS:2.*:*)
1191 echo rs6000-unknown-lynxos"$UNAME_RELEASE"
1192 exit ;;
1193 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1194 echo powerpc-unknown-lynxos"$UNAME_RELEASE"
1195 exit ;;
1196 SM[BE]S:UNIX_SV:*:*)
1197 echo mips-dde-sysv"$UNAME_RELEASE"
1198 exit ;;
1199 RM*:ReliantUNIX-*:*:*)
1200 echo mips-sni-sysv4
1201 exit ;;
1202 RM*:SINIX-*:*:*)
1203 echo mips-sni-sysv4
1204 exit ;;
1205 *:SINIX-*:*:*)
1206 if uname -p 2>/dev/null >/dev/null ; then
1207 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1208 echo "$UNAME_MACHINE"-sni-sysv4
1209 else
1210 echo ns32k-sni-sysv
1211 fi
1212 exit ;;
1213 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1214 # says <Richard.M.Bartel@ccMail.Census.GOV>
1215 echo i586-unisys-sysv4
1216 exit ;;
1217 *:UNIX_System_V:4*:FTX*)
1218 # From Gerald Hewes <hewes@openmarket.com>.
1219 # How about differentiating between stratus architectures? -djm
1220 echo hppa1.1-stratus-sysv4
1221 exit ;;
1222 *:*:*:FTX*)
1223 # From seanf@swdc.stratus.com.
1224 echo i860-stratus-sysv4
1225 exit ;;
1226 i*86:VOS:*:*)
1227 # From Paul.Green@stratus.com.
1228 echo "$UNAME_MACHINE"-stratus-vos
1229 exit ;;
1230 *:VOS:*:*)
1231 # From Paul.Green@stratus.com.
1232 echo hppa1.1-stratus-vos
1233 exit ;;
1234 mc68*:A/UX:*:*)
1235 echo m68k-apple-aux"$UNAME_RELEASE"
1236 exit ;;
1237 news*:NEWS-OS:6*:*)
1238 echo mips-sony-newsos6
1239 exit ;;
1240 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1241 if [ -d /usr/nec ]; then
1242 echo mips-nec-sysv"$UNAME_RELEASE"
1243 else
1244 echo mips-unknown-sysv"$UNAME_RELEASE"
1245 fi
1246 exit ;;
1247 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1248 echo powerpc-be-beos
1249 exit ;;
1250 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1251 echo powerpc-apple-beos
1252 exit ;;
1253 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1254 echo i586-pc-beos
1255 exit ;;
1256 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1257 echo i586-pc-haiku
1258 exit ;;
1259 x86_64:Haiku:*:*)
1260 echo x86_64-unknown-haiku
1261 exit ;;
1262 SX-4:SUPER-UX:*:*)
1263 echo sx4-nec-superux"$UNAME_RELEASE"
1264 exit ;;
1265 SX-5:SUPER-UX:*:*)
1266 echo sx5-nec-superux"$UNAME_RELEASE"
1267 exit ;;
1268 SX-6:SUPER-UX:*:*)
1269 echo sx6-nec-superux"$UNAME_RELEASE"
1270 exit ;;
1271 SX-7:SUPER-UX:*:*)
1272 echo sx7-nec-superux"$UNAME_RELEASE"
1273 exit ;;
1274 SX-8:SUPER-UX:*:*)
1275 echo sx8-nec-superux"$UNAME_RELEASE"
1276 exit ;;
1277 SX-8R:SUPER-UX:*:*)
1278 echo sx8r-nec-superux"$UNAME_RELEASE"
1279 exit ;;
1280 SX-ACE:SUPER-UX:*:*)
1281 echo sxace-nec-superux"$UNAME_RELEASE"
1282 exit ;;
1283 Power*:Rhapsody:*:*)
1284 echo powerpc-apple-rhapsody"$UNAME_RELEASE"
1285 exit ;;
1286 *:Rhapsody:*:*)
1287 echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
1288 exit ;;
1289 *:Darwin:*:*)
1290 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1291 eval "$set_cc_for_build"
1292 if test "$UNAME_PROCESSOR" = unknown ; then
1293 UNAME_PROCESSOR=powerpc
1294 fi
1295 if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
1296 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1297 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1298 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1299 grep IS_64BIT_ARCH >/dev/null
1300 then
1301 case $UNAME_PROCESSOR in
1302 i386) UNAME_PROCESSOR=x86_64 ;;
1303 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1304 esac
1305 fi
1306 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1307 if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1308 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1309 grep IS_PPC >/dev/null
1310 then
1311 UNAME_PROCESSOR=powerpc
1312 fi
1313 fi
1314 elif test "$UNAME_PROCESSOR" = i386 ; then
1315 # Avoid executing cc on OS X 10.9, as it ships with a stub
1316 # that puts up a graphical alert prompting to install
1317 # developer tools. Any system running Mac OS X 10.7 or
1318 # later (Darwin 11 and later) is required to have a 64-bit
1319 # processor. This is not true of the ARM version of Darwin
1320 # that Apple uses in portable devices.
1321 UNAME_PROCESSOR=x86_64
1322 fi
1323 echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
1324 exit ;;
1325 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1326 UNAME_PROCESSOR=`uname -p`
1327 if test "$UNAME_PROCESSOR" = x86; then
1328 UNAME_PROCESSOR=i386
1329 UNAME_MACHINE=pc
1330 fi
1331 echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
1332 exit ;;
1333 *:QNX:*:4*)
1334 echo i386-pc-qnx
1335 exit ;;
1336 NEO-*:NONSTOP_KERNEL:*:*)
1337 echo neo-tandem-nsk"$UNAME_RELEASE"
1338 exit ;;
1339 NSE-*:NONSTOP_KERNEL:*:*)
1340 echo nse-tandem-nsk"$UNAME_RELEASE"
1341 exit ;;
1342 NSR-*:NONSTOP_KERNEL:*:*)
1343 echo nsr-tandem-nsk"$UNAME_RELEASE"
1344 exit ;;
1345 NSV-*:NONSTOP_KERNEL:*:*)
1346 echo nsv-tandem-nsk"$UNAME_RELEASE"
1347 exit ;;
1348 NSX-*:NONSTOP_KERNEL:*:*)
1349 echo nsx-tandem-nsk"$UNAME_RELEASE"
1350 exit ;;
1351 *:NonStop-UX:*:*)
1352 echo mips-compaq-nonstopux
1353 exit ;;
1354 BS2000:POSIX*:*:*)
1355 echo bs2000-siemens-sysv
1356 exit ;;
1357 DS/*:UNIX_System_V:*:*)
1358 echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
1359 exit ;;
1360 *:Plan9:*:*)
1361 # "uname -m" is not consistent, so use $cputype instead. 386
1362 # is converted to i386 for consistency with other x86
1363 # operating systems.
1364 if test "$cputype" = 386; then
1365 UNAME_MACHINE=i386
1366 else
1367 UNAME_MACHINE="$cputype"
1368 fi
1369 echo "$UNAME_MACHINE"-unknown-plan9
1370 exit ;;
1371 *:TOPS-10:*:*)
1372 echo pdp10-unknown-tops10
1373 exit ;;
1374 *:TENEX:*:*)
1375 echo pdp10-unknown-tenex
1376 exit ;;
1377 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1378 echo pdp10-dec-tops20
1379 exit ;;
1380 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1381 echo pdp10-xkl-tops20
1382 exit ;;
1383 *:TOPS-20:*:*)
1384 echo pdp10-unknown-tops20
1385 exit ;;
1386 *:ITS:*:*)
1387 echo pdp10-unknown-its
1388 exit ;;
1389 SEI:*:*:SEIUX)
1390 echo mips-sei-seiux"$UNAME_RELEASE"
1391 exit ;;
1392 *:DragonFly:*:*)
1393 echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
1394 exit ;;
1395 *:*VMS:*:*)
1396 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1397 case "$UNAME_MACHINE" in
1398 A*) echo alpha-dec-vms ; exit ;;
1399 I*) echo ia64-dec-vms ; exit ;;
1400 V*) echo vax-dec-vms ; exit ;;
1401 esac ;;
1402 *:XENIX:*:SysV)
1403 echo i386-pc-xenix
1404 exit ;;
1405 i*86:skyos:*:*)
1406 echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
1407 exit ;;
1408 i*86:rdos:*:*)
1409 echo "$UNAME_MACHINE"-pc-rdos
1410 exit ;;
1411 i*86:AROS:*:*)
1412 echo "$UNAME_MACHINE"-pc-aros
1413 exit ;;
1414 x86_64:VMkernel:*:*)
1415 echo "$UNAME_MACHINE"-unknown-esx
1416 exit ;;
1417 amd64:Isilon\ OneFS:*:*)
1418 echo x86_64-unknown-onefs
1419 exit ;;
1420 esac
1421
1422 echo "$0: unable to guess system type" >&2
1423
1424 case "$UNAME_MACHINE:$UNAME_SYSTEM" in
1425 mips:Linux | mips64:Linux)
1426 # If we got here on MIPS GNU/Linux, output extra information.
1427 cat >&2 <<EOF
1428
1429 NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1430 the system type. Please install a C compiler and try again.
1431 EOF
1432 ;;
1433 esac
1434
1435 cat >&2 <<EOF
1436
1437 This script (version $timestamp), has failed to recognize the
1438 operating system you are using. If your script is old, overwrite *all*
1439 copies of config.guess and config.sub with the latest versions from:
1440
1441 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
1442 and
1443 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1444
1445 If $0 has already been updated, send the following data and any
1446 information you think might be pertinent to config-patches@gnu.org to
1447 provide the necessary information to handle your system.
1448
1449 config.guess timestamp = $timestamp
1450
1451 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1452 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1453 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1454 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1455
1456 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1457 /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1458
1459 hostinfo = `(hostinfo) 2>/dev/null`
1460 /bin/universe = `(/bin/universe) 2>/dev/null`
1461 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1462 /bin/arch = `(/bin/arch) 2>/dev/null`
1463 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1464 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1465
1466 UNAME_MACHINE = "$UNAME_MACHINE"
1467 UNAME_RELEASE = "$UNAME_RELEASE"
1468 UNAME_SYSTEM = "$UNAME_SYSTEM"
1469 UNAME_VERSION = "$UNAME_VERSION"
1470 EOF
1471
1472 exit 1
1473
1474 # Local variables:
1475 # eval: (add-hook 'write-file-functions 'time-stamp)
1476 # time-stamp-start: "timestamp='"
1477 # time-stamp-format: "%:y-%02m-%02d"
1478 # time-stamp-end: "'"
1479 # End:
+0
-1801
config.sub less more
0 #! /bin/sh
1 # Configuration validation subroutine script.
2 # Copyright 1992-2018 Free Software Foundation, Inc.
3
4 timestamp='2018-02-22'
5
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <https://www.gnu.org/licenses/>.
18 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program that contains a
21 # configuration script generated by Autoconf, you may include it under
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
25
26
27 # Please send patches to <config-patches@gnu.org>.
28 #
29 # Configuration subroutine to validate and canonicalize a configuration type.
30 # Supply the specified configuration type as an argument.
31 # If it is invalid, we print an error message on stderr and exit with code 1.
32 # Otherwise, we print the canonical config type on stdout and succeed.
33
34 # You can get the latest version of this script from:
35 # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
36
37 # This file is supposed to be the same for all GNU packages
38 # and recognize all the CPU types, system types and aliases
39 # that are meaningful with *any* GNU software.
40 # Each package is responsible for reporting which valid configurations
41 # it does not support. The user should be able to distinguish
42 # a failure to support a valid configuration from a meaningless
43 # configuration.
44
45 # The goal of this file is to map all the various variations of a given
46 # machine specification into a single specification in the form:
47 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
48 # or in some cases, the newer four-part form:
49 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
50 # It is wrong to echo any other type of specification.
51
52 me=`echo "$0" | sed -e 's,.*/,,'`
53
54 usage="\
55 Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
56
57 Canonicalize a configuration name.
58
59 Options:
60 -h, --help print this help, then exit
61 -t, --time-stamp print date of last modification, then exit
62 -v, --version print version number, then exit
63
64 Report bugs and patches to <config-patches@gnu.org>."
65
66 version="\
67 GNU config.sub ($timestamp)
68
69 Copyright 1992-2018 Free Software Foundation, Inc.
70
71 This is free software; see the source for copying conditions. There is NO
72 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
73
74 help="
75 Try \`$me --help' for more information."
76
77 # Parse command line
78 while test $# -gt 0 ; do
79 case $1 in
80 --time-stamp | --time* | -t )
81 echo "$timestamp" ; exit ;;
82 --version | -v )
83 echo "$version" ; exit ;;
84 --help | --h* | -h )
85 echo "$usage"; exit ;;
86 -- ) # Stop option processing
87 shift; break ;;
88 - ) # Use stdin as input.
89 break ;;
90 -* )
91 echo "$me: invalid option $1$help"
92 exit 1 ;;
93
94 *local*)
95 # First pass through any local machine types.
96 echo "$1"
97 exit ;;
98
99 * )
100 break ;;
101 esac
102 done
103
104 case $# in
105 0) echo "$me: missing argument$help" >&2
106 exit 1;;
107 1) ;;
108 *) echo "$me: too many arguments$help" >&2
109 exit 1;;
110 esac
111
112 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
113 # Here we must recognize all the valid KERNEL-OS combinations.
114 maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
115 case $maybe_os in
116 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
117 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
118 knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
119 kopensolaris*-gnu* | cloudabi*-eabi* | \
120 storm-chaos* | os2-emx* | rtmk-nova*)
121 os=-$maybe_os
122 basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
123 ;;
124 android-linux)
125 os=-linux-android
126 basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
127 ;;
128 *)
129 basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
130 if [ "$basic_machine" != "$1" ]
131 then os=`echo "$1" | sed 's/.*-/-/'`
132 else os=; fi
133 ;;
134 esac
135
136 ### Let's recognize common machines as not being operating systems so
137 ### that things like config.sub decstation-3100 work. We also
138 ### recognize some manufacturers as not being operating systems, so we
139 ### can provide default operating systems below.
140 case $os in
141 -sun*os*)
142 # Prevent following clause from handling this invalid input.
143 ;;
144 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
145 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
146 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
147 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
148 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
149 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
150 -apple | -axis | -knuth | -cray | -microblaze*)
151 os=
152 basic_machine=$1
153 ;;
154 -bluegene*)
155 os=-cnk
156 ;;
157 -sim | -cisco | -oki | -wec | -winbond)
158 os=
159 basic_machine=$1
160 ;;
161 -scout)
162 ;;
163 -wrs)
164 os=-vxworks
165 basic_machine=$1
166 ;;
167 -chorusos*)
168 os=-chorusos
169 basic_machine=$1
170 ;;
171 -chorusrdb)
172 os=-chorusrdb
173 basic_machine=$1
174 ;;
175 -hiux*)
176 os=-hiuxwe2
177 ;;
178 -sco6)
179 os=-sco5v6
180 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
181 ;;
182 -sco5)
183 os=-sco3.2v5
184 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
185 ;;
186 -sco4)
187 os=-sco3.2v4
188 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
189 ;;
190 -sco3.2.[4-9]*)
191 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
192 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
193 ;;
194 -sco3.2v[4-9]*)
195 # Don't forget version if it is 3.2v4 or newer.
196 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
197 ;;
198 -sco5v6*)
199 # Don't forget version if it is 3.2v4 or newer.
200 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
201 ;;
202 -sco*)
203 os=-sco3.2v2
204 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
205 ;;
206 -udk*)
207 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
208 ;;
209 -isc)
210 os=-isc2.2
211 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
212 ;;
213 -clix*)
214 basic_machine=clipper-intergraph
215 ;;
216 -isc*)
217 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
218 ;;
219 -lynx*178)
220 os=-lynxos178
221 ;;
222 -lynx*5)
223 os=-lynxos5
224 ;;
225 -lynx*)
226 os=-lynxos
227 ;;
228 -ptx*)
229 basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
230 ;;
231 -psos*)
232 os=-psos
233 ;;
234 -mint | -mint[0-9]*)
235 basic_machine=m68k-atari
236 os=-mint
237 ;;
238 esac
239
240 # Decode aliases for certain CPU-COMPANY combinations.
241 case $basic_machine in
242 # Recognize the basic CPU types without company name.
243 # Some are omitted here because they have special meanings below.
244 1750a | 580 \
245 | a29k \
246 | aarch64 | aarch64_be \
247 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
248 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
249 | am33_2.0 \
250 | arc | arceb \
251 | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
252 | avr | avr32 \
253 | ba \
254 | be32 | be64 \
255 | bfin \
256 | c4x | c8051 | clipper \
257 | d10v | d30v | dlx | dsp16xx \
258 | e2k | epiphany \
259 | fido | fr30 | frv | ft32 \
260 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
261 | hexagon \
262 | i370 | i860 | i960 | ia16 | ia64 \
263 | ip2k | iq2000 \
264 | k1om \
265 | le32 | le64 \
266 | lm32 \
267 | m32c | m32r | m32rle | m68000 | m68k | m88k \
268 | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
269 | mips | mipsbe | mipseb | mipsel | mipsle \
270 | mips16 \
271 | mips64 | mips64el \
272 | mips64octeon | mips64octeonel \
273 | mips64orion | mips64orionel \
274 | mips64r5900 | mips64r5900el \
275 | mips64vr | mips64vrel \
276 | mips64vr4100 | mips64vr4100el \
277 | mips64vr4300 | mips64vr4300el \
278 | mips64vr5000 | mips64vr5000el \
279 | mips64vr5900 | mips64vr5900el \
280 | mipsisa32 | mipsisa32el \
281 | mipsisa32r2 | mipsisa32r2el \
282 | mipsisa32r6 | mipsisa32r6el \
283 | mipsisa64 | mipsisa64el \
284 | mipsisa64r2 | mipsisa64r2el \
285 | mipsisa64r6 | mipsisa64r6el \
286 | mipsisa64sb1 | mipsisa64sb1el \
287 | mipsisa64sr71k | mipsisa64sr71kel \
288 | mipsr5900 | mipsr5900el \
289 | mipstx39 | mipstx39el \
290 | mn10200 | mn10300 \
291 | moxie \
292 | mt \
293 | msp430 \
294 | nds32 | nds32le | nds32be \
295 | nios | nios2 | nios2eb | nios2el \
296 | ns16k | ns32k \
297 | open8 | or1k | or1knd | or32 \
298 | pdp10 | pj | pjl \
299 | powerpc | powerpc64 | powerpc64le | powerpcle \
300 | pru \
301 | pyramid \
302 | riscv32 | riscv64 \
303 | rl78 | rx \
304 | score \
305 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
306 | sh64 | sh64le \
307 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
308 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
309 | spu \
310 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
311 | ubicom32 \
312 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
313 | visium \
314 | wasm32 \
315 | x86 | xc16x | xstormy16 | xtensa \
316 | z8k | z80)
317 basic_machine=$basic_machine-unknown
318 ;;
319 c54x)
320 basic_machine=tic54x-unknown
321 ;;
322 c55x)
323 basic_machine=tic55x-unknown
324 ;;
325 c6x)
326 basic_machine=tic6x-unknown
327 ;;
328 leon|leon[3-9])
329 basic_machine=sparc-$basic_machine
330 ;;
331 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
332 basic_machine=$basic_machine-unknown
333 os=-none
334 ;;
335 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
336 ;;
337 ms1)
338 basic_machine=mt-unknown
339 ;;
340
341 strongarm | thumb | xscale)
342 basic_machine=arm-unknown
343 ;;
344 xgate)
345 basic_machine=$basic_machine-unknown
346 os=-none
347 ;;
348 xscaleeb)
349 basic_machine=armeb-unknown
350 ;;
351
352 xscaleel)
353 basic_machine=armel-unknown
354 ;;
355
356 # We use `pc' rather than `unknown'
357 # because (1) that's what they normally are, and
358 # (2) the word "unknown" tends to confuse beginning users.
359 i*86 | x86_64)
360 basic_machine=$basic_machine-pc
361 ;;
362 # Object if more than one company name word.
363 *-*-*)
364 echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
365 exit 1
366 ;;
367 # Recognize the basic CPU types with company name.
368 580-* \
369 | a29k-* \
370 | aarch64-* | aarch64_be-* \
371 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
372 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
373 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
374 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
375 | avr-* | avr32-* \
376 | ba-* \
377 | be32-* | be64-* \
378 | bfin-* | bs2000-* \
379 | c[123]* | c30-* | [cjt]90-* | c4x-* \
380 | c8051-* | clipper-* | craynv-* | cydra-* \
381 | d10v-* | d30v-* | dlx-* \
382 | e2k-* | elxsi-* \
383 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
384 | h8300-* | h8500-* \
385 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
386 | hexagon-* \
387 | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
388 | ip2k-* | iq2000-* \
389 | k1om-* \
390 | le32-* | le64-* \
391 | lm32-* \
392 | m32c-* | m32r-* | m32rle-* \
393 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
394 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
395 | microblaze-* | microblazeel-* \
396 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
397 | mips16-* \
398 | mips64-* | mips64el-* \
399 | mips64octeon-* | mips64octeonel-* \
400 | mips64orion-* | mips64orionel-* \
401 | mips64r5900-* | mips64r5900el-* \
402 | mips64vr-* | mips64vrel-* \
403 | mips64vr4100-* | mips64vr4100el-* \
404 | mips64vr4300-* | mips64vr4300el-* \
405 | mips64vr5000-* | mips64vr5000el-* \
406 | mips64vr5900-* | mips64vr5900el-* \
407 | mipsisa32-* | mipsisa32el-* \
408 | mipsisa32r2-* | mipsisa32r2el-* \
409 | mipsisa32r6-* | mipsisa32r6el-* \
410 | mipsisa64-* | mipsisa64el-* \
411 | mipsisa64r2-* | mipsisa64r2el-* \
412 | mipsisa64r6-* | mipsisa64r6el-* \
413 | mipsisa64sb1-* | mipsisa64sb1el-* \
414 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
415 | mipsr5900-* | mipsr5900el-* \
416 | mipstx39-* | mipstx39el-* \
417 | mmix-* \
418 | mt-* \
419 | msp430-* \
420 | nds32-* | nds32le-* | nds32be-* \
421 | nios-* | nios2-* | nios2eb-* | nios2el-* \
422 | none-* | np1-* | ns16k-* | ns32k-* \
423 | open8-* \
424 | or1k*-* \
425 | orion-* \
426 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
427 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
428 | pru-* \
429 | pyramid-* \
430 | riscv32-* | riscv64-* \
431 | rl78-* | romp-* | rs6000-* | rx-* \
432 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
433 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
434 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
435 | sparclite-* \
436 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
437 | tahoe-* \
438 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
439 | tile*-* \
440 | tron-* \
441 | ubicom32-* \
442 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
443 | vax-* \
444 | visium-* \
445 | wasm32-* \
446 | we32k-* \
447 | x86-* | x86_64-* | xc16x-* | xps100-* \
448 | xstormy16-* | xtensa*-* \
449 | ymp-* \
450 | z8k-* | z80-*)
451 ;;
452 # Recognize the basic CPU types without company name, with glob match.
453 xtensa*)
454 basic_machine=$basic_machine-unknown
455 ;;
456 # Recognize the various machine names and aliases which stand
457 # for a CPU type and a company and sometimes even an OS.
458 386bsd)
459 basic_machine=i386-pc
460 os=-bsd
461 ;;
462 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
463 basic_machine=m68000-att
464 ;;
465 3b*)
466 basic_machine=we32k-att
467 ;;
468 a29khif)
469 basic_machine=a29k-amd
470 os=-udi
471 ;;
472 abacus)
473 basic_machine=abacus-unknown
474 ;;
475 adobe68k)
476 basic_machine=m68010-adobe
477 os=-scout
478 ;;
479 alliant | fx80)
480 basic_machine=fx80-alliant
481 ;;
482 altos | altos3068)
483 basic_machine=m68k-altos
484 ;;
485 am29k)
486 basic_machine=a29k-none
487 os=-bsd
488 ;;
489 amd64)
490 basic_machine=x86_64-pc
491 ;;
492 amd64-*)
493 basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
494 ;;
495 amdahl)
496 basic_machine=580-amdahl
497 os=-sysv
498 ;;
499 amiga | amiga-*)
500 basic_machine=m68k-unknown
501 ;;
502 amigaos | amigados)
503 basic_machine=m68k-unknown
504 os=-amigaos
505 ;;
506 amigaunix | amix)
507 basic_machine=m68k-unknown
508 os=-sysv4
509 ;;
510 apollo68)
511 basic_machine=m68k-apollo
512 os=-sysv
513 ;;
514 apollo68bsd)
515 basic_machine=m68k-apollo
516 os=-bsd
517 ;;
518 aros)
519 basic_machine=i386-pc
520 os=-aros
521 ;;
522 asmjs)
523 basic_machine=asmjs-unknown
524 ;;
525 aux)
526 basic_machine=m68k-apple
527 os=-aux
528 ;;
529 balance)
530 basic_machine=ns32k-sequent
531 os=-dynix
532 ;;
533 blackfin)
534 basic_machine=bfin-unknown
535 os=-linux
536 ;;
537 blackfin-*)
538 basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
539 os=-linux
540 ;;
541 bluegene*)
542 basic_machine=powerpc-ibm
543 os=-cnk
544 ;;
545 c54x-*)
546 basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
547 ;;
548 c55x-*)
549 basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
550 ;;
551 c6x-*)
552 basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
553 ;;
554 c90)
555 basic_machine=c90-cray
556 os=-unicos
557 ;;
558 cegcc)
559 basic_machine=arm-unknown
560 os=-cegcc
561 ;;
562 convex-c1)
563 basic_machine=c1-convex
564 os=-bsd
565 ;;
566 convex-c2)
567 basic_machine=c2-convex
568 os=-bsd
569 ;;
570 convex-c32)
571 basic_machine=c32-convex
572 os=-bsd
573 ;;
574 convex-c34)
575 basic_machine=c34-convex
576 os=-bsd
577 ;;
578 convex-c38)
579 basic_machine=c38-convex
580 os=-bsd
581 ;;
582 cray | j90)
583 basic_machine=j90-cray
584 os=-unicos
585 ;;
586 craynv)
587 basic_machine=craynv-cray
588 os=-unicosmp
589 ;;
590 cr16 | cr16-*)
591 basic_machine=cr16-unknown
592 os=-elf
593 ;;
594 crds | unos)
595 basic_machine=m68k-crds
596 ;;
597 crisv32 | crisv32-* | etraxfs*)
598 basic_machine=crisv32-axis
599 ;;
600 cris | cris-* | etrax*)
601 basic_machine=cris-axis
602 ;;
603 crx)
604 basic_machine=crx-unknown
605 os=-elf
606 ;;
607 da30 | da30-*)
608 basic_machine=m68k-da30
609 ;;
610 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
611 basic_machine=mips-dec
612 ;;
613 decsystem10* | dec10*)
614 basic_machine=pdp10-dec
615 os=-tops10
616 ;;
617 decsystem20* | dec20*)
618 basic_machine=pdp10-dec
619 os=-tops20
620 ;;
621 delta | 3300 | motorola-3300 | motorola-delta \
622 | 3300-motorola | delta-motorola)
623 basic_machine=m68k-motorola
624 ;;
625 delta88)
626 basic_machine=m88k-motorola
627 os=-sysv3
628 ;;
629 dicos)
630 basic_machine=i686-pc
631 os=-dicos
632 ;;
633 djgpp)
634 basic_machine=i586-pc
635 os=-msdosdjgpp
636 ;;
637 dpx20 | dpx20-*)
638 basic_machine=rs6000-bull
639 os=-bosx
640 ;;
641 dpx2*)
642 basic_machine=m68k-bull
643 os=-sysv3
644 ;;
645 e500v[12])
646 basic_machine=powerpc-unknown
647 os=$os"spe"
648 ;;
649 e500v[12]-*)
650 basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
651 os=$os"spe"
652 ;;
653 ebmon29k)
654 basic_machine=a29k-amd
655 os=-ebmon
656 ;;
657 elxsi)
658 basic_machine=elxsi-elxsi
659 os=-bsd
660 ;;
661 encore | umax | mmax)
662 basic_machine=ns32k-encore
663 ;;
664 es1800 | OSE68k | ose68k | ose | OSE)
665 basic_machine=m68k-ericsson
666 os=-ose
667 ;;
668 fx2800)
669 basic_machine=i860-alliant
670 ;;
671 genix)
672 basic_machine=ns32k-ns
673 ;;
674 gmicro)
675 basic_machine=tron-gmicro
676 os=-sysv
677 ;;
678 go32)
679 basic_machine=i386-pc
680 os=-go32
681 ;;
682 h3050r* | hiux*)
683 basic_machine=hppa1.1-hitachi
684 os=-hiuxwe2
685 ;;
686 h8300hms)
687 basic_machine=h8300-hitachi
688 os=-hms
689 ;;
690 h8300xray)
691 basic_machine=h8300-hitachi
692 os=-xray
693 ;;
694 h8500hms)
695 basic_machine=h8500-hitachi
696 os=-hms
697 ;;
698 harris)
699 basic_machine=m88k-harris
700 os=-sysv3
701 ;;
702 hp300-*)
703 basic_machine=m68k-hp
704 ;;
705 hp300bsd)
706 basic_machine=m68k-hp
707 os=-bsd
708 ;;
709 hp300hpux)
710 basic_machine=m68k-hp
711 os=-hpux
712 ;;
713 hp3k9[0-9][0-9] | hp9[0-9][0-9])
714 basic_machine=hppa1.0-hp
715 ;;
716 hp9k2[0-9][0-9] | hp9k31[0-9])
717 basic_machine=m68000-hp
718 ;;
719 hp9k3[2-9][0-9])
720 basic_machine=m68k-hp
721 ;;
722 hp9k6[0-9][0-9] | hp6[0-9][0-9])
723 basic_machine=hppa1.0-hp
724 ;;
725 hp9k7[0-79][0-9] | hp7[0-79][0-9])
726 basic_machine=hppa1.1-hp
727 ;;
728 hp9k78[0-9] | hp78[0-9])
729 # FIXME: really hppa2.0-hp
730 basic_machine=hppa1.1-hp
731 ;;
732 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
733 # FIXME: really hppa2.0-hp
734 basic_machine=hppa1.1-hp
735 ;;
736 hp9k8[0-9][13679] | hp8[0-9][13679])
737 basic_machine=hppa1.1-hp
738 ;;
739 hp9k8[0-9][0-9] | hp8[0-9][0-9])
740 basic_machine=hppa1.0-hp
741 ;;
742 hppaosf)
743 basic_machine=hppa1.1-hp
744 os=-osf
745 ;;
746 hppro)
747 basic_machine=hppa1.1-hp
748 os=-proelf
749 ;;
750 i370-ibm* | ibm*)
751 basic_machine=i370-ibm
752 ;;
753 i*86v32)
754 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
755 os=-sysv32
756 ;;
757 i*86v4*)
758 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
759 os=-sysv4
760 ;;
761 i*86v)
762 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
763 os=-sysv
764 ;;
765 i*86sol2)
766 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
767 os=-solaris2
768 ;;
769 i386mach)
770 basic_machine=i386-mach
771 os=-mach
772 ;;
773 vsta)
774 basic_machine=i386-unknown
775 os=-vsta
776 ;;
777 iris | iris4d)
778 basic_machine=mips-sgi
779 case $os in
780 -irix*)
781 ;;
782 *)
783 os=-irix4
784 ;;
785 esac
786 ;;
787 isi68 | isi)
788 basic_machine=m68k-isi
789 os=-sysv
790 ;;
791 leon-*|leon[3-9]-*)
792 basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
793 ;;
794 m68knommu)
795 basic_machine=m68k-unknown
796 os=-linux
797 ;;
798 m68knommu-*)
799 basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
800 os=-linux
801 ;;
802 magnum | m3230)
803 basic_machine=mips-mips
804 os=-sysv
805 ;;
806 merlin)
807 basic_machine=ns32k-utek
808 os=-sysv
809 ;;
810 microblaze*)
811 basic_machine=microblaze-xilinx
812 ;;
813 mingw64)
814 basic_machine=x86_64-pc
815 os=-mingw64
816 ;;
817 mingw32)
818 basic_machine=i686-pc
819 os=-mingw32
820 ;;
821 mingw32ce)
822 basic_machine=arm-unknown
823 os=-mingw32ce
824 ;;
825 miniframe)
826 basic_machine=m68000-convergent
827 ;;
828 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
829 basic_machine=m68k-atari
830 os=-mint
831 ;;
832 mips3*-*)
833 basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
834 ;;
835 mips3*)
836 basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
837 ;;
838 monitor)
839 basic_machine=m68k-rom68k
840 os=-coff
841 ;;
842 morphos)
843 basic_machine=powerpc-unknown
844 os=-morphos
845 ;;
846 moxiebox)
847 basic_machine=moxie-unknown
848 os=-moxiebox
849 ;;
850 msdos)
851 basic_machine=i386-pc
852 os=-msdos
853 ;;
854 ms1-*)
855 basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
856 ;;
857 msys)
858 basic_machine=i686-pc
859 os=-msys
860 ;;
861 mvs)
862 basic_machine=i370-ibm
863 os=-mvs
864 ;;
865 nacl)
866 basic_machine=le32-unknown
867 os=-nacl
868 ;;
869 ncr3000)
870 basic_machine=i486-ncr
871 os=-sysv4
872 ;;
873 netbsd386)
874 basic_machine=i386-unknown
875 os=-netbsd
876 ;;
877 netwinder)
878 basic_machine=armv4l-rebel
879 os=-linux
880 ;;
881 news | news700 | news800 | news900)
882 basic_machine=m68k-sony
883 os=-newsos
884 ;;
885 news1000)
886 basic_machine=m68030-sony
887 os=-newsos
888 ;;
889 news-3600 | risc-news)
890 basic_machine=mips-sony
891 os=-newsos
892 ;;
893 necv70)
894 basic_machine=v70-nec
895 os=-sysv
896 ;;
897 next | m*-next)
898 basic_machine=m68k-next
899 case $os in
900 -nextstep* )
901 ;;
902 -ns2*)
903 os=-nextstep2
904 ;;
905 *)
906 os=-nextstep3
907 ;;
908 esac
909 ;;
910 nh3000)
911 basic_machine=m68k-harris
912 os=-cxux
913 ;;
914 nh[45]000)
915 basic_machine=m88k-harris
916 os=-cxux
917 ;;
918 nindy960)
919 basic_machine=i960-intel
920 os=-nindy
921 ;;
922 mon960)
923 basic_machine=i960-intel
924 os=-mon960
925 ;;
926 nonstopux)
927 basic_machine=mips-compaq
928 os=-nonstopux
929 ;;
930 np1)
931 basic_machine=np1-gould
932 ;;
933 neo-tandem)
934 basic_machine=neo-tandem
935 ;;
936 nse-tandem)
937 basic_machine=nse-tandem
938 ;;
939 nsr-tandem)
940 basic_machine=nsr-tandem
941 ;;
942 nsv-tandem)
943 basic_machine=nsv-tandem
944 ;;
945 nsx-tandem)
946 basic_machine=nsx-tandem
947 ;;
948 op50n-* | op60c-*)
949 basic_machine=hppa1.1-oki
950 os=-proelf
951 ;;
952 openrisc | openrisc-*)
953 basic_machine=or32-unknown
954 ;;
955 os400)
956 basic_machine=powerpc-ibm
957 os=-os400
958 ;;
959 OSE68000 | ose68000)
960 basic_machine=m68000-ericsson
961 os=-ose
962 ;;
963 os68k)
964 basic_machine=m68k-none
965 os=-os68k
966 ;;
967 pa-hitachi)
968 basic_machine=hppa1.1-hitachi
969 os=-hiuxwe2
970 ;;
971 paragon)
972 basic_machine=i860-intel
973 os=-osf
974 ;;
975 parisc)
976 basic_machine=hppa-unknown
977 os=-linux
978 ;;
979 parisc-*)
980 basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
981 os=-linux
982 ;;
983 pbd)
984 basic_machine=sparc-tti
985 ;;
986 pbb)
987 basic_machine=m68k-tti
988 ;;
989 pc532 | pc532-*)
990 basic_machine=ns32k-pc532
991 ;;
992 pc98)
993 basic_machine=i386-pc
994 ;;
995 pc98-*)
996 basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
997 ;;
998 pentium | p5 | k5 | k6 | nexgen | viac3)
999 basic_machine=i586-pc
1000 ;;
1001 pentiumpro | p6 | 6x86 | athlon | athlon_*)
1002 basic_machine=i686-pc
1003 ;;
1004 pentiumii | pentium2 | pentiumiii | pentium3)
1005 basic_machine=i686-pc
1006 ;;
1007 pentium4)
1008 basic_machine=i786-pc
1009 ;;
1010 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
1011 basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1012 ;;
1013 pentiumpro-* | p6-* | 6x86-* | athlon-*)
1014 basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1015 ;;
1016 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1017 basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1018 ;;
1019 pentium4-*)
1020 basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1021 ;;
1022 pn)
1023 basic_machine=pn-gould
1024 ;;
1025 power) basic_machine=power-ibm
1026 ;;
1027 ppc | ppcbe) basic_machine=powerpc-unknown
1028 ;;
1029 ppc-* | ppcbe-*)
1030 basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1031 ;;
1032 ppcle | powerpclittle)
1033 basic_machine=powerpcle-unknown
1034 ;;
1035 ppcle-* | powerpclittle-*)
1036 basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1037 ;;
1038 ppc64) basic_machine=powerpc64-unknown
1039 ;;
1040 ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1041 ;;
1042 ppc64le | powerpc64little)
1043 basic_machine=powerpc64le-unknown
1044 ;;
1045 ppc64le-* | powerpc64little-*)
1046 basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1047 ;;
1048 ps2)
1049 basic_machine=i386-ibm
1050 ;;
1051 pw32)
1052 basic_machine=i586-unknown
1053 os=-pw32
1054 ;;
1055 rdos | rdos64)
1056 basic_machine=x86_64-pc
1057 os=-rdos
1058 ;;
1059 rdos32)
1060 basic_machine=i386-pc
1061 os=-rdos
1062 ;;
1063 rom68k)
1064 basic_machine=m68k-rom68k
1065 os=-coff
1066 ;;
1067 rm[46]00)
1068 basic_machine=mips-siemens
1069 ;;
1070 rtpc | rtpc-*)
1071 basic_machine=romp-ibm
1072 ;;
1073 s390 | s390-*)
1074 basic_machine=s390-ibm
1075 ;;
1076 s390x | s390x-*)
1077 basic_machine=s390x-ibm
1078 ;;
1079 sa29200)
1080 basic_machine=a29k-amd
1081 os=-udi
1082 ;;
1083 sb1)
1084 basic_machine=mipsisa64sb1-unknown
1085 ;;
1086 sb1el)
1087 basic_machine=mipsisa64sb1el-unknown
1088 ;;
1089 sde)
1090 basic_machine=mipsisa32-sde
1091 os=-elf
1092 ;;
1093 sei)
1094 basic_machine=mips-sei
1095 os=-seiux
1096 ;;
1097 sequent)
1098 basic_machine=i386-sequent
1099 ;;
1100 sh5el)
1101 basic_machine=sh5le-unknown
1102 ;;
1103 simso-wrs)
1104 basic_machine=sparclite-wrs
1105 os=-vxworks
1106 ;;
1107 sps7)
1108 basic_machine=m68k-bull
1109 os=-sysv2
1110 ;;
1111 spur)
1112 basic_machine=spur-unknown
1113 ;;
1114 st2000)
1115 basic_machine=m68k-tandem
1116 ;;
1117 stratus)
1118 basic_machine=i860-stratus
1119 os=-sysv4
1120 ;;
1121 strongarm-* | thumb-*)
1122 basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1123 ;;
1124 sun2)
1125 basic_machine=m68000-sun
1126 ;;
1127 sun2os3)
1128 basic_machine=m68000-sun
1129 os=-sunos3
1130 ;;
1131 sun2os4)
1132 basic_machine=m68000-sun
1133 os=-sunos4
1134 ;;
1135 sun3os3)
1136 basic_machine=m68k-sun
1137 os=-sunos3
1138 ;;
1139 sun3os4)
1140 basic_machine=m68k-sun
1141 os=-sunos4
1142 ;;
1143 sun4os3)
1144 basic_machine=sparc-sun
1145 os=-sunos3
1146 ;;
1147 sun4os4)
1148 basic_machine=sparc-sun
1149 os=-sunos4
1150 ;;
1151 sun4sol2)
1152 basic_machine=sparc-sun
1153 os=-solaris2
1154 ;;
1155 sun3 | sun3-*)
1156 basic_machine=m68k-sun
1157 ;;
1158 sun4)
1159 basic_machine=sparc-sun
1160 ;;
1161 sun386 | sun386i | roadrunner)
1162 basic_machine=i386-sun
1163 ;;
1164 sv1)
1165 basic_machine=sv1-cray
1166 os=-unicos
1167 ;;
1168 symmetry)
1169 basic_machine=i386-sequent
1170 os=-dynix
1171 ;;
1172 t3e)
1173 basic_machine=alphaev5-cray
1174 os=-unicos
1175 ;;
1176 t90)
1177 basic_machine=t90-cray
1178 os=-unicos
1179 ;;
1180 tile*)
1181 basic_machine=$basic_machine-unknown
1182 os=-linux-gnu
1183 ;;
1184 tx39)
1185 basic_machine=mipstx39-unknown
1186 ;;
1187 tx39el)
1188 basic_machine=mipstx39el-unknown
1189 ;;
1190 toad1)
1191 basic_machine=pdp10-xkl
1192 os=-tops20
1193 ;;
1194 tower | tower-32)
1195 basic_machine=m68k-ncr
1196 ;;
1197 tpf)
1198 basic_machine=s390x-ibm
1199 os=-tpf
1200 ;;
1201 udi29k)
1202 basic_machine=a29k-amd
1203 os=-udi
1204 ;;
1205 ultra3)
1206 basic_machine=a29k-nyu
1207 os=-sym1
1208 ;;
1209 v810 | necv810)
1210 basic_machine=v810-nec
1211 os=-none
1212 ;;
1213 vaxv)
1214 basic_machine=vax-dec
1215 os=-sysv
1216 ;;
1217 vms)
1218 basic_machine=vax-dec
1219 os=-vms
1220 ;;
1221 vpp*|vx|vx-*)
1222 basic_machine=f301-fujitsu
1223 ;;
1224 vxworks960)
1225 basic_machine=i960-wrs
1226 os=-vxworks
1227 ;;
1228 vxworks68)
1229 basic_machine=m68k-wrs
1230 os=-vxworks
1231 ;;
1232 vxworks29k)
1233 basic_machine=a29k-wrs
1234 os=-vxworks
1235 ;;
1236 w65*)
1237 basic_machine=w65-wdc
1238 os=-none
1239 ;;
1240 w89k-*)
1241 basic_machine=hppa1.1-winbond
1242 os=-proelf
1243 ;;
1244 x64)
1245 basic_machine=x86_64-pc
1246 ;;
1247 xbox)
1248 basic_machine=i686-pc
1249 os=-mingw32
1250 ;;
1251 xps | xps100)
1252 basic_machine=xps100-honeywell
1253 ;;
1254 xscale-* | xscalee[bl]-*)
1255 basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
1256 ;;
1257 ymp)
1258 basic_machine=ymp-cray
1259 os=-unicos
1260 ;;
1261 none)
1262 basic_machine=none-none
1263 os=-none
1264 ;;
1265
1266 # Here we handle the default manufacturer of certain CPU types. It is in
1267 # some cases the only manufacturer, in others, it is the most popular.
1268 w89k)
1269 basic_machine=hppa1.1-winbond
1270 ;;
1271 op50n)
1272 basic_machine=hppa1.1-oki
1273 ;;
1274 op60c)
1275 basic_machine=hppa1.1-oki
1276 ;;
1277 romp)
1278 basic_machine=romp-ibm
1279 ;;
1280 mmix)
1281 basic_machine=mmix-knuth
1282 ;;
1283 rs6000)
1284 basic_machine=rs6000-ibm
1285 ;;
1286 vax)
1287 basic_machine=vax-dec
1288 ;;
1289 pdp11)
1290 basic_machine=pdp11-dec
1291 ;;
1292 we32k)
1293 basic_machine=we32k-att
1294 ;;
1295 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1296 basic_machine=sh-unknown
1297 ;;
1298 cydra)
1299 basic_machine=cydra-cydrome
1300 ;;
1301 orion)
1302 basic_machine=orion-highlevel
1303 ;;
1304 orion105)
1305 basic_machine=clipper-highlevel
1306 ;;
1307 mac | mpw | mac-mpw)
1308 basic_machine=m68k-apple
1309 ;;
1310 pmac | pmac-mpw)
1311 basic_machine=powerpc-apple
1312 ;;
1313 *-unknown)
1314 # Make sure to match an already-canonicalized machine name.
1315 ;;
1316 *)
1317 echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
1318 exit 1
1319 ;;
1320 esac
1321
1322 # Here we canonicalize certain aliases for manufacturers.
1323 case $basic_machine in
1324 *-digital*)
1325 basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
1326 ;;
1327 *-commodore*)
1328 basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
1329 ;;
1330 *)
1331 ;;
1332 esac
1333
1334 # Decode manufacturer-specific aliases for certain operating systems.
1335
1336 if [ x"$os" != x"" ]
1337 then
1338 case $os in
1339 # First match some system type aliases that might get confused
1340 # with valid system types.
1341 # -solaris* is a basic system type, with this one exception.
1342 -auroraux)
1343 os=-auroraux
1344 ;;
1345 -solaris1 | -solaris1.*)
1346 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1347 ;;
1348 -solaris)
1349 os=-solaris2
1350 ;;
1351 -unixware*)
1352 os=-sysv4.2uw
1353 ;;
1354 -gnu/linux*)
1355 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1356 ;;
1357 # es1800 is here to avoid being matched by es* (a different OS)
1358 -es1800*)
1359 os=-ose
1360 ;;
1361 # Now accept the basic system types.
1362 # The portable systems comes first.
1363 # Each alternative MUST end in a * to match a version number.
1364 # -sysv* is not here because it comes later, after sysvr4.
1365 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1366 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1367 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1368 | -sym* | -kopensolaris* | -plan9* \
1369 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1370 | -aos* | -aros* | -cloudabi* | -sortix* \
1371 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1372 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1373 | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
1374 | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
1375 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1376 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1377 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1378 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1379 | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
1380 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1381 | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1382 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
1383 | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
1384 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
1385 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1386 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1387 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1388 | -morphos* | -superux* | -rtmk* | -windiss* \
1389 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1390 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
1391 | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
1392 | -midnightbsd*)
1393 # Remember, each alternative MUST END IN *, to match a version number.
1394 ;;
1395 -qnx*)
1396 case $basic_machine in
1397 x86-* | i*86-*)
1398 ;;
1399 *)
1400 os=-nto$os
1401 ;;
1402 esac
1403 ;;
1404 -nto-qnx*)
1405 ;;
1406 -nto*)
1407 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1408 ;;
1409 -sim | -xray | -os68k* | -v88r* \
1410 | -windows* | -osx | -abug | -netware* | -os9* \
1411 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1412 ;;
1413 -mac*)
1414 os=`echo "$os" | sed -e 's|mac|macos|'`
1415 ;;
1416 -linux-dietlibc)
1417 os=-linux-dietlibc
1418 ;;
1419 -linux*)
1420 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1421 ;;
1422 -sunos5*)
1423 os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
1424 ;;
1425 -sunos6*)
1426 os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
1427 ;;
1428 -opened*)
1429 os=-openedition
1430 ;;
1431 -os400*)
1432 os=-os400
1433 ;;
1434 -wince*)
1435 os=-wince
1436 ;;
1437 -utek*)
1438 os=-bsd
1439 ;;
1440 -dynix*)
1441 os=-bsd
1442 ;;
1443 -acis*)
1444 os=-aos
1445 ;;
1446 -atheos*)
1447 os=-atheos
1448 ;;
1449 -syllable*)
1450 os=-syllable
1451 ;;
1452 -386bsd)
1453 os=-bsd
1454 ;;
1455 -ctix* | -uts*)
1456 os=-sysv
1457 ;;
1458 -nova*)
1459 os=-rtmk-nova
1460 ;;
1461 -ns2)
1462 os=-nextstep2
1463 ;;
1464 -nsk*)
1465 os=-nsk
1466 ;;
1467 # Preserve the version number of sinix5.
1468 -sinix5.*)
1469 os=`echo $os | sed -e 's|sinix|sysv|'`
1470 ;;
1471 -sinix*)
1472 os=-sysv4
1473 ;;
1474 -tpf*)
1475 os=-tpf
1476 ;;
1477 -triton*)
1478 os=-sysv3
1479 ;;
1480 -oss*)
1481 os=-sysv3
1482 ;;
1483 -svr4*)
1484 os=-sysv4
1485 ;;
1486 -svr3)
1487 os=-sysv3
1488 ;;
1489 -sysvr4)
1490 os=-sysv4
1491 ;;
1492 # This must come after -sysvr4.
1493 -sysv*)
1494 ;;
1495 -ose*)
1496 os=-ose
1497 ;;
1498 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1499 os=-mint
1500 ;;
1501 -zvmoe)
1502 os=-zvmoe
1503 ;;
1504 -dicos*)
1505 os=-dicos
1506 ;;
1507 -pikeos*)
1508 # Until real need of OS specific support for
1509 # particular features comes up, bare metal
1510 # configurations are quite functional.
1511 case $basic_machine in
1512 arm*)
1513 os=-eabi
1514 ;;
1515 *)
1516 os=-elf
1517 ;;
1518 esac
1519 ;;
1520 -nacl*)
1521 ;;
1522 -ios)
1523 ;;
1524 -none)
1525 ;;
1526 *)
1527 # Get rid of the `-' at the beginning of $os.
1528 os=`echo $os | sed 's/[^-]*-//'`
1529 echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
1530 exit 1
1531 ;;
1532 esac
1533 else
1534
1535 # Here we handle the default operating systems that come with various machines.
1536 # The value should be what the vendor currently ships out the door with their
1537 # machine or put another way, the most popular os provided with the machine.
1538
1539 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1540 # "-sun"), then you have to tell the case statement up towards the top
1541 # that MANUFACTURER isn't an operating system. Otherwise, code above
1542 # will signal an error saying that MANUFACTURER isn't an operating
1543 # system, and we'll never get to this point.
1544
1545 case $basic_machine in
1546 score-*)
1547 os=-elf
1548 ;;
1549 spu-*)
1550 os=-elf
1551 ;;
1552 *-acorn)
1553 os=-riscix1.2
1554 ;;
1555 arm*-rebel)
1556 os=-linux
1557 ;;
1558 arm*-semi)
1559 os=-aout
1560 ;;
1561 c4x-* | tic4x-*)
1562 os=-coff
1563 ;;
1564 c8051-*)
1565 os=-elf
1566 ;;
1567 hexagon-*)
1568 os=-elf
1569 ;;
1570 tic54x-*)
1571 os=-coff
1572 ;;
1573 tic55x-*)
1574 os=-coff
1575 ;;
1576 tic6x-*)
1577 os=-coff
1578 ;;
1579 # This must come before the *-dec entry.
1580 pdp10-*)
1581 os=-tops20
1582 ;;
1583 pdp11-*)
1584 os=-none
1585 ;;
1586 *-dec | vax-*)
1587 os=-ultrix4.2
1588 ;;
1589 m68*-apollo)
1590 os=-domain
1591 ;;
1592 i386-sun)
1593 os=-sunos4.0.2
1594 ;;
1595 m68000-sun)
1596 os=-sunos3
1597 ;;
1598 m68*-cisco)
1599 os=-aout
1600 ;;
1601 mep-*)
1602 os=-elf
1603 ;;
1604 mips*-cisco)
1605 os=-elf
1606 ;;
1607 mips*-*)
1608 os=-elf
1609 ;;
1610 or32-*)
1611 os=-coff
1612 ;;
1613 *-tti) # must be before sparc entry or we get the wrong os.
1614 os=-sysv3
1615 ;;
1616 sparc-* | *-sun)
1617 os=-sunos4.1.1
1618 ;;
1619 pru-*)
1620 os=-elf
1621 ;;
1622 *-be)
1623 os=-beos
1624 ;;
1625 *-ibm)
1626 os=-aix
1627 ;;
1628 *-knuth)
1629 os=-mmixware
1630 ;;
1631 *-wec)
1632 os=-proelf
1633 ;;
1634 *-winbond)
1635 os=-proelf
1636 ;;
1637 *-oki)
1638 os=-proelf
1639 ;;
1640 *-hp)
1641 os=-hpux
1642 ;;
1643 *-hitachi)
1644 os=-hiux
1645 ;;
1646 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1647 os=-sysv
1648 ;;
1649 *-cbm)
1650 os=-amigaos
1651 ;;
1652 *-dg)
1653 os=-dgux
1654 ;;
1655 *-dolphin)
1656 os=-sysv3
1657 ;;
1658 m68k-ccur)
1659 os=-rtu
1660 ;;
1661 m88k-omron*)
1662 os=-luna
1663 ;;
1664 *-next)
1665 os=-nextstep
1666 ;;
1667 *-sequent)
1668 os=-ptx
1669 ;;
1670 *-crds)
1671 os=-unos
1672 ;;
1673 *-ns)
1674 os=-genix
1675 ;;
1676 i370-*)
1677 os=-mvs
1678 ;;
1679 *-gould)
1680 os=-sysv
1681 ;;
1682 *-highlevel)
1683 os=-bsd
1684 ;;
1685 *-encore)
1686 os=-bsd
1687 ;;
1688 *-sgi)
1689 os=-irix
1690 ;;
1691 *-siemens)
1692 os=-sysv4
1693 ;;
1694 *-masscomp)
1695 os=-rtu
1696 ;;
1697 f30[01]-fujitsu | f700-fujitsu)
1698 os=-uxpv
1699 ;;
1700 *-rom68k)
1701 os=-coff
1702 ;;
1703 *-*bug)
1704 os=-coff
1705 ;;
1706 *-apple)
1707 os=-macos
1708 ;;
1709 *-atari*)
1710 os=-mint
1711 ;;
1712 *)
1713 os=-none
1714 ;;
1715 esac
1716 fi
1717
1718 # Here we handle the case where we know the os, and the CPU type, but not the
1719 # manufacturer. We pick the logical manufacturer.
1720 vendor=unknown
1721 case $basic_machine in
1722 *-unknown)
1723 case $os in
1724 -riscix*)
1725 vendor=acorn
1726 ;;
1727 -sunos*)
1728 vendor=sun
1729 ;;
1730 -cnk*|-aix*)
1731 vendor=ibm
1732 ;;
1733 -beos*)
1734 vendor=be
1735 ;;
1736 -hpux*)
1737 vendor=hp
1738 ;;
1739 -mpeix*)
1740 vendor=hp
1741 ;;
1742 -hiux*)
1743 vendor=hitachi
1744 ;;
1745 -unos*)
1746 vendor=crds
1747 ;;
1748 -dgux*)
1749 vendor=dg
1750 ;;
1751 -luna*)
1752 vendor=omron
1753 ;;
1754 -genix*)
1755 vendor=ns
1756 ;;
1757 -mvs* | -opened*)
1758 vendor=ibm
1759 ;;
1760 -os400*)
1761 vendor=ibm
1762 ;;
1763 -ptx*)
1764 vendor=sequent
1765 ;;
1766 -tpf*)
1767 vendor=ibm
1768 ;;
1769 -vxsim* | -vxworks* | -windiss*)
1770 vendor=wrs
1771 ;;
1772 -aux*)
1773 vendor=apple
1774 ;;
1775 -hms*)
1776 vendor=hitachi
1777 ;;
1778 -mpw* | -macos*)
1779 vendor=apple
1780 ;;
1781 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1782 vendor=atari
1783 ;;
1784 -vos*)
1785 vendor=stratus
1786 ;;
1787 esac
1788 basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
1789 ;;
1790 esac
1791
1792 echo "$basic_machine$os"
1793 exit
1794
1795 # Local variables:
1796 # eval: (add-hook 'write-file-functions 'time-stamp)
1797 # time-stamp-start: "timestamp='"
1798 # time-stamp-format: "%:y-%02m-%02d"
1799 # time-stamp-end: "'"
1800 # End:
+0
-19880
configure less more
0 #! /bin/sh
1 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for getdns 1.5.2.
3 #
4 # Report bugs to <team@getdnsapi.net>.
5 #
6 #
7 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
8 #
9 #
10 # This configure script is free software; the Free Software Foundation
11 # gives unlimited permission to copy, distribute and modify it.
12 ## -------------------- ##
13 ## M4sh Initialization. ##
14 ## -------------------- ##
15
16 # Be more Bourne compatible
17 DUALCASE=1; export DUALCASE # for MKS sh
18 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
19 emulate sh
20 NULLCMD=:
21 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
22 # is contrary to our usage. Disable this feature.
23 alias -g '${1+"$@"}'='"$@"'
24 setopt NO_GLOB_SUBST
25 else
26 case `(set -o) 2>/dev/null` in #(
27 *posix*) :
28 set -o posix ;; #(
29 *) :
30 ;;
31 esac
32 fi
33
34
35 as_nl='
36 '
37 export as_nl
38 # Printing a long string crashes Solaris 7 /usr/bin/printf.
39 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
40 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
41 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
42 # Prefer a ksh shell builtin over an external printf program on Solaris,
43 # but without wasting forks for bash or zsh.
44 if test -z "$BASH_VERSION$ZSH_VERSION" \
45 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
46 as_echo='print -r --'
47 as_echo_n='print -rn --'
48 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
49 as_echo='printf %s\n'
50 as_echo_n='printf %s'
51 else
52 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
53 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
54 as_echo_n='/usr/ucb/echo -n'
55 else
56 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
57 as_echo_n_body='eval
58 arg=$1;
59 case $arg in #(
60 *"$as_nl"*)
61 expr "X$arg" : "X\\(.*\\)$as_nl";
62 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
63 esac;
64 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
65 '
66 export as_echo_n_body
67 as_echo_n='sh -c $as_echo_n_body as_echo'
68 fi
69 export as_echo_body
70 as_echo='sh -c $as_echo_body as_echo'
71 fi
72
73 # The user is always right.
74 if test "${PATH_SEPARATOR+set}" != set; then
75 PATH_SEPARATOR=:
76 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
77 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
78 PATH_SEPARATOR=';'
79 }
80 fi
81
82
83 # IFS
84 # We need space, tab and new line, in precisely that order. Quoting is
85 # there to prevent editors from complaining about space-tab.
86 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
87 # splitting by setting IFS to empty value.)
88 IFS=" "" $as_nl"
89
90 # Find who we are. Look in the path if we contain no directory separator.
91 as_myself=
92 case $0 in #((
93 *[\\/]* ) as_myself=$0 ;;
94 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
95 for as_dir in $PATH
96 do
97 IFS=$as_save_IFS
98 test -z "$as_dir" && as_dir=.
99 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
100 done
101 IFS=$as_save_IFS
102
103 ;;
104 esac
105 # We did not find ourselves, most probably we were run as `sh COMMAND'
106 # in which case we are not to be found in the path.
107 if test "x$as_myself" = x; then
108 as_myself=$0
109 fi
110 if test ! -f "$as_myself"; then
111 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
112 exit 1
113 fi
114
115 # Unset variables that we do not need and which cause bugs (e.g. in
116 # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
117 # suppresses any "Segmentation fault" message there. '((' could
118 # trigger a bug in pdksh 5.2.14.
119 for as_var in BASH_ENV ENV MAIL MAILPATH
120 do eval test x\${$as_var+set} = xset \
121 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
122 done
123 PS1='$ '
124 PS2='> '
125 PS4='+ '
126
127 # NLS nuisances.
128 LC_ALL=C
129 export LC_ALL
130 LANGUAGE=C
131 export LANGUAGE
132
133 # CDPATH.
134 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
135
136 # Use a proper internal environment variable to ensure we don't fall
137 # into an infinite loop, continuously re-executing ourselves.
138 if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
139 _as_can_reexec=no; export _as_can_reexec;
140 # We cannot yet assume a decent shell, so we have to provide a
141 # neutralization value for shells without unset; and this also
142 # works around shells that cannot unset nonexistent variables.
143 # Preserve -v and -x to the replacement shell.
144 BASH_ENV=/dev/null
145 ENV=/dev/null
146 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
147 case $- in # ((((
148 *v*x* | *x*v* ) as_opts=-vx ;;
149 *v* ) as_opts=-v ;;
150 *x* ) as_opts=-x ;;
151 * ) as_opts= ;;
152 esac
153 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
154 # Admittedly, this is quite paranoid, since all the known shells bail
155 # out after a failed `exec'.
156 $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
157 as_fn_exit 255
158 fi
159 # We don't want this to propagate to other subprocesses.
160 { _as_can_reexec=; unset _as_can_reexec;}
161 if test "x$CONFIG_SHELL" = x; then
162 as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
163 emulate sh
164 NULLCMD=:
165 # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
166 # is contrary to our usage. Disable this feature.
167 alias -g '\${1+\"\$@\"}'='\"\$@\"'
168 setopt NO_GLOB_SUBST
169 else
170 case \`(set -o) 2>/dev/null\` in #(
171 *posix*) :
172 set -o posix ;; #(
173 *) :
174 ;;
175 esac
176 fi
177 "
178 as_required="as_fn_return () { (exit \$1); }
179 as_fn_success () { as_fn_return 0; }
180 as_fn_failure () { as_fn_return 1; }
181 as_fn_ret_success () { return 0; }
182 as_fn_ret_failure () { return 1; }
183
184 exitcode=0
185 as_fn_success || { exitcode=1; echo as_fn_success failed.; }
186 as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
187 as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
188 as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
189 if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
190
191 else
192 exitcode=1; echo positional parameters were not saved.
193 fi
194 test x\$exitcode = x0 || exit 1
195 test -x / || exit 1"
196 as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
197 as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
198 eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
199 test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
200
201 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
202 ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
203 ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
204 ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
205 PATH=/empty FPATH=/empty; export PATH FPATH
206 test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
207 || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
208 test \$(( 1 + 1 )) = 2 || exit 1"
209 if (eval "$as_required") 2>/dev/null; then :
210 as_have_required=yes
211 else
212 as_have_required=no
213 fi
214 if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
215
216 else
217 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
218 as_found=false
219 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
220 do
221 IFS=$as_save_IFS
222 test -z "$as_dir" && as_dir=.
223 as_found=:
224 case $as_dir in #(
225 /*)
226 for as_base in sh bash ksh sh5; do
227 # Try only shells that exist, to save several forks.
228 as_shell=$as_dir/$as_base
229 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
230 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
231 CONFIG_SHELL=$as_shell as_have_required=yes
232 if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
233 break 2
234 fi
235 fi
236 done;;
237 esac
238 as_found=false
239 done
240 $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
241 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
242 CONFIG_SHELL=$SHELL as_have_required=yes
243 fi; }
244 IFS=$as_save_IFS
245
246
247 if test "x$CONFIG_SHELL" != x; then :
248 export CONFIG_SHELL
249 # We cannot yet assume a decent shell, so we have to provide a
250 # neutralization value for shells without unset; and this also
251 # works around shells that cannot unset nonexistent variables.
252 # Preserve -v and -x to the replacement shell.
253 BASH_ENV=/dev/null
254 ENV=/dev/null
255 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
256 case $- in # ((((
257 *v*x* | *x*v* ) as_opts=-vx ;;
258 *v* ) as_opts=-v ;;
259 *x* ) as_opts=-x ;;
260 * ) as_opts= ;;
261 esac
262 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
263 # Admittedly, this is quite paranoid, since all the known shells bail
264 # out after a failed `exec'.
265 $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
266 exit 255
267 fi
268
269 if test x$as_have_required = xno; then :
270 $as_echo "$0: This script requires a shell more modern than all"
271 $as_echo "$0: the shells that I found on your system."
272 if test x${ZSH_VERSION+set} = xset ; then
273 $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
274 $as_echo "$0: be upgraded to zsh 4.3.4 or later."
275 else
276 $as_echo "$0: Please tell bug-autoconf@gnu.org and team@getdnsapi.net
277 $0: about your system, including any error possibly output
278 $0: before this message. Then install a modern shell, or
279 $0: manually run the script under such a shell if you do
280 $0: have one."
281 fi
282 exit 1
283 fi
284 fi
285 fi
286 SHELL=${CONFIG_SHELL-/bin/sh}
287 export SHELL
288 # Unset more variables known to interfere with behavior of common tools.
289 CLICOLOR_FORCE= GREP_OPTIONS=
290 unset CLICOLOR_FORCE GREP_OPTIONS
291
292 ## --------------------- ##
293 ## M4sh Shell Functions. ##
294 ## --------------------- ##
295 # as_fn_unset VAR
296 # ---------------
297 # Portably unset VAR.
298 as_fn_unset ()
299 {
300 { eval $1=; unset $1;}
301 }
302 as_unset=as_fn_unset
303
304 # as_fn_set_status STATUS
305 # -----------------------
306 # Set $? to STATUS, without forking.
307 as_fn_set_status ()
308 {
309 return $1
310 } # as_fn_set_status
311
312 # as_fn_exit STATUS
313 # -----------------
314 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
315 as_fn_exit ()
316 {
317 set +e
318 as_fn_set_status $1
319 exit $1
320 } # as_fn_exit
321
322 # as_fn_mkdir_p
323 # -------------
324 # Create "$as_dir" as a directory, including parents if necessary.
325 as_fn_mkdir_p ()
326 {
327
328 case $as_dir in #(
329 -*) as_dir=./$as_dir;;
330 esac
331 test -d "$as_dir" || eval $as_mkdir_p || {
332 as_dirs=
333 while :; do
334 case $as_dir in #(
335 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
336 *) as_qdir=$as_dir;;
337 esac
338 as_dirs="'$as_qdir' $as_dirs"
339 as_dir=`$as_dirname -- "$as_dir" ||
340 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
341 X"$as_dir" : 'X\(//\)[^/]' \| \
342 X"$as_dir" : 'X\(//\)$' \| \
343 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
344 $as_echo X"$as_dir" |
345 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
346 s//\1/
347 q
348 }
349 /^X\(\/\/\)[^/].*/{
350 s//\1/
351 q
352 }
353 /^X\(\/\/\)$/{
354 s//\1/
355 q
356 }
357 /^X\(\/\).*/{
358 s//\1/
359 q
360 }
361 s/.*/./; q'`
362 test -d "$as_dir" && break
363 done
364 test -z "$as_dirs" || eval "mkdir $as_dirs"
365 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
366
367
368 } # as_fn_mkdir_p
369
370 # as_fn_executable_p FILE
371 # -----------------------
372 # Test if FILE is an executable regular file.
373 as_fn_executable_p ()
374 {
375 test -f "$1" && test -x "$1"
376 } # as_fn_executable_p
377 # as_fn_append VAR VALUE
378 # ----------------------
379 # Append the text in VALUE to the end of the definition contained in VAR. Take
380 # advantage of any shell optimizations that allow amortized linear growth over
381 # repeated appends, instead of the typical quadratic growth present in naive
382 # implementations.
383 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
384 eval 'as_fn_append ()
385 {
386 eval $1+=\$2
387 }'
388 else
389 as_fn_append ()
390 {
391 eval $1=\$$1\$2
392 }
393 fi # as_fn_append
394
395 # as_fn_arith ARG...
396 # ------------------
397 # Perform arithmetic evaluation on the ARGs, and store the result in the
398 # global $as_val. Take advantage of shells that can avoid forks. The arguments
399 # must be portable across $(()) and expr.
400 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
401 eval 'as_fn_arith ()
402 {
403 as_val=$(( $* ))
404 }'
405 else
406 as_fn_arith ()
407 {
408 as_val=`expr "$@" || test $? -eq 1`
409 }
410 fi # as_fn_arith
411
412
413 # as_fn_error STATUS ERROR [LINENO LOG_FD]
414 # ----------------------------------------
415 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
416 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
417 # script with STATUS, using 1 if that was 0.
418 as_fn_error ()
419 {
420 as_status=$1; test $as_status -eq 0 && as_status=1
421 if test "$4"; then
422 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
423 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
424 fi
425 $as_echo "$as_me: error: $2" >&2
426 as_fn_exit $as_status
427 } # as_fn_error
428
429 if expr a : '\(a\)' >/dev/null 2>&1 &&
430 test "X`expr 00001 : '.*\(...\)'`" = X001; then
431 as_expr=expr
432 else
433 as_expr=false
434 fi
435
436 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
437 as_basename=basename
438 else
439 as_basename=false
440 fi
441
442 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
443 as_dirname=dirname
444 else
445 as_dirname=false
446 fi
447
448 as_me=`$as_basename -- "$0" ||
449 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
450 X"$0" : 'X\(//\)$' \| \
451 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
452 $as_echo X/"$0" |
453 sed '/^.*\/\([^/][^/]*\)\/*$/{
454 s//\1/
455 q
456 }
457 /^X\/\(\/\/\)$/{
458 s//\1/
459 q
460 }
461 /^X\/\(\/\).*/{
462 s//\1/
463 q
464 }
465 s/.*/./; q'`
466
467 # Avoid depending upon Character Ranges.
468 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
469 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
470 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
471 as_cr_digits='0123456789'
472 as_cr_alnum=$as_cr_Letters$as_cr_digits
473
474
475 as_lineno_1=$LINENO as_lineno_1a=$LINENO
476 as_lineno_2=$LINENO as_lineno_2a=$LINENO
477 eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
478 test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
479 # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
480 sed -n '
481 p
482 /[$]LINENO/=
483 ' <$as_myself |
484 sed '
485 s/[$]LINENO.*/&-/
486 t lineno
487 b
488 :lineno
489 N
490 :loop
491 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
492 t loop
493 s/-\n.*//
494 ' >$as_me.lineno &&
495 chmod +x "$as_me.lineno" ||
496 { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
497
498 # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
499 # already done that, so ensure we don't try to do so again and fall
500 # in an infinite loop. This has already happened in practice.
501 _as_can_reexec=no; export _as_can_reexec
502 # Don't try to exec as it changes $[0], causing all sort of problems
503 # (the dirname of $[0] is not the place where we might find the
504 # original and so on. Autoconf is especially sensitive to this).
505 . "./$as_me.lineno"
506 # Exit status is that of the last command.
507 exit
508 }
509
510 ECHO_C= ECHO_N= ECHO_T=
511 case `echo -n x` in #(((((
512 -n*)
513 case `echo 'xy\c'` in
514 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
515 xy) ECHO_C='\c';;
516 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
517 ECHO_T=' ';;
518 esac;;
519 *)
520 ECHO_N='-n';;
521 esac
522
523 rm -f conf$$ conf$$.exe conf$$.file
524 if test -d conf$$.dir; then
525 rm -f conf$$.dir/conf$$.file
526 else
527 rm -f conf$$.dir
528 mkdir conf$$.dir 2>/dev/null
529 fi
530 if (echo >conf$$.file) 2>/dev/null; then
531 if ln -s conf$$.file conf$$ 2>/dev/null; then
532 as_ln_s='ln -s'
533 # ... but there are two gotchas:
534 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
535 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
536 # In both cases, we have to default to `cp -pR'.
537 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
538 as_ln_s='cp -pR'
539 elif ln conf$$.file conf$$ 2>/dev/null; then
540 as_ln_s=ln
541 else
542 as_ln_s='cp -pR'
543 fi
544 else
545 as_ln_s='cp -pR'
546 fi
547 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
548 rmdir conf$$.dir 2>/dev/null
549
550 if mkdir -p . 2>/dev/null; then
551 as_mkdir_p='mkdir -p "$as_dir"'
552 else
553 test -d ./-p && rmdir ./-p
554 as_mkdir_p=false
555 fi
556
557 as_test_x='test -x'
558 as_executable_p=as_fn_executable_p
559
560 # Sed expression to map a string onto a valid CPP name.
561 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
562
563 # Sed expression to map a string onto a valid variable name.
564 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
565
566 SHELL=${CONFIG_SHELL-/bin/sh}
567
568
569 test -n "$DJDIR" || exec 7<&0 </dev/null
570 exec 6>&1
571
572 # Name of the host.
573 # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
574 # so uname gets run too.
575 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
576
577 #
578 # Initializations.
579 #
580 ac_default_prefix=/usr/local
581 ac_clean_files=
582 ac_config_libobj_dir=.
583 LIBOBJS=
584 cross_compiling=no
585 subdirs=
586 MFLAGS=
587 MAKEFLAGS=
588
589 # Identity of this package.
590 PACKAGE_NAME='getdns'
591 PACKAGE_TARNAME='getdns'
592 PACKAGE_VERSION='1.5.2'
593 PACKAGE_STRING='getdns 1.5.2'
594 PACKAGE_BUGREPORT='team@getdnsapi.net'
595 PACKAGE_URL='https://getdnsapi.net'
596
597 ac_unique_file="src/getdns/getdns.h.in"
598 # Factoring default headers for most tests.
599 ac_includes_default="\
600 #include <stdio.h>
601 #ifdef HAVE_SYS_TYPES_H
602 # include <sys/types.h>
603 #endif
604 #ifdef HAVE_SYS_STAT_H
605 # include <sys/stat.h>
606 #endif
607 #ifdef STDC_HEADERS
608 # include <stdlib.h>
609 # include <stddef.h>
610 #else
611 # ifdef HAVE_STDLIB_H
612 # include <stdlib.h>
613 # endif
614 #endif
615 #ifdef HAVE_STRING_H
616 # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
617 # include <memory.h>
618 # endif
619 # include <string.h>
620 #endif
621 #ifdef HAVE_STRINGS_H
622 # include <strings.h>
623 #endif
624 #ifdef HAVE_INTTYPES_H
625 # include <inttypes.h>
626 #endif
627 #ifdef HAVE_STDINT_H
628 # include <stdint.h>
629 #endif
630 #ifdef HAVE_UNISTD_H
631 # include <unistd.h>
632 #endif"
633
634 ac_subst_vars='LTLIBOBJS
635 C99COMPATFLAGS
636 LIBBSD_LIBS
637 LIBBSD_CFLAGS
638 STUBBY_LIBS
639 STUBBY_LDFLAGS
640 STUBBY_XTRA_OBJS
641 UNINSTALL_STUBBY
642 INSTALL_STUBBY
643 STUBBY
644 UNINSTALL_GETDNS_SERVER_MON
645 INSTALL_GETDNS_SERVER_MON
646 GETDNS_SERVER_MON
647 UNINSTALL_GETDNS_QUERY
648 INSTALL_GETDNS_QUERY
649 GETDNS_QUERY
650 TRUST_ANCHOR_FILE
651 CHECK_EV_PROG
652 EXTENSION_LIBEV_LDFLAGS
653 EXTENSION_LIBEV_EXT_LIBS
654 EXTENSION_LIBEV_LIB
655 have_libev
656 CHECK_UV_PROG
657 EXTENSION_LIBUV_LDFLAGS
658 EXTENSION_LIBUV_EXT_LIBS
659 EXTENSION_LIBUV_LIB
660 have_libuv
661 CHECK_EVENT_PROG
662 EXTENSION_LIBEVENT_LDFLAGS
663 EXTENSION_LIBEVENT_EXT_LIBS
664 EXTENSION_LIBEVENT_LIB
665 have_libevent
666 CHECK_GETDNS
667 NOLIBCHECK
668 CHECK_LIBS
669 CHECK_CFLAGS
670 DOXYGEN
671 GETDNS_XTRA_OBJS
672 DANESSL_XTRA_OBJS
673 RUNTIME_PATH
674 HAVE_SSL
675 NETTLE_LIBS
676 TLSDIR
677 libgnutlsdane_LIBS
678 libgnutlsdane_CFLAGS
679 libgnutls_LIBS
680 libgnutls_CFLAGS
681 PKG_CONFIG_LIBDIR
682 PKG_CONFIG_PATH
683 PKG_CONFIG
684 LIBOBJS
685 DEFAULT_EVENTLOOP
686 INSTALL_DATA
687 INSTALL_SCRIPT
688 INSTALL_PROGRAM
689 LT_SYS_LIBRARY_PATH
690 OTOOL64
691 OTOOL
692 LIPO
693 NMEDIT
694 DSYMUTIL
695 MANIFEST_TOOL
696 AWK
697 RANLIB
698 STRIP
699 ac_ct_AR
700 AR
701 DLLTOOL
702 OBJDUMP
703 LN_S
704 NM
705 ac_ct_DUMPBIN
706 DUMPBIN
707 LD
708 FGREP
709 EGREP
710 GREP
711 SED
712 LIBTOOL
713 libtool
714 WNOERRORFLAG
715 WPEDANTICFLAG
716 HOSTOS
717 host_os
718 host_vendor
719 host_cpu
720 host
721 build_os
722 build_vendor
723 build_cpu
724 build
725 CPP
726 OBJEXT
727 EXEEXT
728 ac_ct_CC
729 CPPFLAGS
730 LDFLAGS
731 CFLAGS
732 CC
733 GETDNS_LIBVERSION
734 GETDNS_COMPILATION_COMMENT
735 API_NUMERIC_VERSION
736 API_VERSION
737 GETDNS_NUMERIC_VERSION
738 GETDNS_VERSION
739 STUBBY_RELEASE_CANDIDATE
740 RELEASE_CANDIDATE
741 target_alias
742 host_alias
743 build_alias
744 LIBS
745 ECHO_T
746 ECHO_N
747 ECHO_C
748 DEFS
749 mandir
750 localedir
751 libdir
752 psdir
753 pdfdir
754 dvidir
755 htmldir
756 infodir
757 docdir
758 oldincludedir
759 includedir
760 runstatedir
761 localstatedir
762 sharedstatedir
763 sysconfdir
764 datadir
765 datarootdir
766 libexecdir
767 sbindir
768 bindir
769 program_transform_name
770 prefix
771 exec_prefix
772 PACKAGE_URL
773 PACKAGE_BUGREPORT
774 PACKAGE_STRING
775 PACKAGE_VERSION
776 PACKAGE_TARNAME
777 PACKAGE_NAME
778 PATH_SEPARATOR
779 SHELL'
780 ac_subst_files=''
781 ac_user_opts='
782 enable_option_checking
783 with_piddir
784 with_current_date
785 enable_shared
786 enable_static
787 with_pic
788 enable_fast_install
789 with_aix_soname
790 with_gnu_ld
791 with_sysroot
792 enable_libtool_lock
793 enable_rpath
794 enable_debug_req
795 enable_debug_sched
796 enable_debug_stub
797 enable_debug_daemon
798 enable_debug_sec
799 enable_debug_server
800 enable_debug_anchor
801 enable_all_debugging
802 enable_debug_keep_connections_open
803 enable_poll_eventloop
804 enable_tcp_fastopen
805 enable_native_stub_dnssec
806 with_resolvconf
807 with_hosts
808 with_fd_setsize
809 with_max_udp_backoff
810 with_libpthread
811 with_gnutls
812 with_nettle
813 with_ssl
814 enable_sha1
815 enable_sha2
816 enable_gost
817 enable_ecdsa
818 enable_dsa
819 enable_ed25519
820 enable_ed448
821 enable_all_drafts
822 enable_dnssec_roadblock_avoidance
823 enable_edns_cookies
824 enable_draft_mdns_support
825 enable_stub_only
826 enable_yaml_config
827 with_libidn
828 with_libidn2
829 with_libunbound
830 enable_unbound_event_api
831 with_libevent
832 with_libuv
833 with_libev
834 with_trust_anchor
835 with_getdns_query
836 with_getdns_server_mon
837 with_stubby
838 with_libyaml
839 '
840 ac_precious_vars='build_alias
841 host_alias
842 target_alias
843 CC
844 CFLAGS
845 LDFLAGS
846 LIBS
847 CPPFLAGS
848 CPP
849 LT_SYS_LIBRARY_PATH
850 PKG_CONFIG
851 PKG_CONFIG_PATH
852 PKG_CONFIG_LIBDIR
853 libgnutls_CFLAGS
854 libgnutls_LIBS
855 libgnutlsdane_CFLAGS
856 libgnutlsdane_LIBS
857 CHECK_CFLAGS
858 CHECK_LIBS
859 LIBBSD_CFLAGS
860 LIBBSD_LIBS'
861
862
863 # Initialize some variables set by options.
864 ac_init_help=
865 ac_init_version=false
866 ac_unrecognized_opts=
867 ac_unrecognized_sep=
868 # The variables have the same names as the options, with
869 # dashes changed to underlines.
870 cache_file=/dev/null
871 exec_prefix=NONE
872 no_create=
873 no_recursion=
874 prefix=NONE
875 program_prefix=NONE
876 program_suffix=NONE
877 program_transform_name=s,x,x,
878 silent=
879 site=
880 srcdir=
881 verbose=
882 x_includes=NONE
883 x_libraries=NONE
884
885 # Installation directory options.
886 # These are left unexpanded so users can "make install exec_prefix=/foo"
887 # and all the variables that are supposed to be based on exec_prefix
888 # by default will actually change.
889 # Use braces instead of parens because sh, perl, etc. also accept them.
890 # (The list follows the same order as the GNU Coding Standards.)
891 bindir='${exec_prefix}/bin'
892 sbindir='${exec_prefix}/sbin'
893 libexecdir='${exec_prefix}/libexec'
894 datarootdir='${prefix}/share'
895 datadir='${datarootdir}'
896 sysconfdir='${prefix}/etc'
897 sharedstatedir='${prefix}/com'
898 localstatedir='${prefix}/var'
899 runstatedir='${localstatedir}/run'
900 includedir='${prefix}/include'
901 oldincludedir='/usr/include'
902 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
903 infodir='${datarootdir}/info'
904 htmldir='${docdir}'
905 dvidir='${docdir}'
906 pdfdir='${docdir}'
907 psdir='${docdir}'
908 libdir='${exec_prefix}/lib'
909 localedir='${datarootdir}/locale'
910 mandir='${datarootdir}/man'
911
912 ac_prev=
913 ac_dashdash=
914 for ac_option
915 do
916 # If the previous option needs an argument, assign it.
917 if test -n "$ac_prev"; then
918 eval $ac_prev=\$ac_option
919 ac_prev=
920 continue
921 fi
922
923 case $ac_option in
924 *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
925 *=) ac_optarg= ;;
926 *) ac_optarg=yes ;;
927 esac
928
929 # Accept the important Cygnus configure options, so we can diagnose typos.
930
931 case $ac_dashdash$ac_option in
932 --)
933 ac_dashdash=yes ;;
934
935 -bindir | --bindir | --bindi | --bind | --bin | --bi)
936 ac_prev=bindir ;;
937 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
938 bindir=$ac_optarg ;;
939
940 -build | --build | --buil | --bui | --bu)
941 ac_prev=build_alias ;;
942 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
943 build_alias=$ac_optarg ;;
944
945 -cache-file | --cache-file | --cache-fil | --cache-fi \
946 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
947 ac_prev=cache_file ;;
948 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
949 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
950 cache_file=$ac_optarg ;;
951
952 --config-cache | -C)
953 cache_file=config.cache ;;
954
955 -datadir | --datadir | --datadi | --datad)
956 ac_prev=datadir ;;
957 -datadir=* | --datadir=* | --datadi=* | --datad=*)
958 datadir=$ac_optarg ;;
959
960 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
961 | --dataroo | --dataro | --datar)
962 ac_prev=datarootdir ;;
963 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
964 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
965 datarootdir=$ac_optarg ;;
966
967 -disable-* | --disable-*)
968 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
969 # Reject names that are not valid shell variable names.
970 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
971 as_fn_error $? "invalid feature name: $ac_useropt"
972 ac_useropt_orig=$ac_useropt
973 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
974 case $ac_user_opts in
975 *"
976 "enable_$ac_useropt"
977 "*) ;;
978 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
979 ac_unrecognized_sep=', ';;
980 esac
981 eval enable_$ac_useropt=no ;;
982
983 -docdir | --docdir | --docdi | --doc | --do)
984 ac_prev=docdir ;;
985 -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
986 docdir=$ac_optarg ;;
987
988 -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
989 ac_prev=dvidir ;;
990 -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
991 dvidir=$ac_optarg ;;
992
993 -enable-* | --enable-*)
994 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
995 # Reject names that are not valid shell variable names.
996 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
997 as_fn_error $? "invalid feature name: $ac_useropt"
998 ac_useropt_orig=$ac_useropt
999 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1000 case $ac_user_opts in
1001 *"
1002 "enable_$ac_useropt"
1003 "*) ;;
1004 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
1005 ac_unrecognized_sep=', ';;
1006 esac
1007 eval enable_$ac_useropt=\$ac_optarg ;;
1008
1009 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
1010 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
1011 | --exec | --exe | --ex)
1012 ac_prev=exec_prefix ;;
1013 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
1014 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
1015 | --exec=* | --exe=* | --ex=*)
1016 exec_prefix=$ac_optarg ;;
1017
1018 -gas | --gas | --ga | --g)
1019 # Obsolete; use --with-gas.
1020 with_gas=yes ;;
1021
1022 -help | --help | --hel | --he | -h)
1023 ac_init_help=long ;;
1024 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
1025 ac_init_help=recursive ;;
1026 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
1027 ac_init_help=short ;;
1028
1029 -host | --host | --hos | --ho)
1030 ac_prev=host_alias ;;
1031 -host=* | --host=* | --hos=* | --ho=*)
1032 host_alias=$ac_optarg ;;
1033
1034 -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
1035 ac_prev=htmldir ;;
1036 -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
1037 | --ht=*)
1038 htmldir=$ac_optarg ;;
1039
1040 -includedir | --includedir | --includedi | --included | --include \
1041 | --includ | --inclu | --incl | --inc)
1042 ac_prev=includedir ;;
1043 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
1044 | --includ=* | --inclu=* | --incl=* | --inc=*)
1045 includedir=$ac_optarg ;;
1046
1047 -infodir | --infodir | --infodi | --infod | --info | --inf)
1048 ac_prev=infodir ;;
1049 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
1050 infodir=$ac_optarg ;;
1051
1052 -libdir | --libdir | --libdi | --libd)
1053 ac_prev=libdir ;;
1054 -libdir=* | --libdir=* | --libdi=* | --libd=*)
1055 libdir=$ac_optarg ;;
1056
1057 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
1058 | --libexe | --libex | --libe)
1059 ac_prev=libexecdir ;;
1060 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
1061 | --libexe=* | --libex=* | --libe=*)
1062 libexecdir=$ac_optarg ;;
1063
1064 -localedir | --localedir | --localedi | --localed | --locale)
1065 ac_prev=localedir ;;
1066 -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
1067 localedir=$ac_optarg ;;
1068
1069 -localstatedir | --localstatedir | --localstatedi | --localstated \
1070 | --localstate | --localstat | --localsta | --localst | --locals)
1071 ac_prev=localstatedir ;;
1072 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
1073 | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
1074 localstatedir=$ac_optarg ;;
1075
1076 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1077 ac_prev=mandir ;;
1078 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1079 mandir=$ac_optarg ;;
1080
1081 -nfp | --nfp | --nf)
1082 # Obsolete; use --without-fp.
1083 with_fp=no ;;
1084
1085 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1086 | --no-cr | --no-c | -n)
1087 no_create=yes ;;
1088
1089 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1090 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1091 no_recursion=yes ;;
1092
1093 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1094 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1095 | --oldin | --oldi | --old | --ol | --o)
1096 ac_prev=oldincludedir ;;
1097 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1098 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1099 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1100 oldincludedir=$ac_optarg ;;
1101
1102 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1103 ac_prev=prefix ;;
1104 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1105 prefix=$ac_optarg ;;
1106
1107 -program-prefix | --program-prefix | --program-prefi | --program-pref \
1108 | --program-pre | --program-pr | --program-p)
1109 ac_prev=program_prefix ;;
1110 -program-prefix=* | --program-prefix=* | --program-prefi=* \
1111 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1112 program_prefix=$ac_optarg ;;
1113
1114 -program-suffix | --program-suffix | --program-suffi | --program-suff \
1115 | --program-suf | --program-su | --program-s)
1116 ac_prev=program_suffix ;;
1117 -program-suffix=* | --program-suffix=* | --program-suffi=* \
1118 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1119 program_suffix=$ac_optarg ;;
1120
1121 -program-transform-name | --program-transform-name \
1122 | --program-transform-nam | --program-transform-na \
1123 | --program-transform-n | --program-transform- \
1124 | --program-transform | --program-transfor \
1125 | --program-transfo | --program-transf \
1126 | --program-trans | --program-tran \
1127 | --progr-tra | --program-tr | --program-t)
1128 ac_prev=program_transform_name ;;
1129 -program-transform-name=* | --program-transform-name=* \
1130 | --program-transform-nam=* | --program-transform-na=* \
1131 | --program-transform-n=* | --program-transform-=* \
1132 | --program-transform=* | --program-transfor=* \
1133 | --program-transfo=* | --program-transf=* \
1134 | --program-trans=* | --program-tran=* \
1135 | --progr-tra=* | --program-tr=* | --program-t=*)
1136 program_transform_name=$ac_optarg ;;
1137
1138 -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1139 ac_prev=pdfdir ;;
1140 -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1141 pdfdir=$ac_optarg ;;
1142
1143 -psdir | --psdir | --psdi | --psd | --ps)
1144 ac_prev=psdir ;;
1145 -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1146 psdir=$ac_optarg ;;
1147
1148 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1149 | -silent | --silent | --silen | --sile | --sil)
1150 silent=yes ;;
1151
1152 -runstatedir | --runstatedir | --runstatedi | --runstated \
1153 | --runstate | --runstat | --runsta | --runst | --runs \
1154 | --run | --ru | --r)
1155 ac_prev=runstatedir ;;
1156 -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1157 | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1158 | --run=* | --ru=* | --r=*)
1159 runstatedir=$ac_optarg ;;
1160
1161 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1162 ac_prev=sbindir ;;
1163 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1164 | --sbi=* | --sb=*)
1165 sbindir=$ac_optarg ;;
1166
1167 -sharedstatedir | --sharedstatedir | --sharedstatedi \
1168 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1169 | --sharedst | --shareds | --shared | --share | --shar \
1170 | --sha | --sh)
1171 ac_prev=sharedstatedir ;;
1172 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1173 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1174 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1175 | --sha=* | --sh=*)
1176 sharedstatedir=$ac_optarg ;;
1177
1178 -site | --site | --sit)
1179 ac_prev=site ;;
1180 -site=* | --site=* | --sit=*)
1181 site=$ac_optarg ;;
1182
1183 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1184 ac_prev=srcdir ;;
1185 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1186 srcdir=$ac_optarg ;;
1187
1188 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1189 | --syscon | --sysco | --sysc | --sys | --sy)
1190 ac_prev=sysconfdir ;;
1191 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1192 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1193 sysconfdir=$ac_optarg ;;
1194
1195 -target | --target | --targe | --targ | --tar | --ta | --t)
1196 ac_prev=target_alias ;;
1197 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1198 target_alias=$ac_optarg ;;
1199
1200 -v | -verbose | --verbose | --verbos | --verbo | --verb)
1201 verbose=yes ;;
1202
1203 -version | --version | --versio | --versi | --vers | -V)
1204 ac_init_version=: ;;
1205
1206 -with-* | --with-*)
1207 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1208 # Reject names that are not valid shell variable names.
1209 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1210 as_fn_error $? "invalid package name: $ac_useropt"
1211 ac_useropt_orig=$ac_useropt
1212 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1213 case $ac_user_opts in
1214 *"
1215 "with_$ac_useropt"
1216 "*) ;;
1217 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1218 ac_unrecognized_sep=', ';;
1219 esac
1220 eval with_$ac_useropt=\$ac_optarg ;;
1221
1222 -without-* | --without-*)
1223 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1224 # Reject names that are not valid shell variable names.
1225 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1226 as_fn_error $? "invalid package name: $ac_useropt"
1227 ac_useropt_orig=$ac_useropt
1228 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1229 case $ac_user_opts in
1230 *"
1231 "with_$ac_useropt"
1232 "*) ;;
1233 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1234 ac_unrecognized_sep=', ';;
1235 esac
1236 eval with_$ac_useropt=no ;;
1237
1238 --x)
1239 # Obsolete; use --with-x.
1240 with_x=yes ;;
1241
1242 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1243 | --x-incl | --x-inc | --x-in | --x-i)
1244 ac_prev=x_includes ;;
1245 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1246 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1247 x_includes=$ac_optarg ;;
1248
1249 -x-libraries | --x-libraries | --x-librarie | --x-librari \
1250 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1251 ac_prev=x_libraries ;;
1252 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1253 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1254 x_libraries=$ac_optarg ;;
1255
1256 -*) as_fn_error $? "unrecognized option: \`$ac_option'
1257 Try \`$0 --help' for more information"
1258 ;;
1259
1260 *=*)
1261 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1262 # Reject names that are not valid shell variable names.
1263 case $ac_envvar in #(
1264 '' | [0-9]* | *[!_$as_cr_alnum]* )
1265 as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
1266 esac
1267 eval $ac_envvar=\$ac_optarg
1268 export $ac_envvar ;;
1269
1270 *)
1271 # FIXME: should be removed in autoconf 3.0.
1272 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1273 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1274 $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1275 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
1276 ;;
1277
1278 esac
1279 done
1280
1281 if test -n "$ac_prev"; then
1282 ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1283 as_fn_error $? "missing argument to $ac_option"
1284 fi
1285
1286 if test -n "$ac_unrecognized_opts"; then
1287 case $enable_option_checking in
1288 no) ;;
1289 fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
1290 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1291 esac
1292 fi
1293
1294 # Check all directory arguments for consistency.
1295 for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
1296 datadir sysconfdir sharedstatedir localstatedir includedir \
1297 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1298 libdir localedir mandir runstatedir
1299 do
1300 eval ac_val=\$$ac_var
1301 # Remove trailing slashes.
1302 case $ac_val in
1303 */ )
1304 ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1305 eval $ac_var=\$ac_val;;
1306 esac
1307 # Be sure to have absolute directory names.
1308 case $ac_val in
1309 [\\/$]* | ?:[\\/]* ) continue;;
1310 NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1311 esac
1312 as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
1313 done
1314
1315 # There might be people who depend on the old broken behavior: `$host'
1316 # used to hold the argument of --host etc.
1317 # FIXME: To remove some day.
1318 build=$build_alias
1319 host=$host_alias
1320 target=$target_alias
1321
1322 # FIXME: To remove some day.
1323 if test "x$host_alias" != x; then
1324 if test "x$build_alias" = x; then
1325 cross_compiling=maybe
1326 elif test "x$build_alias" != "x$host_alias"; then
1327 cross_compiling=yes
1328 fi
1329 fi
1330
1331 ac_tool_prefix=
1332 test -n "$host_alias" && ac_tool_prefix=$host_alias-
1333
1334 test "$silent" = yes && exec 6>/dev/null
1335
1336
1337 ac_pwd=`pwd` && test -n "$ac_pwd" &&
1338 ac_ls_di=`ls -di .` &&
1339 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1340 as_fn_error $? "working directory cannot be determined"
1341 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1342 as_fn_error $? "pwd does not report name of working directory"
1343
1344
1345 # Find the source files, if location was not specified.
1346 if test -z "$srcdir"; then
1347 ac_srcdir_defaulted=yes
1348 # Try the directory containing this script, then the parent directory.
1349 ac_confdir=`$as_dirname -- "$as_myself" ||
1350 $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1351 X"$as_myself" : 'X\(//\)[^/]' \| \
1352 X"$as_myself" : 'X\(//\)$' \| \
1353 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1354 $as_echo X"$as_myself" |
1355 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1356 s//\1/
1357 q
1358 }
1359 /^X\(\/\/\)[^/].*/{
1360 s//\1/
1361 q
1362 }
1363 /^X\(\/\/\)$/{
1364 s//\1/
1365 q
1366 }
1367 /^X\(\/\).*/{
1368 s//\1/
1369 q
1370 }
1371 s/.*/./; q'`
1372 srcdir=$ac_confdir
1373 if test ! -r "$srcdir/$ac_unique_file"; then
1374 srcdir=..
1375 fi
1376 else
1377 ac_srcdir_defaulted=no
1378 fi
1379 if test ! -r "$srcdir/$ac_unique_file"; then
1380 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1381 as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
1382 fi
1383 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1384 ac_abs_confdir=`(
1385 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
1386 pwd)`
1387 # When building in place, set srcdir=.
1388 if test "$ac_abs_confdir" = "$ac_pwd"; then
1389 srcdir=.
1390 fi
1391 # Remove unnecessary trailing slashes from srcdir.
1392 # Double slashes in file names in object file debugging info
1393 # mess up M-x gdb in Emacs.
1394 case $srcdir in
1395 */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1396 esac
1397 for ac_var in $ac_precious_vars; do
1398 eval ac_env_${ac_var}_set=\${${ac_var}+set}
1399 eval ac_env_${ac_var}_value=\$${ac_var}
1400 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1401 eval ac_cv_env_${ac_var}_value=\$${ac_var}
1402 done
1403
1404 #
1405 # Report the --help message.
1406 #
1407 if test "$ac_init_help" = "long"; then
1408 # Omit some internal or obsolete options to make the list less imposing.
1409 # This message is too long to be a string in the A/UX 3.1 sh.
1410 cat <<_ACEOF
1411 \`configure' configures getdns 1.5.2 to adapt to many kinds of systems.
1412
1413 Usage: $0 [OPTION]... [VAR=VALUE]...
1414
1415 To assign environment variables (e.g., CC, CFLAGS...), specify them as
1416 VAR=VALUE. See below for descriptions of some of the useful variables.
1417
1418 Defaults for the options are specified in brackets.
1419
1420 Configuration:
1421 -h, --help display this help and exit
1422 --help=short display options specific to this package
1423 --help=recursive display the short help of all the included packages
1424 -V, --version display version information and exit
1425 -q, --quiet, --silent do not print \`checking ...' messages
1426 --cache-file=FILE cache test results in FILE [disabled]
1427 -C, --config-cache alias for \`--cache-file=config.cache'
1428 -n, --no-create do not create output files
1429 --srcdir=DIR find the sources in DIR [configure dir or \`..']
1430
1431 Installation directories:
1432 --prefix=PREFIX install architecture-independent files in PREFIX
1433 [$ac_default_prefix]
1434 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
1435 [PREFIX]
1436
1437 By default, \`make install' will install all the files in
1438 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
1439 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1440 for instance \`--prefix=\$HOME'.
1441
1442 For better control, use the options below.
1443
1444 Fine tuning of the installation directories:
1445 --bindir=DIR user executables [EPREFIX/bin]
1446 --sbindir=DIR system admin executables [EPREFIX/sbin]
1447 --libexecdir=DIR program executables [EPREFIX/libexec]
1448 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
1449 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
1450 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
1451 --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
1452 --libdir=DIR object code libraries [EPREFIX/lib]
1453 --includedir=DIR C header files [PREFIX/include]
1454 --oldincludedir=DIR C header files for non-gcc [/usr/include]
1455 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
1456 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
1457 --infodir=DIR info documentation [DATAROOTDIR/info]
1458 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
1459 --mandir=DIR man documentation [DATAROOTDIR/man]
1460 --docdir=DIR documentation root [DATAROOTDIR/doc/getdns]
1461 --htmldir=DIR html documentation [DOCDIR]
1462 --dvidir=DIR dvi documentation [DOCDIR]
1463 --pdfdir=DIR pdf documentation [DOCDIR]
1464 --psdir=DIR ps documentation [DOCDIR]
1465 _ACEOF
1466
1467 cat <<\_ACEOF
1468
1469 System types:
1470 --build=BUILD configure for building on BUILD [guessed]
1471 --host=HOST cross-compile to build programs to run on HOST [BUILD]
1472 _ACEOF
1473 fi
1474
1475 if test -n "$ac_init_help"; then
1476 case $ac_init_help in
1477 short | recursive ) echo "Configuration of getdns 1.5.2:";;
1478 esac
1479 cat <<\_ACEOF
1480
1481 Optional Features:
1482 --disable-option-checking ignore unrecognized --enable/--with options
1483 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
1484 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1485 --enable-shared[=PKGS] build shared libraries [default=yes]
1486 --enable-static[=PKGS] build static libraries [default=yes]
1487 --enable-fast-install[=PKGS]
1488 optimize for fast installation [default=yes]
1489 --disable-libtool-lock avoid locking (might break parallel builds)
1490 --disable-rpath disable hardcoded rpath (default=enabled)
1491 --enable-debug-req Enable request debugging
1492 --enable-debug-sched Enable scheduling debugging messages
1493 --enable-debug-stub Enable stub debugging messages
1494 --enable-debug-daemon Enable daemon debugging messages
1495 --enable-debug-sec Enable dnssec debugging messages
1496 --enable-debug-server Enable server debugging messages
1497 --enable-debug-anchor Enable anchor debugging messages
1498 --enable-all-debugging Enable scheduling, stub and dnssec debugging
1499
1500 --disable-poll-eventloop
1501 Disable default eventloop based on poll
1502 (default=enabled if available)
1503 --disable-tcp-fastopen Disable TCP Fast Open (default=enabled if available)
1504 --disable-native-stub-dnssec
1505 Disable native stub DNSSEC support
1506 --disable-sha1 Disable SHA1 RRSIG support, does not disable nsec3
1507 support
1508 --disable-sha2 Disable SHA256 and SHA512 RRSIG support
1509 --disable-gost Disable GOST support
1510 --disable-ecdsa Disable ECDSA support
1511 --disable-dsa Disable DSA support
1512 --disable-ed25519 Disable ED25519 support
1513 --disable-ed448 Disable ED448 support
1514 --enable-all-drafts Enables the draft mdns client support
1515 --disable-dnssec-roadblock-avoidance
1516 Disable dnssec roadblock avoidance
1517 --disable-edns-cookies Disable edns cookies
1518 --enable-draft-mdns-support
1519 Enable draft mdns client support
1520 --enable-stub-only Restricts resolution modes to STUB (which will be
1521 the default mode). Removes the libunbound
1522 dependency.
1523 --disable-unbound-event-api
1524 Disable usage of libunbounds event API
1525
1526 Optional Packages:
1527 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
1528 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1529 --with-piddir=DIR directory for pid files [default=RUNSTATEDIR or
1530 LOCALSTATEDIR/run]
1531 --with-current-date
1532 current date of the compilation, set to fixed date for reproducible builds [default=system]
1533
1534 --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
1535 both]
1536 --with-aix-soname=aix|svr4|both
1537 shared library versioning (aka "SONAME") variant to
1538 provide on AIX, [default=aix].
1539 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
1540 --with-sysroot[=DIR] Search for dependent libraries within DIR (or the
1541 compiler's sysroot if not specified).
1542 --with-resolvconf=PATH Set the resolver configuration file path. Defaults
1543 to /etc/resolv.conf or values retrieved via
1544 GetNetworkParams() on Windows
1545 --with-hosts=PATH Set the static table lookup for hostnames path.
1546 Defaults to /etc/hosts or
1547 C:\Windows\System32\Drivers\etc\hosts on Windows
1548 --with-fd-setsize=size Set maximum file descriptor number that can be used
1549 by select
1550 --with-max-udp-backoff=<number of queries>
1551 Set the maximum number of messages that can be sent
1552 to other upstreams before the upstream which has
1553 previously timed out will be tried again. (defaults
1554 to 1000)
1555 --without-libpthread Disable libpthread (default is autodetect)
1556 --with-gnutls use GnuTLS instead of OpenSSL
1557 --with-nettle Require nettle library (required with GnuTLS)
1558 --with-ssl=pathname enable SSL (will check /usr/local/ssl /usr/lib/ssl
1559 /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw
1560 /usr)
1561 --with-libidn=pathname path to libidn (default: search /usr/local ..)
1562 --with-libidn2=pathname path to libidn2 (default: search /usr/local ..)
1563 --with-libunbound=pathname
1564 path to libunbound (default: search /usr/local ..)
1565 --with-libevent path to libevent (default: search /usr/local ..)
1566 --with-libuv path to libuv (default: search /usr/local ..)
1567 --with-libev path to libev (default: search /usr/local ..)
1568 --with-trust-anchor=KEYFILE
1569 Default location of the trust anchor file.
1570 [default=SYSCONFDIR/unbound/getdns-root.key]
1571 --without-getdns_query Do not compile and install the getdns_query tool
1572 --without-getdns_server_mon
1573 Do not compile and install the getdns_server_mon
1574 tool
1575 --with-stubby Compile and install stubby, the (stub) resolver
1576 daemon
1577 --with-libyaml=pathname path to libyaml (default: search /usr/local ..)
1578
1579 Some influential environment variables:
1580 CC C compiler command
1581 CFLAGS C compiler flags
1582 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
1583 nonstandard directory <lib dir>
1584 LIBS libraries to pass to the linker, e.g. -l<library>
1585 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1586 you have headers in a nonstandard directory <include dir>
1587 CPP C preprocessor
1588 LT_SYS_LIBRARY_PATH
1589 User-defined run-time library search path.
1590 PKG_CONFIG path to pkg-config utility
1591 PKG_CONFIG_PATH
1592 directories to add to pkg-config's search path
1593 PKG_CONFIG_LIBDIR
1594 path overriding pkg-config's built-in search path
1595 libgnutls_CFLAGS
1596 C compiler flags for libgnutls, overriding pkg-config
1597 libgnutls_LIBS
1598 linker flags for libgnutls, overriding pkg-config
1599 libgnutlsdane_CFLAGS
1600 C compiler flags for libgnutlsdane, overriding pkg-config
1601 libgnutlsdane_LIBS
1602 linker flags for libgnutlsdane, overriding pkg-config
1603 CHECK_CFLAGS
1604 C compiler flags for CHECK, overriding pkg-config
1605 CHECK_LIBS linker flags for CHECK, overriding pkg-config
1606 LIBBSD_CFLAGS
1607 C compiler flags for LIBBSD, overriding pkg-config
1608 LIBBSD_LIBS linker flags for LIBBSD, overriding pkg-config
1609
1610 Use these variables to override the choices made by `configure' or to help
1611 it to find libraries and programs with nonstandard names/locations.
1612
1613 Report bugs to <team@getdnsapi.net>.
1614 getdns home page: <https://getdnsapi.net>.
1615 _ACEOF
1616 ac_status=$?
1617 fi
1618
1619 if test "$ac_init_help" = "recursive"; then
1620 # If there are subdirs, report their specific --help.
1621 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1622 test -d "$ac_dir" ||
1623 { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1624 continue
1625 ac_builddir=.
1626
1627 case "$ac_dir" in
1628 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1629 *)
1630 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1631 # A ".." for each directory in $ac_dir_suffix.
1632 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1633 case $ac_top_builddir_sub in
1634 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1635 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1636 esac ;;
1637 esac
1638 ac_abs_top_builddir=$ac_pwd
1639 ac_abs_builddir=$ac_pwd$ac_dir_suffix
1640 # for backward compatibility:
1641 ac_top_builddir=$ac_top_build_prefix
1642
1643 case $srcdir in
1644 .) # We are building in place.
1645 ac_srcdir=.
1646 ac_top_srcdir=$ac_top_builddir_sub
1647 ac_abs_top_srcdir=$ac_pwd ;;
1648 [\\/]* | ?:[\\/]* ) # Absolute name.
1649 ac_srcdir=$srcdir$ac_dir_suffix;
1650 ac_top_srcdir=$srcdir
1651 ac_abs_top_srcdir=$srcdir ;;
1652 *) # Relative name.
1653 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1654 ac_top_srcdir=$ac_top_build_prefix$srcdir
1655 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1656 esac
1657 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1658
1659 cd "$ac_dir" || { ac_status=$?; continue; }
1660 # Check for guested configure.
1661 if test -f "$ac_srcdir/configure.gnu"; then
1662 echo &&
1663 $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1664 elif test -f "$ac_srcdir/configure"; then
1665 echo &&
1666 $SHELL "$ac_srcdir/configure" --help=recursive
1667 else
1668 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1669 fi || ac_status=$?
1670 cd "$ac_pwd" || { ac_status=$?; break; }
1671 done
1672 fi
1673
1674 test -n "$ac_init_help" && exit $ac_status
1675 if $ac_init_version; then
1676 cat <<\_ACEOF
1677 getdns configure 1.5.2
1678 generated by GNU Autoconf 2.69
1679
1680 Copyright (C) 2012 Free Software Foundation, Inc.
1681 This configure script is free software; the Free Software Foundation
1682 gives unlimited permission to copy, distribute and modify it.
1683 _ACEOF
1684 exit
1685 fi
1686
1687 ## ------------------------ ##
1688 ## Autoconf initialization. ##
1689 ## ------------------------ ##
1690
1691 # ac_fn_c_try_compile LINENO
1692 # --------------------------
1693 # Try to compile conftest.$ac_ext, and return whether this succeeded.
1694 ac_fn_c_try_compile ()
1695 {
1696 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1697 rm -f conftest.$ac_objext
1698 if { { ac_try="$ac_compile"
1699 case "(($ac_try" in
1700 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1701 *) ac_try_echo=$ac_try;;
1702 esac
1703 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1704 $as_echo "$ac_try_echo"; } >&5
1705 (eval "$ac_compile") 2>conftest.err
1706 ac_status=$?
1707 if test -s conftest.err; then
1708 grep -v '^ *+' conftest.err >conftest.er1
1709 cat conftest.er1 >&5
1710 mv -f conftest.er1 conftest.err
1711 fi
1712 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1713 test $ac_status = 0; } && {
1714 test -z "$ac_c_werror_flag" ||
1715 test ! -s conftest.err
1716 } && test -s conftest.$ac_objext; then :
1717 ac_retval=0
1718 else
1719 $as_echo "$as_me: failed program was:" >&5
1720 sed 's/^/| /' conftest.$ac_ext >&5
1721
1722 ac_retval=1
1723 fi
1724 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1725 as_fn_set_status $ac_retval
1726
1727 } # ac_fn_c_try_compile
1728
1729 # ac_fn_c_try_cpp LINENO
1730 # ----------------------
1731 # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
1732 ac_fn_c_try_cpp ()
1733 {
1734 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1735 if { { ac_try="$ac_cpp conftest.$ac_ext"
1736 case "(($ac_try" in
1737 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1738 *) ac_try_echo=$ac_try;;
1739 esac
1740 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1741 $as_echo "$ac_try_echo"; } >&5
1742 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
1743 ac_status=$?
1744 if test -s conftest.err; then
1745 grep -v '^ *+' conftest.err >conftest.er1
1746 cat conftest.er1 >&5
1747 mv -f conftest.er1 conftest.err
1748 fi
1749 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1750 test $ac_status = 0; } > conftest.i && {
1751 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1752 test ! -s conftest.err
1753 }; then :
1754 ac_retval=0
1755 else
1756 $as_echo "$as_me: failed program was:" >&5
1757 sed 's/^/| /' conftest.$ac_ext >&5
1758
1759 ac_retval=1
1760 fi
1761 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1762 as_fn_set_status $ac_retval
1763
1764 } # ac_fn_c_try_cpp
1765
1766 # ac_fn_c_try_link LINENO
1767 # -----------------------
1768 # Try to link conftest.$ac_ext, and return whether this succeeded.
1769 ac_fn_c_try_link ()
1770 {
1771 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1772 rm -f conftest.$ac_objext conftest$ac_exeext
1773 if { { ac_try="$ac_link"
1774 case "(($ac_try" in
1775 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1776 *) ac_try_echo=$ac_try;;
1777 esac
1778 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1779 $as_echo "$ac_try_echo"; } >&5
1780 (eval "$ac_link") 2>conftest.err
1781 ac_status=$?
1782 if test -s conftest.err; then
1783 grep -v '^ *+' conftest.err >conftest.er1
1784 cat conftest.er1 >&5
1785 mv -f conftest.er1 conftest.err
1786 fi
1787 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1788 test $ac_status = 0; } && {
1789 test -z "$ac_c_werror_flag" ||
1790 test ! -s conftest.err
1791 } && test -s conftest$ac_exeext && {
1792 test "$cross_compiling" = yes ||
1793 test -x conftest$ac_exeext
1794 }; then :
1795 ac_retval=0
1796 else
1797 $as_echo "$as_me: failed program was:" >&5
1798 sed 's/^/| /' conftest.$ac_ext >&5
1799
1800 ac_retval=1
1801 fi
1802 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1803 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1804 # interfere with the next link command; also delete a directory that is
1805 # left behind by Apple's compiler. We do this before executing the actions.
1806 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1807 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1808 as_fn_set_status $ac_retval
1809
1810 } # ac_fn_c_try_link
1811
1812 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1813 # -------------------------------------------------------
1814 # Tests whether HEADER exists and can be compiled using the include files in
1815 # INCLUDES, setting the cache variable VAR accordingly.
1816 ac_fn_c_check_header_compile ()
1817 {
1818 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1819 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1820 $as_echo_n "checking for $2... " >&6; }
1821 if eval \${$3+:} false; then :
1822 $as_echo_n "(cached) " >&6
1823 else
1824 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1825 /* end confdefs.h. */
1826 $4
1827 #include <$2>
1828 _ACEOF
1829 if ac_fn_c_try_compile "$LINENO"; then :
1830 eval "$3=yes"
1831 else
1832 eval "$3=no"
1833 fi
1834 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1835 fi
1836 eval ac_res=\$$3
1837 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1838 $as_echo "$ac_res" >&6; }
1839 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1840
1841 } # ac_fn_c_check_header_compile
1842
1843 # ac_fn_c_try_run LINENO
1844 # ----------------------
1845 # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
1846 # that executables *can* be run.
1847 ac_fn_c_try_run ()
1848 {
1849 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1850 if { { ac_try="$ac_link"
1851 case "(($ac_try" in
1852 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1853 *) ac_try_echo=$ac_try;;
1854 esac
1855 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1856 $as_echo "$ac_try_echo"; } >&5
1857 (eval "$ac_link") 2>&5
1858 ac_status=$?
1859 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1860 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
1861 { { case "(($ac_try" in
1862 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1863 *) ac_try_echo=$ac_try;;
1864 esac
1865 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1866 $as_echo "$ac_try_echo"; } >&5
1867 (eval "$ac_try") 2>&5
1868 ac_status=$?
1869 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1870 test $ac_status = 0; }; }; then :
1871 ac_retval=0
1872 else
1873 $as_echo "$as_me: program exited with status $ac_status" >&5
1874 $as_echo "$as_me: failed program was:" >&5
1875 sed 's/^/| /' conftest.$ac_ext >&5
1876
1877 ac_retval=$ac_status
1878 fi
1879 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1880 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1881 as_fn_set_status $ac_retval
1882
1883 } # ac_fn_c_try_run
1884
1885 # ac_fn_c_check_func LINENO FUNC VAR
1886 # ----------------------------------
1887 # Tests whether FUNC exists, setting the cache variable VAR accordingly
1888 ac_fn_c_check_func ()
1889 {
1890 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1891 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1892 $as_echo_n "checking for $2... " >&6; }
1893 if eval \${$3+:} false; then :
1894 $as_echo_n "(cached) " >&6
1895 else
1896 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1897 /* end confdefs.h. */
1898 /* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1899 For example, HP-UX 11i <limits.h> declares gettimeofday. */
1900 #define $2 innocuous_$2
1901
1902 /* System header to define __stub macros and hopefully few prototypes,
1903 which can conflict with char $2 (); below.
1904 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
1905 <limits.h> exists even on freestanding compilers. */
1906
1907 #ifdef __STDC__
1908 # include <limits.h>
1909 #else
1910 # include <assert.h>
1911 #endif
1912
1913 #undef $2
1914
1915 /* Override any GCC internal prototype to avoid an error.
1916 Use char because int might match the return type of a GCC
1917 builtin and then its argument prototype would still apply. */
1918 #ifdef __cplusplus
1919 extern "C"
1920 #endif
1921 char $2 ();
1922 /* The GNU C library defines this for functions which it implements
1923 to always fail with ENOSYS. Some functions are actually named
1924 something starting with __ and the normal name is an alias. */
1925 #if defined __stub_$2 || defined __stub___$2
1926 choke me
1927 #endif
1928
1929 int
1930 main ()
1931 {
1932 return $2 ();
1933 ;
1934 return 0;
1935 }
1936 _ACEOF
1937 if ac_fn_c_try_link "$LINENO"; then :
1938 eval "$3=yes"
1939 else
1940 eval "$3=no"
1941 fi
1942 rm -f core conftest.err conftest.$ac_objext \
1943 conftest$ac_exeext conftest.$ac_ext
1944 fi
1945 eval ac_res=\$$3
1946 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1947 $as_echo "$ac_res" >&6; }
1948 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1949
1950 } # ac_fn_c_check_func
1951
1952 # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
1953 # ---------------------------------------------
1954 # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
1955 # accordingly.
1956 ac_fn_c_check_decl ()
1957 {
1958 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1959 as_decl_name=`echo $2|sed 's/ *(.*//'`
1960 as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
1961 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
1962 $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
1963 if eval \${$3+:} false; then :
1964 $as_echo_n "(cached) " >&6
1965 else
1966 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1967 /* end confdefs.h. */
1968 $4
1969 int
1970 main ()
1971 {
1972 #ifndef $as_decl_name
1973 #ifdef __cplusplus
1974 (void) $as_decl_use;
1975 #else
1976 (void) $as_decl_name;
1977 #endif
1978 #endif
1979
1980 ;
1981 return 0;
1982 }
1983 _ACEOF
1984 if ac_fn_c_try_compile "$LINENO"; then :
1985 eval "$3=yes"
1986 else
1987 eval "$3=no"
1988 fi
1989 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1990 fi
1991 eval ac_res=\$$3
1992 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1993 $as_echo "$ac_res" >&6; }
1994 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1995
1996 } # ac_fn_c_check_decl
1997
1998 # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
1999 # -------------------------------------------------------
2000 # Tests whether HEADER exists, giving a warning if it cannot be compiled using
2001 # the include files in INCLUDES and setting the cache variable VAR
2002 # accordingly.
2003 ac_fn_c_check_header_mongrel ()
2004 {
2005 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2006 if eval \${$3+:} false; then :
2007 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2008 $as_echo_n "checking for $2... " >&6; }
2009 if eval \${$3+:} false; then :
2010 $as_echo_n "(cached) " >&6
2011 fi
2012 eval ac_res=\$$3
2013 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2014 $as_echo "$ac_res" >&6; }
2015 else
2016 # Is the header compilable?
2017 { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
2018 $as_echo_n "checking $2 usability... " >&6; }
2019 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2020 /* end confdefs.h. */
2021 $4
2022 #include <$2>
2023 _ACEOF
2024 if ac_fn_c_try_compile "$LINENO"; then :
2025 ac_header_compiler=yes
2026 else
2027 ac_header_compiler=no
2028 fi
2029 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2030 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
2031 $as_echo "$ac_header_compiler" >&6; }
2032
2033 # Is the header present?
2034 { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
2035 $as_echo_n "checking $2 presence... " >&6; }
2036 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2037 /* end confdefs.h. */
2038 #include <$2>
2039 _ACEOF
2040 if ac_fn_c_try_cpp "$LINENO"; then :
2041 ac_header_preproc=yes
2042 else
2043 ac_header_preproc=no
2044 fi
2045 rm -f conftest.err conftest.i conftest.$ac_ext
2046 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
2047 $as_echo "$ac_header_preproc" >&6; }
2048
2049 # So? What about this header?
2050 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
2051 yes:no: )
2052 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
2053 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
2054 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
2055 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
2056 ;;
2057 no:yes:* )
2058 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
2059 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
2060 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
2061 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
2062 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
2063 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
2064 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
2065 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
2066 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
2067 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
2068 ( $as_echo "## --------------------------------- ##
2069 ## Report this to team@getdnsapi.net ##
2070 ## --------------------------------- ##"
2071 ) | sed "s/^/$as_me: WARNING: /" >&2
2072 ;;
2073 esac
2074 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2075 $as_echo_n "checking for $2... " >&6; }
2076 if eval \${$3+:} false; then :
2077 $as_echo_n "(cached) " >&6
2078 else
2079 eval "$3=\$ac_header_compiler"
2080 fi
2081 eval ac_res=\$$3
2082 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2083 $as_echo "$ac_res" >&6; }
2084 fi
2085 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2086
2087 } # ac_fn_c_check_header_mongrel
2088
2089 # ac_fn_c_check_type LINENO TYPE VAR INCLUDES
2090 # -------------------------------------------
2091 # Tests whether TYPE exists after having included INCLUDES, setting cache
2092 # variable VAR accordingly.
2093 ac_fn_c_check_type ()
2094 {
2095 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2096 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2097 $as_echo_n "checking for $2... " >&6; }
2098 if eval \${$3+:} false; then :
2099 $as_echo_n "(cached) " >&6
2100 else
2101 eval "$3=no"
2102 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2103 /* end confdefs.h. */
2104 $4
2105 int
2106 main ()
2107 {
2108 if (sizeof ($2))
2109 return 0;
2110 ;
2111 return 0;
2112 }
2113 _ACEOF
2114 if ac_fn_c_try_compile "$LINENO"; then :
2115 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2116 /* end confdefs.h. */
2117 $4
2118 int
2119 main ()
2120 {
2121 if (sizeof (($2)))
2122 return 0;
2123 ;
2124 return 0;
2125 }
2126 _ACEOF
2127 if ac_fn_c_try_compile "$LINENO"; then :
2128
2129 else
2130 eval "$3=yes"
2131 fi
2132 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2133 fi
2134 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2135 fi
2136 eval ac_res=\$$3
2137 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2138 $as_echo "$ac_res" >&6; }
2139 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2140
2141 } # ac_fn_c_check_type
2142
2143 # ac_fn_c_find_uintX_t LINENO BITS VAR
2144 # ------------------------------------
2145 # Finds an unsigned integer type with width BITS, setting cache variable VAR
2146 # accordingly.
2147 ac_fn_c_find_uintX_t ()
2148 {
2149 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2150 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
2151 $as_echo_n "checking for uint$2_t... " >&6; }
2152 if eval \${$3+:} false; then :
2153 $as_echo_n "(cached) " >&6
2154 else
2155 eval "$3=no"
2156 # Order is important - never check a type that is potentially smaller
2157 # than half of the expected target width.
2158 for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
2159 'unsigned long long int' 'unsigned short int' 'unsigned char'; do
2160 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2161 /* end confdefs.h. */
2162 $ac_includes_default
2163 int
2164 main ()
2165 {
2166 static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
2167 test_array [0] = 0;
2168 return test_array [0];
2169
2170 ;
2171 return 0;
2172 }
2173 _ACEOF
2174 if ac_fn_c_try_compile "$LINENO"; then :
2175 case $ac_type in #(
2176 uint$2_t) :
2177 eval "$3=yes" ;; #(
2178 *) :
2179 eval "$3=\$ac_type" ;;
2180 esac
2181 fi
2182 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2183 if eval test \"x\$"$3"\" = x"no"; then :
2184
2185 else
2186 break
2187 fi
2188 done
2189 fi
2190 eval ac_res=\$$3
2191 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2192 $as_echo "$ac_res" >&6; }
2193 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2194
2195 } # ac_fn_c_find_uintX_t
2196 cat >config.log <<_ACEOF
2197 This file contains any messages produced by compilers while
2198 running configure, to aid debugging if configure makes a mistake.
2199
2200 It was created by getdns $as_me 1.5.2, which was
2201 generated by GNU Autoconf 2.69. Invocation command line was
2202
2203 $ $0 $@
2204
2205 _ACEOF
2206 exec 5>>config.log
2207 {
2208 cat <<_ASUNAME
2209 ## --------- ##
2210 ## Platform. ##
2211 ## --------- ##
2212
2213 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
2214 uname -m = `(uname -m) 2>/dev/null || echo unknown`
2215 uname -r = `(uname -r) 2>/dev/null || echo unknown`
2216 uname -s = `(uname -s) 2>/dev/null || echo unknown`
2217 uname -v = `(uname -v) 2>/dev/null || echo unknown`
2218
2219 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
2220 /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
2221
2222 /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
2223 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
2224 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
2225 /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
2226 /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
2227 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
2228 /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
2229
2230 _ASUNAME
2231
2232 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2233 for as_dir in $PATH
2234 do
2235 IFS=$as_save_IFS
2236 test -z "$as_dir" && as_dir=.
2237 $as_echo "PATH: $as_dir"
2238 done
2239 IFS=$as_save_IFS
2240
2241 } >&5
2242
2243 cat >&5 <<_ACEOF
2244
2245
2246 ## ----------- ##
2247 ## Core tests. ##
2248 ## ----------- ##
2249
2250 _ACEOF
2251
2252
2253 # Keep a trace of the command line.
2254 # Strip out --no-create and --no-recursion so they do not pile up.
2255 # Strip out --silent because we don't want to record it for future runs.
2256 # Also quote any args containing shell meta-characters.
2257 # Make two passes to allow for proper duplicate-argument suppression.
2258 ac_configure_args=
2259 ac_configure_args0=
2260 ac_configure_args1=
2261 ac_must_keep_next=false
2262 for ac_pass in 1 2
2263 do
2264 for ac_arg
2265 do
2266 case $ac_arg in
2267 -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
2268 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2269 | -silent | --silent | --silen | --sile | --sil)
2270 continue ;;
2271 *\'*)
2272 ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
2273 esac
2274 case $ac_pass in
2275 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2276 2)
2277 as_fn_append ac_configure_args1 " '$ac_arg'"
2278 if test $ac_must_keep_next = true; then
2279 ac_must_keep_next=false # Got value, back to normal.
2280 else
2281 case $ac_arg in
2282 *=* | --config-cache | -C | -disable-* | --disable-* \
2283 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
2284 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
2285 | -with-* | --with-* | -without-* | --without-* | --x)
2286 case "$ac_configure_args0 " in
2287 "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
2288 esac
2289 ;;
2290 -* ) ac_must_keep_next=true ;;
2291 esac
2292 fi
2293 as_fn_append ac_configure_args " '$ac_arg'"
2294 ;;
2295 esac
2296 done
2297 done
2298 { ac_configure_args0=; unset ac_configure_args0;}
2299 { ac_configure_args1=; unset ac_configure_args1;}
2300
2301 # When interrupted or exit'd, cleanup temporary files, and complete
2302 # config.log. We remove comments because anyway the quotes in there
2303 # would cause problems or look ugly.
2304 # WARNING: Use '\'' to represent an apostrophe within the trap.
2305 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
2306 trap 'exit_status=$?
2307 # Save into config.log some information that might help in debugging.
2308 {
2309 echo
2310
2311 $as_echo "## ---------------- ##
2312 ## Cache variables. ##
2313 ## ---------------- ##"
2314 echo
2315 # The following way of writing the cache mishandles newlines in values,
2316 (
2317 for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
2318 eval ac_val=\$$ac_var
2319 case $ac_val in #(
2320 *${as_nl}*)
2321 case $ac_var in #(
2322 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
2323 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2324 esac
2325 case $ac_var in #(
2326 _ | IFS | as_nl) ;; #(
2327 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
2328 *) { eval $ac_var=; unset $ac_var;} ;;
2329 esac ;;
2330 esac
2331 done
2332 (set) 2>&1 |
2333 case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
2334 *${as_nl}ac_space=\ *)
2335 sed -n \
2336 "s/'\''/'\''\\\\'\'''\''/g;
2337 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
2338 ;; #(
2339 *)
2340 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
2341 ;;
2342 esac |
2343 sort
2344 )
2345 echo
2346
2347 $as_echo "## ----------------- ##
2348 ## Output variables. ##
2349 ## ----------------- ##"
2350 echo
2351 for ac_var in $ac_subst_vars
2352 do
2353 eval ac_val=\$$ac_var
2354 case $ac_val in
2355 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2356 esac
2357 $as_echo "$ac_var='\''$ac_val'\''"
2358 done | sort
2359 echo
2360
2361 if test -n "$ac_subst_files"; then
2362 $as_echo "## ------------------- ##
2363 ## File substitutions. ##
2364 ## ------------------- ##"
2365 echo
2366 for ac_var in $ac_subst_files
2367 do
2368 eval ac_val=\$$ac_var
2369 case $ac_val in
2370 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2371 esac
2372 $as_echo "$ac_var='\''$ac_val'\''"
2373 done | sort
2374 echo
2375 fi
2376
2377 if test -s confdefs.h; then
2378 $as_echo "## ----------- ##
2379 ## confdefs.h. ##
2380 ## ----------- ##"
2381 echo
2382 cat confdefs.h
2383 echo
2384 fi
2385 test "$ac_signal" != 0 &&
2386 $as_echo "$as_me: caught signal $ac_signal"
2387 $as_echo "$as_me: exit $exit_status"
2388 } >&5
2389 rm -f core *.core core.conftest.* &&
2390 rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
2391 exit $exit_status
2392 ' 0
2393 for ac_signal in 1 2 13 15; do
2394 trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
2395 done
2396 ac_signal=0
2397
2398 # confdefs.h avoids OS command line length limits that DEFS can exceed.
2399 rm -f -r conftest* confdefs.h
2400
2401 $as_echo "/* confdefs.h */" > confdefs.h
2402
2403 # Predefined preprocessor variables.
2404
2405 cat >>confdefs.h <<_ACEOF
2406 #define PACKAGE_NAME "$PACKAGE_NAME"
2407 _ACEOF
2408
2409 cat >>confdefs.h <<_ACEOF
2410 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
2411 _ACEOF
2412
2413 cat >>confdefs.h <<_ACEOF
2414 #define PACKAGE_VERSION "$PACKAGE_VERSION"
2415 _ACEOF
2416
2417 cat >>confdefs.h <<_ACEOF
2418 #define PACKAGE_STRING "$PACKAGE_STRING"
2419 _ACEOF
2420
2421 cat >>confdefs.h <<_ACEOF
2422 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
2423 _ACEOF
2424
2425 cat >>confdefs.h <<_ACEOF
2426 #define PACKAGE_URL "$PACKAGE_URL"
2427 _ACEOF
2428
2429
2430 # Let the site file select an alternate cache file if it wants to.
2431 # Prefer an explicitly selected file to automatically selected ones.
2432 ac_site_file1=NONE
2433 ac_site_file2=NONE
2434 if test -n "$CONFIG_SITE"; then
2435 # We do not want a PATH search for config.site.
2436 case $CONFIG_SITE in #((
2437 -*) ac_site_file1=./$CONFIG_SITE;;
2438 */*) ac_site_file1=$CONFIG_SITE;;
2439 *) ac_site_file1=./$CONFIG_SITE;;
2440 esac
2441 elif test "x$prefix" != xNONE; then
2442 ac_site_file1=$prefix/share/config.site
2443 ac_site_file2=$prefix/etc/config.site
2444 else
2445 ac_site_file1=$ac_default_prefix/share/config.site
2446 ac_site_file2=$ac_default_prefix/etc/config.site
2447 fi
2448 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
2449 do
2450 test "x$ac_site_file" = xNONE && continue
2451 if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
2452 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2453 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
2454 sed 's/^/| /' "$ac_site_file" >&5
2455 . "$ac_site_file" \
2456 || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2457 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2458 as_fn_error $? "failed to load site script $ac_site_file
2459 See \`config.log' for more details" "$LINENO" 5; }
2460 fi
2461 done
2462
2463 if test -r "$cache_file"; then
2464 # Some versions of bash will fail to source /dev/null (special files
2465 # actually), so we avoid doing that. DJGPP emulates it as a regular file.
2466 if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2467 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
2468 $as_echo "$as_me: loading cache $cache_file" >&6;}
2469 case $cache_file in
2470 [\\/]* | ?:[\\/]* ) . "$cache_file";;
2471 *) . "./$cache_file";;
2472 esac
2473 fi
2474 else
2475 { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
2476 $as_echo "$as_me: creating cache $cache_file" >&6;}
2477 >$cache_file
2478 fi
2479
2480 # Check that the precious variables saved in the cache have kept the same
2481 # value.
2482 ac_cache_corrupted=false
2483 for ac_var in $ac_precious_vars; do
2484 eval ac_old_set=\$ac_cv_env_${ac_var}_set
2485 eval ac_new_set=\$ac_env_${ac_var}_set
2486 eval ac_old_val=\$ac_cv_env_${ac_var}_value
2487 eval ac_new_val=\$ac_env_${ac_var}_value
2488 case $ac_old_set,$ac_new_set in
2489 set,)
2490 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
2491 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
2492 ac_cache_corrupted=: ;;
2493 ,set)
2494 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
2495 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
2496 ac_cache_corrupted=: ;;
2497 ,);;
2498 *)
2499 if test "x$ac_old_val" != "x$ac_new_val"; then
2500 # differences in whitespace do not lead to failure.
2501 ac_old_val_w=`echo x $ac_old_val`
2502 ac_new_val_w=`echo x $ac_new_val`
2503 if test "$ac_old_val_w" != "$ac_new_val_w"; then
2504 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
2505 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
2506 ac_cache_corrupted=:
2507 else
2508 { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
2509 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
2510 eval $ac_var=\$ac_old_val
2511 fi
2512 { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
2513 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
2514 { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
2515 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
2516 fi;;
2517 esac
2518 # Pass precious variables to config.status.
2519 if test "$ac_new_set" = set; then
2520 case $ac_new_val in
2521 *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
2522 *) ac_arg=$ac_var=$ac_new_val ;;
2523 esac
2524 case " $ac_configure_args " in
2525 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
2526 *) as_fn_append ac_configure_args " '$ac_arg'" ;;
2527 esac
2528 fi
2529 done
2530 if $ac_cache_corrupted; then
2531 { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2532 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2533 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2534 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2535 as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
2536 fi
2537 ## -------------------- ##
2538 ## Main body of script. ##
2539 ## -------------------- ##
2540
2541 ac_ext=c
2542 ac_cpp='$CPP $CPPFLAGS'
2543 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2544 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2545 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2546
2547
2548
2549 # Autoconf 2.70 will have set up runstatedir. 2.69 is frequently (Debian)
2550 # patched to do the same, but frequently (MacOS) not. So add a with option
2551 # for pid file location, and default it to runstatedir if present.
2552 default_piddir=${runstatedir:-"${localstatedir}/run"}
2553
2554 # Check whether --with-piddir was given.
2555 if test "${with_piddir+set}" = set; then :
2556 withval=$with_piddir;
2557 else
2558 with_piddir=${default_piddir}
2559 fi
2560
2561 runstatedir=$with_piddir
2562
2563
2564 # Don't forget to put a dash in front of the release candidate!!!
2565 # That is how it is done with semantic versioning!
2566 #
2567
2568
2569
2570 # Set current date from system if not set
2571
2572 # Check whether --with-current-date was given.
2573 if test "${with_current_date+set}" = set; then :
2574 withval=$with_current_date; CURRENT_DATE="$with_current_date"
2575 else
2576 CURRENT_DATE="`date -u +%Y-%m-%dT%H:%M:%SZ`"
2577 fi
2578
2579
2580 GETDNS_VERSION="1.5.2$RELEASE_CANDIDATE"
2581
2582 GETDNS_NUMERIC_VERSION=0x01050200
2583
2584 API_VERSION="December 2015"
2585
2586 API_NUMERIC_VERSION=0x07df0c00
2587
2588 GETDNS_COMPILATION_COMMENT="getdns $GETDNS_VERSION configured on $CURRENT_DATE for the $API_VERSION version of the API"
2589
2590
2591 cat >>confdefs.h <<_ACEOF
2592 #define STUBBY_PACKAGE "stubby"
2593 _ACEOF
2594
2595
2596 cat >>confdefs.h <<_ACEOF
2597 #define STUBBY_PACKAGE_STRING "0.2.6$STUBBY_RELEASE_CANDIDATE"
2598 _ACEOF
2599
2600
2601 # Library version
2602 # ---------------
2603 # current:revision:age
2604 # (binary-api-number):(which-binary-api-version):(how-many-nrs-backwardscompat)
2605 # if source code changes increment revision
2606 # if any interfaces have been added/removed/changed since last update then
2607 # increment current and set revision to 0
2608 # if any interfaces have been added since the last public release then increment age
2609 # if any interfaces have been removed or changed since the last public release then
2610 # set age to 0
2611 #
2612 # getdns-0.1.4 had libversion 0:0:0
2613 # getdns-0.1.5 had libversion 1:0:0
2614 # getdns-0.1.6 had libversion 1:1:0
2615 # getdns-0.1.7 had libversion 1:2:1 (but should have had 2:0:1)
2616 # getdns-0.1.8 had libversion 1:3:0 (but should have had 2:1:1)
2617 # getdns-0.2.0 had libversion 2:2:1
2618 # getdns-0.3.0 had libversion 3:3:2
2619 # getdns-0.3.1 had libversion 3:4:2
2620 # getdns-0.3.2 had libversion 3:5:2
2621 # getdns-0.3.3 had libversion 3:6:2
2622 # getdns-0.5.0 had libversion 4:0:3
2623 # getdns-0.5.1 had libversion 4:1:3 (but should have been getdns-0.6.0)
2624 # getdns-0.9.0 had libversion 5:0:4
2625 # getdns-1.0.0 had libversion 5:1:4
2626 # getdns-1.1.0 had libversion 6:0:0
2627 # getdns-1.1.1 had libversion 6:1:0
2628 # getdns-1.1.2 had libversion 7:0:1
2629 # getdns-1.1.3 had libversion 7:1:1
2630 # getdns-1.2.0 had libversion 8:0:2
2631 # getdns-1.2.1 had libversion 8:1:2
2632 # getdns-1.3.0 had libversion 9:0:3
2633 # getdns-1.4.0 had libversion 10:0:0
2634 # getdns-1.4.1 had libversion 10:1:0
2635 # getdns-1.4.2 had libversion 10:2:0
2636 # getdns-1.5.0 had libversion 11:0:1
2637 # getdns-1.5.1 had libversion 11:1:1
2638 # getdns-1.5.2 has libversion 11:2:1
2639 GETDNS_LIBVERSION=11:2:1
2640
2641
2642
2643
2644 # AM_INIT_AUTOMAKE
2645 # LT_INIT
2646
2647
2648 ac_ext=c
2649 ac_cpp='$CPP $CPPFLAGS'
2650 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2651 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2652 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2653 if test -n "$ac_tool_prefix"; then
2654 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
2655 set dummy ${ac_tool_prefix}gcc; ac_word=$2
2656 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2657 $as_echo_n "checking for $ac_word... " >&6; }
2658 if ${ac_cv_prog_CC+:} false; then :
2659 $as_echo_n "(cached) " >&6
2660 else
2661 if test -n "$CC"; then
2662 ac_cv_prog_CC="$CC" # Let the user override the test.
2663 else
2664 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2665 for as_dir in $PATH
2666 do
2667 IFS=$as_save_IFS
2668 test -z "$as_dir" && as_dir=.
2669 for ac_exec_ext in '' $ac_executable_extensions; do
2670 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2671 ac_cv_prog_CC="${ac_tool_prefix}gcc"
2672 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2673 break 2
2674 fi
2675 done
2676 done
2677 IFS=$as_save_IFS
2678
2679 fi
2680 fi
2681 CC=$ac_cv_prog_CC
2682 if test -n "$CC"; then
2683 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2684 $as_echo "$CC" >&6; }
2685 else
2686 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2687 $as_echo "no" >&6; }
2688 fi
2689
2690
2691 fi
2692 if test -z "$ac_cv_prog_CC"; then
2693 ac_ct_CC=$CC
2694 # Extract the first word of "gcc", so it can be a program name with args.
2695 set dummy gcc; ac_word=$2
2696 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2697 $as_echo_n "checking for $ac_word... " >&6; }
2698 if ${ac_cv_prog_ac_ct_CC+:} false; then :
2699 $as_echo_n "(cached) " >&6
2700 else
2701 if test -n "$ac_ct_CC"; then
2702 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2703 else
2704 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2705 for as_dir in $PATH
2706 do
2707 IFS=$as_save_IFS
2708 test -z "$as_dir" && as_dir=.
2709 for ac_exec_ext in '' $ac_executable_extensions; do
2710 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2711 ac_cv_prog_ac_ct_CC="gcc"
2712 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2713 break 2
2714 fi
2715 done
2716 done
2717 IFS=$as_save_IFS
2718
2719 fi
2720 fi
2721 ac_ct_CC=$ac_cv_prog_ac_ct_CC
2722 if test -n "$ac_ct_CC"; then
2723 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
2724 $as_echo "$ac_ct_CC" >&6; }
2725 else
2726 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2727 $as_echo "no" >&6; }
2728 fi
2729
2730 if test "x$ac_ct_CC" = x; then
2731 CC=""
2732 else
2733 case $cross_compiling:$ac_tool_warned in
2734 yes:)
2735 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2736 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2737 ac_tool_warned=yes ;;
2738 esac
2739 CC=$ac_ct_CC
2740 fi
2741 else
2742 CC="$ac_cv_prog_CC"
2743 fi
2744
2745 if test -z "$CC"; then
2746 if test -n "$ac_tool_prefix"; then
2747 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
2748 set dummy ${ac_tool_prefix}cc; ac_word=$2
2749 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2750 $as_echo_n "checking for $ac_word... " >&6; }
2751 if ${ac_cv_prog_CC+:} false; then :
2752 $as_echo_n "(cached) " >&6
2753 else
2754 if test -n "$CC"; then
2755 ac_cv_prog_CC="$CC" # Let the user override the test.
2756 else
2757 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2758 for as_dir in $PATH
2759 do
2760 IFS=$as_save_IFS
2761 test -z "$as_dir" && as_dir=.
2762 for ac_exec_ext in '' $ac_executable_extensions; do
2763 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2764 ac_cv_prog_CC="${ac_tool_prefix}cc"
2765 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2766 break 2
2767 fi
2768 done
2769 done
2770 IFS=$as_save_IFS
2771
2772 fi
2773 fi
2774 CC=$ac_cv_prog_CC
2775 if test -n "$CC"; then
2776 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2777 $as_echo "$CC" >&6; }
2778 else
2779 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2780 $as_echo "no" >&6; }
2781 fi
2782
2783
2784 fi
2785 fi
2786 if test -z "$CC"; then
2787 # Extract the first word of "cc", so it can be a program name with args.
2788 set dummy cc; ac_word=$2
2789 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2790 $as_echo_n "checking for $ac_word... " >&6; }
2791 if ${ac_cv_prog_CC+:} false; then :
2792 $as_echo_n "(cached) " >&6
2793 else
2794 if test -n "$CC"; then
2795 ac_cv_prog_CC="$CC" # Let the user override the test.
2796 else
2797 ac_prog_rejected=no
2798 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2799 for as_dir in $PATH
2800 do
2801 IFS=$as_save_IFS
2802 test -z "$as_dir" && as_dir=.
2803 for ac_exec_ext in '' $ac_executable_extensions; do
2804 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2805 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
2806 ac_prog_rejected=yes
2807 continue
2808 fi
2809 ac_cv_prog_CC="cc"
2810 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2811 break 2
2812 fi
2813 done
2814 done
2815 IFS=$as_save_IFS
2816
2817 if test $ac_prog_rejected = yes; then
2818 # We found a bogon in the path, so make sure we never use it.
2819 set dummy $ac_cv_prog_CC
2820 shift
2821 if test $# != 0; then
2822 # We chose a different compiler from the bogus one.
2823 # However, it has the same basename, so the bogon will be chosen
2824 # first if we set CC to just the basename; use the full file name.
2825 shift
2826 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
2827 fi
2828 fi
2829 fi
2830 fi
2831 CC=$ac_cv_prog_CC
2832 if test -n "$CC"; then
2833 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2834 $as_echo "$CC" >&6; }
2835 else
2836 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2837 $as_echo "no" >&6; }
2838 fi
2839
2840
2841 fi
2842 if test -z "$CC"; then
2843 if test -n "$ac_tool_prefix"; then
2844 for ac_prog in cl.exe
2845 do
2846 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
2847 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
2848 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2849 $as_echo_n "checking for $ac_word... " >&6; }
2850 if ${ac_cv_prog_CC+:} false; then :
2851 $as_echo_n "(cached) " >&6
2852 else
2853 if test -n "$CC"; then
2854 ac_cv_prog_CC="$CC" # Let the user override the test.
2855 else
2856 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2857 for as_dir in $PATH
2858 do
2859 IFS=$as_save_IFS
2860 test -z "$as_dir" && as_dir=.
2861 for ac_exec_ext in '' $ac_executable_extensions; do
2862 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2863 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
2864 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2865 break 2
2866 fi
2867 done
2868 done
2869 IFS=$as_save_IFS
2870
2871 fi
2872 fi
2873 CC=$ac_cv_prog_CC
2874 if test -n "$CC"; then
2875 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2876 $as_echo "$CC" >&6; }
2877 else
2878 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2879 $as_echo "no" >&6; }
2880 fi
2881
2882
2883 test -n "$CC" && break
2884 done
2885 fi
2886 if test -z "$CC"; then
2887 ac_ct_CC=$CC
2888 for ac_prog in cl.exe
2889 do
2890 # Extract the first word of "$ac_prog", so it can be a program name with args.
2891 set dummy $ac_prog; ac_word=$2
2892 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2893 $as_echo_n "checking for $ac_word... " >&6; }
2894 if ${ac_cv_prog_ac_ct_CC+:} false; then :
2895 $as_echo_n "(cached) " >&6
2896 else
2897 if test -n "$ac_ct_CC"; then
2898 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2899 else
2900 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2901 for as_dir in $PATH
2902 do
2903 IFS=$as_save_IFS
2904 test -z "$as_dir" && as_dir=.
2905 for ac_exec_ext in '' $ac_executable_extensions; do
2906 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2907 ac_cv_prog_ac_ct_CC="$ac_prog"
2908 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2909 break 2
2910 fi
2911 done
2912 done
2913 IFS=$as_save_IFS
2914
2915 fi
2916 fi
2917 ac_ct_CC=$ac_cv_prog_ac_ct_CC
2918 if test -n "$ac_ct_CC"; then
2919 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
2920 $as_echo "$ac_ct_CC" >&6; }
2921 else
2922 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2923 $as_echo "no" >&6; }
2924 fi
2925
2926
2927 test -n "$ac_ct_CC" && break
2928 done
2929
2930 if test "x$ac_ct_CC" = x; then
2931 CC=""
2932 else
2933 case $cross_compiling:$ac_tool_warned in
2934 yes:)
2935 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2936 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2937 ac_tool_warned=yes ;;
2938 esac
2939 CC=$ac_ct_CC
2940 fi
2941 fi
2942
2943 fi
2944
2945
2946 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2947 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2948 as_fn_error $? "no acceptable C compiler found in \$PATH
2949 See \`config.log' for more details" "$LINENO" 5; }
2950
2951 # Provide some information about the compiler.
2952 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
2953 set X $ac_compile
2954 ac_compiler=$2
2955 for ac_option in --version -v -V -qversion; do
2956 { { ac_try="$ac_compiler $ac_option >&5"
2957 case "(($ac_try" in
2958 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2959 *) ac_try_echo=$ac_try;;
2960 esac
2961 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2962 $as_echo "$ac_try_echo"; } >&5
2963 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
2964 ac_status=$?
2965 if test -s conftest.err; then
2966 sed '10a\
2967 ... rest of stderr output deleted ...
2968 10q' conftest.err >conftest.er1
2969 cat conftest.er1 >&5
2970 fi
2971 rm -f conftest.er1 conftest.err
2972 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2973 test $ac_status = 0; }
2974 done
2975
2976 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2977 /* end confdefs.h. */
2978
2979 int
2980 main ()
2981 {
2982
2983 ;
2984 return 0;
2985 }
2986 _ACEOF
2987 ac_clean_files_save=$ac_clean_files
2988 ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
2989 # Try to create an executable without -o first, disregard a.out.
2990 # It will help us diagnose broken compilers, and finding out an intuition
2991 # of exeext.
2992 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
2993 $as_echo_n "checking whether the C compiler works... " >&6; }
2994 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
2995
2996 # The possible output files:
2997 ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
2998
2999 ac_rmfiles=
3000 for ac_file in $ac_files
3001 do
3002 case $ac_file in
3003 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3004 * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3005 esac
3006 done
3007 rm -f $ac_rmfiles
3008
3009 if { { ac_try="$ac_link_default"
3010 case "(($ac_try" in
3011 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3012 *) ac_try_echo=$ac_try;;
3013 esac
3014 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3015 $as_echo "$ac_try_echo"; } >&5
3016 (eval "$ac_link_default") 2>&5
3017 ac_status=$?
3018 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3019 test $ac_status = 0; }; then :
3020 # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
3021 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
3022 # in a Makefile. We should not override ac_cv_exeext if it was cached,
3023 # so that the user can short-circuit this test for compilers unknown to
3024 # Autoconf.
3025 for ac_file in $ac_files ''
3026 do
3027 test -f "$ac_file" || continue
3028 case $ac_file in
3029 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
3030 ;;
3031 [ab].out )
3032 # We found the default executable, but exeext='' is most
3033 # certainly right.
3034 break;;
3035 *.* )
3036 if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
3037 then :; else
3038 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3039 fi
3040 # We set ac_cv_exeext here because the later test for it is not
3041 # safe: cross compilers may not add the suffix if given an `-o'
3042 # argument, so we may need to know it at that point already.
3043 # Even if this section looks crufty: it has the advantage of
3044 # actually working.
3045 break;;
3046 * )
3047 break;;
3048 esac
3049 done
3050 test "$ac_cv_exeext" = no && ac_cv_exeext=
3051
3052 else
3053 ac_file=''
3054 fi
3055 if test -z "$ac_file"; then :
3056 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3057 $as_echo "no" >&6; }
3058 $as_echo "$as_me: failed program was:" >&5
3059 sed 's/^/| /' conftest.$ac_ext >&5
3060
3061 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3062 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3063 as_fn_error 77 "C compiler cannot create executables
3064 See \`config.log' for more details" "$LINENO" 5; }
3065 else
3066 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3067 $as_echo "yes" >&6; }
3068 fi
3069 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
3070 $as_echo_n "checking for C compiler default output file name... " >&6; }
3071 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
3072 $as_echo "$ac_file" >&6; }
3073 ac_exeext=$ac_cv_exeext
3074
3075 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
3076 ac_clean_files=$ac_clean_files_save
3077 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
3078 $as_echo_n "checking for suffix of executables... " >&6; }
3079 if { { ac_try="$ac_link"
3080 case "(($ac_try" in
3081 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3082 *) ac_try_echo=$ac_try;;
3083 esac
3084 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3085 $as_echo "$ac_try_echo"; } >&5
3086 (eval "$ac_link") 2>&5
3087 ac_status=$?
3088 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3089 test $ac_status = 0; }; then :
3090 # If both `conftest.exe' and `conftest' are `present' (well, observable)
3091 # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
3092 # work properly (i.e., refer to `conftest.exe'), while it won't with
3093 # `rm'.
3094 for ac_file in conftest.exe conftest conftest.*; do
3095 test -f "$ac_file" || continue
3096 case $ac_file in
3097 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3098 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3099 break;;
3100 * ) break;;
3101 esac
3102 done
3103 else
3104 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3105 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3106 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
3107 See \`config.log' for more details" "$LINENO" 5; }
3108 fi
3109 rm -f conftest conftest$ac_cv_exeext
3110 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
3111 $as_echo "$ac_cv_exeext" >&6; }
3112
3113 rm -f conftest.$ac_ext
3114 EXEEXT=$ac_cv_exeext
3115 ac_exeext=$EXEEXT
3116 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3117 /* end confdefs.h. */
3118 #include <stdio.h>
3119 int
3120 main ()
3121 {
3122 FILE *f = fopen ("conftest.out", "w");
3123 return ferror (f) || fclose (f) != 0;
3124
3125 ;
3126 return 0;
3127 }
3128 _ACEOF
3129 ac_clean_files="$ac_clean_files conftest.out"
3130 # Check that the compiler produces executables we can run. If not, either
3131 # the compiler is broken, or we cross compile.
3132 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
3133 $as_echo_n "checking whether we are cross compiling... " >&6; }
3134 if test "$cross_compiling" != yes; then
3135 { { ac_try="$ac_link"
3136 case "(($ac_try" in
3137 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3138 *) ac_try_echo=$ac_try;;
3139 esac
3140 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3141 $as_echo "$ac_try_echo"; } >&5
3142 (eval "$ac_link") 2>&5
3143 ac_status=$?
3144 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3145 test $ac_status = 0; }
3146 if { ac_try='./conftest$ac_cv_exeext'
3147 { { case "(($ac_try" in
3148 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3149 *) ac_try_echo=$ac_try;;
3150 esac
3151 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3152 $as_echo "$ac_try_echo"; } >&5
3153 (eval "$ac_try") 2>&5
3154 ac_status=$?
3155 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3156 test $ac_status = 0; }; }; then
3157 cross_compiling=no
3158 else
3159 if test "$cross_compiling" = maybe; then
3160 cross_compiling=yes
3161 else
3162 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3163 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3164 as_fn_error $? "cannot run C compiled programs.
3165 If you meant to cross compile, use \`--host'.
3166 See \`config.log' for more details" "$LINENO" 5; }
3167 fi
3168 fi
3169 fi
3170 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
3171 $as_echo "$cross_compiling" >&6; }
3172
3173 rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
3174 ac_clean_files=$ac_clean_files_save
3175 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
3176 $as_echo_n "checking for suffix of object files... " >&6; }
3177 if ${ac_cv_objext+:} false; then :
3178 $as_echo_n "(cached) " >&6
3179 else
3180 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3181 /* end confdefs.h. */
3182
3183 int
3184 main ()
3185 {
3186
3187 ;
3188 return 0;
3189 }
3190 _ACEOF
3191 rm -f conftest.o conftest.obj
3192 if { { ac_try="$ac_compile"
3193 case "(($ac_try" in
3194 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3195 *) ac_try_echo=$ac_try;;
3196 esac
3197 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3198 $as_echo "$ac_try_echo"; } >&5
3199 (eval "$ac_compile") 2>&5
3200 ac_status=$?
3201 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3202 test $ac_status = 0; }; then :
3203 for ac_file in conftest.o conftest.obj conftest.*; do
3204 test -f "$ac_file" || continue;
3205 case $ac_file in
3206 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
3207 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
3208 break;;
3209 esac
3210 done
3211 else
3212 $as_echo "$as_me: failed program was:" >&5
3213 sed 's/^/| /' conftest.$ac_ext >&5
3214
3215 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3216 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3217 as_fn_error $? "cannot compute suffix of object files: cannot compile
3218 See \`config.log' for more details" "$LINENO" 5; }
3219 fi
3220 rm -f conftest.$ac_cv_objext conftest.$ac_ext
3221 fi
3222 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
3223 $as_echo "$ac_cv_objext" >&6; }
3224 OBJEXT=$ac_cv_objext
3225 ac_objext=$OBJEXT
3226 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
3227 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
3228 if ${ac_cv_c_compiler_gnu+:} false; then :
3229 $as_echo_n "(cached) " >&6
3230 else
3231 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3232 /* end confdefs.h. */
3233
3234 int
3235 main ()
3236 {
3237 #ifndef __GNUC__
3238 choke me
3239 #endif
3240
3241 ;
3242 return 0;
3243 }
3244 _ACEOF
3245 if ac_fn_c_try_compile "$LINENO"; then :
3246 ac_compiler_gnu=yes
3247 else
3248 ac_compiler_gnu=no
3249 fi
3250 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3251 ac_cv_c_compiler_gnu=$ac_compiler_gnu
3252
3253 fi
3254 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
3255 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
3256 if test $ac_compiler_gnu = yes; then
3257 GCC=yes
3258 else
3259 GCC=
3260 fi
3261 ac_test_CFLAGS=${CFLAGS+set}
3262 ac_save_CFLAGS=$CFLAGS
3263 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
3264 $as_echo_n "checking whether $CC accepts -g... " >&6; }
3265 if ${ac_cv_prog_cc_g+:} false; then :
3266 $as_echo_n "(cached) " >&6
3267 else
3268 ac_save_c_werror_flag=$ac_c_werror_flag
3269 ac_c_werror_flag=yes
3270 ac_cv_prog_cc_g=no
3271 CFLAGS="-g"
3272 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3273 /* end confdefs.h. */
3274
3275 int
3276 main ()
3277 {
3278
3279 ;
3280 return 0;
3281 }
3282 _ACEOF
3283 if ac_fn_c_try_compile "$LINENO"; then :
3284 ac_cv_prog_cc_g=yes
3285 else
3286 CFLAGS=""
3287 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3288 /* end confdefs.h. */
3289
3290 int
3291 main ()
3292 {
3293
3294 ;
3295 return 0;
3296 }
3297 _ACEOF
3298 if ac_fn_c_try_compile "$LINENO"; then :
3299
3300 else
3301 ac_c_werror_flag=$ac_save_c_werror_flag
3302 CFLAGS="-g"
3303 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3304 /* end confdefs.h. */
3305
3306 int
3307 main ()
3308 {
3309
3310 ;
3311 return 0;
3312 }
3313 _ACEOF
3314 if ac_fn_c_try_compile "$LINENO"; then :
3315 ac_cv_prog_cc_g=yes
3316 fi
3317 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3318 fi
3319 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3320 fi
3321 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3322 ac_c_werror_flag=$ac_save_c_werror_flag
3323 fi
3324 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
3325 $as_echo "$ac_cv_prog_cc_g" >&6; }
3326 if test "$ac_test_CFLAGS" = set; then
3327 CFLAGS=$ac_save_CFLAGS
3328 elif test $ac_cv_prog_cc_g = yes; then
3329 if test "$GCC" = yes; then
3330 CFLAGS="-g -O2"
3331 else
3332 CFLAGS="-g"
3333 fi
3334 else
3335 if test "$GCC" = yes; then
3336 CFLAGS="-O2"
3337 else
3338 CFLAGS=
3339 fi
3340 fi
3341 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
3342 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
3343 if ${ac_cv_prog_cc_c89+:} false; then :
3344 $as_echo_n "(cached) " >&6
3345 else
3346 ac_cv_prog_cc_c89=no
3347 ac_save_CC=$CC
3348 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3349 /* end confdefs.h. */
3350 #include <stdarg.h>
3351 #include <stdio.h>
3352 struct stat;
3353 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
3354 struct buf { int x; };
3355 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3356 static char *e (p, i)
3357 char **p;
3358 int i;
3359 {
3360 return p[i];
3361 }
3362 static char *f (char * (*g) (char **, int), char **p, ...)
3363 {
3364 char *s;
3365 va_list v;
3366 va_start (v,p);
3367 s = g (p, va_arg (v,int));
3368 va_end (v);
3369 return s;
3370 }
3371
3372 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
3373 function prototypes and stuff, but not '\xHH' hex character constants.
3374 These don't provoke an error unfortunately, instead are silently treated
3375 as 'x'. The following induces an error, until -std is added to get
3376 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
3377 array size at least. It's necessary to write '\x00'==0 to get something
3378 that's true only with -std. */
3379 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
3380
3381 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
3382 inside strings and character constants. */
3383 #define FOO(x) 'x'
3384 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
3385
3386 int test (int i, double x);
3387 struct s1 {int (*f) (int a);};
3388 struct s2 {int (*f) (double a);};
3389 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3390 int argc;
3391 char **argv;
3392 int
3393 main ()
3394 {
3395 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
3396 ;
3397 return 0;
3398 }
3399 _ACEOF
3400 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
3401 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3402 do
3403 CC="$ac_save_CC $ac_arg"
3404 if ac_fn_c_try_compile "$LINENO"; then :
3405 ac_cv_prog_cc_c89=$ac_arg
3406 fi
3407 rm -f core conftest.err conftest.$ac_objext
3408 test "x$ac_cv_prog_cc_c89" != "xno" && break
3409 done
3410 rm -f conftest.$ac_ext
3411 CC=$ac_save_CC
3412
3413 fi
3414 # AC_CACHE_VAL
3415 case "x$ac_cv_prog_cc_c89" in
3416 x)
3417 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
3418 $as_echo "none needed" >&6; } ;;
3419 xno)
3420 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
3421 $as_echo "unsupported" >&6; } ;;
3422 *)
3423 CC="$CC $ac_cv_prog_cc_c89"
3424 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
3425 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
3426 esac
3427 if test "x$ac_cv_prog_cc_c89" != xno; then :
3428
3429 fi
3430
3431 ac_ext=c
3432 ac_cpp='$CPP $CPPFLAGS'
3433 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3434 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3435 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3436
3437 ac_ext=c
3438 ac_cpp='$CPP $CPPFLAGS'
3439 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3440 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3441 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3442 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
3443 $as_echo_n "checking how to run the C preprocessor... " >&6; }
3444 # On Suns, sometimes $CPP names a directory.
3445 if test -n "$CPP" && test -d "$CPP"; then
3446 CPP=
3447 fi
3448 if test -z "$CPP"; then
3449 if ${ac_cv_prog_CPP+:} false; then :
3450 $as_echo_n "(cached) " >&6
3451 else
3452 # Double quotes because CPP needs to be expanded
3453 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
3454 do
3455 ac_preproc_ok=false
3456 for ac_c_preproc_warn_flag in '' yes
3457 do
3458 # Use a header file that comes with gcc, so configuring glibc
3459 # with a fresh cross-compiler works.
3460 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3461 # <limits.h> exists even on freestanding compilers.
3462 # On the NeXT, cc -E runs the code through the compiler's parser,
3463 # not just through cpp. "Syntax error" is here to catch this case.
3464 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3465 /* end confdefs.h. */
3466 #ifdef __STDC__
3467 # include <limits.h>
3468 #else
3469 # include <assert.h>
3470 #endif
3471 Syntax error
3472 _ACEOF
3473 if ac_fn_c_try_cpp "$LINENO"; then :
3474
3475 else
3476 # Broken: fails on valid input.
3477 continue
3478 fi
3479 rm -f conftest.err conftest.i conftest.$ac_ext
3480
3481 # OK, works on sane cases. Now check whether nonexistent headers
3482 # can be detected and how.
3483 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3484 /* end confdefs.h. */
3485 #include <ac_nonexistent.h>
3486 _ACEOF
3487 if ac_fn_c_try_cpp "$LINENO"; then :
3488 # Broken: success on invalid input.
3489 continue
3490 else
3491 # Passes both tests.
3492 ac_preproc_ok=:
3493 break
3494 fi
3495 rm -f conftest.err conftest.i conftest.$ac_ext
3496
3497 done
3498 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3499 rm -f conftest.i conftest.err conftest.$ac_ext
3500 if $ac_preproc_ok; then :
3501 break
3502 fi
3503
3504 done
3505 ac_cv_prog_CPP=$CPP
3506
3507 fi
3508 CPP=$ac_cv_prog_CPP
3509 else
3510 ac_cv_prog_CPP=$CPP
3511 fi
3512 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
3513 $as_echo "$CPP" >&6; }
3514 ac_preproc_ok=false
3515 for ac_c_preproc_warn_flag in '' yes
3516 do
3517 # Use a header file that comes with gcc, so configuring glibc
3518 # with a fresh cross-compiler works.
3519 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3520 # <limits.h> exists even on freestanding compilers.
3521 # On the NeXT, cc -E runs the code through the compiler's parser,
3522 # not just through cpp. "Syntax error" is here to catch this case.
3523 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3524 /* end confdefs.h. */
3525 #ifdef __STDC__
3526 # include <limits.h>
3527 #else
3528 # include <assert.h>
3529 #endif
3530 Syntax error
3531 _ACEOF
3532 if ac_fn_c_try_cpp "$LINENO"; then :
3533
3534 else
3535 # Broken: fails on valid input.
3536 continue
3537 fi
3538 rm -f conftest.err conftest.i conftest.$ac_ext
3539
3540 # OK, works on sane cases. Now check whether nonexistent headers
3541 # can be detected and how.
3542 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3543 /* end confdefs.h. */
3544 #include <ac_nonexistent.h>
3545 _ACEOF
3546 if ac_fn_c_try_cpp "$LINENO"; then :
3547 # Broken: success on invalid input.
3548 continue
3549 else
3550 # Passes both tests.
3551 ac_preproc_ok=:
3552 break
3553 fi
3554 rm -f conftest.err conftest.i conftest.$ac_ext
3555
3556 done
3557 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3558 rm -f conftest.i conftest.err conftest.$ac_ext
3559 if $ac_preproc_ok; then :
3560
3561 else
3562 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3563 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3564 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
3565 See \`config.log' for more details" "$LINENO" 5; }
3566 fi
3567
3568 ac_ext=c
3569 ac_cpp='$CPP $CPPFLAGS'
3570 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3571 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3572 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3573
3574
3575 # Checks for programs.
3576 HOSTOS="unix"
3577 ac_aux_dir=
3578 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
3579 if test -f "$ac_dir/install-sh"; then
3580 ac_aux_dir=$ac_dir
3581 ac_install_sh="$ac_aux_dir/install-sh -c"
3582 break
3583 elif test -f "$ac_dir/install.sh"; then
3584 ac_aux_dir=$ac_dir
3585 ac_install_sh="$ac_aux_dir/install.sh -c"
3586 break
3587 elif test -f "$ac_dir/shtool"; then
3588 ac_aux_dir=$ac_dir
3589 ac_install_sh="$ac_aux_dir/shtool install -c"
3590 break
3591 fi
3592 done
3593 if test -z "$ac_aux_dir"; then
3594 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
3595 fi
3596
3597 # These three variables are undocumented and unsupported,
3598 # and are intended to be withdrawn in a future Autoconf release.
3599 # They can cause serious problems if a builder's source tree is in a directory
3600 # whose full name contains unusual characters.
3601 ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
3602 ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
3603 ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
3604
3605
3606 # Make sure we can run config.sub.
3607 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
3608 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
3609
3610 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
3611 $as_echo_n "checking build system type... " >&6; }
3612 if ${ac_cv_build+:} false; then :
3613 $as_echo_n "(cached) " >&6
3614 else
3615 ac_build_alias=$build_alias
3616 test "x$ac_build_alias" = x &&
3617 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
3618 test "x$ac_build_alias" = x &&
3619 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
3620 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
3621 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
3622
3623 fi
3624 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
3625 $as_echo "$ac_cv_build" >&6; }
3626 case $ac_cv_build in
3627 *-*-*) ;;
3628 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
3629 esac
3630 build=$ac_cv_build
3631 ac_save_IFS=$IFS; IFS='-'
3632 set x $ac_cv_build
3633 shift
3634 build_cpu=$1
3635 build_vendor=$2
3636 shift; shift
3637 # Remember, the first character of IFS is used to create $*,
3638 # except with old shells:
3639 build_os=$*
3640 IFS=$ac_save_IFS
3641 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
3642
3643
3644 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
3645 $as_echo_n "checking host system type... " >&6; }
3646 if ${ac_cv_host+:} false; then :
3647 $as_echo_n "(cached) " >&6
3648 else
3649 if test "x$host_alias" = x; then
3650 ac_cv_host=$ac_cv_build
3651 else
3652 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
3653 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
3654 fi
3655
3656 fi
3657 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
3658 $as_echo "$ac_cv_host" >&6; }
3659 case $ac_cv_host in
3660 *-*-*) ;;
3661 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
3662 esac
3663 host=$ac_cv_host
3664 ac_save_IFS=$IFS; IFS='-'
3665 set x $ac_cv_host
3666 shift
3667 host_cpu=$1
3668 host_vendor=$2
3669 shift; shift
3670 # Remember, the first character of IFS is used to create $*,
3671 # except with old shells:
3672 host_os=$*
3673 IFS=$ac_save_IFS
3674 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
3675
3676
3677 case "${host_os}" in
3678 cygwin*|mingw*)
3679 HOSTOS=windows
3680 ;;
3681 darwin*)
3682 HOSTOS=macos
3683 ;;
3684 esac
3685
3686
3687
3688 CFLAGS="$CFLAGS"
3689 WPEDANTICFLAG=""
3690 WNOERRORFLAG=""
3691 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
3692 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
3693 if ${ac_cv_prog_cc_c99+:} false; then :
3694 $as_echo_n "(cached) " >&6
3695 else
3696 ac_cv_prog_cc_c99=no
3697 ac_save_CC=$CC
3698 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3699 /* end confdefs.h. */
3700 #include <stdarg.h>
3701 #include <stdbool.h>
3702 #include <stdlib.h>
3703 #include <wchar.h>
3704 #include <stdio.h>
3705
3706 // Check varargs macros. These examples are taken from C99 6.10.3.5.
3707 #define debug(...) fprintf (stderr, __VA_ARGS__)
3708 #define showlist(...) puts (#__VA_ARGS__)
3709 #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
3710 static void
3711 test_varargs_macros (void)
3712 {
3713 int x = 1234;
3714 int y = 5678;
3715 debug ("Flag");
3716 debug ("X = %d\n", x);
3717 showlist (The first, second, and third items.);
3718 report (x>y, "x is %d but y is %d", x, y);
3719 }
3720
3721 // Check long long types.
3722 #define BIG64 18446744073709551615ull
3723 #define BIG32 4294967295ul
3724 #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
3725 #if !BIG_OK
3726 your preprocessor is broken;
3727 #endif
3728 #if BIG_OK
3729 #else
3730 your preprocessor is broken;
3731 #endif
3732 static long long int bignum = -9223372036854775807LL;
3733 static unsigned long long int ubignum = BIG64;
3734
3735 struct incomplete_array
3736 {
3737 int datasize;
3738 double data[];
3739 };
3740
3741 struct named_init {
3742 int number;
3743 const wchar_t *name;
3744 double average;
3745 };
3746
3747 typedef const char *ccp;
3748
3749 static inline int
3750 test_restrict (ccp restrict text)
3751 {
3752 // See if C++-style comments work.
3753 // Iterate through items via the restricted pointer.
3754 // Also check for declarations in for loops.
3755 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
3756 continue;
3757 return 0;
3758 }
3759
3760 // Check varargs and va_copy.
3761 static void
3762 test_varargs (const char *format, ...)
3763 {
3764 va_list args;
3765 va_start (args, format);
3766 va_list args_copy;
3767 va_copy (args_copy, args);
3768
3769 const char *str;
3770 int number;
3771 float fnumber;
3772
3773 while (*format)
3774 {
3775 switch (*format++)
3776 {
3777 case 's': // string
3778 str = va_arg (args_copy, const char *);
3779 break;
3780 case 'd': // int
3781 number = va_arg (args_copy, int);
3782 break;
3783 case 'f': // float
3784 fnumber = va_arg (args_copy, double);
3785 break;
3786 default:
3787 break;
3788 }
3789 }
3790 va_end (args_copy);
3791 va_end (args);
3792 }
3793
3794 int
3795 main ()
3796 {
3797
3798 // Check bool.
3799 _Bool success = false;
3800
3801 // Check restrict.
3802 if (test_restrict ("String literal") == 0)
3803 success = true;
3804 char *restrict newvar = "Another string";
3805
3806 // Check varargs.
3807 test_varargs ("s, d' f .", "string", 65, 34.234);
3808 test_varargs_macros ();
3809
3810 // Check flexible array members.
3811 struct incomplete_array *ia =
3812 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
3813 ia->datasize = 10;
3814 for (int i = 0; i < ia->datasize; ++i)
3815 ia->data[i] = i * 1.234;
3816
3817 // Check named initializers.
3818 struct named_init ni = {
3819 .number = 34,
3820 .name = L"Test wide string",
3821 .average = 543.34343,
3822 };
3823
3824 ni.number = 58;
3825
3826 int dynamic_array[ni.number];
3827 dynamic_array[ni.number - 1] = 543;
3828
3829 // work around unused variable warnings
3830 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
3831 || dynamic_array[ni.number - 1] != 543);
3832
3833 ;
3834 return 0;
3835 }
3836 _ACEOF
3837 for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
3838 do
3839 CC="$ac_save_CC $ac_arg"
3840 if ac_fn_c_try_compile "$LINENO"; then :
3841 ac_cv_prog_cc_c99=$ac_arg
3842 fi
3843 rm -f core conftest.err conftest.$ac_objext
3844 test "x$ac_cv_prog_cc_c99" != "xno" && break
3845 done
3846 rm -f conftest.$ac_ext
3847 CC=$ac_save_CC
3848
3849 fi
3850 # AC_CACHE_VAL
3851 case "x$ac_cv_prog_cc_c99" in
3852 x)
3853 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
3854 $as_echo "none needed" >&6; } ;;
3855 xno)
3856 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
3857 $as_echo "unsupported" >&6; } ;;
3858 *)
3859 CC="$CC $ac_cv_prog_cc_c99"
3860 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
3861 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
3862 esac
3863 if test "x$ac_cv_prog_cc_c99" != xno; then :
3864
3865 fi
3866
3867
3868
3869 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -xc99" >&5
3870 $as_echo_n "checking whether C compiler accepts -xc99... " >&6; }
3871 if ${ax_cv_check_cflags___xc99+:} false; then :
3872 $as_echo_n "(cached) " >&6
3873 else
3874
3875 ax_check_save_flags=$CFLAGS
3876 CFLAGS="$CFLAGS -xc99"
3877 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3878 /* end confdefs.h. */
3879
3880 int
3881 main ()
3882 {
3883
3884 ;
3885 return 0;
3886 }
3887 _ACEOF
3888 if ac_fn_c_try_compile "$LINENO"; then :
3889 ax_cv_check_cflags___xc99=yes
3890 else
3891 ax_cv_check_cflags___xc99=no
3892 fi
3893 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3894 CFLAGS=$ax_check_save_flags
3895 fi
3896 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___xc99" >&5
3897 $as_echo "$ax_cv_check_cflags___xc99" >&6; }
3898 if test x"$ax_cv_check_cflags___xc99" = xyes; then :
3899 CFLAGS="$CFLAGS -xc99"
3900 else
3901 :
3902 fi
3903
3904 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wall" >&5
3905 $as_echo_n "checking whether C compiler accepts -Wall... " >&6; }
3906 if ${ax_cv_check_cflags___Wall+:} false; then :
3907 $as_echo_n "(cached) " >&6
3908 else
3909
3910 ax_check_save_flags=$CFLAGS
3911 CFLAGS="$CFLAGS -Wall"
3912 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3913 /* end confdefs.h. */
3914
3915 int
3916 main ()
3917 {
3918
3919 ;
3920 return 0;
3921 }
3922 _ACEOF
3923 if ac_fn_c_try_compile "$LINENO"; then :
3924 ax_cv_check_cflags___Wall=yes
3925 else
3926 ax_cv_check_cflags___Wall=no
3927 fi
3928 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3929 CFLAGS=$ax_check_save_flags
3930 fi
3931 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wall" >&5
3932 $as_echo "$ax_cv_check_cflags___Wall" >&6; }
3933 if test x"$ax_cv_check_cflags___Wall" = xyes; then :
3934 CFLAGS="$CFLAGS -Wall"
3935 else
3936 :
3937 fi
3938
3939 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wextra" >&5
3940 $as_echo_n "checking whether C compiler accepts -Wextra... " >&6; }
3941 if ${ax_cv_check_cflags___Wextra+:} false; then :
3942 $as_echo_n "(cached) " >&6
3943 else
3944
3945 ax_check_save_flags=$CFLAGS
3946 CFLAGS="$CFLAGS -Wextra"
3947 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3948 /* end confdefs.h. */
3949
3950 int
3951 main ()
3952 {
3953
3954 ;
3955 return 0;
3956 }
3957 _ACEOF
3958 if ac_fn_c_try_compile "$LINENO"; then :
3959 ax_cv_check_cflags___Wextra=yes
3960 else
3961 ax_cv_check_cflags___Wextra=no
3962 fi
3963 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3964 CFLAGS=$ax_check_save_flags
3965 fi
3966 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wextra" >&5
3967 $as_echo "$ax_cv_check_cflags___Wextra" >&6; }
3968 if test x"$ax_cv_check_cflags___Wextra" = xyes; then :
3969 CFLAGS="$CFLAGS -Wextra"
3970 else
3971 :
3972 fi
3973
3974 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wpedantic" >&5
3975 $as_echo_n "checking whether C compiler accepts -Wpedantic... " >&6; }
3976 if ${ax_cv_check_cflags___Wpedantic+:} false; then :
3977 $as_echo_n "(cached) " >&6
3978 else
3979
3980 ax_check_save_flags=$CFLAGS
3981 CFLAGS="$CFLAGS -Wpedantic"
3982 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3983 /* end confdefs.h. */
3984
3985 int
3986 main ()
3987 {
3988
3989 ;
3990 return 0;
3991 }
3992 _ACEOF
3993 if ac_fn_c_try_compile "$LINENO"; then :
3994 ax_cv_check_cflags___Wpedantic=yes
3995 else
3996 ax_cv_check_cflags___Wpedantic=no
3997 fi
3998 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3999 CFLAGS=$ax_check_save_flags
4000 fi
4001 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wpedantic" >&5
4002 $as_echo "$ax_cv_check_cflags___Wpedantic" >&6; }
4003 if test x"$ax_cv_check_cflags___Wpedantic" = xyes; then :
4004 WPEDANTICFLAG="-Wpedantic"
4005 else
4006 :
4007 fi
4008
4009 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wno-error=unused-parameter" >&5
4010 $as_echo_n "checking whether C compiler accepts -Wno-error=unused-parameter... " >&6; }
4011 if ${ax_cv_check_cflags___Wno_error_unused_parameter+:} false; then :
4012 $as_echo_n "(cached) " >&6
4013 else
4014
4015 ax_check_save_flags=$CFLAGS
4016 CFLAGS="$CFLAGS -Wno-error=unused-parameter"
4017 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4018 /* end confdefs.h. */
4019
4020 int
4021 main ()
4022 {
4023
4024 ;
4025 return 0;
4026 }
4027 _ACEOF
4028 if ac_fn_c_try_compile "$LINENO"; then :
4029 ax_cv_check_cflags___Wno_error_unused_parameter=yes
4030 else
4031 ax_cv_check_cflags___Wno_error_unused_parameter=no
4032 fi
4033 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4034 CFLAGS=$ax_check_save_flags
4035 fi
4036 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wno_error_unused_parameter" >&5
4037 $as_echo "$ax_cv_check_cflags___Wno_error_unused_parameter" >&6; }
4038 if test x"$ax_cv_check_cflags___Wno_error_unused_parameter" = xyes; then :
4039 WNOERRORFLAG="-Wno-error=unused-parameter"
4040 else
4041 :
4042 fi
4043
4044 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wno-unused-parameter" >&5
4045 $as_echo_n "checking whether C compiler accepts -Wno-unused-parameter... " >&6; }
4046 if ${ax_cv_check_cflags___Wno_unused_parameter+:} false; then :
4047 $as_echo_n "(cached) " >&6
4048 else
4049
4050 ax_check_save_flags=$CFLAGS
4051 CFLAGS="$CFLAGS -Wno-unused-parameter"
4052 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4053 /* end confdefs.h. */
4054
4055 int
4056 main ()
4057 {
4058
4059 ;
4060 return 0;
4061 }
4062 _ACEOF
4063 if ac_fn_c_try_compile "$LINENO"; then :
4064 ax_cv_check_cflags___Wno_unused_parameter=yes
4065 else
4066 ax_cv_check_cflags___Wno_unused_parameter=no
4067 fi
4068 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4069 CFLAGS=$ax_check_save_flags
4070 fi
4071 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wno_unused_parameter" >&5
4072 $as_echo "$ax_cv_check_cflags___Wno_unused_parameter" >&6; }
4073 if test x"$ax_cv_check_cflags___Wno_unused_parameter" = xyes; then :
4074 WNOERRORFLAG="$WNOERRORFLAG -Wno-unused-parameter"
4075 else
4076 :
4077 fi
4078
4079
4080
4081
4082 case "$host_os" in
4083 linux* ) CFLAGS="$CFLAGS -D_BSD_SOURCE -D_DEFAULT_SOURCE"
4084 ;;
4085 solaris* ) CFLAGS="$CFLAGS -D__EXTENSIONS__" # for strdup() from <string.h>
4086 ;;
4087 darwin* ) CFLAGS="$CFLAGS -D_DARWIN_C_SOURCE" # for strlcpy() from <string.h>
4088 ;;
4089 esac
4090
4091 # always use ./libtool unless override from commandline (libtool=mylibtool)
4092 if test -z "$libtool"; then
4093 libtool="`pwd`/libtool"
4094 fi
4095
4096 case `pwd` in
4097 *\ * | *\ *)
4098 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
4099 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
4100 esac
4101
4102
4103
4104 macro_version='2.4.6'
4105 macro_revision='2.4.6'
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119 ltmain=$ac_aux_dir/ltmain.sh
4120
4121 # Backslashify metacharacters that are still active within
4122 # double-quoted strings.
4123 sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
4124
4125 # Same as above, but do not quote variable references.
4126 double_quote_subst='s/\(["`\\]\)/\\\1/g'
4127
4128 # Sed substitution to delay expansion of an escaped shell variable in a
4129 # double_quote_subst'ed string.
4130 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
4131
4132 # Sed substitution to delay expansion of an escaped single quote.
4133 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
4134
4135 # Sed substitution to avoid accidental globbing in evaled expressions
4136 no_glob_subst='s/\*/\\\*/g'
4137
4138 ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
4139 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
4140 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
4141
4142 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
4143 $as_echo_n "checking how to print strings... " >&6; }
4144 # Test print first, because it will be a builtin if present.
4145 if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
4146 test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
4147 ECHO='print -r --'
4148 elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
4149 ECHO='printf %s\n'
4150 else
4151 # Use this function as a fallback that always works.
4152 func_fallback_echo ()
4153 {
4154 eval 'cat <<_LTECHO_EOF
4155 $1
4156 _LTECHO_EOF'
4157 }
4158 ECHO='func_fallback_echo'
4159 fi
4160
4161 # func_echo_all arg...
4162 # Invoke $ECHO with all args, space-separated.
4163 func_echo_all ()
4164 {
4165 $ECHO ""
4166 }
4167
4168 case $ECHO in
4169 printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
4170 $as_echo "printf" >&6; } ;;
4171 print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
4172 $as_echo "print -r" >&6; } ;;
4173 *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
4174 $as_echo "cat" >&6; } ;;
4175 esac
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
4191 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
4192 if ${ac_cv_path_SED+:} false; then :
4193 $as_echo_n "(cached) " >&6
4194 else
4195 ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
4196 for ac_i in 1 2 3 4 5 6 7; do
4197 ac_script="$ac_script$as_nl$ac_script"
4198 done
4199 echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
4200 { ac_script=; unset ac_script;}
4201 if test -z "$SED"; then
4202 ac_path_SED_found=false
4203 # Loop through the user's path and test for each of PROGNAME-LIST
4204 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4205 for as_dir in $PATH
4206 do
4207 IFS=$as_save_IFS
4208 test -z "$as_dir" && as_dir=.
4209 for ac_prog in sed gsed; do
4210 for ac_exec_ext in '' $ac_executable_extensions; do
4211 ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
4212 as_fn_executable_p "$ac_path_SED" || continue
4213 # Check for GNU ac_path_SED and select it if it is found.
4214 # Check for GNU $ac_path_SED
4215 case `"$ac_path_SED" --version 2>&1` in
4216 *GNU*)
4217 ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
4218 *)
4219 ac_count=0
4220 $as_echo_n 0123456789 >"conftest.in"
4221 while :
4222 do
4223 cat "conftest.in" "conftest.in" >"conftest.tmp"
4224 mv "conftest.tmp" "conftest.in"
4225 cp "conftest.in" "conftest.nl"
4226 $as_echo '' >> "conftest.nl"
4227 "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
4228 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4229 as_fn_arith $ac_count + 1 && ac_count=$as_val
4230 if test $ac_count -gt ${ac_path_SED_max-0}; then
4231 # Best one so far, save it but keep looking for a better one
4232 ac_cv_path_SED="$ac_path_SED"
4233 ac_path_SED_max=$ac_count
4234 fi
4235 # 10*(2^10) chars as input seems more than enough
4236 test $ac_count -gt 10 && break
4237 done
4238 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4239 esac
4240
4241 $ac_path_SED_found && break 3
4242 done
4243 done
4244 done
4245 IFS=$as_save_IFS
4246 if test -z "$ac_cv_path_SED"; then
4247 as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
4248 fi
4249 else
4250 ac_cv_path_SED=$SED
4251 fi
4252
4253 fi
4254 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
4255 $as_echo "$ac_cv_path_SED" >&6; }
4256 SED="$ac_cv_path_SED"
4257 rm -f conftest.sed
4258
4259 test -z "$SED" && SED=sed
4260 Xsed="$SED -e 1s/^X//"
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
4273 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
4274 if ${ac_cv_path_GREP+:} false; then :
4275 $as_echo_n "(cached) " >&6
4276 else
4277 if test -z "$GREP"; then
4278 ac_path_GREP_found=false
4279 # Loop through the user's path and test for each of PROGNAME-LIST
4280 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4281 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4282 do
4283 IFS=$as_save_IFS
4284 test -z "$as_dir" && as_dir=.
4285 for ac_prog in grep ggrep; do
4286 for ac_exec_ext in '' $ac_executable_extensions; do
4287 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
4288 as_fn_executable_p "$ac_path_GREP" || continue
4289 # Check for GNU ac_path_GREP and select it if it is found.
4290 # Check for GNU $ac_path_GREP
4291 case `"$ac_path_GREP" --version 2>&1` in
4292 *GNU*)
4293 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
4294 *)
4295 ac_count=0
4296 $as_echo_n 0123456789 >"conftest.in"
4297 while :
4298 do
4299 cat "conftest.in" "conftest.in" >"conftest.tmp"
4300 mv "conftest.tmp" "conftest.in"
4301 cp "conftest.in" "conftest.nl"
4302 $as_echo 'GREP' >> "conftest.nl"
4303 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4304 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4305 as_fn_arith $ac_count + 1 && ac_count=$as_val
4306 if test $ac_count -gt ${ac_path_GREP_max-0}; then
4307 # Best one so far, save it but keep looking for a better one
4308 ac_cv_path_GREP="$ac_path_GREP"
4309 ac_path_GREP_max=$ac_count
4310 fi
4311 # 10*(2^10) chars as input seems more than enough
4312 test $ac_count -gt 10 && break
4313 done
4314 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4315 esac
4316
4317 $ac_path_GREP_found && break 3
4318 done
4319 done
4320 done
4321 IFS=$as_save_IFS
4322 if test -z "$ac_cv_path_GREP"; then
4323 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4324 fi
4325 else
4326 ac_cv_path_GREP=$GREP
4327 fi
4328
4329 fi
4330 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
4331 $as_echo "$ac_cv_path_GREP" >&6; }
4332 GREP="$ac_cv_path_GREP"
4333
4334
4335 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
4336 $as_echo_n "checking for egrep... " >&6; }
4337 if ${ac_cv_path_EGREP+:} false; then :
4338 $as_echo_n "(cached) " >&6
4339 else
4340 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
4341 then ac_cv_path_EGREP="$GREP -E"
4342 else
4343 if test -z "$EGREP"; then
4344 ac_path_EGREP_found=false
4345 # Loop through the user's path and test for each of PROGNAME-LIST
4346 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4347 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4348 do
4349 IFS=$as_save_IFS
4350 test -z "$as_dir" && as_dir=.
4351 for ac_prog in egrep; do
4352 for ac_exec_ext in '' $ac_executable_extensions; do
4353 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4354 as_fn_executable_p "$ac_path_EGREP" || continue
4355 # Check for GNU ac_path_EGREP and select it if it is found.
4356 # Check for GNU $ac_path_EGREP
4357 case `"$ac_path_EGREP" --version 2>&1` in
4358 *GNU*)
4359 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
4360 *)
4361 ac_count=0
4362 $as_echo_n 0123456789 >"conftest.in"
4363 while :
4364 do
4365 cat "conftest.in" "conftest.in" >"conftest.tmp"
4366 mv "conftest.tmp" "conftest.in"
4367 cp "conftest.in" "conftest.nl"
4368 $as_echo 'EGREP' >> "conftest.nl"
4369 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4370 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4371 as_fn_arith $ac_count + 1 && ac_count=$as_val
4372 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
4373 # Best one so far, save it but keep looking for a better one
4374 ac_cv_path_EGREP="$ac_path_EGREP"
4375 ac_path_EGREP_max=$ac_count
4376 fi
4377 # 10*(2^10) chars as input seems more than enough
4378 test $ac_count -gt 10 && break
4379 done
4380 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4381 esac
4382
4383 $ac_path_EGREP_found && break 3
4384 done
4385 done
4386 done
4387 IFS=$as_save_IFS
4388 if test -z "$ac_cv_path_EGREP"; then
4389 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4390 fi
4391 else
4392 ac_cv_path_EGREP=$EGREP
4393 fi
4394
4395 fi
4396 fi
4397 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
4398 $as_echo "$ac_cv_path_EGREP" >&6; }
4399 EGREP="$ac_cv_path_EGREP"
4400
4401
4402 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
4403 $as_echo_n "checking for fgrep... " >&6; }
4404 if ${ac_cv_path_FGREP+:} false; then :
4405 $as_echo_n "(cached) " >&6
4406 else
4407 if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
4408 then ac_cv_path_FGREP="$GREP -F"
4409 else
4410 if test -z "$FGREP"; then
4411 ac_path_FGREP_found=false
4412 # Loop through the user's path and test for each of PROGNAME-LIST
4413 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4414 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4415 do
4416 IFS=$as_save_IFS
4417 test -z "$as_dir" && as_dir=.
4418 for ac_prog in fgrep; do
4419 for ac_exec_ext in '' $ac_executable_extensions; do
4420 ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
4421 as_fn_executable_p "$ac_path_FGREP" || continue
4422 # Check for GNU ac_path_FGREP and select it if it is found.
4423 # Check for GNU $ac_path_FGREP
4424 case `"$ac_path_FGREP" --version 2>&1` in
4425 *GNU*)
4426 ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
4427 *)
4428 ac_count=0
4429 $as_echo_n 0123456789 >"conftest.in"
4430 while :
4431 do
4432 cat "conftest.in" "conftest.in" >"conftest.tmp"
4433 mv "conftest.tmp" "conftest.in"
4434 cp "conftest.in" "conftest.nl"
4435 $as_echo 'FGREP' >> "conftest.nl"
4436 "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
4437 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4438 as_fn_arith $ac_count + 1 && ac_count=$as_val
4439 if test $ac_count -gt ${ac_path_FGREP_max-0}; then
4440 # Best one so far, save it but keep looking for a better one
4441 ac_cv_path_FGREP="$ac_path_FGREP"
4442 ac_path_FGREP_max=$ac_count
4443 fi
4444 # 10*(2^10) chars as input seems more than enough
4445 test $ac_count -gt 10 && break
4446 done
4447 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4448 esac
4449
4450 $ac_path_FGREP_found && break 3
4451 done
4452 done
4453 done
4454 IFS=$as_save_IFS
4455 if test -z "$ac_cv_path_FGREP"; then
4456 as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4457 fi
4458 else
4459 ac_cv_path_FGREP=$FGREP
4460 fi
4461
4462 fi
4463 fi
4464 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
4465 $as_echo "$ac_cv_path_FGREP" >&6; }
4466 FGREP="$ac_cv_path_FGREP"
4467
4468
4469 test -z "$GREP" && GREP=grep
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489 # Check whether --with-gnu-ld was given.
4490 if test "${with_gnu_ld+set}" = set; then :
4491 withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
4492 else
4493 with_gnu_ld=no
4494 fi
4495
4496 ac_prog=ld
4497 if test yes = "$GCC"; then
4498 # Check if gcc -print-prog-name=ld gives a path.
4499 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
4500 $as_echo_n "checking for ld used by $CC... " >&6; }
4501 case $host in
4502 *-*-mingw*)
4503 # gcc leaves a trailing carriage return, which upsets mingw
4504 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4505 *)
4506 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4507 esac
4508 case $ac_prog in
4509 # Accept absolute paths.
4510 [\\/]* | ?:[\\/]*)
4511 re_direlt='/[^/][^/]*/\.\./'
4512 # Canonicalize the pathname of ld
4513 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4514 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4515 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4516 done
4517 test -z "$LD" && LD=$ac_prog
4518 ;;
4519 "")
4520 # If it fails, then pretend we aren't using GCC.
4521 ac_prog=ld
4522 ;;
4523 *)
4524 # If it is relative, then search for the first ld in PATH.
4525 with_gnu_ld=unknown
4526 ;;
4527 esac
4528 elif test yes = "$with_gnu_ld"; then
4529 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
4530 $as_echo_n "checking for GNU ld... " >&6; }
4531 else
4532 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
4533 $as_echo_n "checking for non-GNU ld... " >&6; }
4534 fi
4535 if ${lt_cv_path_LD+:} false; then :
4536 $as_echo_n "(cached) " >&6
4537 else
4538 if test -z "$LD"; then
4539 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
4540 for ac_dir in $PATH; do
4541 IFS=$lt_save_ifs
4542 test -z "$ac_dir" && ac_dir=.
4543 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4544 lt_cv_path_LD=$ac_dir/$ac_prog
4545 # Check to see if the program is GNU ld. I'd rather use --version,
4546 # but apparently some variants of GNU ld only accept -v.
4547 # Break only if it was the GNU/non-GNU ld that we prefer.
4548 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4549 *GNU* | *'with BFD'*)
4550 test no != "$with_gnu_ld" && break
4551 ;;
4552 *)
4553 test yes != "$with_gnu_ld" && break
4554 ;;
4555 esac
4556 fi
4557 done
4558 IFS=$lt_save_ifs
4559 else
4560 lt_cv_path_LD=$LD # Let the user override the test with a path.
4561 fi
4562 fi
4563
4564 LD=$lt_cv_path_LD
4565 if test -n "$LD"; then
4566 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
4567 $as_echo "$LD" >&6; }
4568 else
4569 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4570 $as_echo "no" >&6; }
4571 fi
4572 test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
4573 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
4574 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
4575 if ${lt_cv_prog_gnu_ld+:} false; then :
4576 $as_echo_n "(cached) " >&6
4577 else
4578 # I'd rather use --version here, but apparently some GNU lds only accept -v.
4579 case `$LD -v 2>&1 </dev/null` in
4580 *GNU* | *'with BFD'*)
4581 lt_cv_prog_gnu_ld=yes
4582 ;;
4583 *)
4584 lt_cv_prog_gnu_ld=no
4585 ;;
4586 esac
4587 fi
4588 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
4589 $as_echo "$lt_cv_prog_gnu_ld" >&6; }
4590 with_gnu_ld=$lt_cv_prog_gnu_ld
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
4601 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
4602 if ${lt_cv_path_NM+:} false; then :
4603 $as_echo_n "(cached) " >&6
4604 else
4605 if test -n "$NM"; then
4606 # Let the user override the test.
4607 lt_cv_path_NM=$NM
4608 else
4609 lt_nm_to_check=${ac_tool_prefix}nm
4610 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4611 lt_nm_to_check="$lt_nm_to_check nm"
4612 fi
4613 for lt_tmp_nm in $lt_nm_to_check; do
4614 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
4615 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4616 IFS=$lt_save_ifs
4617 test -z "$ac_dir" && ac_dir=.
4618 tmp_nm=$ac_dir/$lt_tmp_nm
4619 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
4620 # Check to see if the nm accepts a BSD-compat flag.
4621 # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
4622 # nm: unknown option "B" ignored
4623 # Tru64's nm complains that /dev/null is an invalid object file
4624 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
4625 case $build_os in
4626 mingw*) lt_bad_file=conftest.nm/nofile ;;
4627 *) lt_bad_file=/dev/null ;;
4628 esac
4629 case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
4630 *$lt_bad_file* | *'Invalid file or object type'*)
4631 lt_cv_path_NM="$tmp_nm -B"
4632 break 2
4633 ;;
4634 *)
4635 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4636 */dev/null*)
4637 lt_cv_path_NM="$tmp_nm -p"
4638 break 2
4639 ;;
4640 *)
4641 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4642 continue # so that we can try to find one that supports BSD flags
4643 ;;
4644 esac
4645 ;;
4646 esac
4647 fi
4648 done
4649 IFS=$lt_save_ifs
4650 done
4651 : ${lt_cv_path_NM=no}
4652 fi
4653 fi
4654 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
4655 $as_echo "$lt_cv_path_NM" >&6; }
4656 if test no != "$lt_cv_path_NM"; then
4657 NM=$lt_cv_path_NM
4658 else
4659 # Didn't find any BSD compatible name lister, look for dumpbin.
4660 if test -n "$DUMPBIN"; then :
4661 # Let the user override the test.
4662 else
4663 if test -n "$ac_tool_prefix"; then
4664 for ac_prog in dumpbin "link -dump"
4665 do
4666 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4667 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4668 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4669 $as_echo_n "checking for $ac_word... " >&6; }
4670 if ${ac_cv_prog_DUMPBIN+:} false; then :
4671 $as_echo_n "(cached) " >&6
4672 else
4673 if test -n "$DUMPBIN"; then
4674 ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
4675 else
4676 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4677 for as_dir in $PATH
4678 do
4679 IFS=$as_save_IFS
4680 test -z "$as_dir" && as_dir=.
4681 for ac_exec_ext in '' $ac_executable_extensions; do
4682 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4683 ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
4684 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4685 break 2
4686 fi
4687 done
4688 done
4689 IFS=$as_save_IFS
4690
4691 fi
4692 fi
4693 DUMPBIN=$ac_cv_prog_DUMPBIN
4694 if test -n "$DUMPBIN"; then
4695 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
4696 $as_echo "$DUMPBIN" >&6; }
4697 else
4698 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4699 $as_echo "no" >&6; }
4700 fi
4701
4702
4703 test -n "$DUMPBIN" && break
4704 done
4705 fi
4706 if test -z "$DUMPBIN"; then
4707 ac_ct_DUMPBIN=$DUMPBIN
4708 for ac_prog in dumpbin "link -dump"
4709 do
4710 # Extract the first word of "$ac_prog", so it can be a program name with args.
4711 set dummy $ac_prog; ac_word=$2
4712 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4713 $as_echo_n "checking for $ac_word... " >&6; }
4714 if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
4715 $as_echo_n "(cached) " >&6
4716 else
4717 if test -n "$ac_ct_DUMPBIN"; then
4718 ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
4719 else
4720 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4721 for as_dir in $PATH
4722 do
4723 IFS=$as_save_IFS
4724 test -z "$as_dir" && as_dir=.
4725 for ac_exec_ext in '' $ac_executable_extensions; do
4726 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4727 ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
4728 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4729 break 2
4730 fi
4731 done
4732 done
4733 IFS=$as_save_IFS
4734
4735 fi
4736 fi
4737 ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
4738 if test -n "$ac_ct_DUMPBIN"; then
4739 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
4740 $as_echo "$ac_ct_DUMPBIN" >&6; }
4741 else
4742 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4743 $as_echo "no" >&6; }
4744 fi
4745
4746
4747 test -n "$ac_ct_DUMPBIN" && break
4748 done
4749
4750 if test "x$ac_ct_DUMPBIN" = x; then
4751 DUMPBIN=":"
4752 else
4753 case $cross_compiling:$ac_tool_warned in
4754 yes:)
4755 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4756 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4757 ac_tool_warned=yes ;;
4758 esac
4759 DUMPBIN=$ac_ct_DUMPBIN
4760 fi
4761 fi
4762
4763 case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
4764 *COFF*)
4765 DUMPBIN="$DUMPBIN -symbols -headers"
4766 ;;
4767 *)
4768 DUMPBIN=:
4769 ;;
4770 esac
4771 fi
4772
4773 if test : != "$DUMPBIN"; then
4774 NM=$DUMPBIN
4775 fi
4776 fi
4777 test -z "$NM" && NM=nm
4778
4779
4780
4781
4782
4783
4784 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
4785 $as_echo_n "checking the name lister ($NM) interface... " >&6; }
4786 if ${lt_cv_nm_interface+:} false; then :
4787 $as_echo_n "(cached) " >&6
4788 else
4789 lt_cv_nm_interface="BSD nm"
4790 echo "int some_variable = 0;" > conftest.$ac_ext
4791 (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
4792 (eval "$ac_compile" 2>conftest.err)
4793 cat conftest.err >&5
4794 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
4795 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4796 cat conftest.err >&5
4797 (eval echo "\"\$as_me:$LINENO: output\"" >&5)
4798 cat conftest.out >&5
4799 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4800 lt_cv_nm_interface="MS dumpbin"
4801 fi
4802 rm -f conftest*
4803 fi
4804 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
4805 $as_echo "$lt_cv_nm_interface" >&6; }
4806
4807 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
4808 $as_echo_n "checking whether ln -s works... " >&6; }
4809 LN_S=$as_ln_s
4810 if test "$LN_S" = "ln -s"; then
4811 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4812 $as_echo "yes" >&6; }
4813 else
4814 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
4815 $as_echo "no, using $LN_S" >&6; }
4816 fi
4817
4818 # find the maximum length of command line arguments
4819 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
4820 $as_echo_n "checking the maximum length of command line arguments... " >&6; }
4821 if ${lt_cv_sys_max_cmd_len+:} false; then :
4822 $as_echo_n "(cached) " >&6
4823 else
4824 i=0
4825 teststring=ABCD
4826
4827 case $build_os in
4828 msdosdjgpp*)
4829 # On DJGPP, this test can blow up pretty badly due to problems in libc
4830 # (any single argument exceeding 2000 bytes causes a buffer overrun
4831 # during glob expansion). Even if it were fixed, the result of this
4832 # check would be larger than it should be.
4833 lt_cv_sys_max_cmd_len=12288; # 12K is about right
4834 ;;
4835
4836 gnu*)
4837 # Under GNU Hurd, this test is not required because there is
4838 # no limit to the length of command line arguments.
4839 # Libtool will interpret -1 as no limit whatsoever
4840 lt_cv_sys_max_cmd_len=-1;
4841 ;;
4842
4843 cygwin* | mingw* | cegcc*)
4844 # On Win9x/ME, this test blows up -- it succeeds, but takes
4845 # about 5 minutes as the teststring grows exponentially.
4846 # Worse, since 9x/ME are not pre-emptively multitasking,
4847 # you end up with a "frozen" computer, even though with patience
4848 # the test eventually succeeds (with a max line length of 256k).
4849 # Instead, let's just punt: use the minimum linelength reported by
4850 # all of the supported platforms: 8192 (on NT/2K/XP).
4851 lt_cv_sys_max_cmd_len=8192;
4852 ;;
4853
4854 mint*)
4855 # On MiNT this can take a long time and run out of memory.
4856 lt_cv_sys_max_cmd_len=8192;
4857 ;;
4858
4859 amigaos*)
4860 # On AmigaOS with pdksh, this test takes hours, literally.
4861 # So we just punt and use a minimum line length of 8192.
4862 lt_cv_sys_max_cmd_len=8192;
4863 ;;
4864
4865 bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
4866 # This has been around since 386BSD, at least. Likely further.
4867 if test -x /sbin/sysctl; then
4868 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
4869 elif test -x /usr/sbin/sysctl; then
4870 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
4871 else
4872 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
4873 fi
4874 # And add a safety zone
4875 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4876 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4877 ;;
4878
4879 interix*)
4880 # We know the value 262144 and hardcode it with a safety zone (like BSD)
4881 lt_cv_sys_max_cmd_len=196608
4882 ;;
4883
4884 os2*)
4885 # The test takes a long time on OS/2.
4886 lt_cv_sys_max_cmd_len=8192
4887 ;;
4888
4889 osf*)
4890 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
4891 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
4892 # nice to cause kernel panics so lets avoid the loop below.
4893 # First set a reasonable default.
4894 lt_cv_sys_max_cmd_len=16384
4895 #
4896 if test -x /sbin/sysconfig; then
4897 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
4898 *1*) lt_cv_sys_max_cmd_len=-1 ;;
4899 esac
4900 fi
4901 ;;
4902 sco3.2v5*)
4903 lt_cv_sys_max_cmd_len=102400
4904 ;;
4905 sysv5* | sco5v6* | sysv4.2uw2*)
4906 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
4907 if test -n "$kargmax"; then
4908 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
4909 else
4910 lt_cv_sys_max_cmd_len=32768
4911 fi
4912 ;;
4913 *)
4914 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
4915 if test -n "$lt_cv_sys_max_cmd_len" && \
4916 test undefined != "$lt_cv_sys_max_cmd_len"; then
4917 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4918 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4919 else
4920 # Make teststring a little bigger before we do anything with it.
4921 # a 1K string should be a reasonable start.
4922 for i in 1 2 3 4 5 6 7 8; do
4923 teststring=$teststring$teststring
4924 done
4925 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
4926 # If test is not a shell built-in, we'll probably end up computing a
4927 # maximum length that is only half of the actual maximum length, but
4928 # we can't tell.
4929 while { test X`env echo "$teststring$teststring" 2>/dev/null` \
4930 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
4931 test 17 != "$i" # 1/2 MB should be enough
4932 do
4933 i=`expr $i + 1`
4934 teststring=$teststring$teststring
4935 done
4936 # Only check the string length outside the loop.
4937 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
4938 teststring=
4939 # Add a significant safety factor because C++ compilers can tack on
4940 # massive amounts of additional arguments before passing them to the
4941 # linker. It appears as though 1/2 is a usable value.
4942 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
4943 fi
4944 ;;
4945 esac
4946
4947 fi
4948
4949 if test -n "$lt_cv_sys_max_cmd_len"; then
4950 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
4951 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
4952 else
4953 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
4954 $as_echo "none" >&6; }
4955 fi
4956 max_cmd_len=$lt_cv_sys_max_cmd_len
4957
4958
4959
4960
4961
4962
4963 : ${CP="cp -f"}
4964 : ${MV="mv -f"}
4965 : ${RM="rm -f"}
4966
4967 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
4968 lt_unset=unset
4969 else
4970 lt_unset=false
4971 fi
4972
4973
4974
4975
4976
4977 # test EBCDIC or ASCII
4978 case `echo X|tr X '\101'` in
4979 A) # ASCII based system
4980 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
4981 lt_SP2NL='tr \040 \012'
4982 lt_NL2SP='tr \015\012 \040\040'
4983 ;;
4984 *) # EBCDIC based system
4985 lt_SP2NL='tr \100 \n'
4986 lt_NL2SP='tr \r\n \100\100'
4987 ;;
4988 esac
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
4999 $as_echo_n "checking how to convert $build file names to $host format... " >&6; }
5000 if ${lt_cv_to_host_file_cmd+:} false; then :
5001 $as_echo_n "(cached) " >&6
5002 else
5003 case $host in
5004 *-*-mingw* )
5005 case $build in
5006 *-*-mingw* ) # actually msys
5007 lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
5008 ;;
5009 *-*-cygwin* )
5010 lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
5011 ;;
5012 * ) # otherwise, assume *nix
5013 lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
5014 ;;
5015 esac
5016 ;;
5017 *-*-cygwin* )
5018 case $build in
5019 *-*-mingw* ) # actually msys
5020 lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
5021 ;;
5022 *-*-cygwin* )
5023 lt_cv_to_host_file_cmd=func_convert_file_noop
5024 ;;
5025 * ) # otherwise, assume *nix
5026 lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
5027 ;;
5028 esac
5029 ;;
5030 * ) # unhandled hosts (and "normal" native builds)
5031 lt_cv_to_host_file_cmd=func_convert_file_noop
5032 ;;
5033 esac
5034
5035 fi
5036
5037 to_host_file_cmd=$lt_cv_to_host_file_cmd
5038 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
5039 $as_echo "$lt_cv_to_host_file_cmd" >&6; }
5040
5041
5042
5043
5044
5045 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
5046 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
5047 if ${lt_cv_to_tool_file_cmd+:} false; then :
5048 $as_echo_n "(cached) " >&6
5049 else
5050 #assume ordinary cross tools, or native build.
5051 lt_cv_to_tool_file_cmd=func_convert_file_noop
5052 case $host in
5053 *-*-mingw* )
5054 case $build in
5055 *-*-mingw* ) # actually msys
5056 lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
5057 ;;
5058 esac
5059 ;;
5060 esac
5061
5062 fi
5063
5064 to_tool_file_cmd=$lt_cv_to_tool_file_cmd
5065 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
5066 $as_echo "$lt_cv_to_tool_file_cmd" >&6; }
5067
5068
5069
5070
5071
5072 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
5073 $as_echo_n "checking for $LD option to reload object files... " >&6; }
5074 if ${lt_cv_ld_reload_flag+:} false; then :
5075 $as_echo_n "(cached) " >&6
5076 else
5077 lt_cv_ld_reload_flag='-r'
5078 fi
5079 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
5080 $as_echo "$lt_cv_ld_reload_flag" >&6; }
5081 reload_flag=$lt_cv_ld_reload_flag
5082 case $reload_flag in
5083 "" | " "*) ;;
5084 *) reload_flag=" $reload_flag" ;;
5085 esac
5086 reload_cmds='$LD$reload_flag -o $output$reload_objs'
5087 case $host_os in
5088 cygwin* | mingw* | pw32* | cegcc*)
5089 if test yes != "$GCC"; then
5090 reload_cmds=false
5091 fi
5092 ;;
5093 darwin*)
5094 if test yes = "$GCC"; then
5095 reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
5096 else
5097 reload_cmds='$LD$reload_flag -o $output$reload_objs'
5098 fi
5099 ;;
5100 esac
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110 if test -n "$ac_tool_prefix"; then
5111 # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
5112 set dummy ${ac_tool_prefix}objdump; ac_word=$2
5113 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5114 $as_echo_n "checking for $ac_word... " >&6; }
5115 if ${ac_cv_prog_OBJDUMP+:} false; then :
5116 $as_echo_n "(cached) " >&6
5117 else
5118 if test -n "$OBJDUMP"; then
5119 ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
5120 else
5121 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5122 for as_dir in $PATH
5123 do
5124 IFS=$as_save_IFS
5125 test -z "$as_dir" && as_dir=.
5126 for ac_exec_ext in '' $ac_executable_extensions; do
5127 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5128 ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
5129 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5130 break 2
5131 fi
5132 done
5133 done
5134 IFS=$as_save_IFS
5135
5136 fi
5137 fi
5138 OBJDUMP=$ac_cv_prog_OBJDUMP
5139 if test -n "$OBJDUMP"; then
5140 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
5141 $as_echo "$OBJDUMP" >&6; }
5142 else
5143 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5144 $as_echo "no" >&6; }
5145 fi
5146
5147
5148 fi
5149 if test -z "$ac_cv_prog_OBJDUMP"; then
5150 ac_ct_OBJDUMP=$OBJDUMP
5151 # Extract the first word of "objdump", so it can be a program name with args.
5152 set dummy objdump; ac_word=$2
5153 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5154 $as_echo_n "checking for $ac_word... " >&6; }
5155 if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
5156 $as_echo_n "(cached) " >&6
5157 else
5158 if test -n "$ac_ct_OBJDUMP"; then
5159 ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
5160 else
5161 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5162 for as_dir in $PATH
5163 do
5164 IFS=$as_save_IFS
5165 test -z "$as_dir" && as_dir=.
5166 for ac_exec_ext in '' $ac_executable_extensions; do
5167 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5168 ac_cv_prog_ac_ct_OBJDUMP="objdump"
5169 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5170 break 2
5171 fi
5172 done
5173 done
5174 IFS=$as_save_IFS
5175
5176 fi
5177 fi
5178 ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
5179 if test -n "$ac_ct_OBJDUMP"; then
5180 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
5181 $as_echo "$ac_ct_OBJDUMP" >&6; }
5182 else
5183 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5184 $as_echo "no" >&6; }
5185 fi
5186
5187 if test "x$ac_ct_OBJDUMP" = x; then
5188 OBJDUMP="false"
5189 else
5190 case $cross_compiling:$ac_tool_warned in
5191 yes:)
5192 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5193 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5194 ac_tool_warned=yes ;;
5195 esac
5196 OBJDUMP=$ac_ct_OBJDUMP
5197 fi
5198 else
5199 OBJDUMP="$ac_cv_prog_OBJDUMP"
5200 fi
5201
5202 test -z "$OBJDUMP" && OBJDUMP=objdump
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
5213 $as_echo_n "checking how to recognize dependent libraries... " >&6; }
5214 if ${lt_cv_deplibs_check_method+:} false; then :
5215 $as_echo_n "(cached) " >&6
5216 else
5217 lt_cv_file_magic_cmd='$MAGIC_CMD'
5218 lt_cv_file_magic_test_file=
5219 lt_cv_deplibs_check_method='unknown'
5220 # Need to set the preceding variable on all platforms that support
5221 # interlibrary dependencies.
5222 # 'none' -- dependencies not supported.
5223 # 'unknown' -- same as none, but documents that we really don't know.
5224 # 'pass_all' -- all dependencies passed with no checks.
5225 # 'test_compile' -- check by making test program.
5226 # 'file_magic [[regex]]' -- check by looking for files in library path
5227 # that responds to the $file_magic_cmd with a given extended regex.
5228 # If you have 'file' or equivalent on your system and you're not sure
5229 # whether 'pass_all' will *always* work, you probably want this one.
5230
5231 case $host_os in
5232 aix[4-9]*)
5233 lt_cv_deplibs_check_method=pass_all
5234 ;;
5235
5236 beos*)
5237 lt_cv_deplibs_check_method=pass_all
5238 ;;
5239
5240 bsdi[45]*)
5241 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
5242 lt_cv_file_magic_cmd='/usr/bin/file -L'
5243 lt_cv_file_magic_test_file=/shlib/libc.so
5244 ;;
5245
5246 cygwin*)
5247 # func_win32_libid is a shell function defined in ltmain.sh
5248 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5249 lt_cv_file_magic_cmd='func_win32_libid'
5250 ;;
5251
5252 mingw* | pw32*)
5253 # Base MSYS/MinGW do not provide the 'file' command needed by
5254 # func_win32_libid shell function, so use a weaker test based on 'objdump',
5255 # unless we find 'file', for example because we are cross-compiling.
5256 if ( file / ) >/dev/null 2>&1; then
5257 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5258 lt_cv_file_magic_cmd='func_win32_libid'
5259 else
5260 # Keep this pattern in sync with the one in func_win32_libid.
5261 lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
5262 lt_cv_file_magic_cmd='$OBJDUMP -f'
5263 fi
5264 ;;
5265
5266 cegcc*)
5267 # use the weaker test based on 'objdump'. See mingw*.
5268 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
5269 lt_cv_file_magic_cmd='$OBJDUMP -f'
5270 ;;
5271
5272 darwin* | rhapsody*)
5273 lt_cv_deplibs_check_method=pass_all
5274 ;;
5275
5276 freebsd* | dragonfly*)
5277 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5278 case $host_cpu in
5279 i*86 )
5280 # Not sure whether the presence of OpenBSD here was a mistake.
5281 # Let's accept both of them until this is cleared up.
5282 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
5283 lt_cv_file_magic_cmd=/usr/bin/file
5284 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
5285 ;;
5286 esac
5287 else
5288 lt_cv_deplibs_check_method=pass_all
5289 fi
5290 ;;
5291
5292 haiku*)
5293 lt_cv_deplibs_check_method=pass_all
5294 ;;
5295
5296 hpux10.20* | hpux11*)
5297 lt_cv_file_magic_cmd=/usr/bin/file
5298 case $host_cpu in
5299 ia64*)
5300 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
5301 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
5302 ;;
5303 hppa*64*)
5304 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
5305 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
5306 ;;
5307 *)
5308 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
5309 lt_cv_file_magic_test_file=/usr/lib/libc.sl
5310 ;;
5311 esac
5312 ;;
5313
5314 interix[3-9]*)
5315 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
5316 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
5317 ;;
5318
5319 irix5* | irix6* | nonstopux*)
5320 case $LD in
5321 *-32|*"-32 ") libmagic=32-bit;;
5322 *-n32|*"-n32 ") libmagic=N32;;
5323 *-64|*"-64 ") libmagic=64-bit;;
5324 *) libmagic=never-match;;
5325 esac
5326 lt_cv_deplibs_check_method=pass_all
5327 ;;
5328
5329 # This must be glibc/ELF.
5330 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
5331 lt_cv_deplibs_check_method=pass_all
5332 ;;
5333
5334 netbsd* | netbsdelf*-gnu)
5335 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5336 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
5337 else
5338 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
5339 fi
5340 ;;
5341
5342 newos6*)
5343 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
5344 lt_cv_file_magic_cmd=/usr/bin/file
5345 lt_cv_file_magic_test_file=/usr/lib/libnls.so
5346 ;;
5347
5348 *nto* | *qnx*)
5349 lt_cv_deplibs_check_method=pass_all
5350 ;;
5351
5352 openbsd* | bitrig*)
5353 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
5354 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
5355 else
5356 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
5357 fi
5358 ;;
5359
5360 osf3* | osf4* | osf5*)
5361 lt_cv_deplibs_check_method=pass_all
5362 ;;
5363
5364 rdos*)
5365 lt_cv_deplibs_check_method=pass_all
5366 ;;
5367
5368 solaris*)
5369 lt_cv_deplibs_check_method=pass_all
5370 ;;
5371
5372 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
5373 lt_cv_deplibs_check_method=pass_all
5374 ;;
5375
5376 sysv4 | sysv4.3*)
5377 case $host_vendor in
5378 motorola)
5379 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]'
5380 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
5381 ;;
5382 ncr)
5383 lt_cv_deplibs_check_method=pass_all
5384 ;;
5385 sequent)
5386 lt_cv_file_magic_cmd='/bin/file'
5387 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
5388 ;;
5389 sni)
5390 lt_cv_file_magic_cmd='/bin/file'
5391 lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
5392 lt_cv_file_magic_test_file=/lib/libc.so
5393 ;;
5394 siemens)
5395 lt_cv_deplibs_check_method=pass_all
5396 ;;
5397 pc)
5398 lt_cv_deplibs_check_method=pass_all
5399 ;;
5400 esac
5401 ;;
5402
5403 tpf*)
5404 lt_cv_deplibs_check_method=pass_all
5405 ;;
5406 os2*)
5407 lt_cv_deplibs_check_method=pass_all
5408 ;;
5409 esac
5410
5411 fi
5412 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
5413 $as_echo "$lt_cv_deplibs_check_method" >&6; }
5414
5415 file_magic_glob=
5416 want_nocaseglob=no
5417 if test "$build" = "$host"; then
5418 case $host_os in
5419 mingw* | pw32*)
5420 if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
5421 want_nocaseglob=yes
5422 else
5423 file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
5424 fi
5425 ;;
5426 esac
5427 fi
5428
5429 file_magic_cmd=$lt_cv_file_magic_cmd
5430 deplibs_check_method=$lt_cv_deplibs_check_method
5431 test -z "$deplibs_check_method" && deplibs_check_method=unknown
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454 if test -n "$ac_tool_prefix"; then
5455 # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
5456 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
5457 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5458 $as_echo_n "checking for $ac_word... " >&6; }
5459 if ${ac_cv_prog_DLLTOOL+:} false; then :
5460 $as_echo_n "(cached) " >&6
5461 else
5462 if test -n "$DLLTOOL"; then
5463 ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
5464 else
5465 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5466 for as_dir in $PATH
5467 do
5468 IFS=$as_save_IFS
5469 test -z "$as_dir" && as_dir=.
5470 for ac_exec_ext in '' $ac_executable_extensions; do
5471 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5472 ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
5473 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5474 break 2
5475 fi
5476 done
5477 done
5478 IFS=$as_save_IFS
5479
5480 fi
5481 fi
5482 DLLTOOL=$ac_cv_prog_DLLTOOL
5483 if test -n "$DLLTOOL"; then
5484 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
5485 $as_echo "$DLLTOOL" >&6; }
5486 else
5487 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5488 $as_echo "no" >&6; }
5489 fi
5490
5491
5492 fi
5493 if test -z "$ac_cv_prog_DLLTOOL"; then
5494 ac_ct_DLLTOOL=$DLLTOOL
5495 # Extract the first word of "dlltool", so it can be a program name with args.
5496 set dummy dlltool; ac_word=$2
5497 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5498 $as_echo_n "checking for $ac_word... " >&6; }
5499 if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
5500 $as_echo_n "(cached) " >&6
5501 else
5502 if test -n "$ac_ct_DLLTOOL"; then
5503 ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
5504 else
5505 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5506 for as_dir in $PATH
5507 do
5508 IFS=$as_save_IFS
5509 test -z "$as_dir" && as_dir=.
5510 for ac_exec_ext in '' $ac_executable_extensions; do
5511 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5512 ac_cv_prog_ac_ct_DLLTOOL="dlltool"
5513 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5514 break 2
5515 fi
5516 done
5517 done
5518 IFS=$as_save_IFS
5519
5520 fi
5521 fi
5522 ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
5523 if test -n "$ac_ct_DLLTOOL"; then
5524 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
5525 $as_echo "$ac_ct_DLLTOOL" >&6; }
5526 else
5527 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5528 $as_echo "no" >&6; }
5529 fi
5530
5531 if test "x$ac_ct_DLLTOOL" = x; then
5532 DLLTOOL="false"
5533 else
5534 case $cross_compiling:$ac_tool_warned in
5535 yes:)
5536 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5537 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5538 ac_tool_warned=yes ;;
5539 esac
5540 DLLTOOL=$ac_ct_DLLTOOL
5541 fi
5542 else
5543 DLLTOOL="$ac_cv_prog_DLLTOOL"
5544 fi
5545
5546 test -z "$DLLTOOL" && DLLTOOL=dlltool
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
5558 $as_echo_n "checking how to associate runtime and link libraries... " >&6; }
5559 if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
5560 $as_echo_n "(cached) " >&6
5561 else
5562 lt_cv_sharedlib_from_linklib_cmd='unknown'
5563
5564 case $host_os in
5565 cygwin* | mingw* | pw32* | cegcc*)
5566 # two different shell functions defined in ltmain.sh;
5567 # decide which one to use based on capabilities of $DLLTOOL
5568 case `$DLLTOOL --help 2>&1` in
5569 *--identify-strict*)
5570 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
5571 ;;
5572 *)
5573 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
5574 ;;
5575 esac
5576 ;;
5577 *)
5578 # fallback: assume linklib IS sharedlib
5579 lt_cv_sharedlib_from_linklib_cmd=$ECHO
5580 ;;
5581 esac
5582
5583 fi
5584 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
5585 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
5586 sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
5587 test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
5588
5589
5590
5591
5592
5593
5594
5595 if test -n "$ac_tool_prefix"; then
5596 for ac_prog in ar
5597 do
5598 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5599 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5600 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5601 $as_echo_n "checking for $ac_word... " >&6; }
5602 if ${ac_cv_prog_AR+:} false; then :
5603 $as_echo_n "(cached) " >&6
5604 else
5605 if test -n "$AR"; then
5606 ac_cv_prog_AR="$AR" # Let the user override the test.
5607 else
5608 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5609 for as_dir in $PATH
5610 do
5611 IFS=$as_save_IFS
5612 test -z "$as_dir" && as_dir=.
5613 for ac_exec_ext in '' $ac_executable_extensions; do
5614 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5615 ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
5616 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5617 break 2
5618 fi
5619 done
5620 done
5621 IFS=$as_save_IFS
5622
5623 fi
5624 fi
5625 AR=$ac_cv_prog_AR
5626 if test -n "$AR"; then
5627 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
5628 $as_echo "$AR" >&6; }
5629 else
5630 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5631 $as_echo "no" >&6; }
5632 fi
5633
5634
5635 test -n "$AR" && break
5636 done
5637 fi
5638 if test -z "$AR"; then
5639 ac_ct_AR=$AR
5640 for ac_prog in ar
5641 do
5642 # Extract the first word of "$ac_prog", so it can be a program name with args.
5643 set dummy $ac_prog; ac_word=$2
5644 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5645 $as_echo_n "checking for $ac_word... " >&6; }
5646 if ${ac_cv_prog_ac_ct_AR+:} false; then :
5647 $as_echo_n "(cached) " >&6
5648 else
5649 if test -n "$ac_ct_AR"; then
5650 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5651 else
5652 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5653 for as_dir in $PATH
5654 do
5655 IFS=$as_save_IFS
5656 test -z "$as_dir" && as_dir=.
5657 for ac_exec_ext in '' $ac_executable_extensions; do
5658 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5659 ac_cv_prog_ac_ct_AR="$ac_prog"
5660 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5661 break 2
5662 fi
5663 done
5664 done
5665 IFS=$as_save_IFS
5666
5667 fi
5668 fi
5669 ac_ct_AR=$ac_cv_prog_ac_ct_AR
5670 if test -n "$ac_ct_AR"; then
5671 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
5672 $as_echo "$ac_ct_AR" >&6; }
5673 else
5674 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5675 $as_echo "no" >&6; }
5676 fi
5677
5678
5679 test -n "$ac_ct_AR" && break
5680 done
5681
5682 if test "x$ac_ct_AR" = x; then
5683 AR="false"
5684 else
5685 case $cross_compiling:$ac_tool_warned in
5686 yes:)
5687 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5688 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5689 ac_tool_warned=yes ;;
5690 esac
5691 AR=$ac_ct_AR
5692 fi
5693 fi
5694
5695 : ${AR=ar}
5696 : ${AR_FLAGS=cru}
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
5709 $as_echo_n "checking for archiver @FILE support... " >&6; }
5710 if ${lt_cv_ar_at_file+:} false; then :
5711 $as_echo_n "(cached) " >&6
5712 else
5713 lt_cv_ar_at_file=no
5714 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5715 /* end confdefs.h. */
5716
5717 int
5718 main ()
5719 {
5720
5721 ;
5722 return 0;
5723 }
5724 _ACEOF
5725 if ac_fn_c_try_compile "$LINENO"; then :
5726 echo conftest.$ac_objext > conftest.lst
5727 lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
5728 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
5729 (eval $lt_ar_try) 2>&5
5730 ac_status=$?
5731 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5732 test $ac_status = 0; }
5733 if test 0 -eq "$ac_status"; then
5734 # Ensure the archiver fails upon bogus file names.
5735 rm -f conftest.$ac_objext libconftest.a
5736 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
5737 (eval $lt_ar_try) 2>&5
5738 ac_status=$?
5739 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5740 test $ac_status = 0; }
5741 if test 0 -ne "$ac_status"; then
5742 lt_cv_ar_at_file=@
5743 fi
5744 fi
5745 rm -f conftest.* libconftest.a
5746
5747 fi
5748 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5749
5750 fi
5751 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
5752 $as_echo "$lt_cv_ar_at_file" >&6; }
5753
5754 if test no = "$lt_cv_ar_at_file"; then
5755 archiver_list_spec=
5756 else
5757 archiver_list_spec=$lt_cv_ar_at_file
5758 fi
5759
5760
5761
5762
5763
5764
5765
5766 if test -n "$ac_tool_prefix"; then
5767 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
5768 set dummy ${ac_tool_prefix}strip; ac_word=$2
5769 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5770 $as_echo_n "checking for $ac_word... " >&6; }
5771 if ${ac_cv_prog_STRIP+:} false; then :
5772 $as_echo_n "(cached) " >&6
5773 else
5774 if test -n "$STRIP"; then
5775 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
5776 else
5777 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5778 for as_dir in $PATH
5779 do
5780 IFS=$as_save_IFS
5781 test -z "$as_dir" && as_dir=.
5782 for ac_exec_ext in '' $ac_executable_extensions; do
5783 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5784 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
5785 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5786 break 2
5787 fi
5788 done
5789 done
5790 IFS=$as_save_IFS
5791
5792 fi
5793 fi
5794 STRIP=$ac_cv_prog_STRIP
5795 if test -n "$STRIP"; then
5796 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
5797 $as_echo "$STRIP" >&6; }
5798 else
5799 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5800 $as_echo "no" >&6; }
5801 fi
5802
5803
5804 fi
5805 if test -z "$ac_cv_prog_STRIP"; then
5806 ac_ct_STRIP=$STRIP
5807 # Extract the first word of "strip", so it can be a program name with args.
5808 set dummy strip; ac_word=$2
5809 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5810 $as_echo_n "checking for $ac_word... " >&6; }
5811 if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
5812 $as_echo_n "(cached) " >&6
5813 else
5814 if test -n "$ac_ct_STRIP"; then
5815 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
5816 else
5817 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5818 for as_dir in $PATH
5819 do
5820 IFS=$as_save_IFS
5821 test -z "$as_dir" && as_dir=.
5822 for ac_exec_ext in '' $ac_executable_extensions; do
5823 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5824 ac_cv_prog_ac_ct_STRIP="strip"
5825 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5826 break 2
5827 fi
5828 done
5829 done
5830 IFS=$as_save_IFS
5831
5832 fi
5833 fi
5834 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
5835 if test -n "$ac_ct_STRIP"; then
5836 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
5837 $as_echo "$ac_ct_STRIP" >&6; }
5838 else
5839 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5840 $as_echo "no" >&6; }
5841 fi
5842
5843 if test "x$ac_ct_STRIP" = x; then
5844 STRIP=":"
5845 else
5846 case $cross_compiling:$ac_tool_warned in
5847 yes:)
5848 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5849 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5850 ac_tool_warned=yes ;;
5851 esac
5852 STRIP=$ac_ct_STRIP
5853 fi
5854 else
5855 STRIP="$ac_cv_prog_STRIP"
5856 fi
5857
5858 test -z "$STRIP" && STRIP=:
5859
5860
5861
5862
5863
5864
5865 if test -n "$ac_tool_prefix"; then
5866 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
5867 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
5868 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5869 $as_echo_n "checking for $ac_word... " >&6; }
5870 if ${ac_cv_prog_RANLIB+:} false; then :
5871 $as_echo_n "(cached) " >&6
5872 else
5873 if test -n "$RANLIB"; then
5874 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
5875 else
5876 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5877 for as_dir in $PATH
5878 do
5879 IFS=$as_save_IFS
5880 test -z "$as_dir" && as_dir=.
5881 for ac_exec_ext in '' $ac_executable_extensions; do
5882 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5883 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
5884 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5885 break 2
5886 fi
5887 done
5888 done
5889 IFS=$as_save_IFS
5890
5891 fi
5892 fi
5893 RANLIB=$ac_cv_prog_RANLIB
5894 if test -n "$RANLIB"; then
5895 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
5896 $as_echo "$RANLIB" >&6; }
5897 else
5898 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5899 $as_echo "no" >&6; }
5900 fi
5901
5902
5903 fi
5904 if test -z "$ac_cv_prog_RANLIB"; then
5905 ac_ct_RANLIB=$RANLIB
5906 # Extract the first word of "ranlib", so it can be a program name with args.
5907 set dummy ranlib; ac_word=$2
5908 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5909 $as_echo_n "checking for $ac_word... " >&6; }
5910 if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
5911 $as_echo_n "(cached) " >&6
5912 else
5913 if test -n "$ac_ct_RANLIB"; then
5914 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
5915 else
5916 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5917 for as_dir in $PATH
5918 do
5919 IFS=$as_save_IFS
5920 test -z "$as_dir" && as_dir=.
5921 for ac_exec_ext in '' $ac_executable_extensions; do
5922 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5923 ac_cv_prog_ac_ct_RANLIB="ranlib"
5924 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5925 break 2
5926 fi
5927 done
5928 done
5929 IFS=$as_save_IFS
5930
5931 fi
5932 fi
5933 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
5934 if test -n "$ac_ct_RANLIB"; then
5935 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
5936 $as_echo "$ac_ct_RANLIB" >&6; }
5937 else
5938 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5939 $as_echo "no" >&6; }
5940 fi
5941
5942 if test "x$ac_ct_RANLIB" = x; then
5943 RANLIB=":"
5944 else
5945 case $cross_compiling:$ac_tool_warned in
5946 yes:)
5947 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5948 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5949 ac_tool_warned=yes ;;
5950 esac
5951 RANLIB=$ac_ct_RANLIB
5952 fi
5953 else
5954 RANLIB="$ac_cv_prog_RANLIB"
5955 fi
5956
5957 test -z "$RANLIB" && RANLIB=:
5958
5959
5960
5961
5962
5963
5964 # Determine commands to create old-style static archives.
5965 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
5966 old_postinstall_cmds='chmod 644 $oldlib'
5967 old_postuninstall_cmds=
5968
5969 if test -n "$RANLIB"; then
5970 case $host_os in
5971 bitrig* | openbsd*)
5972 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
5973 ;;
5974 *)
5975 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
5976 ;;
5977 esac
5978 old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
5979 fi
5980
5981 case $host_os in
5982 darwin*)
5983 lock_old_archive_extraction=yes ;;
5984 *)
5985 lock_old_archive_extraction=no ;;
5986 esac
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008 for ac_prog in gawk mawk nawk awk
6009 do
6010 # Extract the first word of "$ac_prog", so it can be a program name with args.
6011 set dummy $ac_prog; ac_word=$2
6012 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6013 $as_echo_n "checking for $ac_word... " >&6; }
6014 if ${ac_cv_prog_AWK+:} false; then :
6015 $as_echo_n "(cached) " >&6
6016 else
6017 if test -n "$AWK"; then
6018 ac_cv_prog_AWK="$AWK" # Let the user override the test.
6019 else
6020 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6021 for as_dir in $PATH
6022 do
6023 IFS=$as_save_IFS
6024 test -z "$as_dir" && as_dir=.
6025 for ac_exec_ext in '' $ac_executable_extensions; do
6026 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6027 ac_cv_prog_AWK="$ac_prog"
6028 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6029 break 2
6030 fi
6031 done
6032 done
6033 IFS=$as_save_IFS
6034
6035 fi
6036 fi
6037 AWK=$ac_cv_prog_AWK
6038 if test -n "$AWK"; then
6039 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
6040 $as_echo "$AWK" >&6; }
6041 else
6042 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6043 $as_echo "no" >&6; }
6044 fi
6045
6046
6047 test -n "$AWK" && break
6048 done
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068 # If no C compiler was specified, use CC.
6069 LTCC=${LTCC-"$CC"}
6070
6071 # If no C compiler flags were specified, use CFLAGS.
6072 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
6073
6074 # Allow CC to be a program name with arguments.
6075 compiler=$CC
6076
6077
6078 # Check for command to grab the raw symbol name followed by C symbol from nm.
6079 { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
6080 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
6081 if ${lt_cv_sys_global_symbol_pipe+:} false; then :
6082 $as_echo_n "(cached) " >&6
6083 else
6084
6085 # These are sane defaults that work on at least a few old systems.
6086 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
6087
6088 # Character class describing NM global symbol codes.
6089 symcode='[BCDEGRST]'
6090
6091 # Regexp to match symbols that can be accessed directly from C.
6092 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
6093
6094 # Define system-specific variables.
6095 case $host_os in
6096 aix*)
6097 symcode='[BCDT]'
6098 ;;
6099 cygwin* | mingw* | pw32* | cegcc*)
6100 symcode='[ABCDGISTW]'
6101 ;;
6102 hpux*)
6103 if test ia64 = "$host_cpu"; then
6104 symcode='[ABCDEGRST]'
6105 fi
6106 ;;
6107 irix* | nonstopux*)
6108 symcode='[BCDEGRST]'
6109 ;;
6110 osf*)
6111 symcode='[BCDEGQRST]'
6112 ;;
6113 solaris*)
6114 symcode='[BDRT]'
6115 ;;
6116 sco3.2v5*)
6117 symcode='[DT]'
6118 ;;
6119 sysv4.2uw2*)
6120 symcode='[DT]'
6121 ;;
6122 sysv5* | sco5v6* | unixware* | OpenUNIX*)
6123 symcode='[ABDT]'
6124 ;;
6125 sysv4)
6126 symcode='[DFNSTU]'
6127 ;;
6128 esac
6129
6130 # If we're using GNU nm, then use its standard symbol codes.
6131 case `$NM -V 2>&1` in
6132 *GNU* | *'with BFD'*)
6133 symcode='[ABCDGIRSTW]' ;;
6134 esac
6135
6136 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6137 # Gets list of data symbols to import.
6138 lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
6139 # Adjust the below global symbol transforms to fixup imported variables.
6140 lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
6141 lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
6142 lt_c_name_lib_hook="\
6143 -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
6144 -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
6145 else
6146 # Disable hooks by default.
6147 lt_cv_sys_global_symbol_to_import=
6148 lt_cdecl_hook=
6149 lt_c_name_hook=
6150 lt_c_name_lib_hook=
6151 fi
6152
6153 # Transform an extracted symbol line into a proper C declaration.
6154 # Some systems (esp. on ia64) link data and code symbols differently,
6155 # so use this general approach.
6156 lt_cv_sys_global_symbol_to_cdecl="sed -n"\
6157 $lt_cdecl_hook\
6158 " -e 's/^T .* \(.*\)$/extern int \1();/p'"\
6159 " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
6160
6161 # Transform an extracted symbol line into symbol name and symbol address
6162 lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
6163 $lt_c_name_hook\
6164 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
6165 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
6166
6167 # Transform an extracted symbol line into symbol name with lib prefix and
6168 # symbol address.
6169 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
6170 $lt_c_name_lib_hook\
6171 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
6172 " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
6173 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
6174
6175 # Handle CRLF in mingw tool chain
6176 opt_cr=
6177 case $build_os in
6178 mingw*)
6179 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
6180 ;;
6181 esac
6182
6183 # Try without a prefix underscore, then with it.
6184 for ac_symprfx in "" "_"; do
6185
6186 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
6187 symxfrm="\\1 $ac_symprfx\\2 \\2"
6188
6189 # Write the raw and C identifiers.
6190 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6191 # Fake it for dumpbin and say T for any non-static function,
6192 # D for any global variable and I for any imported variable.
6193 # Also find C++ and __fastcall symbols from MSVC++,
6194 # which start with @ or ?.
6195 lt_cv_sys_global_symbol_pipe="$AWK '"\
6196 " {last_section=section; section=\$ 3};"\
6197 " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
6198 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
6199 " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
6200 " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
6201 " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
6202 " \$ 0!~/External *\|/{next};"\
6203 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
6204 " {if(hide[section]) next};"\
6205 " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
6206 " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
6207 " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
6208 " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
6209 " ' prfx=^$ac_symprfx"
6210 else
6211 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
6212 fi
6213 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
6214
6215 # Check to see that the pipe works correctly.
6216 pipe_works=no
6217
6218 rm -f conftest*
6219 cat > conftest.$ac_ext <<_LT_EOF
6220 #ifdef __cplusplus
6221 extern "C" {
6222 #endif
6223 char nm_test_var;
6224 void nm_test_func(void);
6225 void nm_test_func(void){}
6226 #ifdef __cplusplus
6227 }
6228 #endif
6229 int main(){nm_test_var='a';nm_test_func();return(0);}
6230 _LT_EOF
6231
6232 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6233 (eval $ac_compile) 2>&5
6234 ac_status=$?
6235 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6236 test $ac_status = 0; }; then
6237 # Now try to grab the symbols.
6238 nlist=conftest.nm
6239 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
6240 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
6241 ac_status=$?
6242 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6243 test $ac_status = 0; } && test -s "$nlist"; then
6244 # Try sorting and uniquifying the output.
6245 if sort "$nlist" | uniq > "$nlist"T; then
6246 mv -f "$nlist"T "$nlist"
6247 else
6248 rm -f "$nlist"T
6249 fi
6250
6251 # Make sure that we snagged all the symbols we need.
6252 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
6253 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
6254 cat <<_LT_EOF > conftest.$ac_ext
6255 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
6256 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
6257 /* DATA imports from DLLs on WIN32 can't be const, because runtime
6258 relocations are performed -- see ld's documentation on pseudo-relocs. */
6259 # define LT_DLSYM_CONST
6260 #elif defined __osf__
6261 /* This system does not cope well with relocations in const data. */
6262 # define LT_DLSYM_CONST
6263 #else
6264 # define LT_DLSYM_CONST const
6265 #endif
6266
6267 #ifdef __cplusplus
6268 extern "C" {
6269 #endif
6270
6271 _LT_EOF
6272 # Now generate the symbol file.
6273 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
6274
6275 cat <<_LT_EOF >> conftest.$ac_ext
6276
6277 /* The mapping between symbol names and symbols. */
6278 LT_DLSYM_CONST struct {
6279 const char *name;
6280 void *address;
6281 }
6282 lt__PROGRAM__LTX_preloaded_symbols[] =
6283 {
6284 { "@PROGRAM@", (void *) 0 },
6285 _LT_EOF
6286 $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
6287 cat <<\_LT_EOF >> conftest.$ac_ext
6288 {0, (void *) 0}
6289 };
6290
6291 /* This works around a problem in FreeBSD linker */
6292 #ifdef FREEBSD_WORKAROUND
6293 static const void *lt_preloaded_setup() {
6294 return lt__PROGRAM__LTX_preloaded_symbols;
6295 }
6296 #endif
6297
6298 #ifdef __cplusplus
6299 }
6300 #endif
6301 _LT_EOF
6302 # Now try linking the two files.
6303 mv conftest.$ac_objext conftstm.$ac_objext
6304 lt_globsym_save_LIBS=$LIBS
6305 lt_globsym_save_CFLAGS=$CFLAGS
6306 LIBS=conftstm.$ac_objext
6307 CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
6308 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
6309 (eval $ac_link) 2>&5
6310 ac_status=$?
6311 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6312 test $ac_status = 0; } && test -s conftest$ac_exeext; then
6313 pipe_works=yes
6314 fi
6315 LIBS=$lt_globsym_save_LIBS
6316 CFLAGS=$lt_globsym_save_CFLAGS
6317 else
6318 echo "cannot find nm_test_func in $nlist" >&5
6319 fi
6320 else
6321 echo "cannot find nm_test_var in $nlist" >&5
6322 fi
6323 else
6324 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
6325 fi
6326 else
6327 echo "$progname: failed program was:" >&5
6328 cat conftest.$ac_ext >&5
6329 fi
6330 rm -rf conftest* conftst*
6331
6332 # Do not use the global_symbol_pipe unless it works.
6333 if test yes = "$pipe_works"; then
6334 break
6335 else
6336 lt_cv_sys_global_symbol_pipe=
6337 fi
6338 done
6339
6340 fi
6341
6342 if test -z "$lt_cv_sys_global_symbol_pipe"; then
6343 lt_cv_sys_global_symbol_to_cdecl=
6344 fi
6345 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
6346 { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
6347 $as_echo "failed" >&6; }
6348 else
6349 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
6350 $as_echo "ok" >&6; }
6351 fi
6352
6353 # Response file support.
6354 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6355 nm_file_list_spec='@'
6356 elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
6357 nm_file_list_spec='@'
6358 fi
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
6397 $as_echo_n "checking for sysroot... " >&6; }
6398
6399 # Check whether --with-sysroot was given.
6400 if test "${with_sysroot+set}" = set; then :
6401 withval=$with_sysroot;
6402 else
6403 with_sysroot=no
6404 fi
6405
6406
6407 lt_sysroot=
6408 case $with_sysroot in #(
6409 yes)
6410 if test yes = "$GCC"; then
6411 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
6412 fi
6413 ;; #(
6414 /*)
6415 lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
6416 ;; #(
6417 no|'')
6418 ;; #(
6419 *)
6420 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
6421 $as_echo "$with_sysroot" >&6; }
6422 as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
6423 ;;
6424 esac
6425
6426 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
6427 $as_echo "${lt_sysroot:-no}" >&6; }
6428
6429
6430
6431
6432
6433 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
6434 $as_echo_n "checking for a working dd... " >&6; }
6435 if ${ac_cv_path_lt_DD+:} false; then :
6436 $as_echo_n "(cached) " >&6
6437 else
6438 printf 0123456789abcdef0123456789abcdef >conftest.i
6439 cat conftest.i conftest.i >conftest2.i
6440 : ${lt_DD:=$DD}
6441 if test -z "$lt_DD"; then
6442 ac_path_lt_DD_found=false
6443 # Loop through the user's path and test for each of PROGNAME-LIST
6444 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6445 for as_dir in $PATH
6446 do
6447 IFS=$as_save_IFS
6448 test -z "$as_dir" && as_dir=.
6449 for ac_prog in dd; do
6450 for ac_exec_ext in '' $ac_executable_extensions; do
6451 ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
6452 as_fn_executable_p "$ac_path_lt_DD" || continue
6453 if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6454 cmp -s conftest.i conftest.out \
6455 && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
6456 fi
6457 $ac_path_lt_DD_found && break 3
6458 done
6459 done
6460 done
6461 IFS=$as_save_IFS
6462 if test -z "$ac_cv_path_lt_DD"; then
6463 :
6464 fi
6465 else
6466 ac_cv_path_lt_DD=$lt_DD
6467 fi
6468
6469 rm -f conftest.i conftest2.i conftest.out
6470 fi
6471 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
6472 $as_echo "$ac_cv_path_lt_DD" >&6; }
6473
6474
6475 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
6476 $as_echo_n "checking how to truncate binary pipes... " >&6; }
6477 if ${lt_cv_truncate_bin+:} false; then :
6478 $as_echo_n "(cached) " >&6
6479 else
6480 printf 0123456789abcdef0123456789abcdef >conftest.i
6481 cat conftest.i conftest.i >conftest2.i
6482 lt_cv_truncate_bin=
6483 if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6484 cmp -s conftest.i conftest.out \
6485 && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
6486 fi
6487 rm -f conftest.i conftest2.i conftest.out
6488 test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
6489 fi
6490 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
6491 $as_echo "$lt_cv_truncate_bin" >&6; }
6492
6493
6494
6495
6496
6497
6498
6499 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
6500 func_cc_basename ()
6501 {
6502 for cc_temp in $*""; do
6503 case $cc_temp in
6504 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
6505 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
6506 \-*) ;;
6507 *) break;;
6508 esac
6509 done
6510 func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
6511 }
6512
6513 # Check whether --enable-libtool-lock was given.
6514 if test "${enable_libtool_lock+set}" = set; then :
6515 enableval=$enable_libtool_lock;
6516 fi
6517
6518 test no = "$enable_libtool_lock" || enable_libtool_lock=yes
6519
6520 # Some flags need to be propagated to the compiler or linker for good
6521 # libtool support.
6522 case $host in
6523 ia64-*-hpux*)
6524 # Find out what ABI is being produced by ac_compile, and set mode
6525 # options accordingly.
6526 echo 'int i;' > conftest.$ac_ext
6527 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6528 (eval $ac_compile) 2>&5
6529 ac_status=$?
6530 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6531 test $ac_status = 0; }; then
6532 case `/usr/bin/file conftest.$ac_objext` in
6533 *ELF-32*)
6534 HPUX_IA64_MODE=32
6535 ;;
6536 *ELF-64*)
6537 HPUX_IA64_MODE=64
6538 ;;
6539 esac
6540 fi
6541 rm -rf conftest*
6542 ;;
6543 *-*-irix6*)
6544 # Find out what ABI is being produced by ac_compile, and set linker
6545 # options accordingly.
6546 echo '#line '$LINENO' "configure"' > conftest.$ac_ext
6547 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6548 (eval $ac_compile) 2>&5
6549 ac_status=$?
6550 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6551 test $ac_status = 0; }; then
6552 if test yes = "$lt_cv_prog_gnu_ld"; then
6553 case `/usr/bin/file conftest.$ac_objext` in
6554 *32-bit*)
6555 LD="${LD-ld} -melf32bsmip"
6556 ;;
6557 *N32*)
6558 LD="${LD-ld} -melf32bmipn32"
6559 ;;
6560 *64-bit*)
6561 LD="${LD-ld} -melf64bmip"
6562 ;;
6563 esac
6564 else
6565 case `/usr/bin/file conftest.$ac_objext` in
6566 *32-bit*)
6567 LD="${LD-ld} -32"
6568 ;;
6569 *N32*)
6570 LD="${LD-ld} -n32"
6571 ;;
6572 *64-bit*)
6573 LD="${LD-ld} -64"
6574 ;;
6575 esac
6576 fi
6577 fi
6578 rm -rf conftest*
6579 ;;
6580
6581 mips64*-*linux*)
6582 # Find out what ABI is being produced by ac_compile, and set linker
6583 # options accordingly.
6584 echo '#line '$LINENO' "configure"' > conftest.$ac_ext
6585 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6586 (eval $ac_compile) 2>&5
6587 ac_status=$?
6588 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6589 test $ac_status = 0; }; then
6590 emul=elf
6591 case `/usr/bin/file conftest.$ac_objext` in
6592 *32-bit*)
6593 emul="${emul}32"
6594 ;;
6595 *64-bit*)
6596 emul="${emul}64"
6597 ;;
6598 esac
6599 case `/usr/bin/file conftest.$ac_objext` in
6600 *MSB*)
6601 emul="${emul}btsmip"
6602 ;;
6603 *LSB*)
6604 emul="${emul}ltsmip"
6605 ;;
6606 esac
6607 case `/usr/bin/file conftest.$ac_objext` in
6608 *N32*)
6609 emul="${emul}n32"
6610 ;;
6611 esac
6612 LD="${LD-ld} -m $emul"
6613 fi
6614 rm -rf conftest*
6615 ;;
6616
6617 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
6618 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
6619 # Find out what ABI is being produced by ac_compile, and set linker
6620 # options accordingly. Note that the listed cases only cover the
6621 # situations where additional linker options are needed (such as when
6622 # doing 32-bit compilation for a host where ld defaults to 64-bit, or
6623 # vice versa); the common cases where no linker options are needed do
6624 # not appear in the list.
6625 echo 'int i;' > conftest.$ac_ext
6626 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6627 (eval $ac_compile) 2>&5
6628 ac_status=$?
6629 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6630 test $ac_status = 0; }; then
6631 case `/usr/bin/file conftest.o` in
6632 *32-bit*)
6633 case $host in
6634 x86_64-*kfreebsd*-gnu)
6635 LD="${LD-ld} -m elf_i386_fbsd"
6636 ;;
6637 x86_64-*linux*)
6638 case `/usr/bin/file conftest.o` in
6639 *x86-64*)
6640 LD="${LD-ld} -m elf32_x86_64"
6641 ;;
6642 *)
6643 LD="${LD-ld} -m elf_i386"
6644 ;;
6645 esac
6646 ;;
6647 powerpc64le-*linux*)
6648 LD="${LD-ld} -m elf32lppclinux"
6649 ;;
6650 powerpc64-*linux*)
6651 LD="${LD-ld} -m elf32ppclinux"
6652 ;;
6653 s390x-*linux*)
6654 LD="${LD-ld} -m elf_s390"
6655 ;;
6656 sparc64-*linux*)
6657 LD="${LD-ld} -m elf32_sparc"
6658 ;;
6659 esac
6660 ;;
6661 *64-bit*)
6662 case $host in
6663 x86_64-*kfreebsd*-gnu)
6664 LD="${LD-ld} -m elf_x86_64_fbsd"
6665 ;;
6666 x86_64-*linux*)
6667 LD="${LD-ld} -m elf_x86_64"
6668 ;;
6669 powerpcle-*linux*)
6670 LD="${LD-ld} -m elf64lppc"
6671 ;;
6672 powerpc-*linux*)
6673 LD="${LD-ld} -m elf64ppc"
6674 ;;
6675 s390*-*linux*|s390*-*tpf*)
6676 LD="${LD-ld} -m elf64_s390"
6677 ;;
6678 sparc*-*linux*)
6679 LD="${LD-ld} -m elf64_sparc"
6680 ;;
6681 esac
6682 ;;
6683 esac
6684 fi
6685 rm -rf conftest*
6686 ;;
6687
6688 *-*-sco3.2v5*)
6689 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
6690 SAVE_CFLAGS=$CFLAGS
6691 CFLAGS="$CFLAGS -belf"
6692 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
6693 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
6694 if ${lt_cv_cc_needs_belf+:} false; then :
6695 $as_echo_n "(cached) " >&6
6696 else
6697 ac_ext=c
6698 ac_cpp='$CPP $CPPFLAGS'
6699 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6700 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6701 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6702
6703 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6704 /* end confdefs.h. */
6705
6706 int
6707 main ()
6708 {
6709
6710 ;
6711 return 0;
6712 }
6713 _ACEOF
6714 if ac_fn_c_try_link "$LINENO"; then :
6715 lt_cv_cc_needs_belf=yes
6716 else
6717 lt_cv_cc_needs_belf=no
6718 fi
6719 rm -f core conftest.err conftest.$ac_objext \
6720 conftest$ac_exeext conftest.$ac_ext
6721 ac_ext=c
6722 ac_cpp='$CPP $CPPFLAGS'
6723 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6724 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6725 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6726
6727 fi
6728 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
6729 $as_echo "$lt_cv_cc_needs_belf" >&6; }
6730 if test yes != "$lt_cv_cc_needs_belf"; then
6731 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
6732 CFLAGS=$SAVE_CFLAGS
6733 fi
6734 ;;
6735 *-*solaris*)
6736 # Find out what ABI is being produced by ac_compile, and set linker
6737 # options accordingly.
6738 echo 'int i;' > conftest.$ac_ext
6739 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6740 (eval $ac_compile) 2>&5
6741 ac_status=$?
6742 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6743 test $ac_status = 0; }; then
6744 case `/usr/bin/file conftest.o` in
6745 *64-bit*)
6746 case $lt_cv_prog_gnu_ld in
6747 yes*)
6748 case $host in
6749 i?86-*-solaris*|x86_64-*-solaris*)
6750 LD="${LD-ld} -m elf_x86_64"
6751 ;;
6752 sparc*-*-solaris*)
6753 LD="${LD-ld} -m elf64_sparc"
6754 ;;
6755 esac
6756 # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
6757 if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
6758 LD=${LD-ld}_sol2
6759 fi
6760 ;;
6761 *)
6762 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
6763 LD="${LD-ld} -64"
6764 fi
6765 ;;
6766 esac
6767 ;;
6768 esac
6769 fi
6770 rm -rf conftest*
6771 ;;
6772 esac
6773
6774 need_locks=$enable_libtool_lock
6775
6776 if test -n "$ac_tool_prefix"; then
6777 # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
6778 set dummy ${ac_tool_prefix}mt; ac_word=$2
6779 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6780 $as_echo_n "checking for $ac_word... " >&6; }
6781 if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
6782 $as_echo_n "(cached) " >&6
6783 else
6784 if test -n "$MANIFEST_TOOL"; then
6785 ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
6786 else
6787 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6788 for as_dir in $PATH
6789 do
6790 IFS=$as_save_IFS
6791 test -z "$as_dir" && as_dir=.
6792 for ac_exec_ext in '' $ac_executable_extensions; do
6793 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6794 ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
6795 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6796 break 2
6797 fi
6798 done
6799 done
6800 IFS=$as_save_IFS
6801
6802 fi
6803 fi
6804 MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
6805 if test -n "$MANIFEST_TOOL"; then
6806 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
6807 $as_echo "$MANIFEST_TOOL" >&6; }
6808 else
6809 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6810 $as_echo "no" >&6; }
6811 fi
6812
6813
6814 fi
6815 if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
6816 ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
6817 # Extract the first word of "mt", so it can be a program name with args.
6818 set dummy mt; ac_word=$2
6819 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6820 $as_echo_n "checking for $ac_word... " >&6; }
6821 if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
6822 $as_echo_n "(cached) " >&6
6823 else
6824 if test -n "$ac_ct_MANIFEST_TOOL"; then
6825 ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
6826 else
6827 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6828 for as_dir in $PATH
6829 do
6830 IFS=$as_save_IFS
6831 test -z "$as_dir" && as_dir=.
6832 for ac_exec_ext in '' $ac_executable_extensions; do
6833 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6834 ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
6835 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6836 break 2
6837 fi
6838 done
6839 done
6840 IFS=$as_save_IFS
6841
6842 fi
6843 fi
6844 ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
6845 if test -n "$ac_ct_MANIFEST_TOOL"; then
6846 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
6847 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
6848 else
6849 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6850 $as_echo "no" >&6; }
6851 fi
6852
6853 if test "x$ac_ct_MANIFEST_TOOL" = x; then
6854 MANIFEST_TOOL=":"
6855 else
6856 case $cross_compiling:$ac_tool_warned in
6857 yes:)
6858 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6859 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6860 ac_tool_warned=yes ;;
6861 esac
6862 MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
6863 fi
6864 else
6865 MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
6866 fi
6867
6868 test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
6869 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
6870 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
6871 if ${lt_cv_path_mainfest_tool+:} false; then :
6872 $as_echo_n "(cached) " >&6
6873 else
6874 lt_cv_path_mainfest_tool=no
6875 echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
6876 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
6877 cat conftest.err >&5
6878 if $GREP 'Manifest Tool' conftest.out > /dev/null; then
6879 lt_cv_path_mainfest_tool=yes
6880 fi
6881 rm -f conftest*
6882 fi
6883 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
6884 $as_echo "$lt_cv_path_mainfest_tool" >&6; }
6885 if test yes != "$lt_cv_path_mainfest_tool"; then
6886 MANIFEST_TOOL=:
6887 fi
6888
6889
6890
6891
6892
6893
6894 case $host_os in
6895 rhapsody* | darwin*)
6896 if test -n "$ac_tool_prefix"; then
6897 # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
6898 set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
6899 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6900 $as_echo_n "checking for $ac_word... " >&6; }
6901 if ${ac_cv_prog_DSYMUTIL+:} false; then :
6902 $as_echo_n "(cached) " >&6
6903 else
6904 if test -n "$DSYMUTIL"; then
6905 ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
6906 else
6907 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6908 for as_dir in $PATH
6909 do
6910 IFS=$as_save_IFS
6911 test -z "$as_dir" && as_dir=.
6912 for ac_exec_ext in '' $ac_executable_extensions; do
6913 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6914 ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
6915 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6916 break 2
6917 fi
6918 done
6919 done
6920 IFS=$as_save_IFS
6921
6922 fi
6923 fi
6924 DSYMUTIL=$ac_cv_prog_DSYMUTIL
6925 if test -n "$DSYMUTIL"; then
6926 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
6927 $as_echo "$DSYMUTIL" >&6; }
6928 else
6929 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6930 $as_echo "no" >&6; }
6931 fi
6932
6933
6934 fi
6935 if test -z "$ac_cv_prog_DSYMUTIL"; then
6936 ac_ct_DSYMUTIL=$DSYMUTIL
6937 # Extract the first word of "dsymutil", so it can be a program name with args.
6938 set dummy dsymutil; ac_word=$2
6939 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6940 $as_echo_n "checking for $ac_word... " >&6; }
6941 if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
6942 $as_echo_n "(cached) " >&6
6943 else
6944 if test -n "$ac_ct_DSYMUTIL"; then
6945 ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
6946 else
6947 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6948 for as_dir in $PATH
6949 do
6950 IFS=$as_save_IFS
6951 test -z "$as_dir" && as_dir=.
6952 for ac_exec_ext in '' $ac_executable_extensions; do
6953 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6954 ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
6955 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6956 break 2
6957 fi
6958 done
6959 done
6960 IFS=$as_save_IFS
6961
6962 fi
6963 fi
6964 ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
6965 if test -n "$ac_ct_DSYMUTIL"; then
6966 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
6967 $as_echo "$ac_ct_DSYMUTIL" >&6; }
6968 else
6969 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6970 $as_echo "no" >&6; }
6971 fi
6972
6973 if test "x$ac_ct_DSYMUTIL" = x; then
6974 DSYMUTIL=":"
6975 else
6976 case $cross_compiling:$ac_tool_warned in
6977 yes:)
6978 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6979 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6980 ac_tool_warned=yes ;;
6981 esac
6982 DSYMUTIL=$ac_ct_DSYMUTIL
6983 fi
6984 else
6985 DSYMUTIL="$ac_cv_prog_DSYMUTIL"
6986 fi
6987
6988 if test -n "$ac_tool_prefix"; then
6989 # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
6990 set dummy ${ac_tool_prefix}nmedit; ac_word=$2
6991 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6992 $as_echo_n "checking for $ac_word... " >&6; }
6993 if ${ac_cv_prog_NMEDIT+:} false; then :
6994 $as_echo_n "(cached) " >&6
6995 else
6996 if test -n "$NMEDIT"; then
6997 ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
6998 else
6999 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7000 for as_dir in $PATH
7001 do
7002 IFS=$as_save_IFS
7003 test -z "$as_dir" && as_dir=.
7004 for ac_exec_ext in '' $ac_executable_extensions; do
7005 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7006 ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
7007 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7008 break 2
7009 fi
7010 done
7011 done
7012 IFS=$as_save_IFS
7013
7014 fi
7015 fi
7016 NMEDIT=$ac_cv_prog_NMEDIT
7017 if test -n "$NMEDIT"; then
7018 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
7019 $as_echo "$NMEDIT" >&6; }
7020 else
7021 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7022 $as_echo "no" >&6; }
7023 fi
7024
7025
7026 fi
7027 if test -z "$ac_cv_prog_NMEDIT"; then
7028 ac_ct_NMEDIT=$NMEDIT
7029 # Extract the first word of "nmedit", so it can be a program name with args.
7030 set dummy nmedit; ac_word=$2
7031 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7032 $as_echo_n "checking for $ac_word... " >&6; }
7033 if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
7034 $as_echo_n "(cached) " >&6
7035 else
7036 if test -n "$ac_ct_NMEDIT"; then
7037 ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
7038 else
7039 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7040 for as_dir in $PATH
7041 do
7042 IFS=$as_save_IFS
7043 test -z "$as_dir" && as_dir=.
7044 for ac_exec_ext in '' $ac_executable_extensions; do
7045 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7046 ac_cv_prog_ac_ct_NMEDIT="nmedit"
7047 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7048 break 2
7049 fi
7050 done
7051 done
7052 IFS=$as_save_IFS
7053
7054 fi
7055 fi
7056 ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
7057 if test -n "$ac_ct_NMEDIT"; then
7058 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
7059 $as_echo "$ac_ct_NMEDIT" >&6; }
7060 else
7061 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7062 $as_echo "no" >&6; }
7063 fi
7064
7065 if test "x$ac_ct_NMEDIT" = x; then
7066 NMEDIT=":"
7067 else
7068 case $cross_compiling:$ac_tool_warned in
7069 yes:)
7070 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7071 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7072 ac_tool_warned=yes ;;
7073 esac
7074 NMEDIT=$ac_ct_NMEDIT
7075 fi
7076 else
7077 NMEDIT="$ac_cv_prog_NMEDIT"
7078 fi
7079
7080 if test -n "$ac_tool_prefix"; then
7081 # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
7082 set dummy ${ac_tool_prefix}lipo; ac_word=$2
7083 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7084 $as_echo_n "checking for $ac_word... " >&6; }
7085 if ${ac_cv_prog_LIPO+:} false; then :
7086 $as_echo_n "(cached) " >&6
7087 else
7088 if test -n "$LIPO"; then
7089 ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
7090 else
7091 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7092 for as_dir in $PATH
7093 do
7094 IFS=$as_save_IFS
7095 test -z "$as_dir" && as_dir=.
7096 for ac_exec_ext in '' $ac_executable_extensions; do
7097 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7098 ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
7099 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7100 break 2
7101 fi
7102 done
7103 done
7104 IFS=$as_save_IFS
7105
7106 fi
7107 fi
7108 LIPO=$ac_cv_prog_LIPO
7109 if test -n "$LIPO"; then
7110 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
7111 $as_echo "$LIPO" >&6; }
7112 else
7113 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7114 $as_echo "no" >&6; }
7115 fi
7116
7117
7118 fi
7119 if test -z "$ac_cv_prog_LIPO"; then
7120 ac_ct_LIPO=$LIPO
7121 # Extract the first word of "lipo", so it can be a program name with args.
7122 set dummy lipo; ac_word=$2
7123 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7124 $as_echo_n "checking for $ac_word... " >&6; }
7125 if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
7126 $as_echo_n "(cached) " >&6
7127 else
7128 if test -n "$ac_ct_LIPO"; then
7129 ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
7130 else
7131 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7132 for as_dir in $PATH
7133 do
7134 IFS=$as_save_IFS
7135 test -z "$as_dir" && as_dir=.
7136 for ac_exec_ext in '' $ac_executable_extensions; do
7137 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7138 ac_cv_prog_ac_ct_LIPO="lipo"
7139 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7140 break 2
7141 fi
7142 done
7143 done
7144 IFS=$as_save_IFS
7145
7146 fi
7147 fi
7148 ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
7149 if test -n "$ac_ct_LIPO"; then
7150 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
7151 $as_echo "$ac_ct_LIPO" >&6; }
7152 else
7153 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7154 $as_echo "no" >&6; }
7155 fi
7156
7157 if test "x$ac_ct_LIPO" = x; then
7158 LIPO=":"
7159 else
7160 case $cross_compiling:$ac_tool_warned in
7161 yes:)
7162 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7163 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7164 ac_tool_warned=yes ;;
7165 esac
7166 LIPO=$ac_ct_LIPO
7167 fi
7168 else
7169 LIPO="$ac_cv_prog_LIPO"
7170 fi
7171
7172 if test -n "$ac_tool_prefix"; then
7173 # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
7174 set dummy ${ac_tool_prefix}otool; ac_word=$2
7175 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7176 $as_echo_n "checking for $ac_word... " >&6; }
7177 if ${ac_cv_prog_OTOOL+:} false; then :
7178 $as_echo_n "(cached) " >&6
7179 else
7180 if test -n "$OTOOL"; then
7181 ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
7182 else
7183 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7184 for as_dir in $PATH
7185 do
7186 IFS=$as_save_IFS
7187 test -z "$as_dir" && as_dir=.
7188 for ac_exec_ext in '' $ac_executable_extensions; do
7189 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7190 ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
7191 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7192 break 2
7193 fi
7194 done
7195 done
7196 IFS=$as_save_IFS
7197
7198 fi
7199 fi
7200 OTOOL=$ac_cv_prog_OTOOL
7201 if test -n "$OTOOL"; then
7202 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
7203 $as_echo "$OTOOL" >&6; }
7204 else
7205 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7206 $as_echo "no" >&6; }
7207 fi
7208
7209
7210 fi
7211 if test -z "$ac_cv_prog_OTOOL"; then
7212 ac_ct_OTOOL=$OTOOL
7213 # Extract the first word of "otool", so it can be a program name with args.
7214 set dummy otool; ac_word=$2
7215 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7216 $as_echo_n "checking for $ac_word... " >&6; }
7217 if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
7218 $as_echo_n "(cached) " >&6
7219 else
7220 if test -n "$ac_ct_OTOOL"; then
7221 ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
7222 else
7223 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7224 for as_dir in $PATH
7225 do
7226 IFS=$as_save_IFS
7227 test -z "$as_dir" && as_dir=.
7228 for ac_exec_ext in '' $ac_executable_extensions; do
7229 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7230 ac_cv_prog_ac_ct_OTOOL="otool"
7231 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7232 break 2
7233 fi
7234 done
7235 done
7236 IFS=$as_save_IFS
7237
7238 fi
7239 fi
7240 ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
7241 if test -n "$ac_ct_OTOOL"; then
7242 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
7243 $as_echo "$ac_ct_OTOOL" >&6; }
7244 else
7245 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7246 $as_echo "no" >&6; }
7247 fi
7248
7249 if test "x$ac_ct_OTOOL" = x; then
7250 OTOOL=":"
7251 else
7252 case $cross_compiling:$ac_tool_warned in
7253 yes:)
7254 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7255 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7256 ac_tool_warned=yes ;;
7257 esac
7258 OTOOL=$ac_ct_OTOOL
7259 fi
7260 else
7261 OTOOL="$ac_cv_prog_OTOOL"
7262 fi
7263
7264 if test -n "$ac_tool_prefix"; then
7265 # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
7266 set dummy ${ac_tool_prefix}otool64; ac_word=$2
7267 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7268 $as_echo_n "checking for $ac_word... " >&6; }
7269 if ${ac_cv_prog_OTOOL64+:} false; then :
7270 $as_echo_n "(cached) " >&6
7271 else
7272 if test -n "$OTOOL64"; then
7273 ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
7274 else
7275 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7276 for as_dir in $PATH
7277 do
7278 IFS=$as_save_IFS
7279 test -z "$as_dir" && as_dir=.
7280 for ac_exec_ext in '' $ac_executable_extensions; do
7281 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7282 ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
7283 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7284 break 2
7285 fi
7286 done
7287 done
7288 IFS=$as_save_IFS
7289
7290 fi
7291 fi
7292 OTOOL64=$ac_cv_prog_OTOOL64
7293 if test -n "$OTOOL64"; then
7294 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
7295 $as_echo "$OTOOL64" >&6; }
7296 else
7297 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7298 $as_echo "no" >&6; }
7299 fi
7300
7301
7302 fi
7303 if test -z "$ac_cv_prog_OTOOL64"; then
7304 ac_ct_OTOOL64=$OTOOL64
7305 # Extract the first word of "otool64", so it can be a program name with args.
7306 set dummy otool64; ac_word=$2
7307 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7308 $as_echo_n "checking for $ac_word... " >&6; }
7309 if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
7310 $as_echo_n "(cached) " >&6
7311 else
7312 if test -n "$ac_ct_OTOOL64"; then
7313 ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
7314 else
7315 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7316 for as_dir in $PATH
7317 do
7318 IFS=$as_save_IFS
7319 test -z "$as_dir" && as_dir=.
7320 for ac_exec_ext in '' $ac_executable_extensions; do
7321 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7322 ac_cv_prog_ac_ct_OTOOL64="otool64"
7323 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7324 break 2
7325 fi
7326 done
7327 done
7328 IFS=$as_save_IFS
7329
7330 fi
7331 fi
7332 ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
7333 if test -n "$ac_ct_OTOOL64"; then
7334 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
7335 $as_echo "$ac_ct_OTOOL64" >&6; }
7336 else
7337 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7338 $as_echo "no" >&6; }
7339 fi
7340
7341 if test "x$ac_ct_OTOOL64" = x; then
7342 OTOOL64=":"
7343 else
7344 case $cross_compiling:$ac_tool_warned in
7345 yes:)
7346 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7347 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7348 ac_tool_warned=yes ;;
7349 esac
7350 OTOOL64=$ac_ct_OTOOL64
7351 fi
7352 else
7353 OTOOL64="$ac_cv_prog_OTOOL64"
7354 fi
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
7383 $as_echo_n "checking for -single_module linker flag... " >&6; }
7384 if ${lt_cv_apple_cc_single_mod+:} false; then :
7385 $as_echo_n "(cached) " >&6
7386 else
7387 lt_cv_apple_cc_single_mod=no
7388 if test -z "$LT_MULTI_MODULE"; then
7389 # By default we will add the -single_module flag. You can override
7390 # by either setting the environment variable LT_MULTI_MODULE
7391 # non-empty at configure time, or by adding -multi_module to the
7392 # link flags.
7393 rm -rf libconftest.dylib*
7394 echo "int foo(void){return 1;}" > conftest.c
7395 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
7396 -dynamiclib -Wl,-single_module conftest.c" >&5
7397 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
7398 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
7399 _lt_result=$?
7400 # If there is a non-empty error log, and "single_module"
7401 # appears in it, assume the flag caused a linker warning
7402 if test -s conftest.err && $GREP single_module conftest.err; then
7403 cat conftest.err >&5
7404 # Otherwise, if the output was created with a 0 exit code from
7405 # the compiler, it worked.
7406 elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
7407 lt_cv_apple_cc_single_mod=yes
7408 else
7409 cat conftest.err >&5
7410 fi
7411 rm -rf libconftest.dylib*
7412 rm -f conftest.*
7413 fi
7414 fi
7415 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
7416 $as_echo "$lt_cv_apple_cc_single_mod" >&6; }
7417
7418 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
7419 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
7420 if ${lt_cv_ld_exported_symbols_list+:} false; then :
7421 $as_echo_n "(cached) " >&6
7422 else
7423 lt_cv_ld_exported_symbols_list=no
7424 save_LDFLAGS=$LDFLAGS
7425 echo "_main" > conftest.sym
7426 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
7427 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7428 /* end confdefs.h. */
7429
7430 int
7431 main ()
7432 {
7433
7434 ;
7435 return 0;
7436 }
7437 _ACEOF
7438 if ac_fn_c_try_link "$LINENO"; then :
7439 lt_cv_ld_exported_symbols_list=yes
7440 else
7441 lt_cv_ld_exported_symbols_list=no
7442 fi
7443 rm -f core conftest.err conftest.$ac_objext \
7444 conftest$ac_exeext conftest.$ac_ext
7445 LDFLAGS=$save_LDFLAGS
7446
7447 fi
7448 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
7449 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
7450
7451 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
7452 $as_echo_n "checking for -force_load linker flag... " >&6; }
7453 if ${lt_cv_ld_force_load+:} false; then :
7454 $as_echo_n "(cached) " >&6
7455 else
7456 lt_cv_ld_force_load=no
7457 cat > conftest.c << _LT_EOF
7458 int forced_loaded() { return 2;}
7459 _LT_EOF
7460 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
7461 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
7462 echo "$AR cru libconftest.a conftest.o" >&5
7463 $AR cru libconftest.a conftest.o 2>&5
7464 echo "$RANLIB libconftest.a" >&5
7465 $RANLIB libconftest.a 2>&5
7466 cat > conftest.c << _LT_EOF
7467 int main() { return 0;}
7468 _LT_EOF
7469 echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
7470 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
7471 _lt_result=$?
7472 if test -s conftest.err && $GREP force_load conftest.err; then
7473 cat conftest.err >&5
7474 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
7475 lt_cv_ld_force_load=yes
7476 else
7477 cat conftest.err >&5
7478 fi
7479 rm -f conftest.err libconftest.a conftest conftest.c
7480 rm -rf conftest.dSYM
7481
7482 fi
7483 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
7484 $as_echo "$lt_cv_ld_force_load" >&6; }
7485 case $host_os in
7486 rhapsody* | darwin1.[012])
7487 _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
7488 darwin1.*)
7489 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
7490 darwin*) # darwin 5.x on
7491 # if running on 10.5 or later, the deployment target defaults
7492 # to the OS version, if on x86, and 10.4, the deployment
7493 # target defaults to 10.4. Don't you love it?
7494 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
7495 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
7496 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
7497 10.[012][,.]*)
7498 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
7499 10.*)
7500 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
7501 esac
7502 ;;
7503 esac
7504 if test yes = "$lt_cv_apple_cc_single_mod"; then
7505 _lt_dar_single_mod='$single_module'
7506 fi
7507 if test yes = "$lt_cv_ld_exported_symbols_list"; then
7508 _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
7509 else
7510 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
7511 fi
7512 if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
7513 _lt_dsymutil='~$DSYMUTIL $lib || :'
7514 else
7515 _lt_dsymutil=
7516 fi
7517 ;;
7518 esac
7519
7520 # func_munge_path_list VARIABLE PATH
7521 # -----------------------------------
7522 # VARIABLE is name of variable containing _space_ separated list of
7523 # directories to be munged by the contents of PATH, which is string
7524 # having a format:
7525 # "DIR[:DIR]:"
7526 # string "DIR[ DIR]" will be prepended to VARIABLE
7527 # ":DIR[:DIR]"
7528 # string "DIR[ DIR]" will be appended to VARIABLE
7529 # "DIRP[:DIRP]::[DIRA:]DIRA"
7530 # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
7531 # "DIRA[ DIRA]" will be appended to VARIABLE
7532 # "DIR[:DIR]"
7533 # VARIABLE will be replaced by "DIR[ DIR]"
7534 func_munge_path_list ()
7535 {
7536 case x$2 in
7537 x)
7538 ;;
7539 *:)
7540 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
7541 ;;
7542 x:*)
7543 eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
7544 ;;
7545 *::*)
7546 eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
7547 eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
7548 ;;
7549 *)
7550 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
7551 ;;
7552 esac
7553 }
7554
7555
7556 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
7557 $as_echo_n "checking for ANSI C header files... " >&6; }
7558 if ${ac_cv_header_stdc+:} false; then :
7559 $as_echo_n "(cached) " >&6
7560 else
7561 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7562 /* end confdefs.h. */
7563 #include <stdlib.h>
7564 #include <stdarg.h>
7565 #include <string.h>
7566 #include <float.h>
7567
7568 int
7569 main ()
7570 {
7571
7572 ;
7573 return 0;
7574 }
7575 _ACEOF
7576 if ac_fn_c_try_compile "$LINENO"; then :
7577 ac_cv_header_stdc=yes
7578 else
7579 ac_cv_header_stdc=no
7580 fi
7581 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7582
7583 if test $ac_cv_header_stdc = yes; then
7584 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
7585 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7586 /* end confdefs.h. */
7587 #include <string.h>
7588
7589 _ACEOF
7590 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7591 $EGREP "memchr" >/dev/null 2>&1; then :
7592
7593 else
7594 ac_cv_header_stdc=no
7595 fi
7596 rm -f conftest*
7597
7598 fi
7599
7600 if test $ac_cv_header_stdc = yes; then
7601 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
7602 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7603 /* end confdefs.h. */
7604 #include <stdlib.h>
7605
7606 _ACEOF
7607 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7608 $EGREP "free" >/dev/null 2>&1; then :
7609
7610 else
7611 ac_cv_header_stdc=no
7612 fi
7613 rm -f conftest*
7614
7615 fi
7616
7617 if test $ac_cv_header_stdc = yes; then
7618 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
7619 if test "$cross_compiling" = yes; then :
7620 :
7621 else
7622 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7623 /* end confdefs.h. */
7624 #include <ctype.h>
7625 #include <stdlib.h>
7626 #if ((' ' & 0x0FF) == 0x020)
7627 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
7628 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
7629 #else
7630 # define ISLOWER(c) \
7631 (('a' <= (c) && (c) <= 'i') \
7632 || ('j' <= (c) && (c) <= 'r') \
7633 || ('s' <= (c) && (c) <= 'z'))
7634 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
7635 #endif
7636
7637 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
7638 int
7639 main ()
7640 {
7641 int i;
7642 for (i = 0; i < 256; i++)
7643 if (XOR (islower (i), ISLOWER (i))
7644 || toupper (i) != TOUPPER (i))
7645 return 2;
7646 return 0;
7647 }
7648 _ACEOF
7649 if ac_fn_c_try_run "$LINENO"; then :
7650
7651 else
7652 ac_cv_header_stdc=no
7653 fi
7654 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7655 conftest.$ac_objext conftest.beam conftest.$ac_ext
7656 fi
7657
7658 fi
7659 fi
7660 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
7661 $as_echo "$ac_cv_header_stdc" >&6; }
7662 if test $ac_cv_header_stdc = yes; then
7663
7664 $as_echo "#define STDC_HEADERS 1" >>confdefs.h
7665
7666 fi
7667
7668 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
7669 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
7670 inttypes.h stdint.h unistd.h
7671 do :
7672 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7673 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
7674 "
7675 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7676 cat >>confdefs.h <<_ACEOF
7677 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7678 _ACEOF
7679
7680 fi
7681
7682 done
7683
7684
7685 for ac_header in dlfcn.h
7686 do :
7687 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
7688 "
7689 if test "x$ac_cv_header_dlfcn_h" = xyes; then :
7690 cat >>confdefs.h <<_ACEOF
7691 #define HAVE_DLFCN_H 1
7692 _ACEOF
7693
7694 fi
7695
7696 done
7697
7698
7699
7700
7701
7702 # Set options
7703
7704
7705
7706 enable_dlopen=no
7707
7708
7709 enable_win32_dll=no
7710
7711
7712 # Check whether --enable-shared was given.
7713 if test "${enable_shared+set}" = set; then :
7714 enableval=$enable_shared; p=${PACKAGE-default}
7715 case $enableval in
7716 yes) enable_shared=yes ;;
7717 no) enable_shared=no ;;
7718 *)
7719 enable_shared=no
7720 # Look at the argument we got. We use all the common list separators.
7721 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
7722 for pkg in $enableval; do
7723 IFS=$lt_save_ifs
7724 if test "X$pkg" = "X$p"; then
7725 enable_shared=yes
7726 fi
7727 done
7728 IFS=$lt_save_ifs
7729 ;;
7730 esac
7731 else
7732 enable_shared=yes
7733 fi
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743 # Check whether --enable-static was given.
7744 if test "${enable_static+set}" = set; then :
7745 enableval=$enable_static; p=${PACKAGE-default}
7746 case $enableval in
7747 yes) enable_static=yes ;;
7748 no) enable_static=no ;;
7749 *)
7750 enable_static=no
7751 # Look at the argument we got. We use all the common list separators.
7752 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
7753 for pkg in $enableval; do
7754 IFS=$lt_save_ifs
7755 if test "X$pkg" = "X$p"; then
7756 enable_static=yes
7757 fi
7758 done
7759 IFS=$lt_save_ifs
7760 ;;
7761 esac
7762 else
7763 enable_static=yes
7764 fi
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775 # Check whether --with-pic was given.
7776 if test "${with_pic+set}" = set; then :
7777 withval=$with_pic; lt_p=${PACKAGE-default}
7778 case $withval in
7779 yes|no) pic_mode=$withval ;;
7780 *)
7781 pic_mode=default
7782 # Look at the argument we got. We use all the common list separators.
7783 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
7784 for lt_pkg in $withval; do
7785 IFS=$lt_save_ifs
7786 if test "X$lt_pkg" = "X$lt_p"; then
7787 pic_mode=yes
7788 fi
7789 done
7790 IFS=$lt_save_ifs
7791 ;;
7792 esac
7793 else
7794 pic_mode=default
7795 fi
7796
7797
7798
7799
7800
7801
7802
7803
7804 # Check whether --enable-fast-install was given.
7805 if test "${enable_fast_install+set}" = set; then :
7806 enableval=$enable_fast_install; p=${PACKAGE-default}
7807 case $enableval in
7808 yes) enable_fast_install=yes ;;
7809 no) enable_fast_install=no ;;
7810 *)
7811 enable_fast_install=no
7812 # Look at the argument we got. We use all the common list separators.
7813 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
7814 for pkg in $enableval; do
7815 IFS=$lt_save_ifs
7816 if test "X$pkg" = "X$p"; then
7817 enable_fast_install=yes
7818 fi
7819 done
7820 IFS=$lt_save_ifs
7821 ;;
7822 esac
7823 else
7824 enable_fast_install=yes
7825 fi
7826
7827
7828
7829
7830
7831
7832
7833
7834 shared_archive_member_spec=
7835 case $host,$enable_shared in
7836 power*-*-aix[5-9]*,yes)
7837 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
7838 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
7839
7840 # Check whether --with-aix-soname was given.
7841 if test "${with_aix_soname+set}" = set; then :
7842 withval=$with_aix_soname; case $withval in
7843 aix|svr4|both)
7844 ;;
7845 *)
7846 as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
7847 ;;
7848 esac
7849 lt_cv_with_aix_soname=$with_aix_soname
7850 else
7851 if ${lt_cv_with_aix_soname+:} false; then :
7852 $as_echo_n "(cached) " >&6
7853 else
7854 lt_cv_with_aix_soname=aix
7855 fi
7856
7857 with_aix_soname=$lt_cv_with_aix_soname
7858 fi
7859
7860 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
7861 $as_echo "$with_aix_soname" >&6; }
7862 if test aix != "$with_aix_soname"; then
7863 # For the AIX way of multilib, we name the shared archive member
7864 # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
7865 # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
7866 # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
7867 # the AIX toolchain works better with OBJECT_MODE set (default 32).
7868 if test 64 = "${OBJECT_MODE-32}"; then
7869 shared_archive_member_spec=shr_64
7870 else
7871 shared_archive_member_spec=shr
7872 fi
7873 fi
7874 ;;
7875 *)
7876 with_aix_soname=aix
7877 ;;
7878 esac
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889 # This can be used to rebuild libtool when needed
7890 LIBTOOL_DEPS=$ltmain
7891
7892 # Always use our own libtool.
7893 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924 test -z "$LN_S" && LN_S="ln -s"
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939 if test -n "${ZSH_VERSION+set}"; then
7940 setopt NO_GLOB_SUBST
7941 fi
7942
7943 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
7944 $as_echo_n "checking for objdir... " >&6; }
7945 if ${lt_cv_objdir+:} false; then :
7946 $as_echo_n "(cached) " >&6
7947 else
7948 rm -f .libs 2>/dev/null
7949 mkdir .libs 2>/dev/null
7950 if test -d .libs; then
7951 lt_cv_objdir=.libs
7952 else
7953 # MS-DOS does not allow filenames that begin with a dot.
7954 lt_cv_objdir=_libs
7955 fi
7956 rmdir .libs 2>/dev/null
7957 fi
7958 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
7959 $as_echo "$lt_cv_objdir" >&6; }
7960 objdir=$lt_cv_objdir
7961
7962
7963
7964
7965
7966 cat >>confdefs.h <<_ACEOF
7967 #define LT_OBJDIR "$lt_cv_objdir/"
7968 _ACEOF
7969
7970
7971
7972
7973 case $host_os in
7974 aix3*)
7975 # AIX sometimes has problems with the GCC collect2 program. For some
7976 # reason, if we set the COLLECT_NAMES environment variable, the problems
7977 # vanish in a puff of smoke.
7978 if test set != "${COLLECT_NAMES+set}"; then
7979 COLLECT_NAMES=
7980 export COLLECT_NAMES
7981 fi
7982 ;;
7983 esac
7984
7985 # Global variables:
7986 ofile=libtool
7987 can_build_shared=yes
7988
7989 # All known linkers require a '.a' archive for static linking (except MSVC,
7990 # which needs '.lib').
7991 libext=a
7992
7993 with_gnu_ld=$lt_cv_prog_gnu_ld
7994
7995 old_CC=$CC
7996 old_CFLAGS=$CFLAGS
7997
7998 # Set sane defaults for various variables
7999 test -z "$CC" && CC=cc
8000 test -z "$LTCC" && LTCC=$CC
8001 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
8002 test -z "$LD" && LD=ld
8003 test -z "$ac_objext" && ac_objext=o
8004
8005 func_cc_basename $compiler
8006 cc_basename=$func_cc_basename_result
8007
8008
8009 # Only perform the check for file, if the check method requires it
8010 test -z "$MAGIC_CMD" && MAGIC_CMD=file
8011 case $deplibs_check_method in
8012 file_magic*)
8013 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
8014 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
8015 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
8016 if ${lt_cv_path_MAGIC_CMD+:} false; then :
8017 $as_echo_n "(cached) " >&6
8018 else
8019 case $MAGIC_CMD in
8020 [\\/*] | ?:[\\/]*)
8021 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
8022 ;;
8023 *)
8024 lt_save_MAGIC_CMD=$MAGIC_CMD
8025 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
8026 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
8027 for ac_dir in $ac_dummy; do
8028 IFS=$lt_save_ifs
8029 test -z "$ac_dir" && ac_dir=.
8030 if test -f "$ac_dir/${ac_tool_prefix}file"; then
8031 lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
8032 if test -n "$file_magic_test_file"; then
8033 case $deplibs_check_method in
8034 "file_magic "*)
8035 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
8036 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
8037 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
8038 $EGREP "$file_magic_regex" > /dev/null; then
8039 :
8040 else
8041 cat <<_LT_EOF 1>&2
8042
8043 *** Warning: the command libtool uses to detect shared libraries,
8044 *** $file_magic_cmd, produces output that libtool cannot recognize.
8045 *** The result is that libtool may fail to recognize shared libraries
8046 *** as such. This will affect the creation of libtool libraries that
8047 *** depend on shared libraries, but programs linked with such libtool
8048 *** libraries will work regardless of this problem. Nevertheless, you
8049 *** may want to report the problem to your system manager and/or to
8050 *** bug-libtool@gnu.org
8051
8052 _LT_EOF
8053 fi ;;
8054 esac
8055 fi
8056 break
8057 fi
8058 done
8059 IFS=$lt_save_ifs
8060 MAGIC_CMD=$lt_save_MAGIC_CMD
8061 ;;
8062 esac
8063 fi
8064
8065 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
8066 if test -n "$MAGIC_CMD"; then
8067 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
8068 $as_echo "$MAGIC_CMD" >&6; }
8069 else
8070 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8071 $as_echo "no" >&6; }
8072 fi
8073
8074
8075
8076
8077
8078 if test -z "$lt_cv_path_MAGIC_CMD"; then
8079 if test -n "$ac_tool_prefix"; then
8080 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
8081 $as_echo_n "checking for file... " >&6; }
8082 if ${lt_cv_path_MAGIC_CMD+:} false; then :
8083 $as_echo_n "(cached) " >&6
8084 else
8085 case $MAGIC_CMD in
8086 [\\/*] | ?:[\\/]*)
8087 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
8088 ;;
8089 *)
8090 lt_save_MAGIC_CMD=$MAGIC_CMD
8091 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
8092 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
8093 for ac_dir in $ac_dummy; do
8094 IFS=$lt_save_ifs
8095 test -z "$ac_dir" && ac_dir=.
8096 if test -f "$ac_dir/file"; then
8097 lt_cv_path_MAGIC_CMD=$ac_dir/"file"
8098 if test -n "$file_magic_test_file"; then
8099 case $deplibs_check_method in
8100 "file_magic "*)
8101 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
8102 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
8103 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
8104 $EGREP "$file_magic_regex" > /dev/null; then
8105 :
8106 else
8107 cat <<_LT_EOF 1>&2
8108
8109 *** Warning: the command libtool uses to detect shared libraries,
8110 *** $file_magic_cmd, produces output that libtool cannot recognize.
8111 *** The result is that libtool may fail to recognize shared libraries
8112 *** as such. This will affect the creation of libtool libraries that
8113 *** depend on shared libraries, but programs linked with such libtool
8114 *** libraries will work regardless of this problem. Nevertheless, you
8115 *** may want to report the problem to your system manager and/or to
8116 *** bug-libtool@gnu.org
8117
8118 _LT_EOF
8119 fi ;;
8120 esac
8121 fi
8122 break
8123 fi
8124 done
8125 IFS=$lt_save_ifs
8126 MAGIC_CMD=$lt_save_MAGIC_CMD
8127 ;;
8128 esac
8129 fi
8130
8131 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
8132 if test -n "$MAGIC_CMD"; then
8133 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
8134 $as_echo "$MAGIC_CMD" >&6; }
8135 else
8136 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8137 $as_echo "no" >&6; }
8138 fi
8139
8140
8141 else
8142 MAGIC_CMD=:
8143 fi
8144 fi
8145
8146 fi
8147 ;;
8148 esac
8149
8150 # Use C for the default configuration in the libtool script
8151
8152 lt_save_CC=$CC
8153 ac_ext=c
8154 ac_cpp='$CPP $CPPFLAGS'
8155 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8156 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8157 ac_compiler_gnu=$ac_cv_c_compiler_gnu
8158
8159
8160 # Source file extension for C test sources.
8161 ac_ext=c
8162
8163 # Object file extension for compiled C test sources.
8164 objext=o
8165 objext=$objext
8166
8167 # Code to be used in simple compile tests
8168 lt_simple_compile_test_code="int some_variable = 0;"
8169
8170 # Code to be used in simple link tests
8171 lt_simple_link_test_code='int main(){return(0);}'
8172
8173
8174
8175
8176
8177
8178
8179 # If no C compiler was specified, use CC.
8180 LTCC=${LTCC-"$CC"}
8181
8182 # If no C compiler flags were specified, use CFLAGS.
8183 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
8184
8185 # Allow CC to be a program name with arguments.
8186 compiler=$CC
8187
8188 # Save the default compiler, since it gets overwritten when the other
8189 # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
8190 compiler_DEFAULT=$CC
8191
8192 # save warnings/boilerplate of simple test code
8193 ac_outfile=conftest.$ac_objext
8194 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
8195 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
8196 _lt_compiler_boilerplate=`cat conftest.err`
8197 $RM conftest*
8198
8199 ac_outfile=conftest.$ac_objext
8200 echo "$lt_simple_link_test_code" >conftest.$ac_ext
8201 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
8202 _lt_linker_boilerplate=`cat conftest.err`
8203 $RM -r conftest*
8204
8205
8206 ## CAVEAT EMPTOR:
8207 ## There is no encapsulation within the following macros, do not change
8208 ## the running order or otherwise move them around unless you know exactly
8209 ## what you are doing...
8210 if test -n "$compiler"; then
8211
8212 lt_prog_compiler_no_builtin_flag=
8213
8214 if test yes = "$GCC"; then
8215 case $cc_basename in
8216 nvcc*)
8217 lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
8218 *)
8219 lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
8220 esac
8221
8222 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
8223 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
8224 if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
8225 $as_echo_n "(cached) " >&6
8226 else
8227 lt_cv_prog_compiler_rtti_exceptions=no
8228 ac_outfile=conftest.$ac_objext
8229 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8230 lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment
8231 # Insert the option either (1) after the last *FLAGS variable, or
8232 # (2) before a word containing "conftest.", or (3) at the end.
8233 # Note that $ac_compile itself does not contain backslashes and begins
8234 # with a dollar sign (not a hyphen), so the echo should work correctly.
8235 # The option is referenced via a variable to avoid confusing sed.
8236 lt_compile=`echo "$ac_compile" | $SED \
8237 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8238 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8239 -e 's:$: $lt_compiler_flag:'`
8240 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
8241 (eval "$lt_compile" 2>conftest.err)
8242 ac_status=$?
8243 cat conftest.err >&5
8244 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8245 if (exit $ac_status) && test -s "$ac_outfile"; then
8246 # The compiler can only warn and ignore the option if not recognized
8247 # So say no if there are warnings other than the usual output.
8248 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
8249 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
8250 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
8251 lt_cv_prog_compiler_rtti_exceptions=yes
8252 fi
8253 fi
8254 $RM conftest*
8255
8256 fi
8257 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
8258 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
8259
8260 if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
8261 lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
8262 else
8263 :
8264 fi
8265
8266 fi
8267
8268
8269
8270
8271
8272
8273 lt_prog_compiler_wl=
8274 lt_prog_compiler_pic=
8275 lt_prog_compiler_static=
8276
8277
8278 if test yes = "$GCC"; then
8279 lt_prog_compiler_wl='-Wl,'
8280 lt_prog_compiler_static='-static'
8281
8282 case $host_os in
8283 aix*)
8284 # All AIX code is PIC.
8285 if test ia64 = "$host_cpu"; then
8286 # AIX 5 now supports IA64 processor
8287 lt_prog_compiler_static='-Bstatic'
8288 fi
8289 lt_prog_compiler_pic='-fPIC'
8290 ;;
8291
8292 amigaos*)
8293 case $host_cpu in
8294 powerpc)
8295 # see comment about AmigaOS4 .so support
8296 lt_prog_compiler_pic='-fPIC'
8297 ;;
8298 m68k)
8299 # FIXME: we need at least 68020 code to build shared libraries, but
8300 # adding the '-m68020' flag to GCC prevents building anything better,
8301 # like '-m68040'.
8302 lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
8303 ;;
8304 esac
8305 ;;
8306
8307 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
8308 # PIC is the default for these OSes.
8309 ;;
8310
8311 mingw* | cygwin* | pw32* | os2* | cegcc*)
8312 # This hack is so that the source file can tell whether it is being
8313 # built for inclusion in a dll (and should export symbols for example).
8314 # Although the cygwin gcc ignores -fPIC, still need this for old-style
8315 # (--disable-auto-import) libraries
8316 lt_prog_compiler_pic='-DDLL_EXPORT'
8317 case $host_os in
8318 os2*)
8319 lt_prog_compiler_static='$wl-static'
8320 ;;
8321 esac
8322 ;;
8323
8324 darwin* | rhapsody*)
8325 # PIC is the default on this platform
8326 # Common symbols not allowed in MH_DYLIB files
8327 lt_prog_compiler_pic='-fno-common'
8328 ;;
8329
8330 haiku*)
8331 # PIC is the default for Haiku.
8332 # The "-static" flag exists, but is broken.
8333 lt_prog_compiler_static=
8334 ;;
8335
8336 hpux*)
8337 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
8338 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
8339 # sets the default TLS model and affects inlining.
8340 case $host_cpu in
8341 hppa*64*)
8342 # +Z the default
8343 ;;
8344 *)
8345 lt_prog_compiler_pic='-fPIC'
8346 ;;
8347 esac
8348 ;;
8349
8350 interix[3-9]*)
8351 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
8352 # Instead, we relocate shared libraries at runtime.
8353 ;;
8354
8355 msdosdjgpp*)
8356 # Just because we use GCC doesn't mean we suddenly get shared libraries
8357 # on systems that don't support them.
8358 lt_prog_compiler_can_build_shared=no
8359 enable_shared=no
8360 ;;
8361
8362 *nto* | *qnx*)
8363 # QNX uses GNU C++, but need to define -shared option too, otherwise
8364 # it will coredump.
8365 lt_prog_compiler_pic='-fPIC -shared'
8366 ;;
8367
8368 sysv4*MP*)
8369 if test -d /usr/nec; then
8370 lt_prog_compiler_pic=-Kconform_pic
8371 fi
8372 ;;
8373
8374 *)
8375 lt_prog_compiler_pic='-fPIC'
8376 ;;
8377 esac
8378
8379 case $cc_basename in
8380 nvcc*) # Cuda Compiler Driver 2.2
8381 lt_prog_compiler_wl='-Xlinker '
8382 if test -n "$lt_prog_compiler_pic"; then
8383 lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
8384 fi
8385 ;;
8386 esac
8387 else
8388 # PORTME Check for flag to pass linker flags through the system compiler.
8389 case $host_os in
8390 aix*)
8391 lt_prog_compiler_wl='-Wl,'
8392 if test ia64 = "$host_cpu"; then
8393 # AIX 5 now supports IA64 processor
8394 lt_prog_compiler_static='-Bstatic'
8395 else
8396 lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
8397 fi
8398 ;;
8399
8400 darwin* | rhapsody*)
8401 # PIC is the default on this platform
8402 # Common symbols not allowed in MH_DYLIB files
8403 lt_prog_compiler_pic='-fno-common'
8404 case $cc_basename in
8405 nagfor*)
8406 # NAG Fortran compiler
8407 lt_prog_compiler_wl='-Wl,-Wl,,'
8408 lt_prog_compiler_pic='-PIC'
8409 lt_prog_compiler_static='-Bstatic'
8410 ;;
8411 esac
8412 ;;
8413
8414 mingw* | cygwin* | pw32* | os2* | cegcc*)
8415 # This hack is so that the source file can tell whether it is being
8416 # built for inclusion in a dll (and should export symbols for example).
8417 lt_prog_compiler_pic='-DDLL_EXPORT'
8418 case $host_os in
8419 os2*)
8420 lt_prog_compiler_static='$wl-static'
8421 ;;
8422 esac
8423 ;;
8424
8425 hpux9* | hpux10* | hpux11*)
8426 lt_prog_compiler_wl='-Wl,'
8427 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
8428 # not for PA HP-UX.
8429 case $host_cpu in
8430 hppa*64*|ia64*)
8431 # +Z the default
8432 ;;
8433 *)
8434 lt_prog_compiler_pic='+Z'
8435 ;;
8436 esac
8437 # Is there a better lt_prog_compiler_static that works with the bundled CC?
8438 lt_prog_compiler_static='$wl-a ${wl}archive'
8439 ;;
8440
8441 irix5* | irix6* | nonstopux*)
8442 lt_prog_compiler_wl='-Wl,'
8443 # PIC (with -KPIC) is the default.
8444 lt_prog_compiler_static='-non_shared'
8445 ;;
8446
8447 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
8448 case $cc_basename in
8449 # old Intel for x86_64, which still supported -KPIC.
8450 ecc*)
8451 lt_prog_compiler_wl='-Wl,'
8452 lt_prog_compiler_pic='-KPIC'
8453 lt_prog_compiler_static='-static'
8454 ;;
8455 # icc used to be incompatible with GCC.
8456 # ICC 10 doesn't accept -KPIC any more.
8457 icc* | ifort*)
8458 lt_prog_compiler_wl='-Wl,'
8459 lt_prog_compiler_pic='-fPIC'
8460 lt_prog_compiler_static='-static'
8461 ;;
8462 # Lahey Fortran 8.1.
8463 lf95*)
8464 lt_prog_compiler_wl='-Wl,'
8465 lt_prog_compiler_pic='--shared'
8466 lt_prog_compiler_static='--static'
8467 ;;
8468 nagfor*)
8469 # NAG Fortran compiler
8470 lt_prog_compiler_wl='-Wl,-Wl,,'
8471 lt_prog_compiler_pic='-PIC'
8472 lt_prog_compiler_static='-Bstatic'
8473 ;;
8474 tcc*)
8475 # Fabrice Bellard et al's Tiny C Compiler
8476 lt_prog_compiler_wl='-Wl,'
8477 lt_prog_compiler_pic='-fPIC'
8478 lt_prog_compiler_static='-static'
8479 ;;
8480 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
8481 # Portland Group compilers (*not* the Pentium gcc compiler,
8482 # which looks to be a dead project)
8483 lt_prog_compiler_wl='-Wl,'
8484 lt_prog_compiler_pic='-fpic'
8485 lt_prog_compiler_static='-Bstatic'
8486 ;;
8487 ccc*)
8488 lt_prog_compiler_wl='-Wl,'
8489 # All Alpha code is PIC.
8490 lt_prog_compiler_static='-non_shared'
8491 ;;
8492 xl* | bgxl* | bgf* | mpixl*)
8493 # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
8494 lt_prog_compiler_wl='-Wl,'
8495 lt_prog_compiler_pic='-qpic'
8496 lt_prog_compiler_static='-qstaticlink'
8497 ;;
8498 *)
8499 case `$CC -V 2>&1 | sed 5q` in
8500 *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
8501 # Sun Fortran 8.3 passes all unrecognized flags to the linker
8502 lt_prog_compiler_pic='-KPIC'
8503 lt_prog_compiler_static='-Bstatic'
8504 lt_prog_compiler_wl=''
8505 ;;
8506 *Sun\ F* | *Sun*Fortran*)
8507 lt_prog_compiler_pic='-KPIC'
8508 lt_prog_compiler_static='-Bstatic'
8509 lt_prog_compiler_wl='-Qoption ld '
8510 ;;
8511 *Sun\ C*)
8512 # Sun C 5.9
8513 lt_prog_compiler_pic='-KPIC'
8514 lt_prog_compiler_static='-Bstatic'
8515 lt_prog_compiler_wl='-Wl,'
8516 ;;
8517 *Intel*\ [CF]*Compiler*)
8518 lt_prog_compiler_wl='-Wl,'
8519 lt_prog_compiler_pic='-fPIC'
8520 lt_prog_compiler_static='-static'
8521 ;;
8522 *Portland\ Group*)
8523 lt_prog_compiler_wl='-Wl,'
8524 lt_prog_compiler_pic='-fpic'
8525 lt_prog_compiler_static='-Bstatic'
8526 ;;
8527 esac
8528 ;;
8529 esac
8530 ;;
8531
8532 newsos6)
8533 lt_prog_compiler_pic='-KPIC'
8534 lt_prog_compiler_static='-Bstatic'
8535 ;;
8536
8537 *nto* | *qnx*)
8538 # QNX uses GNU C++, but need to define -shared option too, otherwise
8539 # it will coredump.
8540 lt_prog_compiler_pic='-fPIC -shared'
8541 ;;
8542
8543 osf3* | osf4* | osf5*)
8544 lt_prog_compiler_wl='-Wl,'
8545 # All OSF/1 code is PIC.
8546 lt_prog_compiler_static='-non_shared'
8547 ;;
8548
8549 rdos*)
8550 lt_prog_compiler_static='-non_shared'
8551 ;;
8552
8553 solaris*)
8554 lt_prog_compiler_pic='-KPIC'
8555 lt_prog_compiler_static='-Bstatic'
8556 case $cc_basename in
8557 f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
8558 lt_prog_compiler_wl='-Qoption ld ';;
8559 *)
8560 lt_prog_compiler_wl='-Wl,';;
8561 esac
8562 ;;
8563
8564 sunos4*)
8565 lt_prog_compiler_wl='-Qoption ld '
8566 lt_prog_compiler_pic='-PIC'
8567 lt_prog_compiler_static='-Bstatic'
8568 ;;
8569
8570 sysv4 | sysv4.2uw2* | sysv4.3*)
8571 lt_prog_compiler_wl='-Wl,'
8572 lt_prog_compiler_pic='-KPIC'
8573 lt_prog_compiler_static='-Bstatic'
8574 ;;
8575
8576 sysv4*MP*)
8577 if test -d /usr/nec; then
8578 lt_prog_compiler_pic='-Kconform_pic'
8579 lt_prog_compiler_static='-Bstatic'
8580 fi
8581 ;;
8582
8583 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
8584 lt_prog_compiler_wl='-Wl,'
8585 lt_prog_compiler_pic='-KPIC'
8586 lt_prog_compiler_static='-Bstatic'
8587 ;;
8588
8589 unicos*)
8590 lt_prog_compiler_wl='-Wl,'
8591 lt_prog_compiler_can_build_shared=no
8592 ;;
8593
8594 uts4*)
8595 lt_prog_compiler_pic='-pic'
8596 lt_prog_compiler_static='-Bstatic'
8597 ;;
8598
8599 *)
8600 lt_prog_compiler_can_build_shared=no
8601 ;;
8602 esac
8603 fi
8604
8605 case $host_os in
8606 # For platforms that do not support PIC, -DPIC is meaningless:
8607 *djgpp*)
8608 lt_prog_compiler_pic=
8609 ;;
8610 *)
8611 lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
8612 ;;
8613 esac
8614
8615 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
8616 $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
8617 if ${lt_cv_prog_compiler_pic+:} false; then :
8618 $as_echo_n "(cached) " >&6
8619 else
8620 lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
8621 fi
8622 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
8623 $as_echo "$lt_cv_prog_compiler_pic" >&6; }
8624 lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
8625
8626 #
8627 # Check to make sure the PIC flag actually works.
8628 #
8629 if test -n "$lt_prog_compiler_pic"; then
8630 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
8631 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
8632 if ${lt_cv_prog_compiler_pic_works+:} false; then :
8633 $as_echo_n "(cached) " >&6
8634 else
8635 lt_cv_prog_compiler_pic_works=no
8636 ac_outfile=conftest.$ac_objext
8637 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8638 lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
8639 # Insert the option either (1) after the last *FLAGS variable, or
8640 # (2) before a word containing "conftest.", or (3) at the end.
8641 # Note that $ac_compile itself does not contain backslashes and begins
8642 # with a dollar sign (not a hyphen), so the echo should work correctly.
8643 # The option is referenced via a variable to avoid confusing sed.
8644 lt_compile=`echo "$ac_compile" | $SED \
8645 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8646 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8647 -e 's:$: $lt_compiler_flag:'`
8648 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
8649 (eval "$lt_compile" 2>conftest.err)
8650 ac_status=$?
8651 cat conftest.err >&5
8652 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8653 if (exit $ac_status) && test -s "$ac_outfile"; then
8654 # The compiler can only warn and ignore the option if not recognized
8655 # So say no if there are warnings other than the usual output.
8656 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
8657 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
8658 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
8659 lt_cv_prog_compiler_pic_works=yes
8660 fi
8661 fi
8662 $RM conftest*
8663
8664 fi
8665 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
8666 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
8667
8668 if test yes = "$lt_cv_prog_compiler_pic_works"; then
8669 case $lt_prog_compiler_pic in
8670 "" | " "*) ;;
8671 *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
8672 esac
8673 else
8674 lt_prog_compiler_pic=
8675 lt_prog_compiler_can_build_shared=no
8676 fi
8677
8678 fi
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690 #
8691 # Check to make sure the static flag actually works.
8692 #
8693 wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
8694 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
8695 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
8696 if ${lt_cv_prog_compiler_static_works+:} false; then :
8697 $as_echo_n "(cached) " >&6
8698 else
8699 lt_cv_prog_compiler_static_works=no
8700 save_LDFLAGS=$LDFLAGS
8701 LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
8702 echo "$lt_simple_link_test_code" > conftest.$ac_ext
8703 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
8704 # The linker can only warn and ignore the option if not recognized
8705 # So say no if there are warnings
8706 if test -s conftest.err; then
8707 # Append any errors to the config.log.
8708 cat conftest.err 1>&5
8709 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
8710 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
8711 if diff conftest.exp conftest.er2 >/dev/null; then
8712 lt_cv_prog_compiler_static_works=yes
8713 fi
8714 else
8715 lt_cv_prog_compiler_static_works=yes
8716 fi
8717 fi
8718 $RM -r conftest*
8719 LDFLAGS=$save_LDFLAGS
8720
8721 fi
8722 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
8723 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
8724
8725 if test yes = "$lt_cv_prog_compiler_static_works"; then
8726 :
8727 else
8728 lt_prog_compiler_static=
8729 fi
8730
8731
8732
8733
8734
8735
8736
8737 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
8738 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
8739 if ${lt_cv_prog_compiler_c_o+:} false; then :
8740 $as_echo_n "(cached) " >&6
8741 else
8742 lt_cv_prog_compiler_c_o=no
8743 $RM -r conftest 2>/dev/null
8744 mkdir conftest
8745 cd conftest
8746 mkdir out
8747 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8748
8749 lt_compiler_flag="-o out/conftest2.$ac_objext"
8750 # Insert the option either (1) after the last *FLAGS variable, or
8751 # (2) before a word containing "conftest.", or (3) at the end.
8752 # Note that $ac_compile itself does not contain backslashes and begins
8753 # with a dollar sign (not a hyphen), so the echo should work correctly.
8754 lt_compile=`echo "$ac_compile" | $SED \
8755 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8756 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8757 -e 's:$: $lt_compiler_flag:'`
8758 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
8759 (eval "$lt_compile" 2>out/conftest.err)
8760 ac_status=$?
8761 cat out/conftest.err >&5
8762 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8763 if (exit $ac_status) && test -s out/conftest2.$ac_objext
8764 then
8765 # The compiler can only warn and ignore the option if not recognized
8766 # So say no if there are warnings
8767 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
8768 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
8769 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
8770 lt_cv_prog_compiler_c_o=yes
8771 fi
8772 fi
8773 chmod u+w . 2>&5
8774 $RM conftest*
8775 # SGI C++ compiler will create directory out/ii_files/ for
8776 # template instantiation
8777 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
8778 $RM out/* && rmdir out
8779 cd ..
8780 $RM -r conftest
8781 $RM conftest*
8782
8783 fi
8784 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
8785 $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
8786
8787
8788
8789
8790
8791
8792 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
8793 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
8794 if ${lt_cv_prog_compiler_c_o+:} false; then :
8795 $as_echo_n "(cached) " >&6
8796 else
8797 lt_cv_prog_compiler_c_o=no
8798 $RM -r conftest 2>/dev/null
8799 mkdir conftest
8800 cd conftest
8801 mkdir out
8802 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8803
8804 lt_compiler_flag="-o out/conftest2.$ac_objext"
8805 # Insert the option either (1) after the last *FLAGS variable, or
8806 # (2) before a word containing "conftest.", or (3) at the end.
8807 # Note that $ac_compile itself does not contain backslashes and begins
8808 # with a dollar sign (not a hyphen), so the echo should work correctly.
8809 lt_compile=`echo "$ac_compile" | $SED \
8810 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8811 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8812 -e 's:$: $lt_compiler_flag:'`
8813 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
8814 (eval "$lt_compile" 2>out/conftest.err)
8815 ac_status=$?
8816 cat out/conftest.err >&5
8817 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8818 if (exit $ac_status) && test -s out/conftest2.$ac_objext
8819 then
8820 # The compiler can only warn and ignore the option if not recognized
8821 # So say no if there are warnings
8822 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
8823 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
8824 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
8825 lt_cv_prog_compiler_c_o=yes
8826 fi
8827 fi
8828 chmod u+w . 2>&5
8829 $RM conftest*
8830 # SGI C++ compiler will create directory out/ii_files/ for
8831 # template instantiation
8832 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
8833 $RM out/* && rmdir out
8834 cd ..
8835 $RM -r conftest
8836 $RM conftest*
8837
8838 fi
8839 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
8840 $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
8841
8842
8843
8844
8845 hard_links=nottested
8846 if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
8847 # do not overwrite the value of need_locks provided by the user
8848 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
8849 $as_echo_n "checking if we can lock with hard links... " >&6; }
8850 hard_links=yes
8851 $RM conftest*
8852 ln conftest.a conftest.b 2>/dev/null && hard_links=no
8853 touch conftest.a
8854 ln conftest.a conftest.b 2>&5 || hard_links=no
8855 ln conftest.a conftest.b 2>/dev/null && hard_links=no
8856 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
8857 $as_echo "$hard_links" >&6; }
8858 if test no = "$hard_links"; then
8859 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
8860 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
8861 need_locks=warn
8862 fi
8863 else
8864 need_locks=no
8865 fi
8866
8867
8868
8869
8870
8871
8872 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
8873 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
8874
8875 runpath_var=
8876 allow_undefined_flag=
8877 always_export_symbols=no
8878 archive_cmds=
8879 archive_expsym_cmds=
8880 compiler_needs_object=no
8881 enable_shared_with_static_runtimes=no
8882 export_dynamic_flag_spec=
8883 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8884 hardcode_automatic=no
8885 hardcode_direct=no
8886 hardcode_direct_absolute=no
8887 hardcode_libdir_flag_spec=
8888 hardcode_libdir_separator=
8889 hardcode_minus_L=no
8890 hardcode_shlibpath_var=unsupported
8891 inherit_rpath=no
8892 link_all_deplibs=unknown
8893 module_cmds=
8894 module_expsym_cmds=
8895 old_archive_from_new_cmds=
8896 old_archive_from_expsyms_cmds=
8897 thread_safe_flag_spec=
8898 whole_archive_flag_spec=
8899 # include_expsyms should be a list of space-separated symbols to be *always*
8900 # included in the symbol list
8901 include_expsyms=
8902 # exclude_expsyms can be an extended regexp of symbols to exclude
8903 # it will be wrapped by ' (' and ')$', so one must not match beginning or
8904 # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
8905 # as well as any symbol that contains 'd'.
8906 exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
8907 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
8908 # platforms (ab)use it in PIC code, but their linkers get confused if
8909 # the symbol is explicitly referenced. Since portable code cannot
8910 # rely on this symbol name, it's probably fine to never include it in
8911 # preloaded symbol tables.
8912 # Exclude shared library initialization/finalization symbols.
8913 extract_expsyms_cmds=
8914
8915 case $host_os in
8916 cygwin* | mingw* | pw32* | cegcc*)
8917 # FIXME: the MSVC++ port hasn't been tested in a loooong time
8918 # When not using gcc, we currently assume that we are using
8919 # Microsoft Visual C++.
8920 if test yes != "$GCC"; then
8921 with_gnu_ld=no
8922 fi
8923 ;;
8924 interix*)
8925 # we just hope/assume this is gcc and not c89 (= MSVC++)
8926 with_gnu_ld=yes
8927 ;;
8928 openbsd* | bitrig*)
8929 with_gnu_ld=no
8930 ;;
8931 linux* | k*bsd*-gnu | gnu*)
8932 link_all_deplibs=no
8933 ;;
8934 esac
8935
8936 ld_shlibs=yes
8937
8938 # On some targets, GNU ld is compatible enough with the native linker
8939 # that we're better off using the native interface for both.
8940 lt_use_gnu_ld_interface=no
8941 if test yes = "$with_gnu_ld"; then
8942 case $host_os in
8943 aix*)
8944 # The AIX port of GNU ld has always aspired to compatibility
8945 # with the native linker. However, as the warning in the GNU ld
8946 # block says, versions before 2.19.5* couldn't really create working
8947 # shared libraries, regardless of the interface used.
8948 case `$LD -v 2>&1` in
8949 *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
8950 *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
8951 *\ \(GNU\ Binutils\)\ [3-9]*) ;;
8952 *)
8953 lt_use_gnu_ld_interface=yes
8954 ;;
8955 esac
8956 ;;
8957 *)
8958 lt_use_gnu_ld_interface=yes
8959 ;;
8960 esac
8961 fi
8962
8963 if test yes = "$lt_use_gnu_ld_interface"; then
8964 # If archive_cmds runs LD, not CC, wlarc should be empty
8965 wlarc='$wl'
8966
8967 # Set some defaults for GNU ld with shared library support. These
8968 # are reset later if shared libraries are not supported. Putting them
8969 # here allows them to be overridden if necessary.
8970 runpath_var=LD_RUN_PATH
8971 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
8972 export_dynamic_flag_spec='$wl--export-dynamic'
8973 # ancient GNU ld didn't support --whole-archive et. al.
8974 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
8975 whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
8976 else
8977 whole_archive_flag_spec=
8978 fi
8979 supports_anon_versioning=no
8980 case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
8981 *GNU\ gold*) supports_anon_versioning=yes ;;
8982 *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
8983 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
8984 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
8985 *\ 2.11.*) ;; # other 2.11 versions
8986 *) supports_anon_versioning=yes ;;
8987 esac
8988
8989 # See if GNU ld supports shared libraries.
8990 case $host_os in
8991 aix[3-9]*)
8992 # On AIX/PPC, the GNU linker is very broken
8993 if test ia64 != "$host_cpu"; then
8994 ld_shlibs=no
8995 cat <<_LT_EOF 1>&2
8996
8997 *** Warning: the GNU linker, at least up to release 2.19, is reported
8998 *** to be unable to reliably create shared libraries on AIX.
8999 *** Therefore, libtool is disabling shared libraries support. If you
9000 *** really care for shared libraries, you may want to install binutils
9001 *** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
9002 *** You will then need to restart the configuration process.
9003
9004 _LT_EOF
9005 fi
9006 ;;
9007
9008 amigaos*)
9009 case $host_cpu in
9010 powerpc)
9011 # see comment about AmigaOS4 .so support
9012 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9013 archive_expsym_cmds=''
9014 ;;
9015 m68k)
9016 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)'
9017 hardcode_libdir_flag_spec='-L$libdir'
9018 hardcode_minus_L=yes
9019 ;;
9020 esac
9021 ;;
9022
9023 beos*)
9024 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9025 allow_undefined_flag=unsupported
9026 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
9027 # support --undefined. This deserves some investigation. FIXME
9028 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9029 else
9030 ld_shlibs=no
9031 fi
9032 ;;
9033
9034 cygwin* | mingw* | pw32* | cegcc*)
9035 # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
9036 # as there is no search path for DLLs.
9037 hardcode_libdir_flag_spec='-L$libdir'
9038 export_dynamic_flag_spec='$wl--export-all-symbols'
9039 allow_undefined_flag=unsupported
9040 always_export_symbols=no
9041 enable_shared_with_static_runtimes=yes
9042 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
9043 exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
9044
9045 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
9046 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9047 # If the export-symbols file already is a .def file, use it as
9048 # is; otherwise, prepend EXPORTS...
9049 archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
9050 cp $export_symbols $output_objdir/$soname.def;
9051 else
9052 echo EXPORTS > $output_objdir/$soname.def;
9053 cat $export_symbols >> $output_objdir/$soname.def;
9054 fi~
9055 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9056 else
9057 ld_shlibs=no
9058 fi
9059 ;;
9060
9061 haiku*)
9062 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9063 link_all_deplibs=yes
9064 ;;
9065
9066 os2*)
9067 hardcode_libdir_flag_spec='-L$libdir'
9068 hardcode_minus_L=yes
9069 allow_undefined_flag=unsupported
9070 shrext_cmds=.dll
9071 archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9072 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9073 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9074 $ECHO EXPORTS >> $output_objdir/$libname.def~
9075 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
9076 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9077 emximp -o $lib $output_objdir/$libname.def'
9078 archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9079 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9080 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9081 $ECHO EXPORTS >> $output_objdir/$libname.def~
9082 prefix_cmds="$SED"~
9083 if test EXPORTS = "`$SED 1q $export_symbols`"; then
9084 prefix_cmds="$prefix_cmds -e 1d";
9085 fi~
9086 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
9087 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
9088 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9089 emximp -o $lib $output_objdir/$libname.def'
9090 old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
9091 enable_shared_with_static_runtimes=yes
9092 ;;
9093
9094 interix[3-9]*)
9095 hardcode_direct=no
9096 hardcode_shlibpath_var=no
9097 hardcode_libdir_flag_spec='$wl-rpath,$libdir'
9098 export_dynamic_flag_spec='$wl-E'
9099 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
9100 # Instead, shared libraries are loaded at an image base (0x10000000 by
9101 # default) and relocated if they conflict, which is a slow very memory
9102 # consuming and fragmenting process. To avoid this, we pick a random,
9103 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
9104 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
9105 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
9106 archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
9107 ;;
9108
9109 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
9110 tmp_diet=no
9111 if test linux-dietlibc = "$host_os"; then
9112 case $cc_basename in
9113 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
9114 esac
9115 fi
9116 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
9117 && test no = "$tmp_diet"
9118 then
9119 tmp_addflag=' $pic_flag'
9120 tmp_sharedflag='-shared'
9121 case $cc_basename,$host_cpu in
9122 pgcc*) # Portland Group C compiler
9123 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
9124 tmp_addflag=' $pic_flag'
9125 ;;
9126 pgf77* | pgf90* | pgf95* | pgfortran*)
9127 # Portland Group f77 and f90 compilers
9128 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
9129 tmp_addflag=' $pic_flag -Mnomain' ;;
9130 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
9131 tmp_addflag=' -i_dynamic' ;;
9132 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
9133 tmp_addflag=' -i_dynamic -nofor_main' ;;
9134 ifc* | ifort*) # Intel Fortran compiler
9135 tmp_addflag=' -nofor_main' ;;
9136 lf95*) # Lahey Fortran 8.1
9137 whole_archive_flag_spec=
9138 tmp_sharedflag='--shared' ;;
9139 nagfor*) # NAGFOR 5.3
9140 tmp_sharedflag='-Wl,-shared' ;;
9141 xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
9142 tmp_sharedflag='-qmkshrobj'
9143 tmp_addflag= ;;
9144 nvcc*) # Cuda Compiler Driver 2.2
9145 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
9146 compiler_needs_object=yes
9147 ;;
9148 esac
9149 case `$CC -V 2>&1 | sed 5q` in
9150 *Sun\ C*) # Sun C 5.9
9151 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
9152 compiler_needs_object=yes
9153 tmp_sharedflag='-G' ;;
9154 *Sun\ F*) # Sun Fortran 8.3
9155 tmp_sharedflag='-G' ;;
9156 esac
9157 archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9158
9159 if test yes = "$supports_anon_versioning"; then
9160 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
9161 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9162 echo "local: *; };" >> $output_objdir/$libname.ver~
9163 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
9164 fi
9165
9166 case $cc_basename in
9167 tcc*)
9168 export_dynamic_flag_spec='-rdynamic'
9169 ;;
9170 xlf* | bgf* | bgxlf* | mpixlf*)
9171 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
9172 whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
9173 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9174 archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
9175 if test yes = "$supports_anon_versioning"; then
9176 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
9177 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9178 echo "local: *; };" >> $output_objdir/$libname.ver~
9179 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
9180 fi
9181 ;;
9182 esac
9183 else
9184 ld_shlibs=no
9185 fi
9186 ;;
9187
9188 netbsd* | netbsdelf*-gnu)
9189 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9190 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
9191 wlarc=
9192 else
9193 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9194 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
9195 fi
9196 ;;
9197
9198 solaris*)
9199 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
9200 ld_shlibs=no
9201 cat <<_LT_EOF 1>&2
9202
9203 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
9204 *** create shared libraries on Solaris systems. Therefore, libtool
9205 *** is disabling shared libraries support. We urge you to upgrade GNU
9206 *** binutils to release 2.9.1 or newer. Another option is to modify
9207 *** your PATH or compiler configuration so that the native linker is
9208 *** used, and then restart.
9209
9210 _LT_EOF
9211 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9212 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9213 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
9214 else
9215 ld_shlibs=no
9216 fi
9217 ;;
9218
9219 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
9220 case `$LD -v 2>&1` in
9221 *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
9222 ld_shlibs=no
9223 cat <<_LT_EOF 1>&2
9224
9225 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
9226 *** reliably create shared libraries on SCO systems. Therefore, libtool
9227 *** is disabling shared libraries support. We urge you to upgrade GNU
9228 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
9229 *** your PATH or compiler configuration so that the native linker is
9230 *** used, and then restart.
9231
9232 _LT_EOF
9233 ;;
9234 *)
9235 # For security reasons, it is highly recommended that you always
9236 # use absolute paths for naming shared libraries, and exclude the
9237 # DT_RUNPATH tag from executables and libraries. But doing so
9238 # requires that you compile everything twice, which is a pain.
9239 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9240 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9241 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9242 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
9243 else
9244 ld_shlibs=no
9245 fi
9246 ;;
9247 esac
9248 ;;
9249
9250 sunos4*)
9251 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9252 wlarc=
9253 hardcode_direct=yes
9254 hardcode_shlibpath_var=no
9255 ;;
9256
9257 *)
9258 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9259 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9260 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
9261 else
9262 ld_shlibs=no
9263 fi
9264 ;;
9265 esac
9266
9267 if test no = "$ld_shlibs"; then
9268 runpath_var=
9269 hardcode_libdir_flag_spec=
9270 export_dynamic_flag_spec=
9271 whole_archive_flag_spec=
9272 fi
9273 else
9274 # PORTME fill in a description of your system's linker (not GNU ld)
9275 case $host_os in
9276 aix3*)
9277 allow_undefined_flag=unsupported
9278 always_export_symbols=yes
9279 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'
9280 # Note: this linker hardcodes the directories in LIBPATH if there
9281 # are no directories specified by -L.
9282 hardcode_minus_L=yes
9283 if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
9284 # Neither direct hardcoding nor static linking is supported with a
9285 # broken collect2.
9286 hardcode_direct=unsupported
9287 fi
9288 ;;
9289
9290 aix[4-9]*)
9291 if test ia64 = "$host_cpu"; then
9292 # On IA64, the linker does run time linking by default, so we don't
9293 # have to do anything special.
9294 aix_use_runtimelinking=no
9295 exp_sym_flag='-Bexport'
9296 no_entry_flag=
9297 else
9298 # If we're using GNU nm, then we don't want the "-C" option.
9299 # -C means demangle to GNU nm, but means don't demangle to AIX nm.
9300 # Without the "-l" option, or with the "-B" option, AIX nm treats
9301 # weak defined symbols like other global defined symbols, whereas
9302 # GNU nm marks them as "W".
9303 # While the 'weak' keyword is ignored in the Export File, we need
9304 # it in the Import File for the 'aix-soname' feature, so we have
9305 # to replace the "-B" option with "-P" for AIX nm.
9306 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
9307 export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
9308 else
9309 export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
9310 fi
9311 aix_use_runtimelinking=no
9312
9313 # Test if we are trying to use run time linking or normal
9314 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
9315 # have runtime linking enabled, and use it for executables.
9316 # For shared libraries, we enable/disable runtime linking
9317 # depending on the kind of the shared library created -
9318 # when "with_aix_soname,aix_use_runtimelinking" is:
9319 # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
9320 # "aix,yes" lib.so shared, rtl:yes, for executables
9321 # lib.a static archive
9322 # "both,no" lib.so.V(shr.o) shared, rtl:yes
9323 # lib.a(lib.so.V) shared, rtl:no, for executables
9324 # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
9325 # lib.a(lib.so.V) shared, rtl:no
9326 # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
9327 # lib.a static archive
9328 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
9329 for ld_flag in $LDFLAGS; do
9330 if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
9331 aix_use_runtimelinking=yes
9332 break
9333 fi
9334 done
9335 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
9336 # With aix-soname=svr4, we create the lib.so.V shared archives only,
9337 # so we don't have lib.a shared libs to link our executables.
9338 # We have to force runtime linking in this case.
9339 aix_use_runtimelinking=yes
9340 LDFLAGS="$LDFLAGS -Wl,-brtl"
9341 fi
9342 ;;
9343 esac
9344
9345 exp_sym_flag='-bexport'
9346 no_entry_flag='-bnoentry'
9347 fi
9348
9349 # When large executables or shared objects are built, AIX ld can
9350 # have problems creating the table of contents. If linking a library
9351 # or program results in "error TOC overflow" add -mminimal-toc to
9352 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
9353 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
9354
9355 archive_cmds=''
9356 hardcode_direct=yes
9357 hardcode_direct_absolute=yes
9358 hardcode_libdir_separator=':'
9359 link_all_deplibs=yes
9360 file_list_spec='$wl-f,'
9361 case $with_aix_soname,$aix_use_runtimelinking in
9362 aix,*) ;; # traditional, no import file
9363 svr4,* | *,yes) # use import file
9364 # The Import File defines what to hardcode.
9365 hardcode_direct=no
9366 hardcode_direct_absolute=no
9367 ;;
9368 esac
9369
9370 if test yes = "$GCC"; then
9371 case $host_os in aix4.[012]|aix4.[012].*)
9372 # We only want to do this on AIX 4.2 and lower, the check
9373 # below for broken collect2 doesn't work under 4.3+
9374 collect2name=`$CC -print-prog-name=collect2`
9375 if test -f "$collect2name" &&
9376 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
9377 then
9378 # We have reworked collect2
9379 :
9380 else
9381 # We have old collect2
9382 hardcode_direct=unsupported
9383 # It fails to find uninstalled libraries when the uninstalled
9384 # path is not listed in the libpath. Setting hardcode_minus_L
9385 # to unsupported forces relinking
9386 hardcode_minus_L=yes
9387 hardcode_libdir_flag_spec='-L$libdir'
9388 hardcode_libdir_separator=
9389 fi
9390 ;;
9391 esac
9392 shared_flag='-shared'
9393 if test yes = "$aix_use_runtimelinking"; then
9394 shared_flag="$shared_flag "'$wl-G'
9395 fi
9396 # Need to ensure runtime linking is disabled for the traditional
9397 # shared library, or the linker may eventually find shared libraries
9398 # /with/ Import File - we do not want to mix them.
9399 shared_flag_aix='-shared'
9400 shared_flag_svr4='-shared $wl-G'
9401 else
9402 # not using gcc
9403 if test ia64 = "$host_cpu"; then
9404 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
9405 # chokes on -Wl,-G. The following line is correct:
9406 shared_flag='-G'
9407 else
9408 if test yes = "$aix_use_runtimelinking"; then
9409 shared_flag='$wl-G'
9410 else
9411 shared_flag='$wl-bM:SRE'
9412 fi
9413 shared_flag_aix='$wl-bM:SRE'
9414 shared_flag_svr4='$wl-G'
9415 fi
9416 fi
9417
9418 export_dynamic_flag_spec='$wl-bexpall'
9419 # It seems that -bexpall does not export symbols beginning with
9420 # underscore (_), so it is better to generate a list of symbols to export.
9421 always_export_symbols=yes
9422 if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
9423 # Warning - without using the other runtime loading flags (-brtl),
9424 # -berok will link without error, but may produce a broken library.
9425 allow_undefined_flag='-berok'
9426 # Determine the default libpath from the value encoded in an
9427 # empty executable.
9428 if test set = "${lt_cv_aix_libpath+set}"; then
9429 aix_libpath=$lt_cv_aix_libpath
9430 else
9431 if ${lt_cv_aix_libpath_+:} false; then :
9432 $as_echo_n "(cached) " >&6
9433 else
9434 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9435 /* end confdefs.h. */
9436
9437 int
9438 main ()
9439 {
9440
9441 ;
9442 return 0;
9443 }
9444 _ACEOF
9445 if ac_fn_c_try_link "$LINENO"; then :
9446
9447 lt_aix_libpath_sed='
9448 /Import File Strings/,/^$/ {
9449 /^0/ {
9450 s/^0 *\([^ ]*\) *$/\1/
9451 p
9452 }
9453 }'
9454 lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9455 # Check for a 64-bit object if we didn't find anything.
9456 if test -z "$lt_cv_aix_libpath_"; then
9457 lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9458 fi
9459 fi
9460 rm -f core conftest.err conftest.$ac_objext \
9461 conftest$ac_exeext conftest.$ac_ext
9462 if test -z "$lt_cv_aix_libpath_"; then
9463 lt_cv_aix_libpath_=/usr/lib:/lib
9464 fi
9465
9466 fi
9467
9468 aix_libpath=$lt_cv_aix_libpath_
9469 fi
9470
9471 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
9472 archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
9473 else
9474 if test ia64 = "$host_cpu"; then
9475 hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
9476 allow_undefined_flag="-z nodefs"
9477 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
9478 else
9479 # Determine the default libpath from the value encoded in an
9480 # empty executable.
9481 if test set = "${lt_cv_aix_libpath+set}"; then
9482 aix_libpath=$lt_cv_aix_libpath
9483 else
9484 if ${lt_cv_aix_libpath_+:} false; then :
9485 $as_echo_n "(cached) " >&6
9486 else
9487 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9488 /* end confdefs.h. */
9489
9490 int
9491 main ()
9492 {
9493
9494 ;
9495 return 0;
9496 }
9497 _ACEOF
9498 if ac_fn_c_try_link "$LINENO"; then :
9499
9500 lt_aix_libpath_sed='
9501 /Import File Strings/,/^$/ {
9502 /^0/ {
9503 s/^0 *\([^ ]*\) *$/\1/
9504 p
9505 }
9506 }'
9507 lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9508 # Check for a 64-bit object if we didn't find anything.
9509 if test -z "$lt_cv_aix_libpath_"; then
9510 lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9511 fi
9512 fi
9513 rm -f core conftest.err conftest.$ac_objext \
9514 conftest$ac_exeext conftest.$ac_ext
9515 if test -z "$lt_cv_aix_libpath_"; then
9516 lt_cv_aix_libpath_=/usr/lib:/lib
9517 fi
9518
9519 fi
9520
9521 aix_libpath=$lt_cv_aix_libpath_
9522 fi
9523
9524 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
9525 # Warning - without using the other run time loading flags,
9526 # -berok will link without error, but may produce a broken library.
9527 no_undefined_flag=' $wl-bernotok'
9528 allow_undefined_flag=' $wl-berok'
9529 if test yes = "$with_gnu_ld"; then
9530 # We only use this code for GNU lds that support --whole-archive.
9531 whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
9532 else
9533 # Exported symbols can be pulled into shared objects from archives
9534 whole_archive_flag_spec='$convenience'
9535 fi
9536 archive_cmds_need_lc=yes
9537 archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
9538 # -brtl affects multiple linker settings, -berok does not and is overridden later
9539 compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
9540 if test svr4 != "$with_aix_soname"; then
9541 # This is similar to how AIX traditionally builds its shared libraries.
9542 archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
9543 fi
9544 if test aix != "$with_aix_soname"; then
9545 archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
9546 else
9547 # used by -dlpreopen to get the symbols
9548 archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
9549 fi
9550 archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
9551 fi
9552 fi
9553 ;;
9554
9555 amigaos*)
9556 case $host_cpu in
9557 powerpc)
9558 # see comment about AmigaOS4 .so support
9559 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9560 archive_expsym_cmds=''
9561 ;;
9562 m68k)
9563 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)'
9564 hardcode_libdir_flag_spec='-L$libdir'
9565 hardcode_minus_L=yes
9566 ;;
9567 esac
9568 ;;
9569
9570 bsdi[45]*)
9571 export_dynamic_flag_spec=-rdynamic
9572 ;;
9573
9574 cygwin* | mingw* | pw32* | cegcc*)
9575 # When not using gcc, we currently assume that we are using
9576 # Microsoft Visual C++.
9577 # hardcode_libdir_flag_spec is actually meaningless, as there is
9578 # no search path for DLLs.
9579 case $cc_basename in
9580 cl*)
9581 # Native MSVC
9582 hardcode_libdir_flag_spec=' '
9583 allow_undefined_flag=unsupported
9584 always_export_symbols=yes
9585 file_list_spec='@'
9586 # Tell ltmain to make .lib files, not .a files.
9587 libext=lib
9588 # Tell ltmain to make .dll files, not .so files.
9589 shrext_cmds=.dll
9590 # FIXME: Setting linknames here is a bad hack.
9591 archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
9592 archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
9593 cp "$export_symbols" "$output_objdir/$soname.def";
9594 echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
9595 else
9596 $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
9597 fi~
9598 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
9599 linknames='
9600 # The linker will not automatically build a static lib if we build a DLL.
9601 # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
9602 enable_shared_with_static_runtimes=yes
9603 exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
9604 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
9605 # Don't use ranlib
9606 old_postinstall_cmds='chmod 644 $oldlib'
9607 postlink_cmds='lt_outputfile="@OUTPUT@"~
9608 lt_tool_outputfile="@TOOL_OUTPUT@"~
9609 case $lt_outputfile in
9610 *.exe|*.EXE) ;;
9611 *)
9612 lt_outputfile=$lt_outputfile.exe
9613 lt_tool_outputfile=$lt_tool_outputfile.exe
9614 ;;
9615 esac~
9616 if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
9617 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
9618 $RM "$lt_outputfile.manifest";
9619 fi'
9620 ;;
9621 *)
9622 # Assume MSVC wrapper
9623 hardcode_libdir_flag_spec=' '
9624 allow_undefined_flag=unsupported
9625 # Tell ltmain to make .lib files, not .a files.
9626 libext=lib
9627 # Tell ltmain to make .dll files, not .so files.
9628 shrext_cmds=.dll
9629 # FIXME: Setting linknames here is a bad hack.
9630 archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
9631 # The linker will automatically build a .lib file if we build a DLL.
9632 old_archive_from_new_cmds='true'
9633 # FIXME: Should let the user specify the lib program.
9634 old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
9635 enable_shared_with_static_runtimes=yes
9636 ;;
9637 esac
9638 ;;
9639
9640 darwin* | rhapsody*)
9641
9642
9643 archive_cmds_need_lc=no
9644 hardcode_direct=no
9645 hardcode_automatic=yes
9646 hardcode_shlibpath_var=unsupported
9647 if test yes = "$lt_cv_ld_force_load"; then
9648 whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
9649
9650 else
9651 whole_archive_flag_spec=''
9652 fi
9653 link_all_deplibs=yes
9654 allow_undefined_flag=$_lt_dar_allow_undefined
9655 case $cc_basename in
9656 ifort*|nagfor*) _lt_dar_can_shared=yes ;;
9657 *) _lt_dar_can_shared=$GCC ;;
9658 esac
9659 if test yes = "$_lt_dar_can_shared"; then
9660 output_verbose_link_cmd=func_echo_all
9661 archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
9662 module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
9663 archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
9664 module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
9665
9666 else
9667 ld_shlibs=no
9668 fi
9669
9670 ;;
9671
9672 dgux*)
9673 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9674 hardcode_libdir_flag_spec='-L$libdir'
9675 hardcode_shlibpath_var=no
9676 ;;
9677
9678 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
9679 # support. Future versions do this automatically, but an explicit c++rt0.o
9680 # does not break anything, and helps significantly (at the cost of a little
9681 # extra space).
9682 freebsd2.2*)
9683 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
9684 hardcode_libdir_flag_spec='-R$libdir'
9685 hardcode_direct=yes
9686 hardcode_shlibpath_var=no
9687 ;;
9688
9689 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
9690 freebsd2.*)
9691 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9692 hardcode_direct=yes
9693 hardcode_minus_L=yes
9694 hardcode_shlibpath_var=no
9695 ;;
9696
9697 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
9698 freebsd* | dragonfly*)
9699 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9700 hardcode_libdir_flag_spec='-R$libdir'
9701 hardcode_direct=yes
9702 hardcode_shlibpath_var=no
9703 ;;
9704
9705 hpux9*)
9706 if test yes = "$GCC"; then
9707 archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
9708 else
9709 archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
9710 fi
9711 hardcode_libdir_flag_spec='$wl+b $wl$libdir'
9712 hardcode_libdir_separator=:
9713 hardcode_direct=yes
9714
9715 # hardcode_minus_L: Not really in the search PATH,
9716 # but as the default location of the library.
9717 hardcode_minus_L=yes
9718 export_dynamic_flag_spec='$wl-E'
9719 ;;
9720
9721 hpux10*)
9722 if test yes,no = "$GCC,$with_gnu_ld"; then
9723 archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9724 else
9725 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
9726 fi
9727 if test no = "$with_gnu_ld"; then
9728 hardcode_libdir_flag_spec='$wl+b $wl$libdir'
9729 hardcode_libdir_separator=:
9730 hardcode_direct=yes
9731 hardcode_direct_absolute=yes
9732 export_dynamic_flag_spec='$wl-E'
9733 # hardcode_minus_L: Not really in the search PATH,
9734 # but as the default location of the library.
9735 hardcode_minus_L=yes
9736 fi
9737 ;;
9738
9739 hpux11*)
9740 if test yes,no = "$GCC,$with_gnu_ld"; then
9741 case $host_cpu in
9742 hppa*64*)
9743 archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9744 ;;
9745 ia64*)
9746 archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9747 ;;
9748 *)
9749 archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9750 ;;
9751 esac
9752 else
9753 case $host_cpu in
9754 hppa*64*)
9755 archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9756 ;;
9757 ia64*)
9758 archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9759 ;;
9760 *)
9761
9762 # Older versions of the 11.00 compiler do not understand -b yet
9763 # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
9764 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
9765 $as_echo_n "checking if $CC understands -b... " >&6; }
9766 if ${lt_cv_prog_compiler__b+:} false; then :
9767 $as_echo_n "(cached) " >&6
9768 else
9769 lt_cv_prog_compiler__b=no
9770 save_LDFLAGS=$LDFLAGS
9771 LDFLAGS="$LDFLAGS -b"
9772 echo "$lt_simple_link_test_code" > conftest.$ac_ext
9773 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
9774 # The linker can only warn and ignore the option if not recognized
9775 # So say no if there are warnings
9776 if test -s conftest.err; then
9777 # Append any errors to the config.log.
9778 cat conftest.err 1>&5
9779 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
9780 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
9781 if diff conftest.exp conftest.er2 >/dev/null; then
9782 lt_cv_prog_compiler__b=yes
9783 fi
9784 else
9785 lt_cv_prog_compiler__b=yes
9786 fi
9787 fi
9788 $RM -r conftest*
9789 LDFLAGS=$save_LDFLAGS
9790
9791 fi
9792 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
9793 $as_echo "$lt_cv_prog_compiler__b" >&6; }
9794
9795 if test yes = "$lt_cv_prog_compiler__b"; then
9796 archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9797 else
9798 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
9799 fi
9800
9801 ;;
9802 esac
9803 fi
9804 if test no = "$with_gnu_ld"; then
9805 hardcode_libdir_flag_spec='$wl+b $wl$libdir'
9806 hardcode_libdir_separator=:
9807
9808 case $host_cpu in
9809 hppa*64*|ia64*)
9810 hardcode_direct=no
9811 hardcode_shlibpath_var=no
9812 ;;
9813 *)
9814 hardcode_direct=yes
9815 hardcode_direct_absolute=yes
9816 export_dynamic_flag_spec='$wl-E'
9817
9818 # hardcode_minus_L: Not really in the search PATH,
9819 # but as the default location of the library.
9820 hardcode_minus_L=yes
9821 ;;
9822 esac
9823 fi
9824 ;;
9825
9826 irix5* | irix6* | nonstopux*)
9827 if test yes = "$GCC"; then
9828 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
9829 # Try to use the -exported_symbol ld option, if it does not
9830 # work, assume that -exports_file does not work either and
9831 # implicitly export all symbols.
9832 # This should be the same for all languages, so no per-tag cache variable.
9833 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
9834 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
9835 if ${lt_cv_irix_exported_symbol+:} false; then :
9836 $as_echo_n "(cached) " >&6
9837 else
9838 save_LDFLAGS=$LDFLAGS
9839 LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
9840 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9841 /* end confdefs.h. */
9842 int foo (void) { return 0; }
9843 _ACEOF
9844 if ac_fn_c_try_link "$LINENO"; then :
9845 lt_cv_irix_exported_symbol=yes
9846 else
9847 lt_cv_irix_exported_symbol=no
9848 fi
9849 rm -f core conftest.err conftest.$ac_objext \
9850 conftest$ac_exeext conftest.$ac_ext
9851 LDFLAGS=$save_LDFLAGS
9852 fi
9853 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
9854 $as_echo "$lt_cv_irix_exported_symbol" >&6; }
9855 if test yes = "$lt_cv_irix_exported_symbol"; then
9856 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
9857 fi
9858 link_all_deplibs=no
9859 else
9860 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
9861 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
9862 fi
9863 archive_cmds_need_lc='no'
9864 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9865 hardcode_libdir_separator=:
9866 inherit_rpath=yes
9867 link_all_deplibs=yes
9868 ;;
9869
9870 linux*)
9871 case $cc_basename in
9872 tcc*)
9873 # Fabrice Bellard et al's Tiny C Compiler
9874 ld_shlibs=yes
9875 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9876 ;;
9877 esac
9878 ;;
9879
9880 netbsd* | netbsdelf*-gnu)
9881 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9882 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
9883 else
9884 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
9885 fi
9886 hardcode_libdir_flag_spec='-R$libdir'
9887 hardcode_direct=yes
9888 hardcode_shlibpath_var=no
9889 ;;
9890
9891 newsos6)
9892 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9893 hardcode_direct=yes
9894 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9895 hardcode_libdir_separator=:
9896 hardcode_shlibpath_var=no
9897 ;;
9898
9899 *nto* | *qnx*)
9900 ;;
9901
9902 openbsd* | bitrig*)
9903 if test -f /usr/libexec/ld.so; then
9904 hardcode_direct=yes
9905 hardcode_shlibpath_var=no
9906 hardcode_direct_absolute=yes
9907 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
9908 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9909 archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
9910 hardcode_libdir_flag_spec='$wl-rpath,$libdir'
9911 export_dynamic_flag_spec='$wl-E'
9912 else
9913 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9914 hardcode_libdir_flag_spec='$wl-rpath,$libdir'
9915 fi
9916 else
9917 ld_shlibs=no
9918 fi
9919 ;;
9920
9921 os2*)
9922 hardcode_libdir_flag_spec='-L$libdir'
9923 hardcode_minus_L=yes
9924 allow_undefined_flag=unsupported
9925 shrext_cmds=.dll
9926 archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9927 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9928 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9929 $ECHO EXPORTS >> $output_objdir/$libname.def~
9930 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
9931 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9932 emximp -o $lib $output_objdir/$libname.def'
9933 archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9934 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9935 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9936 $ECHO EXPORTS >> $output_objdir/$libname.def~
9937 prefix_cmds="$SED"~
9938 if test EXPORTS = "`$SED 1q $export_symbols`"; then
9939 prefix_cmds="$prefix_cmds -e 1d";
9940 fi~
9941 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
9942 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
9943 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9944 emximp -o $lib $output_objdir/$libname.def'
9945 old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
9946 enable_shared_with_static_runtimes=yes
9947 ;;
9948
9949 osf3*)
9950 if test yes = "$GCC"; then
9951 allow_undefined_flag=' $wl-expect_unresolved $wl\*'
9952 archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
9953 else
9954 allow_undefined_flag=' -expect_unresolved \*'
9955 archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
9956 fi
9957 archive_cmds_need_lc='no'
9958 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9959 hardcode_libdir_separator=:
9960 ;;
9961
9962 osf4* | osf5*) # as osf3* with the addition of -msym flag
9963 if test yes = "$GCC"; then
9964 allow_undefined_flag=' $wl-expect_unresolved $wl\*'
9965 archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
9966 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9967 else
9968 allow_undefined_flag=' -expect_unresolved \*'
9969 archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
9970 archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
9971 $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
9972
9973 # Both c and cxx compiler support -rpath directly
9974 hardcode_libdir_flag_spec='-rpath $libdir'
9975 fi
9976 archive_cmds_need_lc='no'
9977 hardcode_libdir_separator=:
9978 ;;
9979
9980 solaris*)
9981 no_undefined_flag=' -z defs'
9982 if test yes = "$GCC"; then
9983 wlarc='$wl'
9984 archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9985 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9986 $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
9987 else
9988 case `$CC -V 2>&1` in
9989 *"Compilers 5.0"*)
9990 wlarc=''
9991 archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
9992 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9993 $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
9994 ;;
9995 *)
9996 wlarc='$wl'
9997 archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
9998 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9999 $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
10000 ;;
10001 esac
10002 fi
10003 hardcode_libdir_flag_spec='-R$libdir'
10004 hardcode_shlibpath_var=no
10005 case $host_os in
10006 solaris2.[0-5] | solaris2.[0-5].*) ;;
10007 *)
10008 # The compiler driver will combine and reorder linker options,
10009 # but understands '-z linker_flag'. GCC discards it without '$wl',
10010 # but is careful enough not to reorder.
10011 # Supported since Solaris 2.6 (maybe 2.5.1?)
10012 if test yes = "$GCC"; then
10013 whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
10014 else
10015 whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
10016 fi
10017 ;;
10018 esac
10019 link_all_deplibs=yes
10020 ;;
10021
10022 sunos4*)
10023 if test sequent = "$host_vendor"; then
10024 # Use $CC to link under sequent, because it throws in some extra .o
10025 # files that make .init and .fini sections work.
10026 archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
10027 else
10028 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
10029 fi
10030 hardcode_libdir_flag_spec='-L$libdir'
10031 hardcode_direct=yes
10032 hardcode_minus_L=yes
10033 hardcode_shlibpath_var=no
10034 ;;
10035
10036 sysv4)
10037 case $host_vendor in
10038 sni)
10039 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10040 hardcode_direct=yes # is this really true???
10041 ;;
10042 siemens)
10043 ## LD is ld it makes a PLAMLIB
10044 ## CC just makes a GrossModule.
10045 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
10046 reload_cmds='$CC -r -o $output$reload_objs'
10047 hardcode_direct=no
10048 ;;
10049 motorola)
10050 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10051 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
10052 ;;
10053 esac
10054 runpath_var='LD_RUN_PATH'
10055 hardcode_shlibpath_var=no
10056 ;;
10057
10058 sysv4.3*)
10059 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10060 hardcode_shlibpath_var=no
10061 export_dynamic_flag_spec='-Bexport'
10062 ;;
10063
10064 sysv4*MP*)
10065 if test -d /usr/nec; then
10066 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10067 hardcode_shlibpath_var=no
10068 runpath_var=LD_RUN_PATH
10069 hardcode_runpath_var=yes
10070 ld_shlibs=yes
10071 fi
10072 ;;
10073
10074 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
10075 no_undefined_flag='$wl-z,text'
10076 archive_cmds_need_lc=no
10077 hardcode_shlibpath_var=no
10078 runpath_var='LD_RUN_PATH'
10079
10080 if test yes = "$GCC"; then
10081 archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10082 archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10083 else
10084 archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10085 archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10086 fi
10087 ;;
10088
10089 sysv5* | sco3.2v5* | sco5v6*)
10090 # Note: We CANNOT use -z defs as we might desire, because we do not
10091 # link with -lc, and that would cause any symbols used from libc to
10092 # always be unresolved, which means just about no library would
10093 # ever link correctly. If we're not using GNU ld we use -z text
10094 # though, which does catch some bad symbols but isn't as heavy-handed
10095 # as -z defs.
10096 no_undefined_flag='$wl-z,text'
10097 allow_undefined_flag='$wl-z,nodefs'
10098 archive_cmds_need_lc=no
10099 hardcode_shlibpath_var=no
10100 hardcode_libdir_flag_spec='$wl-R,$libdir'
10101 hardcode_libdir_separator=':'
10102 link_all_deplibs=yes
10103 export_dynamic_flag_spec='$wl-Bexport'
10104 runpath_var='LD_RUN_PATH'
10105
10106 if test yes = "$GCC"; then
10107 archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10108 archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10109 else
10110 archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10111 archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10112 fi
10113 ;;
10114
10115 uts4*)
10116 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10117 hardcode_libdir_flag_spec='-L$libdir'
10118 hardcode_shlibpath_var=no
10119 ;;
10120
10121 *)
10122 ld_shlibs=no
10123 ;;
10124 esac
10125
10126 if test sni = "$host_vendor"; then
10127 case $host in
10128 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
10129 export_dynamic_flag_spec='$wl-Blargedynsym'
10130 ;;
10131 esac
10132 fi
10133 fi
10134
10135 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
10136 $as_echo "$ld_shlibs" >&6; }
10137 test no = "$ld_shlibs" && can_build_shared=no
10138
10139 with_gnu_ld=$with_gnu_ld
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155 #
10156 # Do we need to explicitly link libc?
10157 #
10158 case "x$archive_cmds_need_lc" in
10159 x|xyes)
10160 # Assume -lc should be added
10161 archive_cmds_need_lc=yes
10162
10163 if test yes,yes = "$GCC,$enable_shared"; then
10164 case $archive_cmds in
10165 *'~'*)
10166 # FIXME: we may have to deal with multi-command sequences.
10167 ;;
10168 '$CC '*)
10169 # Test whether the compiler implicitly links with -lc since on some
10170 # systems, -lgcc has to come before -lc. If gcc already passes -lc
10171 # to ld, don't add -lc before -lgcc.
10172 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
10173 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
10174 if ${lt_cv_archive_cmds_need_lc+:} false; then :
10175 $as_echo_n "(cached) " >&6
10176 else
10177 $RM conftest*
10178 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
10179
10180 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
10181 (eval $ac_compile) 2>&5
10182 ac_status=$?
10183 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10184 test $ac_status = 0; } 2>conftest.err; then
10185 soname=conftest
10186 lib=conftest
10187 libobjs=conftest.$ac_objext
10188 deplibs=
10189 wl=$lt_prog_compiler_wl
10190 pic_flag=$lt_prog_compiler_pic
10191 compiler_flags=-v
10192 linker_flags=-v
10193 verstring=
10194 output_objdir=.
10195 libname=conftest
10196 lt_save_allow_undefined_flag=$allow_undefined_flag
10197 allow_undefined_flag=
10198 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
10199 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
10200 ac_status=$?
10201 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10202 test $ac_status = 0; }
10203 then
10204 lt_cv_archive_cmds_need_lc=no
10205 else
10206 lt_cv_archive_cmds_need_lc=yes
10207 fi
10208 allow_undefined_flag=$lt_save_allow_undefined_flag
10209 else
10210 cat conftest.err 1>&5
10211 fi
10212 $RM conftest*
10213
10214 fi
10215 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
10216 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
10217 archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
10218 ;;
10219 esac
10220 fi
10221 ;;
10222 esac
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
10376 $as_echo_n "checking dynamic linker characteristics... " >&6; }
10377
10378 if test yes = "$GCC"; then
10379 case $host_os in
10380 darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
10381 *) lt_awk_arg='/^libraries:/' ;;
10382 esac
10383 case $host_os in
10384 mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
10385 *) lt_sed_strip_eq='s|=/|/|g' ;;
10386 esac
10387 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
10388 case $lt_search_path_spec in
10389 *\;*)
10390 # if the path contains ";" then we assume it to be the separator
10391 # otherwise default to the standard path separator (i.e. ":") - it is
10392 # assumed that no part of a normal pathname contains ";" but that should
10393 # okay in the real world where ";" in dirpaths is itself problematic.
10394 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
10395 ;;
10396 *)
10397 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
10398 ;;
10399 esac
10400 # Ok, now we have the path, separated by spaces, we can step through it
10401 # and add multilib dir if necessary...
10402 lt_tmp_lt_search_path_spec=
10403 lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
10404 # ...but if some path component already ends with the multilib dir we assume
10405 # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
10406 case "$lt_multi_os_dir; $lt_search_path_spec " in
10407 "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
10408 lt_multi_os_dir=
10409 ;;
10410 esac
10411 for lt_sys_path in $lt_search_path_spec; do
10412 if test -d "$lt_sys_path$lt_multi_os_dir"; then
10413 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
10414 elif test -n "$lt_multi_os_dir"; then
10415 test -d "$lt_sys_path" && \
10416 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
10417 fi
10418 done
10419 lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
10420 BEGIN {RS = " "; FS = "/|\n";} {
10421 lt_foo = "";
10422 lt_count = 0;
10423 for (lt_i = NF; lt_i > 0; lt_i--) {
10424 if ($lt_i != "" && $lt_i != ".") {
10425 if ($lt_i == "..") {
10426 lt_count++;
10427 } else {
10428 if (lt_count == 0) {
10429 lt_foo = "/" $lt_i lt_foo;
10430 } else {
10431 lt_count--;
10432 }
10433 }
10434 }
10435 }
10436 if (lt_foo != "") { lt_freq[lt_foo]++; }
10437 if (lt_freq[lt_foo] == 1) { print lt_foo; }
10438 }'`
10439 # AWK program above erroneously prepends '/' to C:/dos/paths
10440 # for these hosts.
10441 case $host_os in
10442 mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
10443 $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
10444 esac
10445 sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
10446 else
10447 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
10448 fi
10449 library_names_spec=
10450 libname_spec='lib$name'
10451 soname_spec=
10452 shrext_cmds=.so
10453 postinstall_cmds=
10454 postuninstall_cmds=
10455 finish_cmds=
10456 finish_eval=
10457 shlibpath_var=
10458 shlibpath_overrides_runpath=unknown
10459 version_type=none
10460 dynamic_linker="$host_os ld.so"
10461 sys_lib_dlsearch_path_spec="/lib /usr/lib"
10462 need_lib_prefix=unknown
10463 hardcode_into_libs=no
10464
10465 # when you set need_version to no, make sure it does not cause -set_version
10466 # flags to be left without arguments
10467 need_version=unknown
10468
10469
10470
10471 case $host_os in
10472 aix3*)
10473 version_type=linux # correct to gnu/linux during the next big refactor
10474 library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
10475 shlibpath_var=LIBPATH
10476
10477 # AIX 3 has no versioning support, so we append a major version to the name.
10478 soname_spec='$libname$release$shared_ext$major'
10479 ;;
10480
10481 aix[4-9]*)
10482 version_type=linux # correct to gnu/linux during the next big refactor
10483 need_lib_prefix=no
10484 need_version=no
10485 hardcode_into_libs=yes
10486 if test ia64 = "$host_cpu"; then
10487 # AIX 5 supports IA64
10488 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
10489 shlibpath_var=LD_LIBRARY_PATH
10490 else
10491 # With GCC up to 2.95.x, collect2 would create an import file
10492 # for dependence libraries. The import file would start with
10493 # the line '#! .'. This would cause the generated library to
10494 # depend on '.', always an invalid library. This was fixed in
10495 # development snapshots of GCC prior to 3.0.
10496 case $host_os in
10497 aix4 | aix4.[01] | aix4.[01].*)
10498 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
10499 echo ' yes '
10500 echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
10501 :
10502 else
10503 can_build_shared=no
10504 fi
10505 ;;
10506 esac
10507 # Using Import Files as archive members, it is possible to support
10508 # filename-based versioning of shared library archives on AIX. While
10509 # this would work for both with and without runtime linking, it will
10510 # prevent static linking of such archives. So we do filename-based
10511 # shared library versioning with .so extension only, which is used
10512 # when both runtime linking and shared linking is enabled.
10513 # Unfortunately, runtime linking may impact performance, so we do
10514 # not want this to be the default eventually. Also, we use the
10515 # versioned .so libs for executables only if there is the -brtl
10516 # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
10517 # To allow for filename-based versioning support, we need to create
10518 # libNAME.so.V as an archive file, containing:
10519 # *) an Import File, referring to the versioned filename of the
10520 # archive as well as the shared archive member, telling the
10521 # bitwidth (32 or 64) of that shared object, and providing the
10522 # list of exported symbols of that shared object, eventually
10523 # decorated with the 'weak' keyword
10524 # *) the shared object with the F_LOADONLY flag set, to really avoid
10525 # it being seen by the linker.
10526 # At run time we better use the real file rather than another symlink,
10527 # but for link time we create the symlink libNAME.so -> libNAME.so.V
10528
10529 case $with_aix_soname,$aix_use_runtimelinking in
10530 # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
10531 # soname into executable. Probably we can add versioning support to
10532 # collect2, so additional links can be useful in future.
10533 aix,yes) # traditional libtool
10534 dynamic_linker='AIX unversionable lib.so'
10535 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
10536 # instead of lib<name>.a to let people know that these are not
10537 # typical AIX shared libraries.
10538 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10539 ;;
10540 aix,no) # traditional AIX only
10541 dynamic_linker='AIX lib.a(lib.so.V)'
10542 # We preserve .a as extension for shared libraries through AIX4.2
10543 # and later when we are not doing run time linking.
10544 library_names_spec='$libname$release.a $libname.a'
10545 soname_spec='$libname$release$shared_ext$major'
10546 ;;
10547 svr4,*) # full svr4 only
10548 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
10549 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
10550 # We do not specify a path in Import Files, so LIBPATH fires.
10551 shlibpath_overrides_runpath=yes
10552 ;;
10553 *,yes) # both, prefer svr4
10554 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
10555 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
10556 # unpreferred sharedlib libNAME.a needs extra handling
10557 postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
10558 postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
10559 # We do not specify a path in Import Files, so LIBPATH fires.
10560 shlibpath_overrides_runpath=yes
10561 ;;
10562 *,no) # both, prefer aix
10563 dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
10564 library_names_spec='$libname$release.a $libname.a'
10565 soname_spec='$libname$release$shared_ext$major'
10566 # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
10567 postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
10568 postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
10569 ;;
10570 esac
10571 shlibpath_var=LIBPATH
10572 fi
10573 ;;
10574
10575 amigaos*)
10576 case $host_cpu in
10577 powerpc)
10578 # Since July 2007 AmigaOS4 officially supports .so libraries.
10579 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
10580 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10581 ;;
10582 m68k)
10583 library_names_spec='$libname.ixlibrary $libname.a'
10584 # Create ${libname}_ixlibrary.a entries in /sys/libs.
10585 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $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'
10586 ;;
10587 esac
10588 ;;
10589
10590 beos*)
10591 library_names_spec='$libname$shared_ext'
10592 dynamic_linker="$host_os ld.so"
10593 shlibpath_var=LIBRARY_PATH
10594 ;;
10595
10596 bsdi[45]*)
10597 version_type=linux # correct to gnu/linux during the next big refactor
10598 need_version=no
10599 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10600 soname_spec='$libname$release$shared_ext$major'
10601 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
10602 shlibpath_var=LD_LIBRARY_PATH
10603 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
10604 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
10605 # the default ld.so.conf also contains /usr/contrib/lib and
10606 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
10607 # libtool to hard-code these into programs
10608 ;;
10609
10610 cygwin* | mingw* | pw32* | cegcc*)
10611 version_type=windows
10612 shrext_cmds=.dll
10613 need_version=no
10614 need_lib_prefix=no
10615
10616 case $GCC,$cc_basename in
10617 yes,*)
10618 # gcc
10619 library_names_spec='$libname.dll.a'
10620 # DLL is installed to $(libdir)/../bin by postinstall_cmds
10621 postinstall_cmds='base_file=`basename \$file`~
10622 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
10623 dldir=$destdir/`dirname \$dlpath`~
10624 test -d \$dldir || mkdir -p \$dldir~
10625 $install_prog $dir/$dlname \$dldir/$dlname~
10626 chmod a+x \$dldir/$dlname~
10627 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
10628 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
10629 fi'
10630 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
10631 dlpath=$dir/\$dldll~
10632 $RM \$dlpath'
10633 shlibpath_overrides_runpath=yes
10634
10635 case $host_os in
10636 cygwin*)
10637 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
10638 soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
10639
10640 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
10641 ;;
10642 mingw* | cegcc*)
10643 # MinGW DLLs use traditional 'lib' prefix
10644 soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
10645 ;;
10646 pw32*)
10647 # pw32 DLLs use 'pw' prefix rather than 'lib'
10648 library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
10649 ;;
10650 esac
10651 dynamic_linker='Win32 ld.exe'
10652 ;;
10653
10654 *,cl*)
10655 # Native MSVC
10656 libname_spec='$name'
10657 soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
10658 library_names_spec='$libname.dll.lib'
10659
10660 case $build_os in
10661 mingw*)
10662 sys_lib_search_path_spec=
10663 lt_save_ifs=$IFS
10664 IFS=';'
10665 for lt_path in $LIB
10666 do
10667 IFS=$lt_save_ifs
10668 # Let DOS variable expansion print the short 8.3 style file name.
10669 lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
10670 sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
10671 done
10672 IFS=$lt_save_ifs
10673 # Convert to MSYS style.
10674 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
10675 ;;
10676 cygwin*)
10677 # Convert to unix form, then to dos form, then back to unix form
10678 # but this time dos style (no spaces!) so that the unix form looks
10679 # like /cygdrive/c/PROGRA~1:/cygdr...
10680 sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
10681 sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
10682 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
10683 ;;
10684 *)
10685 sys_lib_search_path_spec=$LIB
10686 if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
10687 # It is most probably a Windows format PATH.
10688 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
10689 else
10690 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
10691 fi
10692 # FIXME: find the short name or the path components, as spaces are
10693 # common. (e.g. "Program Files" -> "PROGRA~1")
10694 ;;
10695 esac
10696
10697 # DLL is installed to $(libdir)/../bin by postinstall_cmds
10698 postinstall_cmds='base_file=`basename \$file`~
10699 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
10700 dldir=$destdir/`dirname \$dlpath`~
10701 test -d \$dldir || mkdir -p \$dldir~
10702 $install_prog $dir/$dlname \$dldir/$dlname'
10703 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
10704 dlpath=$dir/\$dldll~
10705 $RM \$dlpath'
10706 shlibpath_overrides_runpath=yes
10707 dynamic_linker='Win32 link.exe'
10708 ;;
10709
10710 *)
10711 # Assume MSVC wrapper
10712 library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
10713 dynamic_linker='Win32 ld.exe'
10714 ;;
10715 esac
10716 # FIXME: first we should search . and the directory the executable is in
10717 shlibpath_var=PATH
10718 ;;
10719
10720 darwin* | rhapsody*)
10721 dynamic_linker="$host_os dyld"
10722 version_type=darwin
10723 need_lib_prefix=no
10724 need_version=no
10725 library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
10726 soname_spec='$libname$release$major$shared_ext'
10727 shlibpath_overrides_runpath=yes
10728 shlibpath_var=DYLD_LIBRARY_PATH
10729 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
10730
10731 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
10732 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
10733 ;;
10734
10735 dgux*)
10736 version_type=linux # correct to gnu/linux during the next big refactor
10737 need_lib_prefix=no
10738 need_version=no
10739 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10740 soname_spec='$libname$release$shared_ext$major'
10741 shlibpath_var=LD_LIBRARY_PATH
10742 ;;
10743
10744 freebsd* | dragonfly*)
10745 # DragonFly does not have aout. When/if they implement a new
10746 # versioning mechanism, adjust this.
10747 if test -x /usr/bin/objformat; then
10748 objformat=`/usr/bin/objformat`
10749 else
10750 case $host_os in
10751 freebsd[23].*) objformat=aout ;;
10752 *) objformat=elf ;;
10753 esac
10754 fi
10755 version_type=freebsd-$objformat
10756 case $version_type in
10757 freebsd-elf*)
10758 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10759 soname_spec='$libname$release$shared_ext$major'
10760 need_version=no
10761 need_lib_prefix=no
10762 ;;
10763 freebsd-*)
10764 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
10765 need_version=yes
10766 ;;
10767 esac
10768 shlibpath_var=LD_LIBRARY_PATH
10769 case $host_os in
10770 freebsd2.*)
10771 shlibpath_overrides_runpath=yes
10772 ;;
10773 freebsd3.[01]* | freebsdelf3.[01]*)
10774 shlibpath_overrides_runpath=yes
10775 hardcode_into_libs=yes
10776 ;;
10777 freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
10778 freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
10779 shlibpath_overrides_runpath=no
10780 hardcode_into_libs=yes
10781 ;;
10782 *) # from 4.6 on, and DragonFly
10783 shlibpath_overrides_runpath=yes
10784 hardcode_into_libs=yes
10785 ;;
10786 esac
10787 ;;
10788
10789 haiku*)
10790 version_type=linux # correct to gnu/linux during the next big refactor
10791 need_lib_prefix=no
10792 need_version=no
10793 dynamic_linker="$host_os runtime_loader"
10794 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10795 soname_spec='$libname$release$shared_ext$major'
10796 shlibpath_var=LIBRARY_PATH
10797 shlibpath_overrides_runpath=no
10798 sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
10799 hardcode_into_libs=yes
10800 ;;
10801
10802 hpux9* | hpux10* | hpux11*)
10803 # Give a soname corresponding to the major version so that dld.sl refuses to
10804 # link against other versions.
10805 version_type=sunos
10806 need_lib_prefix=no
10807 need_version=no
10808 case $host_cpu in
10809 ia64*)
10810 shrext_cmds='.so'
10811 hardcode_into_libs=yes
10812 dynamic_linker="$host_os dld.so"
10813 shlibpath_var=LD_LIBRARY_PATH
10814 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
10815 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10816 soname_spec='$libname$release$shared_ext$major'
10817 if test 32 = "$HPUX_IA64_MODE"; then
10818 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
10819 sys_lib_dlsearch_path_spec=/usr/lib/hpux32
10820 else
10821 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
10822 sys_lib_dlsearch_path_spec=/usr/lib/hpux64
10823 fi
10824 ;;
10825 hppa*64*)
10826 shrext_cmds='.sl'
10827 hardcode_into_libs=yes
10828 dynamic_linker="$host_os dld.sl"
10829 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
10830 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
10831 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10832 soname_spec='$libname$release$shared_ext$major'
10833 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
10834 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
10835 ;;
10836 *)
10837 shrext_cmds='.sl'
10838 dynamic_linker="$host_os dld.sl"
10839 shlibpath_var=SHLIB_PATH
10840 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
10841 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10842 soname_spec='$libname$release$shared_ext$major'
10843 ;;
10844 esac
10845 # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
10846 postinstall_cmds='chmod 555 $lib'
10847 # or fails outright, so override atomically:
10848 install_override_mode=555
10849 ;;
10850
10851 interix[3-9]*)
10852 version_type=linux # correct to gnu/linux during the next big refactor
10853 need_lib_prefix=no
10854 need_version=no
10855 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10856 soname_spec='$libname$release$shared_ext$major'
10857 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
10858 shlibpath_var=LD_LIBRARY_PATH
10859 shlibpath_overrides_runpath=no
10860 hardcode_into_libs=yes
10861 ;;
10862
10863 irix5* | irix6* | nonstopux*)
10864 case $host_os in
10865 nonstopux*) version_type=nonstopux ;;
10866 *)
10867 if test yes = "$lt_cv_prog_gnu_ld"; then
10868 version_type=linux # correct to gnu/linux during the next big refactor
10869 else
10870 version_type=irix
10871 fi ;;
10872 esac
10873 need_lib_prefix=no
10874 need_version=no
10875 soname_spec='$libname$release$shared_ext$major'
10876 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
10877 case $host_os in
10878 irix5* | nonstopux*)
10879 libsuff= shlibsuff=
10880 ;;
10881 *)
10882 case $LD in # libtool.m4 will add one of these switches to LD
10883 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
10884 libsuff= shlibsuff= libmagic=32-bit;;
10885 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
10886 libsuff=32 shlibsuff=N32 libmagic=N32;;
10887 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
10888 libsuff=64 shlibsuff=64 libmagic=64-bit;;
10889 *) libsuff= shlibsuff= libmagic=never-match;;
10890 esac
10891 ;;
10892 esac
10893 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
10894 shlibpath_overrides_runpath=no
10895 sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
10896 sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
10897 hardcode_into_libs=yes
10898 ;;
10899
10900 # No shared lib support for Linux oldld, aout, or coff.
10901 linux*oldld* | linux*aout* | linux*coff*)
10902 dynamic_linker=no
10903 ;;
10904
10905 linux*android*)
10906 version_type=none # Android doesn't support versioned libraries.
10907 need_lib_prefix=no
10908 need_version=no
10909 library_names_spec='$libname$release$shared_ext'
10910 soname_spec='$libname$release$shared_ext'
10911 finish_cmds=
10912 shlibpath_var=LD_LIBRARY_PATH
10913 shlibpath_overrides_runpath=yes
10914
10915 # This implies no fast_install, which is unacceptable.
10916 # Some rework will be needed to allow for fast_install
10917 # before this can be enabled.
10918 hardcode_into_libs=yes
10919
10920 dynamic_linker='Android linker'
10921 # Don't embed -rpath directories since the linker doesn't support them.
10922 hardcode_libdir_flag_spec='-L$libdir'
10923 ;;
10924
10925 # This must be glibc/ELF.
10926 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
10927 version_type=linux # correct to gnu/linux during the next big refactor
10928 need_lib_prefix=no
10929 need_version=no
10930 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10931 soname_spec='$libname$release$shared_ext$major'
10932 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
10933 shlibpath_var=LD_LIBRARY_PATH
10934 shlibpath_overrides_runpath=no
10935
10936 # Some binutils ld are patched to set DT_RUNPATH
10937 if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
10938 $as_echo_n "(cached) " >&6
10939 else
10940 lt_cv_shlibpath_overrides_runpath=no
10941 save_LDFLAGS=$LDFLAGS
10942 save_libdir=$libdir
10943 eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
10944 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
10945 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10946 /* end confdefs.h. */
10947
10948 int
10949 main ()
10950 {
10951
10952 ;
10953 return 0;
10954 }
10955 _ACEOF
10956 if ac_fn_c_try_link "$LINENO"; then :
10957 if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
10958 lt_cv_shlibpath_overrides_runpath=yes
10959 fi
10960 fi
10961 rm -f core conftest.err conftest.$ac_objext \
10962 conftest$ac_exeext conftest.$ac_ext
10963 LDFLAGS=$save_LDFLAGS
10964 libdir=$save_libdir
10965
10966 fi
10967
10968 shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
10969
10970 # This implies no fast_install, which is unacceptable.
10971 # Some rework will be needed to allow for fast_install
10972 # before this can be enabled.
10973 hardcode_into_libs=yes
10974
10975 # Ideally, we could use ldconfig to report *all* directores which are
10976 # searched for libraries, however this is still not possible. Aside from not
10977 # being certain /sbin/ldconfig is available, command
10978 # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
10979 # even though it is searched at run-time. Try to do the best guess by
10980 # appending ld.so.conf contents (and includes) to the search path.
10981 if test -f /etc/ld.so.conf; then
10982 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
10983 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
10984 fi
10985
10986 # We used to test for /lib/ld.so.1 and disable shared libraries on
10987 # powerpc, because MkLinux only supported shared libraries with the
10988 # GNU dynamic linker. Since this was broken with cross compilers,
10989 # most powerpc-linux boxes support dynamic linking these days and
10990 # people can always --disable-shared, the test was removed, and we
10991 # assume the GNU/Linux dynamic linker is in use.
10992 dynamic_linker='GNU/Linux ld.so'
10993 ;;
10994
10995 netbsdelf*-gnu)
10996 version_type=linux
10997 need_lib_prefix=no
10998 need_version=no
10999 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
11000 soname_spec='${libname}${release}${shared_ext}$major'
11001 shlibpath_var=LD_LIBRARY_PATH
11002 shlibpath_overrides_runpath=no
11003 hardcode_into_libs=yes
11004 dynamic_linker='NetBSD ld.elf_so'
11005 ;;
11006
11007 netbsd*)
11008 version_type=sunos
11009 need_lib_prefix=no
11010 need_version=no
11011 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
11012 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
11013 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
11014 dynamic_linker='NetBSD (a.out) ld.so'
11015 else
11016 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11017 soname_spec='$libname$release$shared_ext$major'
11018 dynamic_linker='NetBSD ld.elf_so'
11019 fi
11020 shlibpath_var=LD_LIBRARY_PATH
11021 shlibpath_overrides_runpath=yes
11022 hardcode_into_libs=yes
11023 ;;
11024
11025 newsos6)
11026 version_type=linux # correct to gnu/linux during the next big refactor
11027 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11028 shlibpath_var=LD_LIBRARY_PATH
11029 shlibpath_overrides_runpath=yes
11030 ;;
11031
11032 *nto* | *qnx*)
11033 version_type=qnx
11034 need_lib_prefix=no
11035 need_version=no
11036 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11037 soname_spec='$libname$release$shared_ext$major'
11038 shlibpath_var=LD_LIBRARY_PATH
11039 shlibpath_overrides_runpath=no
11040 hardcode_into_libs=yes
11041 dynamic_linker='ldqnx.so'
11042 ;;
11043
11044 openbsd* | bitrig*)
11045 version_type=sunos
11046 sys_lib_dlsearch_path_spec=/usr/lib
11047 need_lib_prefix=no
11048 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
11049 need_version=no
11050 else
11051 need_version=yes
11052 fi
11053 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
11054 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
11055 shlibpath_var=LD_LIBRARY_PATH
11056 shlibpath_overrides_runpath=yes
11057 ;;
11058
11059 os2*)
11060 libname_spec='$name'
11061 version_type=windows
11062 shrext_cmds=.dll
11063 need_version=no
11064 need_lib_prefix=no
11065 # OS/2 can only load a DLL with a base name of 8 characters or less.
11066 soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
11067 v=$($ECHO $release$versuffix | tr -d .-);
11068 n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
11069 $ECHO $n$v`$shared_ext'
11070 library_names_spec='${libname}_dll.$libext'
11071 dynamic_linker='OS/2 ld.exe'
11072 shlibpath_var=BEGINLIBPATH
11073 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
11074 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
11075 postinstall_cmds='base_file=`basename \$file`~
11076 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
11077 dldir=$destdir/`dirname \$dlpath`~
11078 test -d \$dldir || mkdir -p \$dldir~
11079 $install_prog $dir/$dlname \$dldir/$dlname~
11080 chmod a+x \$dldir/$dlname~
11081 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
11082 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
11083 fi'
11084 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
11085 dlpath=$dir/\$dldll~
11086 $RM \$dlpath'
11087 ;;
11088
11089 osf3* | osf4* | osf5*)
11090 version_type=osf
11091 need_lib_prefix=no
11092 need_version=no
11093 soname_spec='$libname$release$shared_ext$major'
11094 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11095 shlibpath_var=LD_LIBRARY_PATH
11096 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
11097 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
11098 ;;
11099
11100 rdos*)
11101 dynamic_linker=no
11102 ;;
11103
11104 solaris*)
11105 version_type=linux # correct to gnu/linux during the next big refactor
11106 need_lib_prefix=no
11107 need_version=no
11108 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11109 soname_spec='$libname$release$shared_ext$major'
11110 shlibpath_var=LD_LIBRARY_PATH
11111 shlibpath_overrides_runpath=yes
11112 hardcode_into_libs=yes
11113 # ldd complains unless libraries are executable
11114 postinstall_cmds='chmod +x $lib'
11115 ;;
11116
11117 sunos4*)
11118 version_type=sunos
11119 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
11120 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
11121 shlibpath_var=LD_LIBRARY_PATH
11122 shlibpath_overrides_runpath=yes
11123 if test yes = "$with_gnu_ld"; then
11124 need_lib_prefix=no
11125 fi
11126 need_version=yes
11127 ;;
11128
11129 sysv4 | sysv4.3*)
11130 version_type=linux # correct to gnu/linux during the next big refactor
11131 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11132 soname_spec='$libname$release$shared_ext$major'
11133 shlibpath_var=LD_LIBRARY_PATH
11134 case $host_vendor in
11135 sni)
11136 shlibpath_overrides_runpath=no
11137 need_lib_prefix=no
11138 runpath_var=LD_RUN_PATH
11139 ;;
11140 siemens)
11141 need_lib_prefix=no
11142 ;;
11143 motorola)
11144 need_lib_prefix=no
11145 need_version=no
11146 shlibpath_overrides_runpath=no
11147 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
11148 ;;
11149 esac
11150 ;;
11151
11152 sysv4*MP*)
11153 if test -d /usr/nec; then
11154 version_type=linux # correct to gnu/linux during the next big refactor
11155 library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
11156 soname_spec='$libname$shared_ext.$major'
11157 shlibpath_var=LD_LIBRARY_PATH
11158 fi
11159 ;;
11160
11161 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
11162 version_type=sco
11163 need_lib_prefix=no
11164 need_version=no
11165 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
11166 soname_spec='$libname$release$shared_ext$major'
11167 shlibpath_var=LD_LIBRARY_PATH
11168 shlibpath_overrides_runpath=yes
11169 hardcode_into_libs=yes
11170 if test yes = "$with_gnu_ld"; then
11171 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
11172 else
11173 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
11174 case $host_os in
11175 sco3.2v5*)
11176 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
11177 ;;
11178 esac
11179 fi
11180 sys_lib_dlsearch_path_spec='/usr/lib'
11181 ;;
11182
11183 tpf*)
11184 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
11185 version_type=linux # correct to gnu/linux during the next big refactor
11186 need_lib_prefix=no
11187 need_version=no
11188 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11189 shlibpath_var=LD_LIBRARY_PATH
11190 shlibpath_overrides_runpath=no
11191 hardcode_into_libs=yes
11192 ;;
11193
11194 uts4*)
11195 version_type=linux # correct to gnu/linux during the next big refactor
11196 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11197 soname_spec='$libname$release$shared_ext$major'
11198 shlibpath_var=LD_LIBRARY_PATH
11199 ;;
11200
11201 *)
11202 dynamic_linker=no
11203 ;;
11204 esac
11205 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
11206 $as_echo "$dynamic_linker" >&6; }
11207 test no = "$dynamic_linker" && can_build_shared=no
11208
11209 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
11210 if test yes = "$GCC"; then
11211 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
11212 fi
11213
11214 if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
11215 sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
11216 fi
11217
11218 if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
11219 sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
11220 fi
11221
11222 # remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
11223 configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
11224
11225 # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
11226 func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
11227
11228 # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
11229 configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
11328 $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
11329 hardcode_action=
11330 if test -n "$hardcode_libdir_flag_spec" ||
11331 test -n "$runpath_var" ||
11332 test yes = "$hardcode_automatic"; then
11333
11334 # We can hardcode non-existent directories.
11335 if test no != "$hardcode_direct" &&
11336 # If the only mechanism to avoid hardcoding is shlibpath_var, we
11337 # have to relink, otherwise we might link with an installed library
11338 # when we should be linking with a yet-to-be-installed one
11339 ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
11340 test no != "$hardcode_minus_L"; then
11341 # Linking always hardcodes the temporary library directory.
11342 hardcode_action=relink
11343 else
11344 # We can link without hardcoding, and we can hardcode nonexisting dirs.
11345 hardcode_action=immediate
11346 fi
11347 else
11348 # We cannot hardcode anything, or else we can only hardcode existing
11349 # directories.
11350 hardcode_action=unsupported
11351 fi
11352 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
11353 $as_echo "$hardcode_action" >&6; }
11354
11355 if test relink = "$hardcode_action" ||
11356 test yes = "$inherit_rpath"; then
11357 # Fast installation is not supported
11358 enable_fast_install=no
11359 elif test yes = "$shlibpath_overrides_runpath" ||
11360 test no = "$enable_shared"; then
11361 # Fast installation is not necessary
11362 enable_fast_install=needless
11363 fi
11364
11365
11366
11367
11368
11369
11370 if test yes != "$enable_dlopen"; then
11371 enable_dlopen=unknown
11372 enable_dlopen_self=unknown
11373 enable_dlopen_self_static=unknown
11374 else
11375 lt_cv_dlopen=no
11376 lt_cv_dlopen_libs=
11377
11378 case $host_os in
11379 beos*)
11380 lt_cv_dlopen=load_add_on
11381 lt_cv_dlopen_libs=
11382 lt_cv_dlopen_self=yes
11383 ;;
11384
11385 mingw* | pw32* | cegcc*)
11386 lt_cv_dlopen=LoadLibrary
11387 lt_cv_dlopen_libs=
11388 ;;
11389
11390 cygwin*)
11391 lt_cv_dlopen=dlopen
11392 lt_cv_dlopen_libs=
11393 ;;
11394
11395 darwin*)
11396 # if libdl is installed we need to link against it
11397 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
11398 $as_echo_n "checking for dlopen in -ldl... " >&6; }
11399 if ${ac_cv_lib_dl_dlopen+:} false; then :
11400 $as_echo_n "(cached) " >&6
11401 else
11402 ac_check_lib_save_LIBS=$LIBS
11403 LIBS="-ldl $LIBS"
11404 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11405 /* end confdefs.h. */
11406
11407 /* Override any GCC internal prototype to avoid an error.
11408 Use char because int might match the return type of a GCC
11409 builtin and then its argument prototype would still apply. */
11410 #ifdef __cplusplus
11411 extern "C"
11412 #endif
11413 char dlopen ();
11414 int
11415 main ()
11416 {
11417 return dlopen ();
11418 ;
11419 return 0;
11420 }
11421 _ACEOF
11422 if ac_fn_c_try_link "$LINENO"; then :
11423 ac_cv_lib_dl_dlopen=yes
11424 else
11425 ac_cv_lib_dl_dlopen=no
11426 fi
11427 rm -f core conftest.err conftest.$ac_objext \
11428 conftest$ac_exeext conftest.$ac_ext
11429 LIBS=$ac_check_lib_save_LIBS
11430 fi
11431 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
11432 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
11433 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
11434 lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
11435 else
11436
11437 lt_cv_dlopen=dyld
11438 lt_cv_dlopen_libs=
11439 lt_cv_dlopen_self=yes
11440
11441 fi
11442
11443 ;;
11444
11445 tpf*)
11446 # Don't try to run any link tests for TPF. We know it's impossible
11447 # because TPF is a cross-compiler, and we know how we open DSOs.
11448 lt_cv_dlopen=dlopen
11449 lt_cv_dlopen_libs=
11450 lt_cv_dlopen_self=no
11451 ;;
11452
11453 *)
11454 ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
11455 if test "x$ac_cv_func_shl_load" = xyes; then :
11456 lt_cv_dlopen=shl_load
11457 else
11458 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
11459 $as_echo_n "checking for shl_load in -ldld... " >&6; }
11460 if ${ac_cv_lib_dld_shl_load+:} false; then :
11461 $as_echo_n "(cached) " >&6
11462 else
11463 ac_check_lib_save_LIBS=$LIBS
11464 LIBS="-ldld $LIBS"
11465 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11466 /* end confdefs.h. */
11467
11468 /* Override any GCC internal prototype to avoid an error.
11469 Use char because int might match the return type of a GCC
11470 builtin and then its argument prototype would still apply. */
11471 #ifdef __cplusplus
11472 extern "C"
11473 #endif
11474 char shl_load ();
11475 int
11476 main ()
11477 {
11478 return shl_load ();
11479 ;
11480 return 0;
11481 }
11482 _ACEOF
11483 if ac_fn_c_try_link "$LINENO"; then :
11484 ac_cv_lib_dld_shl_load=yes
11485 else
11486 ac_cv_lib_dld_shl_load=no
11487 fi
11488 rm -f core conftest.err conftest.$ac_objext \
11489 conftest$ac_exeext conftest.$ac_ext
11490 LIBS=$ac_check_lib_save_LIBS
11491 fi
11492 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
11493 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
11494 if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
11495 lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
11496 else
11497 ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
11498 if test "x$ac_cv_func_dlopen" = xyes; then :
11499 lt_cv_dlopen=dlopen
11500 else
11501 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
11502 $as_echo_n "checking for dlopen in -ldl... " >&6; }
11503 if ${ac_cv_lib_dl_dlopen+:} false; then :
11504 $as_echo_n "(cached) " >&6
11505 else
11506 ac_check_lib_save_LIBS=$LIBS
11507 LIBS="-ldl $LIBS"
11508 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11509 /* end confdefs.h. */
11510
11511 /* Override any GCC internal prototype to avoid an error.
11512 Use char because int might match the return type of a GCC
11513 builtin and then its argument prototype would still apply. */
11514 #ifdef __cplusplus
11515 extern "C"
11516 #endif
11517 char dlopen ();
11518 int
11519 main ()
11520 {
11521 return dlopen ();
11522 ;
11523 return 0;
11524 }
11525 _ACEOF
11526 if ac_fn_c_try_link "$LINENO"; then :
11527 ac_cv_lib_dl_dlopen=yes
11528 else
11529 ac_cv_lib_dl_dlopen=no
11530 fi
11531 rm -f core conftest.err conftest.$ac_objext \
11532 conftest$ac_exeext conftest.$ac_ext
11533 LIBS=$ac_check_lib_save_LIBS
11534 fi
11535 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
11536 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
11537 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
11538 lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
11539 else
11540 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
11541 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
11542 if ${ac_cv_lib_svld_dlopen+:} false; then :
11543 $as_echo_n "(cached) " >&6
11544 else
11545 ac_check_lib_save_LIBS=$LIBS
11546 LIBS="-lsvld $LIBS"
11547 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11548 /* end confdefs.h. */
11549
11550 /* Override any GCC internal prototype to avoid an error.
11551 Use char because int might match the return type of a GCC
11552 builtin and then its argument prototype would still apply. */
11553 #ifdef __cplusplus
11554 extern "C"
11555 #endif
11556 char dlopen ();
11557 int
11558 main ()
11559 {
11560 return dlopen ();
11561 ;
11562 return 0;
11563 }
11564 _ACEOF
11565 if ac_fn_c_try_link "$LINENO"; then :
11566 ac_cv_lib_svld_dlopen=yes
11567 else
11568 ac_cv_lib_svld_dlopen=no
11569 fi
11570 rm -f core conftest.err conftest.$ac_objext \
11571 conftest$ac_exeext conftest.$ac_ext
11572 LIBS=$ac_check_lib_save_LIBS
11573 fi
11574 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
11575 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
11576 if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
11577 lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
11578 else
11579 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
11580 $as_echo_n "checking for dld_link in -ldld... " >&6; }
11581 if ${ac_cv_lib_dld_dld_link+:} false; then :
11582 $as_echo_n "(cached) " >&6
11583 else
11584 ac_check_lib_save_LIBS=$LIBS
11585 LIBS="-ldld $LIBS"
11586 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11587 /* end confdefs.h. */
11588
11589 /* Override any GCC internal prototype to avoid an error.
11590 Use char because int might match the return type of a GCC
11591 builtin and then its argument prototype would still apply. */
11592 #ifdef __cplusplus
11593 extern "C"
11594 #endif
11595 char dld_link ();
11596 int
11597 main ()
11598 {
11599 return dld_link ();
11600 ;
11601 return 0;
11602 }
11603 _ACEOF
11604 if ac_fn_c_try_link "$LINENO"; then :
11605 ac_cv_lib_dld_dld_link=yes
11606 else
11607 ac_cv_lib_dld_dld_link=no
11608 fi
11609 rm -f core conftest.err conftest.$ac_objext \
11610 conftest$ac_exeext conftest.$ac_ext
11611 LIBS=$ac_check_lib_save_LIBS
11612 fi
11613 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
11614 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
11615 if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
11616 lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
11617 fi
11618
11619
11620 fi
11621
11622
11623 fi
11624
11625
11626 fi
11627
11628
11629 fi
11630
11631
11632 fi
11633
11634 ;;
11635 esac
11636
11637 if test no = "$lt_cv_dlopen"; then
11638 enable_dlopen=no
11639 else
11640 enable_dlopen=yes
11641 fi
11642
11643 case $lt_cv_dlopen in
11644 dlopen)
11645 save_CPPFLAGS=$CPPFLAGS
11646 test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
11647
11648 save_LDFLAGS=$LDFLAGS
11649 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
11650
11651 save_LIBS=$LIBS
11652 LIBS="$lt_cv_dlopen_libs $LIBS"
11653
11654 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
11655 $as_echo_n "checking whether a program can dlopen itself... " >&6; }
11656 if ${lt_cv_dlopen_self+:} false; then :
11657 $as_echo_n "(cached) " >&6
11658 else
11659 if test yes = "$cross_compiling"; then :
11660 lt_cv_dlopen_self=cross
11661 else
11662 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11663 lt_status=$lt_dlunknown
11664 cat > conftest.$ac_ext <<_LT_EOF
11665 #line $LINENO "configure"
11666 #include "confdefs.h"
11667
11668 #if HAVE_DLFCN_H
11669 #include <dlfcn.h>
11670 #endif
11671
11672 #include <stdio.h>
11673
11674 #ifdef RTLD_GLOBAL
11675 # define LT_DLGLOBAL RTLD_GLOBAL
11676 #else
11677 # ifdef DL_GLOBAL
11678 # define LT_DLGLOBAL DL_GLOBAL
11679 # else
11680 # define LT_DLGLOBAL 0
11681 # endif
11682 #endif
11683
11684 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
11685 find out it does not work in some platform. */
11686 #ifndef LT_DLLAZY_OR_NOW
11687 # ifdef RTLD_LAZY
11688 # define LT_DLLAZY_OR_NOW RTLD_LAZY
11689 # else
11690 # ifdef DL_LAZY
11691 # define LT_DLLAZY_OR_NOW DL_LAZY
11692 # else
11693 # ifdef RTLD_NOW
11694 # define LT_DLLAZY_OR_NOW RTLD_NOW
11695 # else
11696 # ifdef DL_NOW
11697 # define LT_DLLAZY_OR_NOW DL_NOW
11698 # else
11699 # define LT_DLLAZY_OR_NOW 0
11700 # endif
11701 # endif
11702 # endif
11703 # endif
11704 #endif
11705
11706 /* When -fvisibility=hidden is used, assume the code has been annotated
11707 correspondingly for the symbols needed. */
11708 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
11709 int fnord () __attribute__((visibility("default")));
11710 #endif
11711
11712 int fnord () { return 42; }
11713 int main ()
11714 {
11715 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
11716 int status = $lt_dlunknown;
11717
11718 if (self)
11719 {
11720 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
11721 else
11722 {
11723 if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
11724 else puts (dlerror ());
11725 }
11726 /* dlclose (self); */
11727 }
11728 else
11729 puts (dlerror ());
11730
11731 return status;
11732 }
11733 _LT_EOF
11734 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
11735 (eval $ac_link) 2>&5
11736 ac_status=$?
11737 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11738 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
11739 (./conftest; exit; ) >&5 2>/dev/null
11740 lt_status=$?
11741 case x$lt_status in
11742 x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
11743 x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
11744 x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
11745 esac
11746 else :
11747 # compilation failed
11748 lt_cv_dlopen_self=no
11749 fi
11750 fi
11751 rm -fr conftest*
11752
11753
11754 fi
11755 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
11756 $as_echo "$lt_cv_dlopen_self" >&6; }
11757
11758 if test yes = "$lt_cv_dlopen_self"; then
11759 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
11760 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
11761 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
11762 if ${lt_cv_dlopen_self_static+:} false; then :
11763 $as_echo_n "(cached) " >&6
11764 else
11765 if test yes = "$cross_compiling"; then :
11766 lt_cv_dlopen_self_static=cross
11767 else
11768 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11769 lt_status=$lt_dlunknown
11770 cat > conftest.$ac_ext <<_LT_EOF
11771 #line $LINENO "configure"
11772 #include "confdefs.h"
11773
11774 #if HAVE_DLFCN_H
11775 #include <dlfcn.h>
11776 #endif
11777
11778 #include <stdio.h>
11779
11780 #ifdef RTLD_GLOBAL
11781 # define LT_DLGLOBAL RTLD_GLOBAL
11782 #else
11783 # ifdef DL_GLOBAL
11784 # define LT_DLGLOBAL DL_GLOBAL
11785 # else
11786 # define LT_DLGLOBAL 0
11787 # endif
11788 #endif
11789
11790 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
11791 find out it does not work in some platform. */
11792 #ifndef LT_DLLAZY_OR_NOW
11793 # ifdef RTLD_LAZY
11794 # define LT_DLLAZY_OR_NOW RTLD_LAZY
11795 # else
11796 # ifdef DL_LAZY
11797 # define LT_DLLAZY_OR_NOW DL_LAZY
11798 # else
11799 # ifdef RTLD_NOW
11800 # define LT_DLLAZY_OR_NOW RTLD_NOW
11801 # else
11802 # ifdef DL_NOW
11803 # define LT_DLLAZY_OR_NOW DL_NOW
11804 # else
11805 # define LT_DLLAZY_OR_NOW 0
11806 # endif
11807 # endif
11808 # endif
11809 # endif
11810 #endif
11811
11812 /* When -fvisibility=hidden is used, assume the code has been annotated
11813 correspondingly for the symbols needed. */
11814 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
11815 int fnord () __attribute__((visibility("default")));
11816 #endif
11817
11818 int fnord () { return 42; }
11819 int main ()
11820 {
11821 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
11822 int status = $lt_dlunknown;
11823
11824 if (self)
11825 {
11826 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
11827 else
11828 {
11829 if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
11830 else puts (dlerror ());
11831 }
11832 /* dlclose (self); */
11833 }
11834 else
11835 puts (dlerror ());
11836
11837 return status;
11838 }
11839 _LT_EOF
11840 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
11841 (eval $ac_link) 2>&5
11842 ac_status=$?
11843 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11844 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
11845 (./conftest; exit; ) >&5 2>/dev/null
11846 lt_status=$?
11847 case x$lt_status in
11848 x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
11849 x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
11850 x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
11851 esac
11852 else :
11853 # compilation failed
11854 lt_cv_dlopen_self_static=no
11855 fi
11856 fi
11857 rm -fr conftest*
11858
11859
11860 fi
11861 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
11862 $as_echo "$lt_cv_dlopen_self_static" >&6; }
11863 fi
11864
11865 CPPFLAGS=$save_CPPFLAGS
11866 LDFLAGS=$save_LDFLAGS
11867 LIBS=$save_LIBS
11868 ;;
11869 esac
11870
11871 case $lt_cv_dlopen_self in
11872 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
11873 *) enable_dlopen_self=unknown ;;
11874 esac
11875
11876 case $lt_cv_dlopen_self_static in
11877 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
11878 *) enable_dlopen_self_static=unknown ;;
11879 esac
11880 fi
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898 striplib=
11899 old_striplib=
11900 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
11901 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
11902 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
11903 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
11904 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
11905 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
11906 $as_echo "yes" >&6; }
11907 else
11908 # FIXME - insert some real tests, host_os isn't really good enough
11909 case $host_os in
11910 darwin*)
11911 if test -n "$STRIP"; then
11912 striplib="$STRIP -x"
11913 old_striplib="$STRIP -S"
11914 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
11915 $as_echo "yes" >&6; }
11916 else
11917 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11918 $as_echo "no" >&6; }
11919 fi
11920 ;;
11921 *)
11922 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11923 $as_echo "no" >&6; }
11924 ;;
11925 esac
11926 fi
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939 # Report what library types will actually be built
11940 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
11941 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
11942 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
11943 $as_echo "$can_build_shared" >&6; }
11944
11945 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
11946 $as_echo_n "checking whether to build shared libraries... " >&6; }
11947 test no = "$can_build_shared" && enable_shared=no
11948
11949 # On AIX, shared libraries and static libraries use the same namespace, and
11950 # are all built from PIC.
11951 case $host_os in
11952 aix3*)
11953 test yes = "$enable_shared" && enable_static=no
11954 if test -n "$RANLIB"; then
11955 archive_cmds="$archive_cmds~\$RANLIB \$lib"
11956 postinstall_cmds='$RANLIB $lib'
11957 fi
11958 ;;
11959
11960 aix[4-9]*)
11961 if test ia64 != "$host_cpu"; then
11962 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
11963 yes,aix,yes) ;; # shared object as lib.so file only
11964 yes,svr4,*) ;; # shared object as lib.so archive member only
11965 yes,*) enable_static=no ;; # shared object in lib.a archive as well
11966 esac
11967 fi
11968 ;;
11969 esac
11970 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
11971 $as_echo "$enable_shared" >&6; }
11972
11973 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
11974 $as_echo_n "checking whether to build static libraries... " >&6; }
11975 # Make sure either enable_shared or enable_static is yes.
11976 test yes = "$enable_shared" || enable_static=yes
11977 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
11978 $as_echo "$enable_static" >&6; }
11979
11980
11981
11982
11983 fi
11984 ac_ext=c
11985 ac_cpp='$CPP $CPPFLAGS'
11986 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
11987 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
11988 ac_compiler_gnu=$ac_cv_c_compiler_gnu
11989
11990 CC=$lt_save_CC
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006 ac_config_commands="$ac_config_commands libtool"
12007
12008
12009
12010
12011 # Only expand once:
12012
12013
12014 # Find a good install program. We prefer a C program (faster),
12015 # so one script is as good as another. But avoid the broken or
12016 # incompatible versions:
12017 # SysV /etc/install, /usr/sbin/install
12018 # SunOS /usr/etc/install
12019 # IRIX /sbin/install
12020 # AIX /bin/install
12021 # AmigaOS /C/install, which installs bootblocks on floppy discs
12022 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
12023 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
12024 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
12025 # OS/2's system install, which has a completely different semantic
12026 # ./install, which can be erroneously created by make from ./install.sh.
12027 # Reject install programs that cannot install multiple files.
12028 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
12029 $as_echo_n "checking for a BSD-compatible install... " >&6; }
12030 if test -z "$INSTALL"; then
12031 if ${ac_cv_path_install+:} false; then :
12032 $as_echo_n "(cached) " >&6
12033 else
12034 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12035 for as_dir in $PATH
12036 do
12037 IFS=$as_save_IFS
12038 test -z "$as_dir" && as_dir=.
12039 # Account for people who put trailing slashes in PATH elements.
12040 case $as_dir/ in #((
12041 ./ | .// | /[cC]/* | \
12042 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
12043 ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
12044 /usr/ucb/* ) ;;
12045 *)
12046 # OSF1 and SCO ODT 3.0 have their own names for install.
12047 # Don't use installbsd from OSF since it installs stuff as root
12048 # by default.
12049 for ac_prog in ginstall scoinst install; do
12050 for ac_exec_ext in '' $ac_executable_extensions; do
12051 if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
12052 if test $ac_prog = install &&
12053 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
12054 # AIX install. It has an incompatible calling convention.
12055 :
12056 elif test $ac_prog = install &&
12057 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
12058 # program-specific install script used by HP pwplus--don't use.
12059 :
12060 else
12061 rm -rf conftest.one conftest.two conftest.dir
12062 echo one > conftest.one
12063 echo two > conftest.two
12064 mkdir conftest.dir
12065 if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
12066 test -s conftest.one && test -s conftest.two &&
12067 test -s conftest.dir/conftest.one &&
12068 test -s conftest.dir/conftest.two
12069 then
12070 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
12071 break 3
12072 fi
12073 fi
12074 fi
12075 done
12076 done
12077 ;;
12078 esac
12079
12080 done
12081 IFS=$as_save_IFS
12082
12083 rm -rf conftest.one conftest.two conftest.dir
12084
12085 fi
12086 if test "${ac_cv_path_install+set}" = set; then
12087 INSTALL=$ac_cv_path_install
12088 else
12089 # As a last resort, use the slow shell script. Don't cache a
12090 # value for INSTALL within a source directory, because that will
12091 # break other packages using the cache if that directory is
12092 # removed, or if the value is a relative name.
12093 INSTALL=$ac_install_sh
12094 fi
12095 fi
12096 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
12097 $as_echo "$INSTALL" >&6; }
12098
12099 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
12100 # It thinks the first close brace ends the variable substitution.
12101 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
12102
12103 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
12104
12105 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
12106
12107
12108
12109 initial_LIBS="$LIBS"
12110 initial_LDFLAGS="$LDFLAGS"
12111
12112
12113
12114 # Check whether --enable-rpath was given.
12115 if test "${enable_rpath+set}" = set; then :
12116 enableval=$enable_rpath; enable_rpath="$enableval"
12117 else
12118 enable_rpath=yes
12119 fi
12120
12121 if test "x$enable_rpath" = xno; then
12122 ac_config_commands="$ac_config_commands disable-rpath"
12123
12124 fi
12125
12126
12127 # Check whether --enable-debug-req was given.
12128 if test "${enable_debug_req+set}" = set; then :
12129 enableval=$enable_debug_req;
12130 fi
12131
12132 # Check whether --enable-debug-sched was given.
12133 if test "${enable_debug_sched+set}" = set; then :
12134 enableval=$enable_debug_sched;
12135 fi
12136
12137 # Check whether --enable-debug-stub was given.
12138 if test "${enable_debug_stub+set}" = set; then :
12139 enableval=$enable_debug_stub;
12140 fi
12141
12142 # Check whether --enable-debug-daemon was given.
12143 if test "${enable_debug_daemon+set}" = set; then :
12144 enableval=$enable_debug_daemon;
12145 fi
12146
12147 # Check whether --enable-debug-sec was given.
12148 if test "${enable_debug_sec+set}" = set; then :
12149 enableval=$enable_debug_sec;
12150 fi
12151
12152 # Check whether --enable-debug-server was given.
12153 if test "${enable_debug_server+set}" = set; then :
12154 enableval=$enable_debug_server;
12155 fi
12156
12157 # Check whether --enable-debug-anchor was given.
12158 if test "${enable_debug_anchor+set}" = set; then :
12159 enableval=$enable_debug_anchor;
12160 fi
12161
12162 # Check whether --enable-all-debugging was given.
12163 if test "${enable_all_debugging+set}" = set; then :
12164 enableval=$enable_all_debugging;
12165 fi
12166
12167 case "$enable_all_debugging" in
12168 yes)
12169 enable_debug_req=yes
12170 enable_debug_sched=yes
12171 enable_debug_stub=yes
12172 enable_debug_daemon=yes
12173 enable_debug_sec=yes
12174 enable_debug_server=yes
12175 enable_debug_anchor=yes
12176 ;;
12177 no|*)
12178 ;;
12179 esac
12180 case "$enable_debug_req" in
12181 yes)
12182
12183 cat >>confdefs.h <<_ACEOF
12184 #define REQ_DEBUG 1
12185 _ACEOF
12186
12187 ;;
12188 no|*)
12189 ;;
12190 esac
12191 case "$enable_debug_sched" in
12192 yes)
12193
12194 cat >>confdefs.h <<_ACEOF
12195 #define SCHED_DEBUG 1
12196 _ACEOF
12197
12198 ;;
12199 no|*)
12200 ;;
12201 esac
12202 case "$enable_debug_stub" in
12203 yes)
12204
12205 cat >>confdefs.h <<_ACEOF
12206 #define STUB_DEBUG 1
12207 _ACEOF
12208
12209 ;;
12210 no|*)
12211 ;;
12212 esac
12213 case "$enable_debug_daemon" in
12214 yes)
12215
12216 cat >>confdefs.h <<_ACEOF
12217 #define DAEMON_DEBUG 1
12218 _ACEOF
12219
12220 ;;
12221 no|*)
12222 ;;
12223 esac
12224 case "$enable_debug_sec" in
12225 yes)
12226
12227 cat >>confdefs.h <<_ACEOF
12228 #define SEC_DEBUG 1
12229 _ACEOF
12230
12231 ;;
12232 no|*)
12233 ;;
12234 esac
12235 case "$enable_debug_server" in
12236 yes)
12237
12238 cat >>confdefs.h <<_ACEOF
12239 #define SERVER_DEBUG 1
12240 _ACEOF
12241
12242 ;;
12243 no|*)
12244 ;;
12245 esac
12246 case "$enable_debug_anchor" in
12247 yes)
12248
12249 cat >>confdefs.h <<_ACEOF
12250 #define ANCHOR_DEBUG 1
12251 _ACEOF
12252
12253 ;;
12254 no|*)
12255 ;;
12256 esac
12257
12258
12259 # Check whether --enable-debug-keep-connections-open was given.
12260 if test "${enable_debug_keep_connections_open+set}" = set; then :
12261 enableval=$enable_debug_keep_connections_open;
12262 fi
12263
12264 case "$enable_debug_keep_connections_open" in
12265 yes)
12266
12267 cat >>confdefs.h <<_ACEOF
12268 #define KEEP_CONNECTIONS_OPEN_DEBUG 1
12269 _ACEOF
12270
12271 ;;
12272 no)
12273 ;;
12274 esac
12275
12276
12277 DEFAULT_EVENTLOOP=select_eventloop
12278 for ac_header in signal.h sys/poll.h poll.h sys/resource.h sys/types.h sys/stat.h
12279 do :
12280 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
12281 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
12282 "
12283 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
12284 cat >>confdefs.h <<_ACEOF
12285 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
12286 _ACEOF
12287
12288 fi
12289
12290 done
12291
12292 # Check whether --enable-poll-eventloop was given.
12293 if test "${enable_poll_eventloop+set}" = set; then :
12294 enableval=$enable_poll_eventloop;
12295 fi
12296
12297 case "$enable_poll_eventloop" in
12298 no)
12299 ;;
12300 yes|*)
12301 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for poll" >&5
12302 $as_echo_n "checking for poll... " >&6; }
12303 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12304 /* end confdefs.h. */
12305
12306 #ifdef HAVE_SYS_POLL_H
12307 #include <sys/poll.h>
12308 #else
12309 #include <poll.h>
12310 #endif
12311
12312 int
12313 main ()
12314 {
12315 int rc; rc = poll((struct pollfd *)(0), 0, 0);
12316 ;
12317 return 0;
12318 }
12319 _ACEOF
12320 if ac_fn_c_try_link "$LINENO"; then :
12321
12322 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12323 $as_echo "yes" >&6; }
12324
12325 cat >>confdefs.h <<_ACEOF
12326 #define USE_POLL_DEFAULT_EVENTLOOP 1
12327 _ACEOF
12328
12329 DEFAULT_EVENTLOOP=poll_eventloop
12330
12331 else
12332 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12333 $as_echo "no" >&6; }
12334 fi
12335 rm -f core conftest.err conftest.$ac_objext \
12336 conftest$ac_exeext conftest.$ac_ext
12337 ;;
12338 esac
12339
12340
12341 # Check whether --enable-tcp-fastopen was given.
12342 if test "${enable_tcp_fastopen+set}" = set; then :
12343 enableval=$enable_tcp_fastopen; enable_tcp_fastopen="$enableval"
12344 else
12345 enable_tcp_fastopen=yes
12346 fi
12347
12348 if test "x$enable_tcp_fastopen" = xno; then
12349 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: TCP Fast Open is disabled" >&5
12350 $as_echo "$as_me: WARNING: TCP Fast Open is disabled" >&2;}
12351 else
12352 case `uname` in
12353 Darwin) ac_fn_c_check_decl "$LINENO" "CONNECT_RESUME_ON_READ_WRITE" "ac_cv_have_decl_CONNECT_RESUME_ON_READ_WRITE" "#include <sys/socket.h>
12354 "
12355 if test "x$ac_cv_have_decl_CONNECT_RESUME_ON_READ_WRITE" = xyes; then :
12356
12357 cat >>confdefs.h <<_ACEOF
12358 #define USE_OSX_TCP_FASTOPEN 1
12359 _ACEOF
12360
12361 else
12362 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: TCP Fast Open is not available, continuing without" >&5
12363 $as_echo "$as_me: WARNING: TCP Fast Open is not available, continuing without" >&2;}
12364 fi
12365
12366 ;;
12367 *)
12368 for ac_header in sys/socket.h netinet/tcp.h
12369 do :
12370 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
12371 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
12372 "
12373 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
12374 cat >>confdefs.h <<_ACEOF
12375 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
12376 _ACEOF
12377
12378 fi
12379
12380 done
12381
12382 ac_fn_c_check_decl "$LINENO" "TCP_FASTOPEN" "ac_cv_have_decl_TCP_FASTOPEN" "$ac_includes_default
12383 #ifdef HAVE_SYS_SOCKET_H
12384 # include <sys/socket.h>
12385 #endif
12386 #ifdef HAVE_NETINET_TCP_H
12387 # include <netinet/tcp.h>
12388 #endif
12389
12390 "
12391 if test "x$ac_cv_have_decl_TCP_FASTOPEN" = xyes; then :
12392
12393
12394 cat >>confdefs.h <<_ACEOF
12395 #define USE_TCP_FASTOPEN 1
12396 _ACEOF
12397
12398 ac_fn_c_check_decl "$LINENO" "TCP_FASTOPEN" "ac_cv_have_decl_TCP_FASTOPEN" "$ac_includes_default
12399 #ifdef HAVE_SYS_SOCKET_H
12400 # include <sys/socket.h>
12401 #endif
12402 #ifdef HAVE_NETINET_TCP_H
12403 # include <netinet/tcp.h>
12404 #endif
12405
12406 "
12407 if test "x$ac_cv_have_decl_TCP_FASTOPEN" = xyes; then :
12408 ac_have_decl=1
12409 else
12410 ac_have_decl=0
12411 fi
12412
12413 cat >>confdefs.h <<_ACEOF
12414 #define HAVE_DECL_TCP_FASTOPEN $ac_have_decl
12415 _ACEOF
12416 ac_fn_c_check_decl "$LINENO" "MSG_FASTOPEN" "ac_cv_have_decl_MSG_FASTOPEN" "$ac_includes_default
12417 #ifdef HAVE_SYS_SOCKET_H
12418 # include <sys/socket.h>
12419 #endif
12420 #ifdef HAVE_NETINET_TCP_H
12421 # include <netinet/tcp.h>
12422 #endif
12423
12424 "
12425 if test "x$ac_cv_have_decl_MSG_FASTOPEN" = xyes; then :
12426 ac_have_decl=1
12427 else
12428 ac_have_decl=0
12429 fi
12430
12431 cat >>confdefs.h <<_ACEOF
12432 #define HAVE_DECL_MSG_FASTOPEN $ac_have_decl
12433 _ACEOF
12434 ac_fn_c_check_decl "$LINENO" "TCP_FASTOPEN_CONNECT" "ac_cv_have_decl_TCP_FASTOPEN_CONNECT" "$ac_includes_default
12435 #ifdef HAVE_SYS_SOCKET_H
12436 # include <sys/socket.h>
12437 #endif
12438 #ifdef HAVE_NETINET_TCP_H
12439 # include <netinet/tcp.h>
12440 #endif
12441
12442 "
12443 if test "x$ac_cv_have_decl_TCP_FASTOPEN_CONNECT" = xyes; then :
12444 ac_have_decl=1
12445 else
12446 ac_have_decl=0
12447 fi
12448
12449 cat >>confdefs.h <<_ACEOF
12450 #define HAVE_DECL_TCP_FASTOPEN_CONNECT $ac_have_decl
12451 _ACEOF
12452
12453
12454 else
12455
12456 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: TCP Fast Open is not available, continuing without" >&5
12457 $as_echo "$as_me: WARNING: TCP Fast Open is not available, continuing without" >&2;}
12458
12459 fi
12460
12461 ;;
12462 esac
12463 fi
12464
12465 # Check whether --enable-native-stub-dnssec was given.
12466 if test "${enable_native_stub_dnssec+set}" = set; then :
12467 enableval=$enable_native_stub_dnssec;
12468 fi
12469
12470 case "$enable_native_stub_dnssec" in
12471 no)
12472 ;;
12473 yes|*)
12474
12475 cat >>confdefs.h <<_ACEOF
12476 #define STUB_NATIVE_DNSSEC 1
12477 _ACEOF
12478
12479 ;;
12480 esac
12481
12482 # check wether strptime also works
12483
12484 for ac_func in strptime
12485 do :
12486 ac_fn_c_check_func "$LINENO" "strptime" "ac_cv_func_strptime"
12487 if test "x$ac_cv_func_strptime" = xyes; then :
12488 cat >>confdefs.h <<_ACEOF
12489 #define HAVE_STRPTIME 1
12490 _ACEOF
12491
12492 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strptime works" >&5
12493 $as_echo_n "checking whether strptime works... " >&6; }
12494 if test c${cross_compiling} = cno; then
12495 if test "$cross_compiling" = yes; then :
12496 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
12497 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
12498 as_fn_error $? "cannot run test program while cross compiling
12499 See \`config.log' for more details" "$LINENO" 5; }
12500 else
12501 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12502 /* end confdefs.h. */
12503
12504 #define _XOPEN_SOURCE 600
12505 #include <time.h>
12506 int main(void) { struct tm tm; char *res;
12507 res = strptime("2010-07-15T00:00:00+00:00", "%t%Y%t-%t%m%t-%t%d%tT%t%H%t:%t%M%t:%t%S%t", &tm);
12508 if (!res) return 2;
12509 res = strptime("20070207111842", "%Y%m%d%H%M%S", &tm);
12510 if (!res) return 1; return 0; }
12511
12512 _ACEOF
12513 if ac_fn_c_try_run "$LINENO"; then :
12514 eval "ac_cv_c_strptime_works=yes"
12515 else
12516 eval "ac_cv_c_strptime_works=no"
12517 fi
12518 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12519 conftest.$ac_objext conftest.beam conftest.$ac_ext
12520 fi
12521
12522 else
12523 eval "ac_cv_c_strptime_works=maybe"
12524 fi
12525 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_strptime_works" >&5
12526 $as_echo "$ac_cv_c_strptime_works" >&6; }
12527 if test $ac_cv_c_strptime_works = no; then
12528 case " $LIBOBJS " in
12529 *" strptime.$ac_objext "* ) ;;
12530 *) LIBOBJS="$LIBOBJS strptime.$ac_objext"
12531 ;;
12532 esac
12533
12534 else
12535
12536 cat >>confdefs.h <<_ACEOF
12537 #define STRPTIME_WORKS 1
12538 _ACEOF
12539
12540 fi
12541
12542 else
12543 case " $LIBOBJS " in
12544 *" strptime.$ac_objext "* ) ;;
12545 *) LIBOBJS="$LIBOBJS strptime.$ac_objext"
12546 ;;
12547 esac
12548
12549 fi
12550 done
12551
12552
12553 # search to set include and library paths right
12554 # find libidn (no libidn on windows though)
12555 for ac_header in windows.h winsock.h stdio.h winsock2.h ws2tcpip.h
12556 do :
12557 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
12558 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
12559 "
12560 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
12561 cat >>confdefs.h <<_ACEOF
12562 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
12563 _ACEOF
12564
12565 fi
12566
12567 done
12568
12569
12570 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5
12571 $as_echo_n "checking for getaddrinfo... " >&6; }
12572 ac_cv_func_getaddrinfo=no
12573 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12574 /* end confdefs.h. */
12575
12576 #ifdef __cplusplus
12577 extern "C"
12578 {
12579 #endif
12580 char* getaddrinfo();
12581 char* (*f) () = getaddrinfo;
12582 #ifdef __cplusplus
12583 }
12584 #endif
12585 int main() {
12586 ;
12587 return 0;
12588 }
12589
12590 _ACEOF
12591 if ac_fn_c_try_link "$LINENO"; then :
12592 ac_cv_func_getaddrinfo="yes"
12593 if test "$ac_cv_header_windows_h" = "yes"; then
12594
12595 $as_echo "#define USE_WINSOCK 1" >>confdefs.h
12596
12597 USE_WINSOCK="1"
12598 LIBS="$LIBS -lws2_32 -lcrypt32"
12599 fi
12600
12601 else
12602 ORIGLIBS="$LIBS"
12603 LIBS="$LIBS -lws2_32 -lcrypt32"
12604 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12605 /* end confdefs.h. */
12606
12607 #define _WIN32_WINNT 0x0501
12608 #ifdef HAVE_WINDOWS_H
12609 #include <windows.h>
12610 #endif
12611 #ifdef HAVE_WINSOCK_H
12612 #include <winsock.h>
12613 #endif
12614 #ifdef HAVE_WINSOCK2_H
12615 #include <winsock2.h>
12616 #endif
12617 #include <stdio.h>
12618 #ifdef HAVE_WS2TCPIP_H
12619 #include <ws2tcpip.h>
12620 #endif
12621
12622 int
12623 main ()
12624 {
12625
12626 (void)getaddrinfo(NULL, NULL, NULL, NULL);
12627
12628
12629 ;
12630 return 0;
12631 }
12632 _ACEOF
12633 if ac_fn_c_try_link "$LINENO"; then :
12634
12635 ac_cv_func_getaddrinfo="yes"
12636
12637 $as_echo "#define USE_WINSOCK 1" >>confdefs.h
12638
12639 USE_WINSOCK="1"
12640
12641 else
12642
12643 ac_cv_func_getaddrinfo="no"
12644 LIBS="$ORIGLIBS"
12645
12646 fi
12647 rm -f core conftest.err conftest.$ac_objext \
12648 conftest$ac_exeext conftest.$ac_ext
12649
12650 fi
12651 rm -f core conftest.err conftest.$ac_objext \
12652 conftest$ac_exeext conftest.$ac_ext
12653
12654 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getaddrinfo" >&5
12655 $as_echo "$ac_cv_func_getaddrinfo" >&6; }
12656 if test $ac_cv_func_getaddrinfo = yes; then
12657
12658 $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
12659
12660 fi
12661
12662
12663
12664 # Check whether --with-resolvconf was given.
12665 if test "${with_resolvconf+set}" = set; then :
12666 withval=$with_resolvconf;
12667 else
12668 withval="/etc/resolv.conf"
12669 fi
12670
12671
12672 cat >>confdefs.h <<_ACEOF
12673 #define GETDNS_FN_RESOLVCONF "$withval"
12674 _ACEOF
12675
12676
12677
12678 # Check whether --with-hosts was given.
12679 if test "${with_hosts+set}" = set; then :
12680 withval=$with_hosts;
12681 else
12682
12683 if test "$USE_WINSOCK" = 1; then
12684 withval="C:\\\\Windows\\\\System32\\\\Drivers\\\\etc\\\\hosts"
12685 else
12686 withval="/etc/hosts"
12687 fi
12688
12689 fi
12690
12691
12692 cat >>confdefs.h <<_ACEOF
12693 #define GETDNS_FN_HOSTS "$withval"
12694 _ACEOF
12695
12696
12697
12698 # Check whether --with-fd-setsize was given.
12699 if test "${with_fd_setsize+set}" = set; then :
12700 withval=$with_fd_setsize;
12701 else
12702 withval="no"
12703 fi
12704
12705 case "$withval" in
12706 no)
12707 ;;
12708 *)
12709
12710 cat >>confdefs.h <<_ACEOF
12711 #define FD_SETSIZE $withval
12712 _ACEOF
12713
12714 my_enable_unbound_event_api=1
12715 ;;
12716 esac
12717
12718
12719 # Check whether --with-max-udp-backoff was given.
12720 if test "${with_max_udp_backoff+set}" = set; then :
12721 withval=$with_max_udp_backoff;
12722 else
12723 withval="1000"
12724 fi
12725
12726
12727 cat >>confdefs.h <<_ACEOF
12728 #define UDP_MAX_BACKOFF $withval
12729 _ACEOF
12730
12731
12732 #---- check for pthreads library
12733
12734 # Check whether --with-libpthread was given.
12735 if test "${with_libpthread+set}" = set; then :
12736 withval=$with_libpthread;
12737 else
12738 withval="yes"
12739 fi
12740
12741
12742 case "$withval" in
12743 yes)
12744 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_mutex_init" >&5
12745 $as_echo_n "checking for library containing pthread_mutex_init... " >&6; }
12746 if ${ac_cv_search_pthread_mutex_init+:} false; then :
12747 $as_echo_n "(cached) " >&6
12748 else
12749 ac_func_search_save_LIBS=$LIBS
12750 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12751 /* end confdefs.h. */
12752
12753 /* Override any GCC internal prototype to avoid an error.
12754 Use char because int might match the return type of a GCC
12755 builtin and then its argument prototype would still apply. */
12756 #ifdef __cplusplus
12757 extern "C"
12758 #endif
12759 char pthread_mutex_init ();
12760 int
12761 main ()
12762 {
12763 return pthread_mutex_init ();
12764 ;
12765 return 0;
12766 }
12767 _ACEOF
12768 for ac_lib in '' pthread; do
12769 if test -z "$ac_lib"; then
12770 ac_res="none required"
12771 else
12772 ac_res=-l$ac_lib
12773 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
12774 fi
12775 if ac_fn_c_try_link "$LINENO"; then :
12776 ac_cv_search_pthread_mutex_init=$ac_res
12777 fi
12778 rm -f core conftest.err conftest.$ac_objext \
12779 conftest$ac_exeext
12780 if ${ac_cv_search_pthread_mutex_init+:} false; then :
12781 break
12782 fi
12783 done
12784 if ${ac_cv_search_pthread_mutex_init+:} false; then :
12785
12786 else
12787 ac_cv_search_pthread_mutex_init=no
12788 fi
12789 rm conftest.$ac_ext
12790 LIBS=$ac_func_search_save_LIBS
12791 fi
12792 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_mutex_init" >&5
12793 $as_echo "$ac_cv_search_pthread_mutex_init" >&6; }
12794 ac_res=$ac_cv_search_pthread_mutex_init
12795 if test "$ac_res" != no; then :
12796 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
12797
12798
12799 $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
12800
12801 LIBS="-lpthread $LIBS"
12802
12803 else
12804 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pthreads not available" >&5
12805 $as_echo "$as_me: WARNING: pthreads not available" >&2;}
12806 fi
12807
12808 ;;
12809 *)
12810 ;;
12811 esac
12812
12813 USE_NSS="no"
12814
12815 # libnettle
12816 USE_NETTLE="no"
12817
12818 # Which TLS and crypto libs to use.
12819
12820
12821
12822
12823
12824
12825
12826 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
12827 if test -n "$ac_tool_prefix"; then
12828 # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
12829 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
12830 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12831 $as_echo_n "checking for $ac_word... " >&6; }
12832 if ${ac_cv_path_PKG_CONFIG+:} false; then :
12833 $as_echo_n "(cached) " >&6
12834 else
12835 case $PKG_CONFIG in
12836 [\\/]* | ?:[\\/]*)
12837 ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
12838 ;;
12839 *)
12840 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12841 for as_dir in $PATH
12842 do
12843 IFS=$as_save_IFS
12844 test -z "$as_dir" && as_dir=.
12845 for ac_exec_ext in '' $ac_executable_extensions; do
12846 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
12847 ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
12848 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12849 break 2
12850 fi
12851 done
12852 done
12853 IFS=$as_save_IFS
12854
12855 ;;
12856 esac
12857 fi
12858 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
12859 if test -n "$PKG_CONFIG"; then
12860 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
12861 $as_echo "$PKG_CONFIG" >&6; }
12862 else
12863 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12864 $as_echo "no" >&6; }
12865 fi
12866
12867
12868 fi
12869 if test -z "$ac_cv_path_PKG_CONFIG"; then
12870 ac_pt_PKG_CONFIG=$PKG_CONFIG
12871 # Extract the first word of "pkg-config", so it can be a program name with args.
12872 set dummy pkg-config; ac_word=$2
12873 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12874 $as_echo_n "checking for $ac_word... " >&6; }
12875 if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
12876 $as_echo_n "(cached) " >&6
12877 else
12878 case $ac_pt_PKG_CONFIG in
12879 [\\/]* | ?:[\\/]*)
12880 ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
12881 ;;
12882 *)
12883 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12884 for as_dir in $PATH
12885 do
12886 IFS=$as_save_IFS
12887 test -z "$as_dir" && as_dir=.
12888 for ac_exec_ext in '' $ac_executable_extensions; do
12889 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
12890 ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
12891 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12892 break 2
12893 fi
12894 done
12895 done
12896 IFS=$as_save_IFS
12897
12898 ;;
12899 esac
12900 fi
12901 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
12902 if test -n "$ac_pt_PKG_CONFIG"; then
12903 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
12904 $as_echo "$ac_pt_PKG_CONFIG" >&6; }
12905 else
12906 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12907 $as_echo "no" >&6; }
12908 fi
12909
12910 if test "x$ac_pt_PKG_CONFIG" = x; then
12911 PKG_CONFIG=""
12912 else
12913 case $cross_compiling:$ac_tool_warned in
12914 yes:)
12915 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
12916 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
12917 ac_tool_warned=yes ;;
12918 esac
12919 PKG_CONFIG=$ac_pt_PKG_CONFIG
12920 fi
12921 else
12922 PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
12923 fi
12924
12925 fi
12926 if test -n "$PKG_CONFIG"; then
12927 _pkg_min_version=0.9.0
12928 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
12929 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
12930 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
12931 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12932 $as_echo "yes" >&6; }
12933 else
12934 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12935 $as_echo "no" >&6; }
12936 PKG_CONFIG=""
12937 fi
12938 fi
12939
12940 # Check whether --with-gnutls was given.
12941 if test "${with_gnutls+set}" = set; then :
12942 withval=$with_gnutls;
12943
12944 pkg_failed=no
12945 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgnutls" >&5
12946 $as_echo_n "checking for libgnutls... " >&6; }
12947
12948 if test -n "$libgnutls_CFLAGS"; then
12949 pkg_cv_libgnutls_CFLAGS="$libgnutls_CFLAGS"
12950 elif test -n "$PKG_CONFIG"; then
12951 if test -n "$PKG_CONFIG" && \
12952 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 3.5.0\""; } >&5
12953 ($PKG_CONFIG --exists --print-errors "gnutls >= 3.5.0") 2>&5
12954 ac_status=$?
12955 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12956 test $ac_status = 0; }; then
12957 pkg_cv_libgnutls_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 3.5.0" 2>/dev/null`
12958 test "x$?" != "x0" && pkg_failed=yes
12959 else
12960 pkg_failed=yes
12961 fi
12962 else
12963 pkg_failed=untried
12964 fi
12965 if test -n "$libgnutls_LIBS"; then
12966 pkg_cv_libgnutls_LIBS="$libgnutls_LIBS"
12967 elif test -n "$PKG_CONFIG"; then
12968 if test -n "$PKG_CONFIG" && \
12969 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 3.5.0\""; } >&5
12970 ($PKG_CONFIG --exists --print-errors "gnutls >= 3.5.0") 2>&5
12971 ac_status=$?
12972 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12973 test $ac_status = 0; }; then
12974 pkg_cv_libgnutls_LIBS=`$PKG_CONFIG --libs "gnutls >= 3.5.0" 2>/dev/null`
12975 test "x$?" != "x0" && pkg_failed=yes
12976 else
12977 pkg_failed=yes
12978 fi
12979 else
12980 pkg_failed=untried
12981 fi
12982
12983
12984
12985 if test $pkg_failed = yes; then
12986 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12987 $as_echo "no" >&6; }
12988
12989 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
12990 _pkg_short_errors_supported=yes
12991 else
12992 _pkg_short_errors_supported=no
12993 fi
12994 if test $_pkg_short_errors_supported = yes; then
12995 libgnutls_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls >= 3.5.0" 2>&1`
12996 else
12997 libgnutls_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls >= 3.5.0" 2>&1`
12998 fi
12999 # Put the nasty error message in config.log where it belongs
13000 echo "$libgnutls_PKG_ERRORS" >&5
13001
13002 as_fn_error $? "Package requirements (gnutls >= 3.5.0) were not met:
13003
13004 $libgnutls_PKG_ERRORS
13005
13006 Consider adjusting the PKG_CONFIG_PATH environment variable if you
13007 installed software in a non-standard prefix.
13008
13009 Alternatively, you may set the environment variables libgnutls_CFLAGS
13010 and libgnutls_LIBS to avoid the need to call pkg-config.
13011 See the pkg-config man page for more details." "$LINENO" 5
13012 elif test $pkg_failed = untried; then
13013 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13014 $as_echo "no" >&6; }
13015 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13016 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13017 as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
13018 is in your PATH or set the PKG_CONFIG environment variable to the full
13019 path to pkg-config.
13020
13021 Alternatively, you may set the environment variables libgnutls_CFLAGS
13022 and libgnutls_LIBS to avoid the need to call pkg-config.
13023 See the pkg-config man page for more details.
13024
13025 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
13026 See \`config.log' for more details" "$LINENO" 5; }
13027 else
13028 libgnutls_CFLAGS=$pkg_cv_libgnutls_CFLAGS
13029 libgnutls_LIBS=$pkg_cv_libgnutls_LIBS
13030 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13031 $as_echo "yes" >&6; }
13032
13033 fi
13034
13035 pkg_failed=no
13036 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgnutlsdane" >&5
13037 $as_echo_n "checking for libgnutlsdane... " >&6; }
13038
13039 if test -n "$libgnutlsdane_CFLAGS"; then
13040 pkg_cv_libgnutlsdane_CFLAGS="$libgnutlsdane_CFLAGS"
13041 elif test -n "$PKG_CONFIG"; then
13042 if test -n "$PKG_CONFIG" && \
13043 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls-dane >= 3.5.0\""; } >&5
13044 ($PKG_CONFIG --exists --print-errors "gnutls-dane >= 3.5.0") 2>&5
13045 ac_status=$?
13046 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13047 test $ac_status = 0; }; then
13048 pkg_cv_libgnutlsdane_CFLAGS=`$PKG_CONFIG --cflags "gnutls-dane >= 3.5.0" 2>/dev/null`
13049 test "x$?" != "x0" && pkg_failed=yes
13050 else
13051 pkg_failed=yes
13052 fi
13053 else
13054 pkg_failed=untried
13055 fi
13056 if test -n "$libgnutlsdane_LIBS"; then
13057 pkg_cv_libgnutlsdane_LIBS="$libgnutlsdane_LIBS"
13058 elif test -n "$PKG_CONFIG"; then
13059 if test -n "$PKG_CONFIG" && \
13060 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls-dane >= 3.5.0\""; } >&5
13061 ($PKG_CONFIG --exists --print-errors "gnutls-dane >= 3.5.0") 2>&5
13062 ac_status=$?
13063 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13064 test $ac_status = 0; }; then
13065 pkg_cv_libgnutlsdane_LIBS=`$PKG_CONFIG --libs "gnutls-dane >= 3.5.0" 2>/dev/null`
13066 test "x$?" != "x0" && pkg_failed=yes
13067 else
13068 pkg_failed=yes
13069 fi
13070 else
13071 pkg_failed=untried
13072 fi
13073
13074
13075
13076 if test $pkg_failed = yes; then
13077 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13078 $as_echo "no" >&6; }
13079
13080 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
13081 _pkg_short_errors_supported=yes
13082 else
13083 _pkg_short_errors_supported=no
13084 fi
13085 if test $_pkg_short_errors_supported = yes; then
13086 libgnutlsdane_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls-dane >= 3.5.0" 2>&1`
13087 else
13088 libgnutlsdane_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls-dane >= 3.5.0" 2>&1`
13089 fi
13090 # Put the nasty error message in config.log where it belongs
13091 echo "$libgnutlsdane_PKG_ERRORS" >&5
13092
13093 as_fn_error $? "Package requirements (gnutls-dane >= 3.5.0) were not met:
13094
13095 $libgnutlsdane_PKG_ERRORS
13096
13097 Consider adjusting the PKG_CONFIG_PATH environment variable if you
13098 installed software in a non-standard prefix.
13099
13100 Alternatively, you may set the environment variables libgnutlsdane_CFLAGS
13101 and libgnutlsdane_LIBS to avoid the need to call pkg-config.
13102 See the pkg-config man page for more details." "$LINENO" 5
13103 elif test $pkg_failed = untried; then
13104 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13105 $as_echo "no" >&6; }
13106 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13107 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13108 as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
13109 is in your PATH or set the PKG_CONFIG environment variable to the full
13110 path to pkg-config.
13111
13112 Alternatively, you may set the environment variables libgnutlsdane_CFLAGS
13113 and libgnutlsdane_LIBS to avoid the need to call pkg-config.
13114 See the pkg-config man page for more details.
13115
13116 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
13117 See \`config.log' for more details" "$LINENO" 5; }
13118 else
13119 libgnutlsdane_CFLAGS=$pkg_cv_libgnutlsdane_CFLAGS
13120 libgnutlsdane_LIBS=$pkg_cv_libgnutlsdane_LIBS
13121 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13122 $as_echo "yes" >&6; }
13123
13124 fi
13125 LIBS="$libgnutls_LIBS $libgnutlsdane_LIBS $LIBS"
13126 CFLAGS="$libgnutls_CFLAGS $libgnutlsdane_CFLAGS $CFLAGS"
13127 TLSDIR='gnutls'
13128
13129
13130 $as_echo "#define USE_GNUTLS 1" >>confdefs.h
13131
13132 if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
13133
13134
13135 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether nettle is enabled" >&5
13136 $as_echo_n "checking whether nettle is enabled... " >&6; }
13137
13138 # Check whether --with-nettle was given.
13139 if test "${with_nettle+set}" = set; then :
13140 withval=$with_nettle;
13141 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
13142 $as_echo "$withval" >&6; }
13143 ax_with_nettle=$withval
13144
13145 else
13146
13147 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13148 $as_echo "yes" >&6; }
13149 ax_with_nettle=yes
13150
13151 fi
13152
13153 if test "$ax_with_nettle" = "yes" -o "$ax_with_nettle" = "auto" ; then
13154 for ac_header in nettle/nettle-meta.h
13155 do :
13156 ac_fn_c_check_header_mongrel "$LINENO" "nettle/nettle-meta.h" "ac_cv_header_nettle_nettle_meta_h" "$ac_includes_default"
13157 if test "x$ac_cv_header_nettle_nettle_meta_h" = xyes; then :
13158 cat >>confdefs.h <<_ACEOF
13159 #define HAVE_NETTLE_NETTLE_META_H 1
13160 _ACEOF
13161
13162 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_base64_encode_final in -lnettle" >&5
13163 $as_echo_n "checking for nettle_base64_encode_final in -lnettle... " >&6; }
13164 if ${ac_cv_lib_nettle_nettle_base64_encode_final+:} false; then :
13165 $as_echo_n "(cached) " >&6
13166 else
13167 ac_check_lib_save_LIBS=$LIBS
13168 LIBS="-lnettle $LIBS"
13169 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13170 /* end confdefs.h. */
13171
13172 /* Override any GCC internal prototype to avoid an error.
13173 Use char because int might match the return type of a GCC
13174 builtin and then its argument prototype would still apply. */
13175 #ifdef __cplusplus
13176 extern "C"
13177 #endif
13178 char nettle_base64_encode_final ();
13179 int
13180 main ()
13181 {
13182 return nettle_base64_encode_final ();
13183 ;
13184 return 0;
13185 }
13186 _ACEOF
13187 if ac_fn_c_try_link "$LINENO"; then :
13188 ac_cv_lib_nettle_nettle_base64_encode_final=yes
13189 else
13190 ac_cv_lib_nettle_nettle_base64_encode_final=no
13191 fi
13192 rm -f core conftest.err conftest.$ac_objext \
13193 conftest$ac_exeext conftest.$ac_ext
13194 LIBS=$ac_check_lib_save_LIBS
13195 fi
13196 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_base64_encode_final" >&5
13197 $as_echo "$ac_cv_lib_nettle_nettle_base64_encode_final" >&6; }
13198 if test "x$ac_cv_lib_nettle_nettle_base64_encode_final" = xyes; then :
13199
13200
13201 $as_echo "#define HAVE_NETTLE 1" >>confdefs.h
13202
13203 HAVE_NETTLE=1
13204 NETTLE_LIBS=-lnettle
13205
13206 # ciphers
13207
13208 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_aes_encrypt in -lnettle" >&5
13209 $as_echo_n "checking for nettle_aes_encrypt in -lnettle... " >&6; }
13210 if ${ac_cv_lib_nettle_nettle_aes_encrypt+:} false; then :
13211 $as_echo_n "(cached) " >&6
13212 else
13213 ac_check_lib_save_LIBS=$LIBS
13214 LIBS="-lnettle $LIBS"
13215 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13216 /* end confdefs.h. */
13217
13218 /* Override any GCC internal prototype to avoid an error.
13219 Use char because int might match the return type of a GCC
13220 builtin and then its argument prototype would still apply. */
13221 #ifdef __cplusplus
13222 extern "C"
13223 #endif
13224 char nettle_aes_encrypt ();
13225 int
13226 main ()
13227 {
13228 return nettle_aes_encrypt ();
13229 ;
13230 return 0;
13231 }
13232 _ACEOF
13233 if ac_fn_c_try_link "$LINENO"; then :
13234 ac_cv_lib_nettle_nettle_aes_encrypt=yes
13235 else
13236 ac_cv_lib_nettle_nettle_aes_encrypt=no
13237 fi
13238 rm -f core conftest.err conftest.$ac_objext \
13239 conftest$ac_exeext conftest.$ac_ext
13240 LIBS=$ac_check_lib_save_LIBS
13241 fi
13242 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_aes_encrypt" >&5
13243 $as_echo "$ac_cv_lib_nettle_nettle_aes_encrypt" >&6; }
13244 if test "x$ac_cv_lib_nettle_nettle_aes_encrypt" = xyes; then :
13245
13246 $as_echo "#define NETTLE_WITH_AES 1" >>confdefs.h
13247
13248 fi
13249
13250
13251
13252 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_arctwo_encrypt in -lnettle" >&5
13253 $as_echo_n "checking for nettle_arctwo_encrypt in -lnettle... " >&6; }
13254 if ${ac_cv_lib_nettle_nettle_arctwo_encrypt+:} false; then :
13255 $as_echo_n "(cached) " >&6
13256 else
13257 ac_check_lib_save_LIBS=$LIBS
13258 LIBS="-lnettle $LIBS"
13259 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13260 /* end confdefs.h. */
13261
13262 /* Override any GCC internal prototype to avoid an error.
13263 Use char because int might match the return type of a GCC
13264 builtin and then its argument prototype would still apply. */
13265 #ifdef __cplusplus
13266 extern "C"
13267 #endif
13268 char nettle_arctwo_encrypt ();
13269 int
13270 main ()
13271 {
13272 return nettle_arctwo_encrypt ();
13273 ;
13274 return 0;
13275 }
13276 _ACEOF
13277 if ac_fn_c_try_link "$LINENO"; then :
13278 ac_cv_lib_nettle_nettle_arctwo_encrypt=yes
13279 else
13280 ac_cv_lib_nettle_nettle_arctwo_encrypt=no
13281 fi
13282 rm -f core conftest.err conftest.$ac_objext \
13283 conftest$ac_exeext conftest.$ac_ext
13284 LIBS=$ac_check_lib_save_LIBS
13285 fi
13286 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_arctwo_encrypt" >&5
13287 $as_echo "$ac_cv_lib_nettle_nettle_arctwo_encrypt" >&6; }
13288 if test "x$ac_cv_lib_nettle_nettle_arctwo_encrypt" = xyes; then :
13289
13290 $as_echo "#define NETTLE_WITH_ARCTWO 1" >>confdefs.h
13291
13292 fi
13293
13294
13295
13296 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_blowfish_encrypt in -lnettle" >&5
13297 $as_echo_n "checking for nettle_blowfish_encrypt in -lnettle... " >&6; }
13298 if ${ac_cv_lib_nettle_nettle_blowfish_encrypt+:} false; then :
13299 $as_echo_n "(cached) " >&6
13300 else
13301 ac_check_lib_save_LIBS=$LIBS
13302 LIBS="-lnettle $LIBS"
13303 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13304 /* end confdefs.h. */
13305
13306 /* Override any GCC internal prototype to avoid an error.
13307 Use char because int might match the return type of a GCC
13308 builtin and then its argument prototype would still apply. */
13309 #ifdef __cplusplus
13310 extern "C"
13311 #endif
13312 char nettle_blowfish_encrypt ();
13313 int
13314 main ()
13315 {
13316 return nettle_blowfish_encrypt ();
13317 ;
13318 return 0;
13319 }
13320 _ACEOF
13321 if ac_fn_c_try_link "$LINENO"; then :
13322 ac_cv_lib_nettle_nettle_blowfish_encrypt=yes
13323 else
13324 ac_cv_lib_nettle_nettle_blowfish_encrypt=no
13325 fi
13326 rm -f core conftest.err conftest.$ac_objext \
13327 conftest$ac_exeext conftest.$ac_ext
13328 LIBS=$ac_check_lib_save_LIBS
13329 fi
13330 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_blowfish_encrypt" >&5
13331 $as_echo "$ac_cv_lib_nettle_nettle_blowfish_encrypt" >&6; }
13332 if test "x$ac_cv_lib_nettle_nettle_blowfish_encrypt" = xyes; then :
13333
13334 $as_echo "#define NETTLE_WITH_BLOWFISH 1" >>confdefs.h
13335
13336 fi
13337
13338
13339
13340 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_cast128_encrypt in -lnettle" >&5
13341 $as_echo_n "checking for nettle_cast128_encrypt in -lnettle... " >&6; }
13342 if ${ac_cv_lib_nettle_nettle_cast128_encrypt+:} false; then :
13343 $as_echo_n "(cached) " >&6
13344 else
13345 ac_check_lib_save_LIBS=$LIBS
13346 LIBS="-lnettle $LIBS"
13347 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13348 /* end confdefs.h. */
13349
13350 /* Override any GCC internal prototype to avoid an error.
13351 Use char because int might match the return type of a GCC
13352 builtin and then its argument prototype would still apply. */
13353 #ifdef __cplusplus
13354 extern "C"
13355 #endif
13356 char nettle_cast128_encrypt ();
13357 int
13358 main ()
13359 {
13360 return nettle_cast128_encrypt ();
13361 ;
13362 return 0;
13363 }
13364 _ACEOF
13365 if ac_fn_c_try_link "$LINENO"; then :
13366 ac_cv_lib_nettle_nettle_cast128_encrypt=yes
13367 else
13368 ac_cv_lib_nettle_nettle_cast128_encrypt=no
13369 fi
13370 rm -f core conftest.err conftest.$ac_objext \
13371 conftest$ac_exeext conftest.$ac_ext
13372 LIBS=$ac_check_lib_save_LIBS
13373 fi
13374 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_cast128_encrypt" >&5
13375 $as_echo "$ac_cv_lib_nettle_nettle_cast128_encrypt" >&6; }
13376 if test "x$ac_cv_lib_nettle_nettle_cast128_encrypt" = xyes; then :
13377
13378 $as_echo "#define NETTLE_WITH_CAST128 1" >>confdefs.h
13379
13380 fi
13381
13382
13383
13384 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_des_encrypt in -lnettle" >&5
13385 $as_echo_n "checking for nettle_des_encrypt in -lnettle... " >&6; }
13386 if ${ac_cv_lib_nettle_nettle_des_encrypt+:} false; then :
13387 $as_echo_n "(cached) " >&6
13388 else
13389 ac_check_lib_save_LIBS=$LIBS
13390 LIBS="-lnettle $LIBS"
13391 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13392 /* end confdefs.h. */
13393
13394 /* Override any GCC internal prototype to avoid an error.
13395 Use char because int might match the return type of a GCC
13396 builtin and then its argument prototype would still apply. */
13397 #ifdef __cplusplus
13398 extern "C"
13399 #endif
13400 char nettle_des_encrypt ();
13401 int
13402 main ()
13403 {
13404 return nettle_des_encrypt ();
13405 ;
13406 return 0;
13407 }
13408 _ACEOF
13409 if ac_fn_c_try_link "$LINENO"; then :
13410 ac_cv_lib_nettle_nettle_des_encrypt=yes
13411 else
13412 ac_cv_lib_nettle_nettle_des_encrypt=no
13413 fi
13414 rm -f core conftest.err conftest.$ac_objext \
13415 conftest$ac_exeext conftest.$ac_ext
13416 LIBS=$ac_check_lib_save_LIBS
13417 fi
13418 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_des_encrypt" >&5
13419 $as_echo "$ac_cv_lib_nettle_nettle_des_encrypt" >&6; }
13420 if test "x$ac_cv_lib_nettle_nettle_des_encrypt" = xyes; then :
13421
13422 $as_echo "#define NETTLE_WITH_DES 1" >>confdefs.h
13423
13424 fi
13425
13426
13427
13428 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_des3_encrypt in -lnettle" >&5
13429 $as_echo_n "checking for nettle_des3_encrypt in -lnettle... " >&6; }
13430 if ${ac_cv_lib_nettle_nettle_des3_encrypt+:} false; then :
13431 $as_echo_n "(cached) " >&6
13432 else
13433 ac_check_lib_save_LIBS=$LIBS
13434 LIBS="-lnettle $LIBS"
13435 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13436 /* end confdefs.h. */
13437
13438 /* Override any GCC internal prototype to avoid an error.
13439 Use char because int might match the return type of a GCC
13440 builtin and then its argument prototype would still apply. */
13441 #ifdef __cplusplus
13442 extern "C"
13443 #endif
13444 char nettle_des3_encrypt ();
13445 int
13446 main ()
13447 {
13448 return nettle_des3_encrypt ();
13449 ;
13450 return 0;
13451 }
13452 _ACEOF
13453 if ac_fn_c_try_link "$LINENO"; then :
13454 ac_cv_lib_nettle_nettle_des3_encrypt=yes
13455 else
13456 ac_cv_lib_nettle_nettle_des3_encrypt=no
13457 fi
13458 rm -f core conftest.err conftest.$ac_objext \
13459 conftest$ac_exeext conftest.$ac_ext
13460 LIBS=$ac_check_lib_save_LIBS
13461 fi
13462 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_des3_encrypt" >&5
13463 $as_echo "$ac_cv_lib_nettle_nettle_des3_encrypt" >&6; }
13464 if test "x$ac_cv_lib_nettle_nettle_des3_encrypt" = xyes; then :
13465
13466 $as_echo "#define NETTLE_WITH_DES3 1" >>confdefs.h
13467
13468 fi
13469
13470
13471
13472 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_serpent_encrypt in -lnettle" >&5
13473 $as_echo_n "checking for nettle_serpent_encrypt in -lnettle... " >&6; }
13474 if ${ac_cv_lib_nettle_nettle_serpent_encrypt+:} false; then :
13475 $as_echo_n "(cached) " >&6
13476 else
13477 ac_check_lib_save_LIBS=$LIBS
13478 LIBS="-lnettle $LIBS"
13479 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13480 /* end confdefs.h. */
13481
13482 /* Override any GCC internal prototype to avoid an error.
13483 Use char because int might match the return type of a GCC
13484 builtin and then its argument prototype would still apply. */
13485 #ifdef __cplusplus
13486 extern "C"
13487 #endif
13488 char nettle_serpent_encrypt ();
13489 int
13490 main ()
13491 {
13492 return nettle_serpent_encrypt ();
13493 ;
13494 return 0;
13495 }
13496 _ACEOF
13497 if ac_fn_c_try_link "$LINENO"; then :
13498 ac_cv_lib_nettle_nettle_serpent_encrypt=yes
13499 else
13500 ac_cv_lib_nettle_nettle_serpent_encrypt=no
13501 fi
13502 rm -f core conftest.err conftest.$ac_objext \
13503 conftest$ac_exeext conftest.$ac_ext
13504 LIBS=$ac_check_lib_save_LIBS
13505 fi
13506 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_serpent_encrypt" >&5
13507 $as_echo "$ac_cv_lib_nettle_nettle_serpent_encrypt" >&6; }
13508 if test "x$ac_cv_lib_nettle_nettle_serpent_encrypt" = xyes; then :
13509
13510 $as_echo "#define NETTLE_WITH_SERPENT 1" >>confdefs.h
13511
13512 fi
13513
13514
13515
13516 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_twofish_encrypt in -lnettle" >&5
13517 $as_echo_n "checking for nettle_twofish_encrypt in -lnettle... " >&6; }
13518 if ${ac_cv_lib_nettle_nettle_twofish_encrypt+:} false; then :
13519 $as_echo_n "(cached) " >&6
13520 else
13521 ac_check_lib_save_LIBS=$LIBS
13522 LIBS="-lnettle $LIBS"
13523 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13524 /* end confdefs.h. */
13525
13526 /* Override any GCC internal prototype to avoid an error.
13527 Use char because int might match the return type of a GCC
13528 builtin and then its argument prototype would still apply. */
13529 #ifdef __cplusplus
13530 extern "C"
13531 #endif
13532 char nettle_twofish_encrypt ();
13533 int
13534 main ()
13535 {
13536 return nettle_twofish_encrypt ();
13537 ;
13538 return 0;
13539 }
13540 _ACEOF
13541 if ac_fn_c_try_link "$LINENO"; then :
13542 ac_cv_lib_nettle_nettle_twofish_encrypt=yes
13543 else
13544 ac_cv_lib_nettle_nettle_twofish_encrypt=no
13545 fi
13546 rm -f core conftest.err conftest.$ac_objext \
13547 conftest$ac_exeext conftest.$ac_ext
13548 LIBS=$ac_check_lib_save_LIBS
13549 fi
13550 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_twofish_encrypt" >&5
13551 $as_echo "$ac_cv_lib_nettle_nettle_twofish_encrypt" >&6; }
13552 if test "x$ac_cv_lib_nettle_nettle_twofish_encrypt" = xyes; then :
13553
13554 $as_echo "#define NETTLE_WITH_TWOFISH 1" >>confdefs.h
13555
13556 fi
13557
13558
13559 # digests
13560
13561 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_md2_digest in -lnettle" >&5
13562 $as_echo_n "checking for nettle_md2_digest in -lnettle... " >&6; }
13563 if ${ac_cv_lib_nettle_nettle_md2_digest+:} false; then :
13564 $as_echo_n "(cached) " >&6
13565 else
13566 ac_check_lib_save_LIBS=$LIBS
13567 LIBS="-lnettle $LIBS"
13568 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13569 /* end confdefs.h. */
13570
13571 /* Override any GCC internal prototype to avoid an error.
13572 Use char because int might match the return type of a GCC
13573 builtin and then its argument prototype would still apply. */
13574 #ifdef __cplusplus
13575 extern "C"
13576 #endif
13577 char nettle_md2_digest ();
13578 int
13579 main ()
13580 {
13581 return nettle_md2_digest ();
13582 ;
13583 return 0;
13584 }
13585 _ACEOF
13586 if ac_fn_c_try_link "$LINENO"; then :
13587 ac_cv_lib_nettle_nettle_md2_digest=yes
13588 else
13589 ac_cv_lib_nettle_nettle_md2_digest=no
13590 fi
13591 rm -f core conftest.err conftest.$ac_objext \
13592 conftest$ac_exeext conftest.$ac_ext
13593 LIBS=$ac_check_lib_save_LIBS
13594 fi
13595 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_md2_digest" >&5
13596 $as_echo "$ac_cv_lib_nettle_nettle_md2_digest" >&6; }
13597 if test "x$ac_cv_lib_nettle_nettle_md2_digest" = xyes; then :
13598
13599 $as_echo "#define NETTLE_WITH_MD2 1" >>confdefs.h
13600
13601 fi
13602
13603
13604
13605 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_md4_digest in -lnettle" >&5
13606 $as_echo_n "checking for nettle_md4_digest in -lnettle... " >&6; }
13607 if ${ac_cv_lib_nettle_nettle_md4_digest+:} false; then :
13608 $as_echo_n "(cached) " >&6
13609 else
13610 ac_check_lib_save_LIBS=$LIBS
13611 LIBS="-lnettle $LIBS"
13612 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13613 /* end confdefs.h. */
13614
13615 /* Override any GCC internal prototype to avoid an error.
13616 Use char because int might match the return type of a GCC
13617 builtin and then its argument prototype would still apply. */
13618 #ifdef __cplusplus
13619 extern "C"
13620 #endif
13621 char nettle_md4_digest ();
13622 int
13623 main ()
13624 {
13625 return nettle_md4_digest ();
13626 ;
13627 return 0;
13628 }
13629 _ACEOF
13630 if ac_fn_c_try_link "$LINENO"; then :
13631 ac_cv_lib_nettle_nettle_md4_digest=yes
13632 else
13633 ac_cv_lib_nettle_nettle_md4_digest=no
13634 fi
13635 rm -f core conftest.err conftest.$ac_objext \
13636 conftest$ac_exeext conftest.$ac_ext
13637 LIBS=$ac_check_lib_save_LIBS
13638 fi
13639 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_md4_digest" >&5
13640 $as_echo "$ac_cv_lib_nettle_nettle_md4_digest" >&6; }
13641 if test "x$ac_cv_lib_nettle_nettle_md4_digest" = xyes; then :
13642
13643 $as_echo "#define NETTLE_WITH_MD4 1" >>confdefs.h
13644
13645 fi
13646
13647
13648
13649 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_md5_digest in -lnettle" >&5
13650 $as_echo_n "checking for nettle_md5_digest in -lnettle... " >&6; }
13651 if ${ac_cv_lib_nettle_nettle_md5_digest+:} false; then :
13652 $as_echo_n "(cached) " >&6
13653 else
13654 ac_check_lib_save_LIBS=$LIBS
13655 LIBS="-lnettle $LIBS"
13656 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13657 /* end confdefs.h. */
13658
13659 /* Override any GCC internal prototype to avoid an error.
13660 Use char because int might match the return type of a GCC
13661 builtin and then its argument prototype would still apply. */
13662 #ifdef __cplusplus
13663 extern "C"
13664 #endif
13665 char nettle_md5_digest ();
13666 int
13667 main ()
13668 {
13669 return nettle_md5_digest ();
13670 ;
13671 return 0;
13672 }
13673 _ACEOF
13674 if ac_fn_c_try_link "$LINENO"; then :
13675 ac_cv_lib_nettle_nettle_md5_digest=yes
13676 else
13677 ac_cv_lib_nettle_nettle_md5_digest=no
13678 fi
13679 rm -f core conftest.err conftest.$ac_objext \
13680 conftest$ac_exeext conftest.$ac_ext
13681 LIBS=$ac_check_lib_save_LIBS
13682 fi
13683 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_md5_digest" >&5
13684 $as_echo "$ac_cv_lib_nettle_nettle_md5_digest" >&6; }
13685 if test "x$ac_cv_lib_nettle_nettle_md5_digest" = xyes; then :
13686
13687 $as_echo "#define NETTLE_WITH_MD5 1" >>confdefs.h
13688
13689 fi
13690
13691
13692
13693 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_sha1_digest in -lnettle" >&5
13694 $as_echo_n "checking for nettle_sha1_digest in -lnettle... " >&6; }
13695 if ${ac_cv_lib_nettle_nettle_sha1_digest+:} false; then :
13696 $as_echo_n "(cached) " >&6
13697 else
13698 ac_check_lib_save_LIBS=$LIBS
13699 LIBS="-lnettle $LIBS"
13700 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13701 /* end confdefs.h. */
13702
13703 /* Override any GCC internal prototype to avoid an error.
13704 Use char because int might match the return type of a GCC
13705 builtin and then its argument prototype would still apply. */
13706 #ifdef __cplusplus
13707 extern "C"
13708 #endif
13709 char nettle_sha1_digest ();
13710 int
13711 main ()
13712 {
13713 return nettle_sha1_digest ();
13714 ;
13715 return 0;
13716 }
13717 _ACEOF
13718 if ac_fn_c_try_link "$LINENO"; then :
13719 ac_cv_lib_nettle_nettle_sha1_digest=yes
13720 else
13721 ac_cv_lib_nettle_nettle_sha1_digest=no
13722 fi
13723 rm -f core conftest.err conftest.$ac_objext \
13724 conftest$ac_exeext conftest.$ac_ext
13725 LIBS=$ac_check_lib_save_LIBS
13726 fi
13727 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_sha1_digest" >&5
13728 $as_echo "$ac_cv_lib_nettle_nettle_sha1_digest" >&6; }
13729 if test "x$ac_cv_lib_nettle_nettle_sha1_digest" = xyes; then :
13730
13731 $as_echo "#define NETTLE_WITH_SHA1 1" >>confdefs.h
13732
13733 fi
13734
13735
13736
13737 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_sha256_digest in -lnettle" >&5
13738 $as_echo_n "checking for nettle_sha256_digest in -lnettle... " >&6; }
13739 if ${ac_cv_lib_nettle_nettle_sha256_digest+:} false; then :
13740 $as_echo_n "(cached) " >&6
13741 else
13742 ac_check_lib_save_LIBS=$LIBS
13743 LIBS="-lnettle $LIBS"
13744 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13745 /* end confdefs.h. */
13746
13747 /* Override any GCC internal prototype to avoid an error.
13748 Use char because int might match the return type of a GCC
13749 builtin and then its argument prototype would still apply. */
13750 #ifdef __cplusplus
13751 extern "C"
13752 #endif
13753 char nettle_sha256_digest ();
13754 int
13755 main ()
13756 {
13757 return nettle_sha256_digest ();
13758 ;
13759 return 0;
13760 }
13761 _ACEOF
13762 if ac_fn_c_try_link "$LINENO"; then :
13763 ac_cv_lib_nettle_nettle_sha256_digest=yes
13764 else
13765 ac_cv_lib_nettle_nettle_sha256_digest=no
13766 fi
13767 rm -f core conftest.err conftest.$ac_objext \
13768 conftest$ac_exeext conftest.$ac_ext
13769 LIBS=$ac_check_lib_save_LIBS
13770 fi
13771 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_sha256_digest" >&5
13772 $as_echo "$ac_cv_lib_nettle_nettle_sha256_digest" >&6; }
13773 if test "x$ac_cv_lib_nettle_nettle_sha256_digest" = xyes; then :
13774
13775 $as_echo "#define NETTLE_WITH_SHA256 1" >>confdefs.h
13776
13777 fi
13778
13779
13780
13781 fi
13782
13783
13784 fi
13785
13786 done
13787
13788 # complain only if explicitly required
13789 if test "$ax_with_nettle" = "yes" -a "x$HAVE_NETTLE" = "x" ; then
13790 as_fn_error $? "cannot configure required nettle library" "$LINENO" 5
13791 fi
13792 fi
13793
13794 USE_NETTLE="yes"
13795
13796 $as_echo "#define HAVE_NETTLE 1" >>confdefs.h
13797
13798 for ac_header in nettle/dsa-compat.h
13799 do :
13800 ac_fn_c_check_header_compile "$LINENO" "nettle/dsa-compat.h" "ac_cv_header_nettle_dsa_compat_h" "$ac_includes_default
13801 "
13802 if test "x$ac_cv_header_nettle_dsa_compat_h" = xyes; then :
13803 cat >>confdefs.h <<_ACEOF
13804 #define HAVE_NETTLE_DSA_COMPAT_H 1
13805 _ACEOF
13806
13807 fi
13808
13809 done
13810
13811 fi
13812 # Zero configuration DNSSEC we still need libcrypto
13813 for ac_header in openssl/x509.h
13814 do :
13815 ac_fn_c_check_header_compile "$LINENO" "openssl/x509.h" "ac_cv_header_openssl_x509_h" "$ac_includes_default
13816 "
13817 if test "x$ac_cv_header_openssl_x509_h" = xyes; then :
13818 cat >>confdefs.h <<_ACEOF
13819 #define HAVE_OPENSSL_X509_H 1
13820 _ACEOF
13821
13822 fi
13823
13824 done
13825
13826 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X509_STORE_new in -lcrypto" >&5
13827 $as_echo_n "checking for X509_STORE_new in -lcrypto... " >&6; }
13828 if ${ac_cv_lib_crypto_X509_STORE_new+:} false; then :
13829 $as_echo_n "(cached) " >&6
13830 else
13831 ac_check_lib_save_LIBS=$LIBS
13832 LIBS="-lcrypto $LIBS"
13833 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13834 /* end confdefs.h. */
13835
13836 /* Override any GCC internal prototype to avoid an error.
13837 Use char because int might match the return type of a GCC
13838 builtin and then its argument prototype would still apply. */
13839 #ifdef __cplusplus
13840 extern "C"
13841 #endif
13842 char X509_STORE_new ();
13843 int
13844 main ()
13845 {
13846 return X509_STORE_new ();
13847 ;
13848 return 0;
13849 }
13850 _ACEOF
13851 if ac_fn_c_try_link "$LINENO"; then :
13852 ac_cv_lib_crypto_X509_STORE_new=yes
13853 else
13854 ac_cv_lib_crypto_X509_STORE_new=no
13855 fi
13856 rm -f core conftest.err conftest.$ac_objext \
13857 conftest$ac_exeext conftest.$ac_ext
13858 LIBS=$ac_check_lib_save_LIBS
13859 fi
13860 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_X509_STORE_new" >&5
13861 $as_echo "$ac_cv_lib_crypto_X509_STORE_new" >&6; }
13862 if test "x$ac_cv_lib_crypto_X509_STORE_new" = xyes; then :
13863
13864
13865 cat >>confdefs.h <<_ACEOF
13866 #define HAVE_LIBCRYPTO 2
13867 _ACEOF
13868 LIBS="-lcrypto $LIBS"
13869
13870 else
13871
13872 as_fn_error $? "libcrypto still needed for Zero configuration DNSSEC" "$LINENO" 5
13873
13874 fi
13875
13876
13877 else
13878
13879 if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
13880
13881
13882 # Check whether --with-ssl was given.
13883 if test "${with_ssl+set}" = set; then :
13884 withval=$with_ssl;
13885
13886 else
13887
13888 withval="yes"
13889
13890 fi
13891
13892 if test x_$withval = x_no; then
13893 as_fn_error $? "Need SSL library to do digital signature cryptography" "$LINENO" 5
13894 fi
13895
13896 withval=$withval
13897 if test x_$withval != x_no; then
13898 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL" >&5
13899 $as_echo_n "checking for SSL... " >&6; }
13900 if test x_$withval = x_ -o x_$withval = x_yes; then
13901 withval="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr"
13902 fi
13903 for dir in $withval; do
13904 ssldir="$dir"
13905 if test -f "$dir/include/openssl/ssl.h"; then
13906 found_ssl="yes"
13907
13908 cat >>confdefs.h <<_ACEOF
13909 #define HAVE_SSL /**/
13910 _ACEOF
13911
13912 if test "$ssldir" != "/usr"; then
13913 CPPFLAGS="$CPPFLAGS -I$ssldir/include"
13914 LIBSSL_CPPFLAGS="$LIBSSL_CPPFLAGS -I$ssldir/include"
13915 fi
13916 break;
13917 fi
13918 done
13919 if test x_$found_ssl != x_yes; then
13920 as_fn_error $? "Cannot find the SSL libraries in $withval" "$LINENO" 5
13921 else
13922 { $as_echo "$as_me:${as_lineno-$LINENO}: result: found in $ssldir" >&5
13923 $as_echo "found in $ssldir" >&6; }
13924 HAVE_SSL=yes
13925 if test "$ssldir" != "/usr" -a "$ssldir" != ""; then
13926 LDFLAGS="$LDFLAGS -L$ssldir/lib"
13927 LIBSSL_LDFLAGS="$LIBSSL_LDFLAGS -L$ssldir/lib"
13928
13929 if test "x$enable_rpath" = xyes; then
13930 if echo "$ssldir/lib" | grep "^/" >/dev/null; then
13931 RUNTIME_PATH="$RUNTIME_PATH -R$ssldir/lib"
13932 fi
13933 fi
13934
13935 fi
13936
13937 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HMAC_Update in -lcrypto" >&5
13938 $as_echo_n "checking for HMAC_Update in -lcrypto... " >&6; }
13939 LIBS="-lssl -lcrypto $LIBS"
13940 LIBSSL_LIBS="-lssl -lcrypto $LIBSSL_LIBS"
13941 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13942 /* end confdefs.h. */
13943
13944 int
13945 main ()
13946 {
13947
13948 int HMAC_Update(void);
13949 (void)HMAC_Update();
13950
13951 ;
13952 return 0;
13953 }
13954 _ACEOF
13955 if ac_fn_c_try_link "$LINENO"; then :
13956
13957
13958 $as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h
13959
13960 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13961 $as_echo "yes" >&6; }
13962
13963 else
13964
13965 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13966 $as_echo "no" >&6; }
13967 # check if -lwsock32 or -lgdi32 are needed.
13968 BAKLIBS="$LIBS"
13969 BAKSSLLIBS="$LIBSSL_LIBS"
13970 LIBS="$LIBS -lgdi32"
13971 LIBSSL_LIBS="$LIBSSL_LIBS -lgdi32"
13972 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -lcrypto needs -lgdi32" >&5
13973 $as_echo_n "checking if -lcrypto needs -lgdi32... " >&6; }
13974 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13975 /* end confdefs.h. */
13976
13977 int
13978 main ()
13979 {
13980
13981 int HMAC_Update(void);
13982 (void)HMAC_Update();
13983
13984 ;
13985 return 0;
13986 }
13987 _ACEOF
13988 if ac_fn_c_try_link "$LINENO"; then :
13989
13990
13991 $as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h
13992
13993 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13994 $as_echo "yes" >&6; }
13995
13996 else
13997
13998 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13999 $as_echo "no" >&6; }
14000 LIBS="$BAKLIBS"
14001 LIBSSL_LIBS="$BAKSSLLIBS"
14002 LIBS="$LIBS -ldl"
14003 LIBSSL_LIBS="$LIBSSL_LIBS -ldl"
14004 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -lcrypto needs -ldl" >&5
14005 $as_echo_n "checking if -lcrypto needs -ldl... " >&6; }
14006 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14007 /* end confdefs.h. */
14008
14009 int
14010 main ()
14011 {
14012
14013 int HMAC_Update(void);
14014 (void)HMAC_Update();
14015
14016 ;
14017 return 0;
14018 }
14019 _ACEOF
14020 if ac_fn_c_try_link "$LINENO"; then :
14021
14022
14023 $as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h
14024
14025 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14026 $as_echo "yes" >&6; }
14027
14028 else
14029
14030 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14031 $as_echo "no" >&6; }
14032 as_fn_error $? "OpenSSL found in $ssldir, but version 0.9.7 or higher is required" "$LINENO" 5
14033
14034 fi
14035 rm -f core conftest.err conftest.$ac_objext \
14036 conftest$ac_exeext conftest.$ac_ext
14037
14038 fi
14039 rm -f core conftest.err conftest.$ac_objext \
14040 conftest$ac_exeext conftest.$ac_ext
14041
14042 fi
14043 rm -f core conftest.err conftest.$ac_objext \
14044 conftest$ac_exeext conftest.$ac_ext
14045 fi
14046
14047
14048 fi
14049 for ac_header in openssl/ssl.h
14050 do :
14051 ac_fn_c_check_header_compile "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default
14052 "
14053 if test "x$ac_cv_header_openssl_ssl_h" = xyes; then :
14054 cat >>confdefs.h <<_ACEOF
14055 #define HAVE_OPENSSL_SSL_H 1
14056 _ACEOF
14057
14058 fi
14059
14060 done
14061
14062 for ac_header in openssl/err.h
14063 do :
14064 ac_fn_c_check_header_compile "$LINENO" "openssl/err.h" "ac_cv_header_openssl_err_h" "$ac_includes_default
14065 "
14066 if test "x$ac_cv_header_openssl_err_h" = xyes; then :
14067 cat >>confdefs.h <<_ACEOF
14068 #define HAVE_OPENSSL_ERR_H 1
14069 _ACEOF
14070
14071 fi
14072
14073 done
14074
14075 for ac_header in openssl/rand.h
14076 do :
14077 ac_fn_c_check_header_compile "$LINENO" "openssl/rand.h" "ac_cv_header_openssl_rand_h" "$ac_includes_default
14078 "
14079 if test "x$ac_cv_header_openssl_rand_h" = xyes; then :
14080 cat >>confdefs.h <<_ACEOF
14081 #define HAVE_OPENSSL_RAND_H 1
14082 _ACEOF
14083
14084 fi
14085
14086 done
14087
14088
14089 ac_fn_c_check_func "$LINENO" "TLSv1_2_client_method" "ac_cv_func_TLSv1_2_client_method"
14090 if test "x$ac_cv_func_TLSv1_2_client_method" = xyes; then :
14091
14092 $as_echo "#define HAVE_TLS_v1_2 1" >>confdefs.h
14093
14094 else
14095 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find TLSv1_2_client_method in libssl library. TLS will not be available." >&5
14096 $as_echo "$as_me: WARNING: Cannot find TLSv1_2_client_method in libssl library. TLS will not be available." >&2;}
14097 fi
14098
14099
14100 ac_fn_c_check_func "$LINENO" "SSL_CTX_get0_param" "ac_cv_func_SSL_CTX_get0_param"
14101 if test "x$ac_cv_func_SSL_CTX_get0_param" = xyes; then :
14102
14103 $as_echo "#define HAVE_SSL_HN_AUTH 1" >>confdefs.h
14104
14105 else
14106 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find SSL_CTX_get0_param in libssl library. TLS hostname verification will not be available." >&5
14107 $as_echo "$as_me: WARNING: Cannot find SSL_CTX_get0_param in libssl library. TLS hostname verification will not be available." >&2;}
14108 fi
14109
14110
14111
14112 fi
14113
14114 # check if libssl needs libdl
14115 BAKLIBS="$LIBS"
14116 LIBS="-lssl $LIBS"
14117 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libssl needs libdl" >&5
14118 $as_echo_n "checking if libssl needs libdl... " >&6; }
14119 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14120 /* end confdefs.h. */
14121
14122 /* Override any GCC internal prototype to avoid an error.
14123 Use char because int might match the return type of a GCC
14124 builtin and then its argument prototype would still apply. */
14125 #ifdef __cplusplus
14126 extern "C"
14127 #endif
14128 char SSL_CTX_new ();
14129 int
14130 main ()
14131 {
14132 return SSL_CTX_new ();
14133 ;
14134 return 0;
14135 }
14136 _ACEOF
14137 if ac_fn_c_try_link "$LINENO"; then :
14138
14139 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14140 $as_echo "no" >&6; }
14141 LIBS="$BAKLIBS"
14142
14143 else
14144
14145 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14146 $as_echo "yes" >&6; }
14147 LIBS="$BAKLIBS"
14148 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
14149 $as_echo_n "checking for library containing dlopen... " >&6; }
14150 if ${ac_cv_search_dlopen+:} false; then :
14151 $as_echo_n "(cached) " >&6
14152 else
14153 ac_func_search_save_LIBS=$LIBS
14154 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14155 /* end confdefs.h. */
14156
14157 /* Override any GCC internal prototype to avoid an error.
14158 Use char because int might match the return type of a GCC
14159 builtin and then its argument prototype would still apply. */
14160 #ifdef __cplusplus
14161 extern "C"
14162 #endif
14163 char dlopen ();
14164 int
14165 main ()
14166 {
14167 return dlopen ();
14168 ;
14169 return 0;
14170 }
14171 _ACEOF
14172 for ac_lib in '' dl; do
14173 if test -z "$ac_lib"; then
14174 ac_res="none required"
14175 else
14176 ac_res=-l$ac_lib
14177 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
14178 fi
14179 if ac_fn_c_try_link "$LINENO"; then :
14180 ac_cv_search_dlopen=$ac_res
14181 fi
14182 rm -f core conftest.err conftest.$ac_objext \
14183 conftest$ac_exeext
14184 if ${ac_cv_search_dlopen+:} false; then :
14185 break
14186 fi
14187 done
14188 if ${ac_cv_search_dlopen+:} false; then :
14189
14190 else
14191 ac_cv_search_dlopen=no
14192 fi
14193 rm conftest.$ac_ext
14194 LIBS=$ac_func_search_save_LIBS
14195 fi
14196 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
14197 $as_echo "$ac_cv_search_dlopen" >&6; }
14198 ac_res=$ac_cv_search_dlopen
14199 if test "$ac_res" != no; then :
14200 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
14201
14202 fi
14203
14204
14205 fi
14206 rm -f core conftest.err conftest.$ac_objext \
14207 conftest$ac_exeext conftest.$ac_ext
14208 TLSDIR='openssl'
14209
14210
14211 # Verify OpenSSL is at least version 1.0.2.
14212 # We also check it's not LibreSSL, but that's a little later, not here.
14213 for ac_func in X509_check_host SSL_dane_enable
14214 do :
14215 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
14216 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
14217 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
14218 cat >>confdefs.h <<_ACEOF
14219 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
14220 _ACEOF
14221
14222 fi
14223 done
14224
14225 if test "x$ac_cv_func_X509_check_host" != xyes; then
14226 as_fn_error $? "getdns requires OpenSSL version 1.0.2 or later" "$LINENO" 5
14227 fi
14228
14229 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need to compile/link DANE support" >&5
14230 $as_echo_n "checking whether we need to compile/link DANE support... " >&6; }
14231 DANESSL_XTRA_OBJS=""
14232 if test "x$ac_cv_func_SSL_dane_enable" = xyes; then
14233 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14234 $as_echo "no" >&6; }
14235 else
14236 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14237 $as_echo "yes" >&6; }
14238
14239 $as_echo "#define USE_DANESSL 1" >>confdefs.h
14240
14241 DANESSL_XTRA_OBJS="danessl.lo"
14242 fi
14243
14244
14245 fi
14246
14247
14248
14249 # openssl
14250 if test $USE_NSS = "no" -a $USE_NETTLE = "no" ; then
14251 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibreSSL" >&5
14252 $as_echo_n "checking for LibreSSL... " >&6; }
14253 if grep VERSION_TEXT $ssldir/include/openssl/opensslv.h | grep "LibreSSL" >/dev/null; then
14254 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14255 $as_echo "yes" >&6; }
14256 as_fn_error $? "getdns does not support LibreSSL" "$LINENO" 5
14257 else
14258 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14259 $as_echo "no" >&6; }
14260 fi
14261 for ac_header in openssl/conf.h openssl/ssl.h
14262 do :
14263 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
14264 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
14265 "
14266 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
14267 cat >>confdefs.h <<_ACEOF
14268 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
14269 _ACEOF
14270
14271 fi
14272
14273 done
14274
14275 for ac_header in openssl/engine.h
14276 do :
14277 ac_fn_c_check_header_compile "$LINENO" "openssl/engine.h" "ac_cv_header_openssl_engine_h" "$ac_includes_default
14278 "
14279 if test "x$ac_cv_header_openssl_engine_h" = xyes; then :
14280 cat >>confdefs.h <<_ACEOF
14281 #define HAVE_OPENSSL_ENGINE_H 1
14282 _ACEOF
14283
14284 fi
14285
14286 done
14287
14288 for ac_header in openssl/bn.h openssl/rsa.h openssl/dsa.h
14289 do :
14290 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
14291 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
14292 "
14293 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
14294 cat >>confdefs.h <<_ACEOF
14295 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
14296 _ACEOF
14297
14298 fi
14299
14300 done
14301
14302 for ac_func in OPENSSL_config EVP_md5 EVP_sha1 EVP_sha224 EVP_sha256 EVP_sha384 EVP_sha512 FIPS_mode ENGINE_load_cryptodev EVP_PKEY_keygen ECDSA_SIG_get0 EVP_MD_CTX_new EVP_PKEY_base_id HMAC_CTX_new HMAC_CTX_free TLS_client_method DSA_SIG_set0 EVP_dss1 EVP_DigestVerify OpenSSL_version_num OpenSSL_version SSL_CTX_dane_enable SSL_dane_enable SSL_dane_tlsa_add X509_check_host X509_get_notAfter X509_get0_notAfter SSL_CTX_set_ciphersuites SSL_set_ciphersuites OPENSSL_init_crypto DSA_set0_pqg DSA_set0_key RSA_set0_key
14303 do :
14304 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
14305 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
14306 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
14307 cat >>confdefs.h <<_ACEOF
14308 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
14309 _ACEOF
14310
14311 fi
14312 done
14313
14314 ac_fn_c_check_decl "$LINENO" "SSL_COMP_get_compression_methods" "ac_cv_have_decl_SSL_COMP_get_compression_methods" "
14315 $ac_includes_default
14316 #ifdef HAVE_OPENSSL_ERR_H
14317 #include <openssl/err.h>
14318 #endif
14319
14320 #ifdef HAVE_OPENSSL_RAND_H
14321 #include <openssl/rand.h>
14322 #endif
14323
14324 #ifdef HAVE_OPENSSL_CONF_H
14325 #include <openssl/conf.h>
14326 #endif
14327
14328 #ifdef HAVE_OPENSSL_ENGINE_H
14329 #include <openssl/engine.h>
14330 #endif
14331 #include <openssl/ssl.h>
14332 #include <openssl/evp.h>
14333
14334 "
14335 if test "x$ac_cv_have_decl_SSL_COMP_get_compression_methods" = xyes; then :
14336 ac_have_decl=1
14337 else
14338 ac_have_decl=0
14339 fi
14340
14341 cat >>confdefs.h <<_ACEOF
14342 #define HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS $ac_have_decl
14343 _ACEOF
14344 ac_fn_c_check_decl "$LINENO" "sk_SSL_COMP_pop_free" "ac_cv_have_decl_sk_SSL_COMP_pop_free" "
14345 $ac_includes_default
14346 #ifdef HAVE_OPENSSL_ERR_H
14347 #include <openssl/err.h>
14348 #endif
14349
14350 #ifdef HAVE_OPENSSL_RAND_H
14351 #include <openssl/rand.h>
14352 #endif
14353
14354 #ifdef HAVE_OPENSSL_CONF_H
14355 #include <openssl/conf.h>
14356 #endif
14357
14358 #ifdef HAVE_OPENSSL_ENGINE_H
14359 #include <openssl/engine.h>
14360 #endif
14361 #include <openssl/ssl.h>
14362 #include <openssl/evp.h>
14363
14364 "
14365 if test "x$ac_cv_have_decl_sk_SSL_COMP_pop_free" = xyes; then :
14366 ac_have_decl=1
14367 else
14368 ac_have_decl=0
14369 fi
14370
14371 cat >>confdefs.h <<_ACEOF
14372 #define HAVE_DECL_SK_SSL_COMP_POP_FREE $ac_have_decl
14373 _ACEOF
14374 ac_fn_c_check_decl "$LINENO" "SSL_CTX_set_ecdh_auto" "ac_cv_have_decl_SSL_CTX_set_ecdh_auto" "
14375 $ac_includes_default
14376 #ifdef HAVE_OPENSSL_ERR_H
14377 #include <openssl/err.h>
14378 #endif
14379
14380 #ifdef HAVE_OPENSSL_RAND_H
14381 #include <openssl/rand.h>
14382 #endif
14383
14384 #ifdef HAVE_OPENSSL_CONF_H
14385 #include <openssl/conf.h>
14386 #endif
14387
14388 #ifdef HAVE_OPENSSL_ENGINE_H
14389 #include <openssl/engine.h>
14390 #endif
14391 #include <openssl/ssl.h>
14392 #include <openssl/evp.h>
14393
14394 "
14395 if test "x$ac_cv_have_decl_SSL_CTX_set_ecdh_auto" = xyes; then :
14396 ac_have_decl=1
14397 else
14398 ac_have_decl=0
14399 fi
14400
14401 cat >>confdefs.h <<_ACEOF
14402 #define HAVE_DECL_SSL_CTX_SET_ECDH_AUTO $ac_have_decl
14403 _ACEOF
14404 ac_fn_c_check_decl "$LINENO" "SSL_CTX_set1_curves_list" "ac_cv_have_decl_SSL_CTX_set1_curves_list" "
14405 $ac_includes_default
14406 #ifdef HAVE_OPENSSL_ERR_H
14407 #include <openssl/err.h>
14408 #endif
14409
14410 #ifdef HAVE_OPENSSL_RAND_H
14411 #include <openssl/rand.h>
14412 #endif
14413
14414 #ifdef HAVE_OPENSSL_CONF_H
14415 #include <openssl/conf.h>
14416 #endif
14417
14418 #ifdef HAVE_OPENSSL_ENGINE_H
14419 #include <openssl/engine.h>
14420 #endif
14421 #include <openssl/ssl.h>
14422 #include <openssl/evp.h>
14423
14424 "
14425 if test "x$ac_cv_have_decl_SSL_CTX_set1_curves_list" = xyes; then :
14426 ac_have_decl=1
14427 else
14428 ac_have_decl=0
14429 fi
14430
14431 cat >>confdefs.h <<_ACEOF
14432 #define HAVE_DECL_SSL_CTX_SET1_CURVES_LIST $ac_have_decl
14433 _ACEOF
14434 ac_fn_c_check_decl "$LINENO" "SSL_set1_curves_list" "ac_cv_have_decl_SSL_set1_curves_list" "
14435 $ac_includes_default
14436 #ifdef HAVE_OPENSSL_ERR_H
14437 #include <openssl/err.h>
14438 #endif
14439
14440 #ifdef HAVE_OPENSSL_RAND_H
14441 #include <openssl/rand.h>
14442 #endif
14443
14444 #ifdef HAVE_OPENSSL_CONF_H
14445 #include <openssl/conf.h>
14446 #endif
14447
14448 #ifdef HAVE_OPENSSL_ENGINE_H
14449 #include <openssl/engine.h>
14450 #endif
14451 #include <openssl/ssl.h>
14452 #include <openssl/evp.h>
14453
14454 "
14455 if test "x$ac_cv_have_decl_SSL_set1_curves_list" = xyes; then :
14456 ac_have_decl=1
14457 else
14458 ac_have_decl=0
14459 fi
14460
14461 cat >>confdefs.h <<_ACEOF
14462 #define HAVE_DECL_SSL_SET1_CURVES_LIST $ac_have_decl
14463 _ACEOF
14464 ac_fn_c_check_decl "$LINENO" "SSL_set_min_proto_version" "ac_cv_have_decl_SSL_set_min_proto_version" "
14465 $ac_includes_default
14466 #ifdef HAVE_OPENSSL_ERR_H
14467 #include <openssl/err.h>
14468 #endif
14469
14470 #ifdef HAVE_OPENSSL_RAND_H
14471 #include <openssl/rand.h>
14472 #endif
14473
14474 #ifdef HAVE_OPENSSL_CONF_H
14475 #include <openssl/conf.h>
14476 #endif
14477
14478 #ifdef HAVE_OPENSSL_ENGINE_H
14479 #include <openssl/engine.h>
14480 #endif
14481 #include <openssl/ssl.h>
14482 #include <openssl/evp.h>
14483
14484 "
14485 if test "x$ac_cv_have_decl_SSL_set_min_proto_version" = xyes; then :
14486 ac_have_decl=1
14487 else
14488 ac_have_decl=0
14489 fi
14490
14491 cat >>confdefs.h <<_ACEOF
14492 #define HAVE_DECL_SSL_SET_MIN_PROTO_VERSION $ac_have_decl
14493 _ACEOF
14494 ac_fn_c_check_decl "$LINENO" "SSL_get_min_proto_version" "ac_cv_have_decl_SSL_get_min_proto_version" "
14495 $ac_includes_default
14496 #ifdef HAVE_OPENSSL_ERR_H
14497 #include <openssl/err.h>
14498 #endif
14499
14500 #ifdef HAVE_OPENSSL_RAND_H
14501 #include <openssl/rand.h>
14502 #endif
14503
14504 #ifdef HAVE_OPENSSL_CONF_H
14505 #include <openssl/conf.h>
14506 #endif
14507
14508 #ifdef HAVE_OPENSSL_ENGINE_H
14509 #include <openssl/engine.h>
14510 #endif
14511 #include <openssl/ssl.h>
14512 #include <openssl/evp.h>
14513
14514 "
14515 if test "x$ac_cv_have_decl_SSL_get_min_proto_version" = xyes; then :
14516 ac_have_decl=1
14517 else
14518 ac_have_decl=0
14519 fi
14520
14521 cat >>confdefs.h <<_ACEOF
14522 #define HAVE_DECL_SSL_GET_MIN_PROTO_VERSION $ac_have_decl
14523 _ACEOF
14524
14525 fi
14526
14527 # Check whether --enable-sha1 was given.
14528 if test "${enable_sha1+set}" = set; then :
14529 enableval=$enable_sha1;
14530 fi
14531
14532 case "$enable_sha1" in
14533 no)
14534 ;;
14535 yes|*)
14536
14537 $as_echo "#define USE_SHA1 1" >>confdefs.h
14538
14539 ;;
14540 esac
14541
14542 # Check whether --enable-sha2 was given.
14543 if test "${enable_sha2+set}" = set; then :
14544 enableval=$enable_sha2;
14545 fi
14546
14547 case "$enable_sha2" in
14548 no)
14549 ;;
14550 yes|*)
14551
14552 $as_echo "#define USE_SHA2 1" >>confdefs.h
14553
14554 ;;
14555 esac
14556
14557 # check wether gost also works
14558
14559 # Check whether --enable-gost was given.
14560 if test "${enable_gost+set}" = set; then :
14561 enableval=$enable_gost;
14562 fi
14563
14564 use_gost="no"
14565 if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
14566 case "$enable_gost" in
14567 no)
14568 ;;
14569 *)
14570 ac_fn_c_check_func "$LINENO" "EVP_PKEY_set_type_str" "ac_cv_func_EVP_PKEY_set_type_str"
14571 if test "x$ac_cv_func_EVP_PKEY_set_type_str" = xyes; then :
14572 :
14573 else
14574 as_fn_error $? "OpenSSL 1.0.0 is needed for GOST support" "$LINENO" 5
14575 fi
14576
14577 ac_fn_c_check_func "$LINENO" "EC_KEY_new" "ac_cv_func_EC_KEY_new"
14578 if test "x$ac_cv_func_EC_KEY_new" = xyes; then :
14579
14580 else
14581 as_fn_error $? "OpenSSL does not support ECC, needed for GOST support" "$LINENO" 5
14582 fi
14583
14584
14585 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if GOST works" >&5
14586 $as_echo_n "checking if GOST works... " >&6; }
14587 if test c${cross_compiling} = cno; then
14588 BAKCFLAGS="$CFLAGS"
14589 if test -n "$ssldir"; then
14590 CFLAGS="$CFLAGS -Wl,-rpath,$ssldir/lib"
14591 fi
14592 if test "$cross_compiling" = yes; then :
14593 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14594 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14595 as_fn_error $? "cannot run test program while cross compiling
14596 See \`config.log' for more details" "$LINENO" 5; }
14597 else
14598 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14599 /* end confdefs.h. */
14600
14601 #include <string.h>
14602 #include <openssl/ssl.h>
14603 #include <openssl/evp.h>
14604 #include <openssl/engine.h>
14605 #include <openssl/conf.h>
14606 /* routine to load gost (from gldns) */
14607 int load_gost_id(void)
14608 {
14609 static int gost_id = 0;
14610 const EVP_PKEY_ASN1_METHOD* meth;
14611 ENGINE* e;
14612
14613 if(gost_id) return gost_id;
14614
14615 /* see if configuration loaded gost implementation from other engine*/
14616 meth = EVP_PKEY_asn1_find_str(NULL, "gost2001", -1);
14617 if(meth) {
14618 EVP_PKEY_asn1_get0_info(&gost_id, NULL, NULL, NULL, NULL, meth);
14619 return gost_id;
14620 }
14621
14622 /* see if engine can be loaded already */
14623 e = ENGINE_by_id("gost");
14624 if(!e) {
14625 /* load it ourself, in case statically linked */
14626 ENGINE_load_builtin_engines();
14627 ENGINE_load_dynamic();
14628 e = ENGINE_by_id("gost");
14629 }
14630 if(!e) {
14631 /* no gost engine in openssl */
14632 return 0;
14633 }
14634 if(!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
14635 ENGINE_finish(e);
14636 ENGINE_free(e);
14637 return 0;
14638 }
14639
14640 meth = EVP_PKEY_asn1_find_str(&e, "gost2001", -1);
14641 if(!meth) {
14642 /* algo not found */
14643 ENGINE_finish(e);
14644 ENGINE_free(e);
14645 return 0;
14646 }
14647 EVP_PKEY_asn1_get0_info(&gost_id, NULL, NULL, NULL, NULL, meth);
14648 return gost_id;
14649 }
14650 int main(void) {
14651 EVP_MD_CTX* ctx;
14652 const EVP_MD* md;
14653 unsigned char digest[64]; /* its a 256-bit digest, so uses 32 bytes */
14654 const char* str = "Hello world";
14655 const unsigned char check[] = {
14656 0x40 , 0xed , 0xf8 , 0x56 , 0x5a , 0xc5 , 0x36 , 0xe1 ,
14657 0x33 , 0x7c , 0x7e , 0x87 , 0x62 , 0x1c , 0x42 , 0xe0 ,
14658 0x17 , 0x1b , 0x5e , 0xce , 0xa8 , 0x46 , 0x65 , 0x4d ,
14659 0x8d , 0x3e , 0x22 , 0x9b , 0xe1 , 0x30 , 0x19 , 0x9d
14660 };
14661 OPENSSL_config(NULL);
14662 (void)load_gost_id();
14663 md = EVP_get_digestbyname("md_gost94");
14664 if(!md) return 1;
14665 memset(digest, 0, sizeof(digest));
14666 ctx = EVP_MD_CTX_create();
14667 if(!ctx) return 2;
14668 if(!EVP_DigestInit_ex(ctx, md, NULL)) return 3;
14669 if(!EVP_DigestUpdate(ctx, str, 10)) return 4;
14670 if(!EVP_DigestFinal_ex(ctx, digest, NULL)) return 5;
14671 /* uncomment to see the hash calculated.
14672 {int i;
14673 for(i=0; i<32; i++)
14674 printf(" %2.2x", (int)digest[i]);
14675 printf("\n");}
14676 */
14677 if(memcmp(digest, check, sizeof(check)) != 0)
14678 return 6;
14679 return 0;
14680 }
14681
14682 _ACEOF
14683 if ac_fn_c_try_run "$LINENO"; then :
14684 eval "ac_cv_c_gost_works=yes"
14685 else
14686 eval "ac_cv_c_gost_works=no"
14687 fi
14688 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14689 conftest.$ac_objext conftest.beam conftest.$ac_ext
14690 fi
14691
14692 CFLAGS="$BAKCFLAGS"
14693 else
14694 eval "ac_cv_c_gost_works=maybe"
14695 fi
14696 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_gost_works" >&5
14697 $as_echo "$ac_cv_c_gost_works" >&6; }
14698
14699 if test "$ac_cv_c_gost_works" != no; then
14700 use_gost="yes"
14701
14702 $as_echo "#define USE_GOST 1" >>confdefs.h
14703
14704 fi
14705 ;;
14706 esac
14707 fi
14708 # Check whether --enable-ecdsa was given.
14709 if test "${enable_ecdsa+set}" = set; then :
14710 enableval=$enable_ecdsa;
14711 fi
14712
14713 use_ecdsa="no"
14714 case "$enable_ecdsa" in
14715 no)
14716 ;;
14717 *)
14718 if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
14719 ac_fn_c_check_func "$LINENO" "ECDSA_sign" "ac_cv_func_ECDSA_sign"
14720 if test "x$ac_cv_func_ECDSA_sign" = xyes; then :
14721
14722 else
14723 as_fn_error $? "OpenSSL does not support ECDSA: please upgrade or rerun with --disable-ecdsa" "$LINENO" 5
14724 fi
14725
14726 ac_fn_c_check_func "$LINENO" "SHA384_Init" "ac_cv_func_SHA384_Init"
14727 if test "x$ac_cv_func_SHA384_Init" = xyes; then :
14728
14729 else
14730 as_fn_error $? "OpenSSL does not support SHA384: please upgrade or rerun with --disable-ecdsa" "$LINENO" 5
14731 fi
14732
14733 ac_fn_c_check_decl "$LINENO" "NID_X9_62_prime256v1" "ac_cv_have_decl_NID_X9_62_prime256v1" "$ac_includes_default
14734 #include <openssl/evp.h>
14735
14736 "
14737 if test "x$ac_cv_have_decl_NID_X9_62_prime256v1" = xyes; then :
14738 ac_have_decl=1
14739 else
14740 ac_have_decl=0
14741 fi
14742
14743 cat >>confdefs.h <<_ACEOF
14744 #define HAVE_DECL_NID_X9_62_PRIME256V1 $ac_have_decl
14745 _ACEOF
14746 if test $ac_have_decl = 1; then :
14747
14748 else
14749 as_fn_error $? "OpenSSL does not support the ECDSA curves: please upgrade or rerun with --disable-ecdsa" "$LINENO" 5
14750 fi
14751 ac_fn_c_check_decl "$LINENO" "NID_secp384r1" "ac_cv_have_decl_NID_secp384r1" "$ac_includes_default
14752 #include <openssl/evp.h>
14753
14754 "
14755 if test "x$ac_cv_have_decl_NID_secp384r1" = xyes; then :
14756 ac_have_decl=1
14757 else
14758 ac_have_decl=0
14759 fi
14760
14761 cat >>confdefs.h <<_ACEOF
14762 #define HAVE_DECL_NID_SECP384R1 $ac_have_decl
14763 _ACEOF
14764 if test $ac_have_decl = 1; then :
14765
14766 else
14767 as_fn_error $? "OpenSSL does not support the ECDSA curves: please upgrade or rerun with --disable-ecdsa" "$LINENO" 5
14768 fi
14769
14770 # see if OPENSSL 1.0.0 or later (has EVP MD and Verify independency)
14771 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if openssl supports SHA2 and ECDSA with EVP" >&5
14772 $as_echo_n "checking if openssl supports SHA2 and ECDSA with EVP... " >&6; }
14773 if grep OPENSSL_VERSION_TEXT $ssldir/include/openssl/opensslv.h | grep "OpenSSL" >/dev/null; then
14774 if grep OPENSSL_VERSION_NUMBER $ssldir/include/openssl/opensslv.h | grep 0x0 >/dev/null; then
14775 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14776 $as_echo "no" >&6; }
14777
14778 cat >>confdefs.h <<_ACEOF
14779 #define USE_ECDSA_EVP_WORKAROUND 1
14780 _ACEOF
14781
14782 else
14783 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14784 $as_echo "yes" >&6; }
14785 fi
14786 else
14787 # not OpenSSL, thus likely LibreSSL, which supports it
14788 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14789 $as_echo "yes" >&6; }
14790 fi
14791 fi
14792 # we now know we have ECDSA and the required curves.
14793
14794 cat >>confdefs.h <<_ACEOF
14795 #define USE_ECDSA 1
14796 _ACEOF
14797
14798 use_ecdsa="yes"
14799 ;;
14800 esac
14801
14802 # Check whether --enable-dsa was given.
14803 if test "${enable_dsa+set}" = set; then :
14804 enableval=$enable_dsa;
14805 fi
14806
14807 case "$enable_dsa" in
14808 no)
14809 ;;
14810 *) # detect if DSA is supported, and turn it off if not.
14811 if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
14812 ac_fn_c_check_func "$LINENO" "DSA_SIG_new" "ac_cv_func_DSA_SIG_new"
14813 if test "x$ac_cv_func_DSA_SIG_new" = xyes; then :
14814
14815 as_ac_Type=`$as_echo "ac_cv_type_DSA_SIG*" | $as_tr_sh`
14816 ac_fn_c_check_type "$LINENO" "DSA_SIG*" "$as_ac_Type" "
14817 $ac_includes_default
14818 #ifdef HAVE_OPENSSL_ENGINE_H
14819 # include <openssl/engine.h>
14820 #endif
14821
14822 #ifdef HAVE_OPENSSL_RAND_H
14823 #include <openssl/rand.h>
14824 #endif
14825
14826 #ifdef HAVE_OPENSSL_CONF_H
14827 #include <openssl/conf.h>
14828 #endif
14829
14830 #ifdef HAVE_OPENSSL_ENGINE_H
14831 #include <openssl/engine.h>
14832 #endif
14833
14834 "
14835 if eval test \"x\$"$as_ac_Type"\" = x"yes"; then :
14836
14837
14838 cat >>confdefs.h <<_ACEOF
14839 #define USE_DSA 1
14840 _ACEOF
14841
14842
14843 else
14844 if test "x$enable_dsa" = "xyes"; then as_fn_error $? "OpenSSL does not support DSA and you used --enable-dsa." "$LINENO" 5
14845 fi
14846 fi
14847
14848
14849 else
14850 if test "x$enable_dsa" = "xyes"; then as_fn_error $? "OpenSSL does not support DSA and you used --enable-dsa." "$LINENO" 5
14851 fi
14852 fi
14853
14854 else
14855
14856 cat >>confdefs.h <<_ACEOF
14857 #define USE_DSA 1
14858 _ACEOF
14859
14860 fi
14861 ;;
14862 esac
14863
14864 # Check whether --enable-ed25519 was given.
14865 if test "${enable_ed25519+set}" = set; then :
14866 enableval=$enable_ed25519;
14867 fi
14868
14869 use_ed25519="no"
14870 case "$enable_ed25519" in
14871 no)
14872 ;;
14873 *)
14874 if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
14875 ac_fn_c_check_decl "$LINENO" "NID_ED25519" "ac_cv_have_decl_NID_ED25519" "$ac_includes_default
14876 #include <openssl/evp.h>
14877
14878 "
14879 if test "x$ac_cv_have_decl_NID_ED25519" = xyes; then :
14880 ac_have_decl=1
14881 else
14882 ac_have_decl=0
14883 fi
14884
14885 cat >>confdefs.h <<_ACEOF
14886 #define HAVE_DECL_NID_ED25519 $ac_have_decl
14887 _ACEOF
14888 if test $ac_have_decl = 1; then :
14889
14890 use_ed25519="yes"
14891
14892 else
14893 if test "x$enable_ed25519" = "xyes"; then as_fn_error $? "OpenSSL does not support ED25519 and you used --enable-ed25519." "$LINENO" 5
14894 fi
14895 fi
14896
14897 fi
14898 if test $USE_NETTLE = "yes"; then
14899 for ac_header in nettle/eddsa.h
14900 do :
14901 ac_fn_c_check_header_compile "$LINENO" "nettle/eddsa.h" "ac_cv_header_nettle_eddsa_h" "$ac_includes_default
14902 "
14903 if test "x$ac_cv_header_nettle_eddsa_h" = xyes; then :
14904 cat >>confdefs.h <<_ACEOF
14905 #define HAVE_NETTLE_EDDSA_H 1
14906 _ACEOF
14907 use_ed25519="yes"
14908 fi
14909
14910 done
14911
14912 fi
14913 if test $use_ed25519 = "yes"; then
14914
14915 cat >>confdefs.h <<_ACEOF
14916 #define USE_ED25519 1
14917 _ACEOF
14918
14919 fi
14920 ;;
14921 esac
14922
14923 # Check whether --enable-ed448 was given.
14924 if test "${enable_ed448+set}" = set; then :
14925 enableval=$enable_ed448;
14926 fi
14927
14928 use_ed448="no"
14929 case "$enable_ed448" in
14930 no)
14931 ;;
14932 *)
14933 if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
14934 ac_fn_c_check_decl "$LINENO" "NID_ED448" "ac_cv_have_decl_NID_ED448" "$ac_includes_default
14935 #include <openssl/evp.h>
14936
14937 "
14938 if test "x$ac_cv_have_decl_NID_ED448" = xyes; then :
14939 ac_have_decl=1
14940 else
14941 ac_have_decl=0
14942 fi
14943
14944 cat >>confdefs.h <<_ACEOF
14945 #define HAVE_DECL_NID_ED448 $ac_have_decl
14946 _ACEOF
14947 if test $ac_have_decl = 1; then :
14948
14949 use_ed448="yes"
14950
14951 else
14952 if test "x$enable_ed448" = "xyes"; then as_fn_error $? "OpenSSL does not support ED448 and you used --enable-ed448." "$LINENO" 5
14953 fi
14954 fi
14955
14956 fi
14957 if test $use_ed448 = "yes"; then
14958
14959 cat >>confdefs.h <<_ACEOF
14960 #define USE_ED448 1
14961 _ACEOF
14962
14963 fi
14964 ;;
14965 esac
14966
14967 # Check whether --enable-all-drafts was given.
14968 if test "${enable_all_drafts+set}" = set; then :
14969 enableval=$enable_all_drafts;
14970 fi
14971
14972 case "$enable_all_drafts" in
14973 yes)
14974
14975 cat >>confdefs.h <<_ACEOF
14976 #define HAVE_MDNS_SUPPORT 1
14977 _ACEOF
14978
14979 ;;
14980 no|*)
14981 ;;
14982 esac
14983 # Check whether --enable-dnssec-roadblock-avoidance was given.
14984 if test "${enable_dnssec_roadblock_avoidance+set}" = set; then :
14985 enableval=$enable_dnssec_roadblock_avoidance;
14986 fi
14987
14988 case "$enable_dnssec_roadblock_avoidance" in
14989 no)
14990 ;;
14991 yes|*)
14992
14993 cat >>confdefs.h <<_ACEOF
14994 #define DNSSEC_ROADBLOCK_AVOIDANCE 1
14995 _ACEOF
14996
14997 ;;
14998 esac
14999
15000 # Check whether --enable-edns-cookies was given.
15001 if test "${enable_edns_cookies+set}" = set; then :
15002 enableval=$enable_edns_cookies;
15003 fi
15004
15005 case "$enable_edns_cookies" in
15006 no)
15007 ;;
15008 yes|*)
15009 if test "x_$HAVE_SSL" != "x_yes" -a $USE_NETTLE = "no"; then
15010 as_fn_error $? "edns cookies needs crypto library which is not available, please rerun with --disable-edns-cookies" "$LINENO" 5
15011 fi
15012
15013 cat >>confdefs.h <<_ACEOF
15014 #define EDNS_COOKIES 1
15015 _ACEOF
15016
15017 ;;
15018 esac
15019
15020 cat >>confdefs.h <<_ACEOF
15021 #define EDNS_COOKIE_OPCODE 10
15022 _ACEOF
15023
15024
15025 cat >>confdefs.h <<_ACEOF
15026 #define EDNS_COOKIE_ROLLOVER_TIME (24 * 60 * 60)
15027 _ACEOF
15028
15029
15030
15031 cat >>confdefs.h <<_ACEOF
15032 #define MAXIMUM_UPSTREAM_OPTION_SPACE 3000
15033 _ACEOF
15034
15035
15036 cat >>confdefs.h <<_ACEOF
15037 #define EDNS_PADDING_OPCODE 12
15038 _ACEOF
15039
15040
15041 # Check whether --enable-draft-mdns-support was given.
15042 if test "${enable_draft_mdns_support+set}" = set; then :
15043 enableval=$enable_draft_mdns_support;
15044 fi
15045
15046 case "$enable_draft_mdns_support" in
15047 yes)
15048
15049 cat >>confdefs.h <<_ACEOF
15050 #define HAVE_MDNS_SUPPORT 1
15051 _ACEOF
15052
15053 ;;
15054 no|*)
15055 ;;
15056 esac
15057
15058 my_with_libunbound=1
15059 # Check whether --enable-stub-only was given.
15060 if test "${enable_stub_only+set}" = set; then :
15061 enableval=$enable_stub_only;
15062 fi
15063
15064 case "$enable_stub_only" in
15065 yes)
15066 my_with_libunbound=0
15067 ;;
15068 no|*)
15069 ;;
15070 esac
15071
15072 my_with_yaml=0
15073 # Check whether --enable-yaml-config was given.
15074 if test "${enable_yaml_config+set}" = set; then :
15075 enableval=$enable_yaml_config;
15076 fi
15077
15078 case "$enable_yaml_config" in
15079 yes)
15080
15081 cat >>confdefs.h <<_ACEOF
15082 #define USE_YAML_CONFIG 1
15083 _ACEOF
15084
15085
15086 cat >>confdefs.h <<_ACEOF
15087 #define HAVE_GETDNS_YAML2DICT 1
15088 _ACEOF
15089
15090
15091 GETDNS_XTRA_OBJS="convert_yaml_to_json.lo"
15092 my_with_yaml=1
15093 ;;
15094 no|*)
15095 GETDNS_XTRA_OBJS=""
15096 ;;
15097 esac
15098
15099
15100 if test "$USE_WINSOCK" = 1; then
15101 { $as_echo "$as_me:${as_lineno-$LINENO}: Building on Windows ... YES! " >&5
15102 $as_echo "$as_me: Building on Windows ... YES! " >&6;}
15103
15104 cat >>confdefs.h <<_ACEOF
15105 #define GETDNS_ON_WINDOWS 1
15106 _ACEOF
15107
15108 cat >>confdefs.h <<_ACEOF
15109 #define STUB_NATIVE_DNSSEC 1
15110 _ACEOF
15111
15112 LIBS="$LIBS -lgdi32 -liphlpapi"
15113 fi
15114
15115 ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "$ac_includes_default
15116 #ifdef HAVE_SIGNAL_H
15117 #include <signal.h>
15118 #endif
15119 #ifdef HAVE_SYS_TYPES_H
15120 #include <sys/types.h>
15121 #endif
15122
15123 "
15124 if test "x$ac_cv_type_sigset_t" = xyes; then :
15125
15126 cat >>confdefs.h <<_ACEOF
15127 #define HAVE_SIGSET_T 1
15128 _ACEOF
15129
15130
15131 else
15132 ac_fn_c_check_type "$LINENO" "_sigset_t" "ac_cv_type__sigset_t" "$ac_includes_default
15133 #ifdef HAVE_SIGNAL_H
15134 #include <signal.h>
15135 #endif
15136 #ifdef HAVE_SYS_TYPES_H
15137 #include <sys/types.h>
15138 #endif
15139
15140 "
15141 if test "x$ac_cv_type__sigset_t" = xyes; then :
15142
15143 cat >>confdefs.h <<_ACEOF
15144 #define HAVE__SIGSET_T 1
15145 _ACEOF
15146
15147
15148 else
15149 as_fn_error $? "Can't find type \`sigset_t' or type \`_sigset_t'" "$LINENO" 5
15150 fi
15151
15152
15153 fi
15154
15155 for ac_func in sigemptyset sigfillset sigaddset
15156 do :
15157 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
15158 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
15159 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
15160 cat >>confdefs.h <<_ACEOF
15161 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
15162 _ACEOF
15163
15164 fi
15165 done
15166
15167
15168 my_with_libidn=1
15169
15170 # Check whether --with-libidn was given.
15171 if test "${with_libidn+set}" = set; then :
15172 withval=$with_libidn;
15173 else
15174 withval="yes"
15175 fi
15176
15177 if test x_$withval = x_yes; then
15178 for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
15179 if test -f "$dir/include/idna.h"; then
15180 CFLAGS="$CFLAGS -I$dir/include"
15181 LDFLAGS="$LDFLAGS -L$dir/lib"
15182 { $as_echo "$as_me:${as_lineno-$LINENO}: Found libidn in $dir" >&5
15183 $as_echo "$as_me: Found libidn in $dir" >&6;}
15184 break
15185 fi
15186 if test -f "$dir/include/idn/idna.h"; then
15187 CFLAGS="$CFLAGS -I$dir/include/idn"
15188 LDFLAGS="$LDFLAGS -L$dir/lib"
15189 { $as_echo "$as_me:${as_lineno-$LINENO}: Found libidn in $dir" >&5
15190 $as_echo "$as_me: Found libidn in $dir" >&6;}
15191 break
15192 fi
15193 done
15194 if test -f "/usr/include/idn/idna.h"; then
15195 CFLAGS="$CFLAGS -I/usr/include/idn"
15196 #LDFLAGS="$LDFLAGS -L/usr/lib"
15197 { $as_echo "$as_me:${as_lineno-$LINENO}: Found libidn in /usr" >&5
15198 $as_echo "$as_me: Found libidn in /usr" >&6;}
15199 fi
15200 else
15201 if test x_$withval != x_no; then
15202 CFLAGS="$CFLAGS -I$withval/include"
15203 LDFLAGS="$LDFLAGS -L$withval/lib"
15204 else
15205 my_with_libidn=0
15206 fi
15207 fi
15208
15209 my_with_libidn2=1
15210
15211 # Check whether --with-libidn2 was given.
15212 if test "${with_libidn2+set}" = set; then :
15213 withval=$with_libidn2;
15214 else
15215 withval="yes"
15216 fi
15217
15218 if test x_$withval = x_yes; then
15219 for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
15220 if test -f "$dir/include/idn2.h"; then
15221 CFLAGS="$CFLAGS -I$dir/include"
15222 LDFLAGS="$LDFLAGS -L$dir/lib"
15223 { $as_echo "$as_me:${as_lineno-$LINENO}: Found libidn2 in $dir" >&5
15224 $as_echo "$as_me: Found libidn2 in $dir" >&6;}
15225 break
15226 fi
15227 if test -f "$dir/include/idn2/idn2.h"; then
15228 CFLAGS="$CFLAGS -I$dir/include/idn2"
15229 LDFLAGS="$LDFLAGS -L$dir/lib"
15230 { $as_echo "$as_me:${as_lineno-$LINENO}: Found libidn2 in $dir" >&5
15231 $as_echo "$as_me: Found libidn2 in $dir" >&6;}
15232 break
15233 fi
15234 done
15235 if test -f "/usr/include/idn2/idn2.h"; then
15236 CFLAGS="$CFLAGS -I/usr/include/idn2"
15237 #LDFLAGS="$LDFLAGS -L/usr/lib"
15238 { $as_echo "$as_me:${as_lineno-$LINENO}: Found libidn2 in /usr" >&5
15239 $as_echo "$as_me: Found libidn2 in /usr" >&6;}
15240 fi
15241 else
15242 if test x_$withval != x_no; then
15243 CFLAGS="$CFLAGS -I$withval/include"
15244 LDFLAGS="$LDFLAGS -L$withval/lib"
15245 else
15246 my_with_libidn2=0
15247 fi
15248 fi
15249
15250 if test $my_with_libunbound = 1
15251 then
15252 # find libunbound
15253
15254 # Check whether --with-libunbound was given.
15255 if test "${with_libunbound+set}" = set; then :
15256 withval=$with_libunbound;
15257 else
15258 withval="yes"
15259 fi
15260
15261 if test x_$withval = x_yes; then
15262 for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
15263 if test -f "$dir/include/unbound.h"; then
15264 CFLAGS="$CFLAGS -I$dir/include"
15265 LDFLAGS="$LDFLAGS -L$dir/lib"
15266 { $as_echo "$as_me:${as_lineno-$LINENO}: Found libunbound in $dir" >&5
15267 $as_echo "$as_me: Found libunbound in $dir" >&6;}
15268 break
15269 fi
15270 done
15271 else
15272 if test x_$withval != x_no; then
15273 CFLAGS="$CFLAGS -I$withval/include"
15274 LDFLAGS="$LDFLAGS -L$withval/lib"
15275 else
15276
15277 cat >>confdefs.h <<_ACEOF
15278 #define DISABLE_RESOLUTION_RECURSING 1
15279 _ACEOF
15280
15281 my_with_libunbound=0
15282 fi
15283 fi
15284 fi
15285
15286 # Checks for libraries.
15287 found_all_libs=1
15288 MISSING_DEPS=""
15289 MISSING_SEP=""
15290
15291 working_libidn2=0
15292 if test $my_with_libidn2 = 1
15293 then
15294 { $as_echo "$as_me:${as_lineno-$LINENO}: Checking for dependency libidn2" >&5
15295 $as_echo "$as_me: Checking for dependency libidn2" >&6;}
15296 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for idn2_to_unicode_8z8z in -lidn2" >&5
15297 $as_echo_n "checking for idn2_to_unicode_8z8z in -lidn2... " >&6; }
15298 if ${ac_cv_lib_idn2_idn2_to_unicode_8z8z+:} false; then :
15299 $as_echo_n "(cached) " >&6
15300 else
15301 ac_check_lib_save_LIBS=$LIBS
15302 LIBS="-lidn2 $LIBS"
15303 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15304 /* end confdefs.h. */
15305
15306 /* Override any GCC internal prototype to avoid an error.
15307 Use char because int might match the return type of a GCC
15308 builtin and then its argument prototype would still apply. */
15309 #ifdef __cplusplus
15310 extern "C"
15311 #endif
15312 char idn2_to_unicode_8z8z ();
15313 int
15314 main ()
15315 {
15316 return idn2_to_unicode_8z8z ();
15317 ;
15318 return 0;
15319 }
15320 _ACEOF
15321 if ac_fn_c_try_link "$LINENO"; then :
15322 ac_cv_lib_idn2_idn2_to_unicode_8z8z=yes
15323 else
15324 ac_cv_lib_idn2_idn2_to_unicode_8z8z=no
15325 fi
15326 rm -f core conftest.err conftest.$ac_objext \
15327 conftest$ac_exeext conftest.$ac_ext
15328 LIBS=$ac_check_lib_save_LIBS
15329 fi
15330 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_idn2_idn2_to_unicode_8z8z" >&5
15331 $as_echo "$ac_cv_lib_idn2_idn2_to_unicode_8z8z" >&6; }
15332 if test "x$ac_cv_lib_idn2_idn2_to_unicode_8z8z" = xyes; then :
15333
15334 working_libidn2=1
15335 LIBS="-lidn2 $LIBS"
15336
15337 cat >>confdefs.h <<_ACEOF
15338 #define HAVE_LIBIDN2 1
15339 _ACEOF
15340
15341 else
15342
15343 MISSING_DEPS="${MISSING_DEPS}${MISSING_SEP}libidn2 (version 2.0.0 or higher)"
15344 MISSING_SEP=", "
15345
15346 fi
15347
15348 fi
15349 if test $working_libidn2 = 0
15350 then
15351 if test $my_with_libidn = 1
15352 then
15353 { $as_echo "$as_me:${as_lineno-$LINENO}: Checking for dependency libidn" >&5
15354 $as_echo "$as_me: Checking for dependency libidn" >&6;}
15355 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for idna_to_ascii_8z in -lidn" >&5
15356 $as_echo_n "checking for idna_to_ascii_8z in -lidn... " >&6; }
15357 if ${ac_cv_lib_idn_idna_to_ascii_8z+:} false; then :
15358 $as_echo_n "(cached) " >&6
15359 else
15360 ac_check_lib_save_LIBS=$LIBS
15361 LIBS="-lidn $LIBS"
15362 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15363 /* end confdefs.h. */
15364
15365 /* Override any GCC internal prototype to avoid an error.
15366 Use char because int might match the return type of a GCC
15367 builtin and then its argument prototype would still apply. */
15368 #ifdef __cplusplus
15369 extern "C"
15370 #endif
15371 char idna_to_ascii_8z ();
15372 int
15373 main ()
15374 {
15375 return idna_to_ascii_8z ();
15376 ;
15377 return 0;
15378 }
15379 _ACEOF
15380 if ac_fn_c_try_link "$LINENO"; then :
15381 ac_cv_lib_idn_idna_to_ascii_8z=yes
15382 else
15383 ac_cv_lib_idn_idna_to_ascii_8z=no
15384 fi
15385 rm -f core conftest.err conftest.$ac_objext \
15386 conftest$ac_exeext conftest.$ac_ext
15387 LIBS=$ac_check_lib_save_LIBS
15388 fi
15389 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_idn_idna_to_ascii_8z" >&5
15390 $as_echo "$ac_cv_lib_idn_idna_to_ascii_8z" >&6; }
15391 if test "x$ac_cv_lib_idn_idna_to_ascii_8z" = xyes; then :
15392 cat >>confdefs.h <<_ACEOF
15393 #define HAVE_LIBIDN 1
15394 _ACEOF
15395
15396 LIBS="-lidn $LIBS"
15397
15398 else
15399
15400 MISSING_DEPS="${MISSING_DEPS}${MISSING_SEP}libidn"
15401 MISSING_SEP=", "
15402 found_all_libs=0
15403
15404 fi
15405
15406 else
15407 if test $my_with_libidn2 = 1
15408 then
15409 found_all_libs=0
15410 fi
15411 fi
15412 fi
15413
15414 # Check whether --enable-unbound-event-api was given.
15415 if test "${enable_unbound_event_api+set}" = set; then :
15416 enableval=$enable_unbound_event_api;
15417 fi
15418
15419 case "$enable_unbound_event_api" in
15420 no)
15421 my_enable_unbound_event_api=0
15422 ;;
15423 yes|*)
15424 my_enable_unbound_event_api=1
15425 ;;
15426 esac
15427
15428
15429 if test $my_with_libunbound = 1
15430 then
15431 for ac_header in unbound-event.h
15432 do :
15433 ac_fn_c_check_header_compile "$LINENO" "unbound-event.h" "ac_cv_header_unbound_event_h" "$ac_includes_default
15434 "
15435 if test "x$ac_cv_header_unbound_event_h" = xyes; then :
15436 cat >>confdefs.h <<_ACEOF
15437 #define HAVE_UNBOUND_EVENT_H 1
15438 _ACEOF
15439
15440 fi
15441
15442 done
15443
15444 { $as_echo "$as_me:${as_lineno-$LINENO}: Checking for dependency libunbound" >&5
15445 $as_echo "$as_me: Checking for dependency libunbound" >&6;}
15446 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ub_fd in -lunbound" >&5
15447 $as_echo_n "checking for ub_fd in -lunbound... " >&6; }
15448 if ${ac_cv_lib_unbound_ub_fd+:} false; then :
15449 $as_echo_n "(cached) " >&6
15450 else
15451 ac_check_lib_save_LIBS=$LIBS
15452 LIBS="-lunbound $LIBS"
15453 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15454 /* end confdefs.h. */
15455
15456 /* Override any GCC internal prototype to avoid an error.
15457 Use char because int might match the return type of a GCC
15458 builtin and then its argument prototype would still apply. */
15459 #ifdef __cplusplus
15460 extern "C"
15461 #endif
15462 char ub_fd ();
15463 int
15464 main ()
15465 {
15466 return ub_fd ();
15467 ;
15468 return 0;
15469 }
15470 _ACEOF
15471 if ac_fn_c_try_link "$LINENO"; then :
15472 ac_cv_lib_unbound_ub_fd=yes
15473 else
15474 ac_cv_lib_unbound_ub_fd=no
15475 fi
15476 rm -f core conftest.err conftest.$ac_objext \
15477 conftest$ac_exeext conftest.$ac_ext
15478 LIBS=$ac_check_lib_save_LIBS
15479 fi
15480 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_unbound_ub_fd" >&5
15481 $as_echo "$ac_cv_lib_unbound_ub_fd" >&6; }
15482 if test "x$ac_cv_lib_unbound_ub_fd" = xyes; then :
15483
15484
15485 cat >>confdefs.h <<_ACEOF
15486 #define HAVE_LIBUNBOUND 1
15487 _ACEOF
15488 LIBS="-lunbound $LIBS"
15489
15490 if test $my_enable_unbound_event_api = 1
15491 then
15492 ac_fn_c_check_func "$LINENO" "ub_ctx_create_ub_event" "ac_cv_func_ub_ctx_create_ub_event"
15493 if test "x$ac_cv_func_ub_ctx_create_ub_event" = xyes; then :
15494
15495
15496 cat >>confdefs.h <<_ACEOF
15497 #define HAVE_UNBOUND_EVENT_API 1
15498 _ACEOF
15499
15500
15501 fi
15502
15503 fi
15504 for ac_func in ub_ctx_set_stub
15505 do :
15506 ac_fn_c_check_func "$LINENO" "ub_ctx_set_stub" "ac_cv_func_ub_ctx_set_stub"
15507 if test "x$ac_cv_func_ub_ctx_set_stub" = xyes; then :
15508 cat >>confdefs.h <<_ACEOF
15509 #define HAVE_UB_CTX_SET_STUB 1
15510 _ACEOF
15511
15512 fi
15513 done
15514
15515
15516 else
15517
15518 MISSING_DEPS="${MISSING_DEPS}${MISSING_SEP}libunbound"
15519 MISSING_SEP=", "
15520 found_all_libs=0
15521
15522 fi
15523
15524 fi
15525
15526 # Extract the first word of "doxygen", so it can be a program name with args.
15527 set dummy doxygen; ac_word=$2
15528 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15529 $as_echo_n "checking for $ac_word... " >&6; }
15530 if ${ac_cv_path_DOXYGEN+:} false; then :
15531 $as_echo_n "(cached) " >&6
15532 else
15533 case $DOXYGEN in
15534 [\\/]* | ?:[\\/]*)
15535 ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path.
15536 ;;
15537 *)
15538 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15539 for as_dir in $PATH
15540 do
15541 IFS=$as_save_IFS
15542 test -z "$as_dir" && as_dir=.
15543 for ac_exec_ext in '' $ac_executable_extensions; do
15544 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15545 ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext"
15546 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15547 break 2
15548 fi
15549 done
15550 done
15551 IFS=$as_save_IFS
15552
15553 ;;
15554 esac
15555 fi
15556 DOXYGEN=$ac_cv_path_DOXYGEN
15557 if test -n "$DOXYGEN"; then
15558 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5
15559 $as_echo "$DOXYGEN" >&6; }
15560 else
15561 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15562 $as_echo "no" >&6; }
15563 fi
15564
15565
15566 if test -z "$DOXYGEN";
15567 then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: doxygen not found, continuing without" >&5
15568 $as_echo "$as_me: WARNING: doxygen not found, continuing without" >&2;}
15569 fi
15570
15571 # Checks for header files.
15572 for ac_header in inttypes.h netinet/in.h stdint.h stdlib.h string.h
15573 do :
15574 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
15575 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
15576 "
15577 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
15578 cat >>confdefs.h <<_ACEOF
15579 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
15580 _ACEOF
15581
15582 fi
15583
15584 done
15585
15586
15587 # Checks for typedefs, structures, and compiler characteristics.
15588 ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
15589 if test "x$ac_cv_type_size_t" = xyes; then :
15590
15591 else
15592
15593 cat >>confdefs.h <<_ACEOF
15594 #define size_t unsigned int
15595 _ACEOF
15596
15597 fi
15598
15599 ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t"
15600 case $ac_cv_c_uint16_t in #(
15601 no|yes) ;; #(
15602 *)
15603
15604
15605 cat >>confdefs.h <<_ACEOF
15606 #define uint16_t $ac_cv_c_uint16_t
15607 _ACEOF
15608 ;;
15609 esac
15610
15611 ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t"
15612 case $ac_cv_c_uint32_t in #(
15613 no|yes) ;; #(
15614 *)
15615
15616 $as_echo "#define _UINT32_T 1" >>confdefs.h
15617
15618
15619 cat >>confdefs.h <<_ACEOF
15620 #define uint32_t $ac_cv_c_uint32_t
15621 _ACEOF
15622 ;;
15623 esac
15624
15625 ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t"
15626 case $ac_cv_c_uint64_t in #(
15627 no|yes) ;; #(
15628 *)
15629
15630 $as_echo "#define _UINT64_T 1" >>confdefs.h
15631
15632
15633 cat >>confdefs.h <<_ACEOF
15634 #define uint64_t $ac_cv_c_uint64_t
15635 _ACEOF
15636 ;;
15637 esac
15638
15639 ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t"
15640 case $ac_cv_c_uint8_t in #(
15641 no|yes) ;; #(
15642 *)
15643
15644 $as_echo "#define _UINT8_T 1" >>confdefs.h
15645
15646
15647 cat >>confdefs.h <<_ACEOF
15648 #define uint8_t $ac_cv_c_uint8_t
15649 _ACEOF
15650 ;;
15651 esac
15652
15653 ac_fn_c_check_type "$LINENO" "u_char" "ac_cv_type_u_char" "$ac_includes_default"
15654 if test "x$ac_cv_type_u_char" = xyes; then :
15655
15656 cat >>confdefs.h <<_ACEOF
15657 #define HAVE_U_CHAR 1
15658 _ACEOF
15659
15660
15661 fi
15662
15663
15664 for ac_func in fcntl
15665 do :
15666 ac_fn_c_check_func "$LINENO" "fcntl" "ac_cv_func_fcntl"
15667 if test "x$ac_cv_func_fcntl" = xyes; then :
15668 cat >>confdefs.h <<_ACEOF
15669 #define HAVE_FCNTL 1
15670 _ACEOF
15671
15672 fi
15673 done
15674
15675 # check ioctlsocket
15676 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ioctlsocket" >&5
15677 $as_echo_n "checking for ioctlsocket... " >&6; }
15678 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15679 /* end confdefs.h. */
15680
15681 #ifdef HAVE_WINSOCK2_H
15682 #include <winsock2.h>
15683 #endif
15684
15685 int
15686 main ()
15687 {
15688
15689 (void)ioctlsocket(0, 0, NULL);
15690
15691 ;
15692 return 0;
15693 }
15694 _ACEOF
15695 if ac_fn_c_try_link "$LINENO"; then :
15696
15697 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15698 $as_echo "yes" >&6; }
15699
15700 $as_echo "#define HAVE_IOCTLSOCKET 1" >>confdefs.h
15701
15702
15703 else
15704 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15705 $as_echo "no" >&6; }
15706 fi
15707 rm -f core conftest.err conftest.$ac_objext \
15708 conftest$ac_exeext conftest.$ac_ext
15709
15710
15711 # Check for libraries for other things than libgetdns after this point,
15712 # so the getdns libraries can be reset with:
15713 #
15714 # LIBS="$getdns_LIBS"
15715 # LDFLAGS="$getdns_LDFLAGS"
15716 #
15717 # afterwards.
15718 getdns_LIBS="$LIBS"
15719 getdns_LDFLAGS="$LDFLAGS"
15720 getdns_CFLAGS="$CFLAGS"
15721
15722 #-------------------- libraries needed for libcheck
15723 LIBS="$initial_LIBS"
15724
15725 CHECK_GETDNS=""
15726 CHECK_LIBS=""
15727 CHECK_CFLAGS=""
15728
15729
15730 pkg_failed=no
15731 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CHECK" >&5
15732 $as_echo_n "checking for CHECK... " >&6; }
15733
15734 if test -n "$CHECK_CFLAGS"; then
15735 pkg_cv_CHECK_CFLAGS="$CHECK_CFLAGS"
15736 elif test -n "$PKG_CONFIG"; then
15737 if test -n "$PKG_CONFIG" && \
15738 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.9.6\""; } >&5
15739 ($PKG_CONFIG --exists --print-errors "check >= 0.9.6") 2>&5
15740 ac_status=$?
15741 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15742 test $ac_status = 0; }; then
15743 pkg_cv_CHECK_CFLAGS=`$PKG_CONFIG --cflags "check >= 0.9.6" 2>/dev/null`
15744 test "x$?" != "x0" && pkg_failed=yes
15745 else
15746 pkg_failed=yes
15747 fi
15748 else
15749 pkg_failed=untried
15750 fi
15751 if test -n "$CHECK_LIBS"; then
15752 pkg_cv_CHECK_LIBS="$CHECK_LIBS"
15753 elif test -n "$PKG_CONFIG"; then
15754 if test -n "$PKG_CONFIG" && \
15755 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.9.6\""; } >&5
15756 ($PKG_CONFIG --exists --print-errors "check >= 0.9.6") 2>&5
15757 ac_status=$?
15758 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15759 test $ac_status = 0; }; then
15760 pkg_cv_CHECK_LIBS=`$PKG_CONFIG --libs "check >= 0.9.6" 2>/dev/null`
15761 test "x$?" != "x0" && pkg_failed=yes
15762 else
15763 pkg_failed=yes
15764 fi
15765 else
15766 pkg_failed=untried
15767 fi
15768
15769
15770
15771 if test $pkg_failed = yes; then
15772 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15773 $as_echo "no" >&6; }
15774
15775 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
15776 _pkg_short_errors_supported=yes
15777 else
15778 _pkg_short_errors_supported=no
15779 fi
15780 if test $_pkg_short_errors_supported = yes; then
15781 CHECK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "check >= 0.9.6" 2>&1`
15782 else
15783 CHECK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "check >= 0.9.6" 2>&1`
15784 fi
15785 # Put the nasty error message in config.log where it belongs
15786 echo "$CHECK_PKG_ERRORS" >&5
15787
15788
15789 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing floor" >&5
15790 $as_echo_n "checking for library containing floor... " >&6; }
15791 if ${ac_cv_search_floor+:} false; then :
15792 $as_echo_n "(cached) " >&6
15793 else
15794 ac_func_search_save_LIBS=$LIBS
15795 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15796 /* end confdefs.h. */
15797
15798 /* Override any GCC internal prototype to avoid an error.
15799 Use char because int might match the return type of a GCC
15800 builtin and then its argument prototype would still apply. */
15801 #ifdef __cplusplus
15802 extern "C"
15803 #endif
15804 char floor ();
15805 int
15806 main ()
15807 {
15808 return floor ();
15809 ;
15810 return 0;
15811 }
15812 _ACEOF
15813 for ac_lib in '' m; do
15814 if test -z "$ac_lib"; then
15815 ac_res="none required"
15816 else
15817 ac_res=-l$ac_lib
15818 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
15819 fi
15820 if ac_fn_c_try_link "$LINENO"; then :
15821 ac_cv_search_floor=$ac_res
15822 fi
15823 rm -f core conftest.err conftest.$ac_objext \
15824 conftest$ac_exeext
15825 if ${ac_cv_search_floor+:} false; then :
15826 break
15827 fi
15828 done
15829 if ${ac_cv_search_floor+:} false; then :
15830
15831 else
15832 ac_cv_search_floor=no
15833 fi
15834 rm conftest.$ac_ext
15835 LIBS=$ac_func_search_save_LIBS
15836 fi
15837 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_floor" >&5
15838 $as_echo "$ac_cv_search_floor" >&6; }
15839 ac_res=$ac_cv_search_floor
15840 if test "$ac_res" != no; then :
15841 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
15842
15843 fi
15844
15845 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing timer_create" >&5
15846 $as_echo_n "checking for library containing timer_create... " >&6; }
15847 if ${ac_cv_search_timer_create+:} false; then :
15848 $as_echo_n "(cached) " >&6
15849 else
15850 ac_func_search_save_LIBS=$LIBS
15851 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15852 /* end confdefs.h. */
15853
15854 /* Override any GCC internal prototype to avoid an error.
15855 Use char because int might match the return type of a GCC
15856 builtin and then its argument prototype would still apply. */
15857 #ifdef __cplusplus
15858 extern "C"
15859 #endif
15860 char timer_create ();
15861 int
15862 main ()
15863 {
15864 return timer_create ();
15865 ;
15866 return 0;
15867 }
15868 _ACEOF
15869 for ac_lib in '' rt; do
15870 if test -z "$ac_lib"; then
15871 ac_res="none required"
15872 else
15873 ac_res=-l$ac_lib
15874 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
15875 fi
15876 if ac_fn_c_try_link "$LINENO"; then :
15877 ac_cv_search_timer_create=$ac_res
15878 fi
15879 rm -f core conftest.err conftest.$ac_objext \
15880 conftest$ac_exeext
15881 if ${ac_cv_search_timer_create+:} false; then :
15882 break
15883 fi
15884 done
15885 if ${ac_cv_search_timer_create+:} false; then :
15886
15887 else
15888 ac_cv_search_timer_create=no
15889 fi
15890 rm conftest.$ac_ext
15891 LIBS=$ac_func_search_save_LIBS
15892 fi
15893 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_timer_create" >&5
15894 $as_echo "$ac_cv_search_timer_create" >&6; }
15895 ac_res=$ac_cv_search_timer_create
15896 if test "$ac_res" != no; then :
15897 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
15898
15899 fi
15900
15901 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5
15902 $as_echo_n "checking for library containing pthread_create... " >&6; }
15903 if ${ac_cv_search_pthread_create+:} false; then :
15904 $as_echo_n "(cached) " >&6
15905 else
15906 ac_func_search_save_LIBS=$LIBS
15907 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15908 /* end confdefs.h. */
15909
15910 /* Override any GCC internal prototype to avoid an error.
15911 Use char because int might match the return type of a GCC
15912 builtin and then its argument prototype would still apply. */
15913 #ifdef __cplusplus
15914 extern "C"
15915 #endif
15916 char pthread_create ();
15917 int
15918 main ()
15919 {
15920 return pthread_create ();
15921 ;
15922 return 0;
15923 }
15924 _ACEOF
15925 for ac_lib in '' pthread; do
15926 if test -z "$ac_lib"; then
15927 ac_res="none required"
15928 else
15929 ac_res=-l$ac_lib
15930 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
15931 fi
15932 if ac_fn_c_try_link "$LINENO"; then :
15933 ac_cv_search_pthread_create=$ac_res
15934 fi
15935 rm -f core conftest.err conftest.$ac_objext \
15936 conftest$ac_exeext
15937 if ${ac_cv_search_pthread_create+:} false; then :
15938 break
15939 fi
15940 done
15941 if ${ac_cv_search_pthread_create+:} false; then :
15942
15943 else
15944 ac_cv_search_pthread_create=no
15945 fi
15946 rm conftest.$ac_ext
15947 LIBS=$ac_func_search_save_LIBS
15948 fi
15949 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_create" >&5
15950 $as_echo "$ac_cv_search_pthread_create" >&6; }
15951 ac_res=$ac_cv_search_pthread_create
15952 if test "$ac_res" != no; then :
15953 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
15954
15955 fi
15956
15957 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing srunner_create" >&5
15958 $as_echo_n "checking for library containing srunner_create... " >&6; }
15959 if ${ac_cv_search_srunner_create+:} false; then :
15960 $as_echo_n "(cached) " >&6
15961 else
15962 ac_func_search_save_LIBS=$LIBS
15963 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15964 /* end confdefs.h. */
15965
15966 /* Override any GCC internal prototype to avoid an error.
15967 Use char because int might match the return type of a GCC
15968 builtin and then its argument prototype would still apply. */
15969 #ifdef __cplusplus
15970 extern "C"
15971 #endif
15972 char srunner_create ();
15973 int
15974 main ()
15975 {
15976 return srunner_create ();
15977 ;
15978 return 0;
15979 }
15980 _ACEOF
15981 for ac_lib in '' check check_pic; do
15982 if test -z "$ac_lib"; then
15983 ac_res="none required"
15984 else
15985 ac_res=-l$ac_lib
15986 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
15987 fi
15988 if ac_fn_c_try_link "$LINENO"; then :
15989 ac_cv_search_srunner_create=$ac_res
15990 fi
15991 rm -f core conftest.err conftest.$ac_objext \
15992 conftest$ac_exeext
15993 if ${ac_cv_search_srunner_create+:} false; then :
15994 break
15995 fi
15996 done
15997 if ${ac_cv_search_srunner_create+:} false; then :
15998
15999 else
16000 ac_cv_search_srunner_create=no
16001 fi
16002 rm conftest.$ac_ext
16003 LIBS=$ac_func_search_save_LIBS
16004 fi
16005 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_srunner_create" >&5
16006 $as_echo "$ac_cv_search_srunner_create" >&6; }
16007 ac_res=$ac_cv_search_srunner_create
16008 if test "$ac_res" != no; then :
16009 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
16010
16011 CHECK_GETDNS="check_getdns"
16012 CHECK_LIBS="$LIBS"
16013 else
16014
16015 NOLIBCHECK=nolibcheck
16016
16017 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcheck not found or usable; unit tests will not be compiled and run" >&5
16018 $as_echo "$as_me: WARNING: libcheck not found or usable; unit tests will not be compiled and run" >&2;}
16019 fi
16020
16021 elif test $pkg_failed = untried; then
16022 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
16023 $as_echo "no" >&6; }
16024
16025 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing floor" >&5
16026 $as_echo_n "checking for library containing floor... " >&6; }
16027 if ${ac_cv_search_floor+:} false; then :
16028 $as_echo_n "(cached) " >&6
16029 else
16030 ac_func_search_save_LIBS=$LIBS
16031 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16032 /* end confdefs.h. */
16033
16034 /* Override any GCC internal prototype to avoid an error.
16035 Use char because int might match the return type of a GCC
16036 builtin and then its argument prototype would still apply. */
16037 #ifdef __cplusplus
16038 extern "C"
16039 #endif
16040 char floor ();
16041 int
16042 main ()
16043 {
16044 return floor ();
16045 ;
16046 return 0;
16047 }
16048 _ACEOF
16049 for ac_lib in '' m; do
16050 if test -z "$ac_lib"; then
16051 ac_res="none required"
16052 else
16053 ac_res=-l$ac_lib
16054 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
16055 fi
16056 if ac_fn_c_try_link "$LINENO"; then :
16057 ac_cv_search_floor=$ac_res
16058 fi
16059 rm -f core conftest.err conftest.$ac_objext \
16060 conftest$ac_exeext
16061 if ${ac_cv_search_floor+:} false; then :
16062 break
16063 fi
16064 done
16065 if ${ac_cv_search_floor+:} false; then :
16066
16067 else
16068 ac_cv_search_floor=no
16069 fi
16070 rm conftest.$ac_ext
16071 LIBS=$ac_func_search_save_LIBS
16072 fi
16073 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_floor" >&5
16074 $as_echo "$ac_cv_search_floor" >&6; }
16075 ac_res=$ac_cv_search_floor
16076 if test "$ac_res" != no; then :
16077 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
16078
16079 fi
16080
16081 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing timer_create" >&5
16082 $as_echo_n "checking for library containing timer_create... " >&6; }
16083 if ${ac_cv_search_timer_create+:} false; then :
16084 $as_echo_n "(cached) " >&6
16085 else
16086 ac_func_search_save_LIBS=$LIBS
16087 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16088 /* end confdefs.h. */
16089
16090 /* Override any GCC internal prototype to avoid an error.
16091 Use char because int might match the return type of a GCC
16092 builtin and then its argument prototype would still apply. */
16093 #ifdef __cplusplus
16094 extern "C"
16095 #endif
16096 char timer_create ();
16097 int
16098 main ()
16099 {
16100 return timer_create ();
16101 ;
16102 return 0;
16103 }
16104 _ACEOF
16105 for ac_lib in '' rt; do
16106 if test -z "$ac_lib"; then
16107 ac_res="none required"
16108 else
16109 ac_res=-l$ac_lib
16110 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
16111 fi
16112 if ac_fn_c_try_link "$LINENO"; then :
16113 ac_cv_search_timer_create=$ac_res
16114 fi
16115 rm -f core conftest.err conftest.$ac_objext \
16116 conftest$ac_exeext
16117 if ${ac_cv_search_timer_create+:} false; then :
16118 break
16119 fi
16120 done
16121 if ${ac_cv_search_timer_create+:} false; then :
16122
16123 else
16124 ac_cv_search_timer_create=no
16125 fi
16126 rm conftest.$ac_ext
16127 LIBS=$ac_func_search_save_LIBS
16128 fi
16129 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_timer_create" >&5
16130 $as_echo "$ac_cv_search_timer_create" >&6; }
16131 ac_res=$ac_cv_search_timer_create
16132 if test "$ac_res" != no; then :
16133 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
16134
16135 fi
16136
16137 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5
16138 $as_echo_n "checking for library containing pthread_create... " >&6; }
16139 if ${ac_cv_search_pthread_create+:} false; then :
16140 $as_echo_n "(cached) " >&6
16141 else
16142 ac_func_search_save_LIBS=$LIBS
16143 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16144 /* end confdefs.h. */
16145
16146 /* Override any GCC internal prototype to avoid an error.
16147 Use char because int might match the return type of a GCC
16148 builtin and then its argument prototype would still apply. */
16149 #ifdef __cplusplus
16150 extern "C"
16151 #endif
16152 char pthread_create ();
16153 int
16154 main ()
16155 {
16156 return pthread_create ();
16157 ;
16158 return 0;
16159 }
16160 _ACEOF
16161 for ac_lib in '' pthread; do
16162 if test -z "$ac_lib"; then
16163 ac_res="none required"
16164 else
16165 ac_res=-l$ac_lib
16166 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
16167 fi
16168 if ac_fn_c_try_link "$LINENO"; then :
16169 ac_cv_search_pthread_create=$ac_res
16170 fi
16171 rm -f core conftest.err conftest.$ac_objext \
16172 conftest$ac_exeext
16173 if ${ac_cv_search_pthread_create+:} false; then :
16174 break
16175 fi
16176 done
16177 if ${ac_cv_search_pthread_create+:} false; then :
16178
16179 else
16180 ac_cv_search_pthread_create=no
16181 fi
16182 rm conftest.$ac_ext
16183 LIBS=$ac_func_search_save_LIBS
16184 fi
16185 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_create" >&5
16186 $as_echo "$ac_cv_search_pthread_create" >&6; }
16187 ac_res=$ac_cv_search_pthread_create
16188 if test "$ac_res" != no; then :
16189 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
16190
16191 fi
16192
16193 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing srunner_create" >&5
16194 $as_echo_n "checking for library containing srunner_create... " >&6; }
16195 if ${ac_cv_search_srunner_create+:} false; then :
16196 $as_echo_n "(cached) " >&6
16197 else
16198 ac_func_search_save_LIBS=$LIBS
16199 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16200 /* end confdefs.h. */
16201
16202 /* Override any GCC internal prototype to avoid an error.
16203 Use char because int might match the return type of a GCC
16204 builtin and then its argument prototype would still apply. */
16205 #ifdef __cplusplus
16206 extern "C"
16207 #endif
16208 char srunner_create ();
16209 int
16210 main ()
16211 {
16212 return srunner_create ();
16213 ;
16214 return 0;
16215 }
16216 _ACEOF
16217 for ac_lib in '' check check_pic; do
16218 if test -z "$ac_lib"; then
16219 ac_res="none required"
16220 else
16221 ac_res=-l$ac_lib
16222 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
16223 fi
16224 if ac_fn_c_try_link "$LINENO"; then :
16225 ac_cv_search_srunner_create=$ac_res
16226 fi
16227 rm -f core conftest.err conftest.$ac_objext \
16228 conftest$ac_exeext
16229 if ${ac_cv_search_srunner_create+:} false; then :
16230 break
16231 fi
16232 done
16233 if ${ac_cv_search_srunner_create+:} false; then :
16234
16235 else
16236 ac_cv_search_srunner_create=no
16237 fi
16238 rm conftest.$ac_ext
16239 LIBS=$ac_func_search_save_LIBS
16240 fi
16241 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_srunner_create" >&5
16242 $as_echo "$ac_cv_search_srunner_create" >&6; }
16243 ac_res=$ac_cv_search_srunner_create
16244 if test "$ac_res" != no; then :
16245 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
16246
16247 CHECK_GETDNS="check_getdns"
16248 CHECK_LIBS="$LIBS"
16249 else
16250
16251 NOLIBCHECK=nolibcheck
16252
16253 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcheck not found or usable; unit tests will not be compiled and run" >&5
16254 $as_echo "$as_me: WARNING: libcheck not found or usable; unit tests will not be compiled and run" >&2;}
16255 fi
16256
16257 else
16258 CHECK_CFLAGS=$pkg_cv_CHECK_CFLAGS
16259 CHECK_LIBS=$pkg_cv_CHECK_LIBS
16260 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
16261 $as_echo "yes" >&6; }
16262 CHECK_GETDNS="check_getdns"
16263 fi
16264
16265 LIBS="$getdns_LIBS"
16266
16267
16268
16269
16270 # end libraries needed for libcheck
16271
16272 #-------------------- libevent extension
16273
16274 # Check whether --with-libevent was given.
16275 if test "${with_libevent+set}" = set; then :
16276 withval=$with_libevent; with_libevent=search
16277 else
16278 withval=no
16279 fi
16280
16281
16282 # libevent 1.x requires a u_char typedef which is not always available
16283 # on some systems so our check is a little complicated
16284 # we further need to ensure that this is included in the getdns headers
16285 # that get installed later so some users may not be building in an
16286 # environment that has the generated config.h SO we need to generate
16287 # this one extra header in that case
16288
16289 have_libevent=0
16290 EXTENSION_LIBEVENT_EXT_LIBS=""
16291 EXTENSION_LIBEVENT_LIB=""
16292 EXTENSION_LIBEVENT_LDFLAGS=""
16293 CHECK_EVENT_PROG=""
16294 if test x_$withval = x_no; then :
16295
16296 else
16297 if test x_$withval = x_yes; then :
16298 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing event_loop" >&5
16299 $as_echo_n "checking for library containing event_loop... " >&6; }
16300 if ${ac_cv_search_event_loop+:} false; then :
16301 $as_echo_n "(cached) " >&6
16302 else
16303 ac_func_search_save_LIBS=$LIBS
16304 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16305 /* end confdefs.h. */
16306
16307 /* Override any GCC internal prototype to avoid an error.
16308 Use char because int might match the return type of a GCC
16309 builtin and then its argument prototype would still apply. */
16310 #ifdef __cplusplus
16311 extern "C"
16312 #endif
16313 char event_loop ();
16314 int
16315 main ()
16316 {
16317 return event_loop ();
16318 ;
16319 return 0;
16320 }
16321 _ACEOF
16322 for ac_lib in '' event_core event; do
16323 if test -z "$ac_lib"; then
16324 ac_res="none required"
16325 else
16326 ac_res=-l$ac_lib
16327 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
16328 fi
16329 if ac_fn_c_try_link "$LINENO"; then :
16330 ac_cv_search_event_loop=$ac_res
16331 fi
16332 rm -f core conftest.err conftest.$ac_objext \
16333 conftest$ac_exeext
16334 if ${ac_cv_search_event_loop+:} false; then :
16335 break
16336 fi
16337 done
16338 if ${ac_cv_search_event_loop+:} false; then :
16339
16340 else
16341 ac_cv_search_event_loop=no
16342 fi
16343 rm conftest.$ac_ext
16344 LIBS=$ac_func_search_save_LIBS
16345 fi
16346 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_event_loop" >&5
16347 $as_echo "$ac_cv_search_event_loop" >&6; }
16348 ac_res=$ac_cv_search_event_loop
16349 if test "$ac_res" != no; then :
16350 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
16351 for ac_func in event_base_new event_base_free
16352 do :
16353 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
16354 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
16355 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
16356 cat >>confdefs.h <<_ACEOF
16357 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
16358 _ACEOF
16359
16360 fi
16361 done
16362
16363 for ac_header in event2/event.h
16364 do :
16365 ac_fn_c_check_header_compile "$LINENO" "event2/event.h" "ac_cv_header_event2_event_h" "$ac_includes_default
16366 "
16367 if test "x$ac_cv_header_event2_event_h" = xyes; then :
16368 cat >>confdefs.h <<_ACEOF
16369 #define HAVE_EVENT2_EVENT_H 1
16370 _ACEOF
16371 have_libevent=1
16372 if test "x_$ac_cv_search_event_loop" = "x_none required"; then :
16373
16374 else
16375 EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop"
16376 fi
16377 else
16378 for ac_header in event.h
16379 do :
16380 ac_fn_c_check_header_compile "$LINENO" "event.h" "ac_cv_header_event_h" "$ac_includes_default
16381 #ifndef HAVE_U_CHAR
16382 typedef unsigned char u_char;
16383 #endif
16384 "
16385 if test "x$ac_cv_header_event_h" = xyes; then :
16386 cat >>confdefs.h <<_ACEOF
16387 #define HAVE_EVENT_H 1
16388 _ACEOF
16389 have_libevent=1
16390 if test "x_$ac_cv_search_event_loop" = "x_none required"; then :
16391
16392 else
16393 EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop"
16394 fi
16395 else
16396 as_fn_error $? "event2/event.h and event.h missing, try without libevent" "$LINENO" 5
16397 have_libevent=0
16398 fi
16399
16400 done
16401
16402 fi
16403
16404 done
16405
16406 else
16407 as_fn_error $? "libevent missing, try without libevent" "$LINENO" 5
16408
16409 fi
16410
16411 else
16412 have_libevent=1
16413 { $as_echo "$as_me:${as_lineno-$LINENO}: assuming libevent in $withval" >&5
16414 $as_echo "$as_me: assuming libevent in $withval" >&6;}
16415 CFLAGS="$CFLAGS -I$withval/include"
16416 EXTENSION_LIBEVENT_LDFLAGS="-L$withval/lib"
16417 EXTENSION_LIBEVENT_EXT_LIBS="-levent"
16418 fi
16419
16420 fi
16421
16422 if test x_$have_libevent = x_1; then :
16423 EXTENSION_LIBEVENT_LIB="libgetdns_ext_event.la"
16424 CHECK_EVENT_PROG=check_getdns_event
16425 # libunbound version 1.4.22 and older, not linked against libevent, on FreeBSD,
16426 # =============================================================================
16427 # cannot be linked against a program that also links libevent, because of
16428 # symbol clash. Libunbound has a libevent clone (called mini_event) build when
16429 # not linked against libevent that uses the same symbols as libevent.
16430
16431 # First detect if the libevent symbols are visible when linking with libunbound
16432 LIBS="$getdns_LIBS"
16433 LDFLAGS="$getdns_LDFLAGS"
16434 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if event_get_version symbol is leaking from libunbound" >&5
16435 $as_echo_n "checking if event_get_version symbol is leaking from libunbound... " >&6; }
16436 ac_ext=c
16437 ac_cpp='$CPP $CPPFLAGS'
16438 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
16439 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
16440 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16441
16442 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16443 /* end confdefs.h. */
16444 const char *event_get_version(void);
16445 int
16446 main ()
16447 {
16448 const char *v = event_get_version();
16449 ;
16450 return 0;
16451 }
16452
16453 _ACEOF
16454 if ac_fn_c_try_link "$LINENO"; then :
16455 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
16456 $as_echo "yes" >&6; }
16457 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libunbound is linked against libevent" >&5
16458 $as_echo_n "checking if libunbound is linked against libevent... " >&6; }
16459 if test "$cross_compiling" = yes; then :
16460 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16461 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16462 as_fn_error $? "cannot run test program while cross compiling
16463 See \`config.log' for more details" "$LINENO" 5; }
16464 else
16465 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16466 /* end confdefs.h. */
16467 const char *event_get_version(void);
16468 int
16469 main ()
16470 {
16471 const char *v = event_get_version();
16472 return v[0] == 'm' && v[1] == 'i' &&
16473 v[2] == 'n' && v[3] == 'i' ? 1 : 0;
16474 ;
16475 return 0;
16476 }
16477
16478 _ACEOF
16479 if ac_fn_c_try_run "$LINENO"; then :
16480 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
16481 $as_echo "yes" >&6; }
16482
16483 else
16484 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
16485 $as_echo "no" >&6; }
16486 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16487 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16488 as_fn_error $? "
16489 ***
16490 *** On this system, when using libevent, libunbound must
16491 *** also have been compiled with libevent. Please recompile
16492 *** libunbound with libevent, or configure --without-libevent.
16493 ***
16494 See \`config.log' for more details" "$LINENO" 5; }
16495
16496
16497 fi
16498 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16499 conftest.$ac_objext conftest.beam conftest.$ac_ext
16500 fi
16501
16502
16503 else
16504 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
16505 $as_echo "no" >&6; }
16506
16507
16508 fi
16509 rm -f core conftest.err conftest.$ac_objext \
16510 conftest$ac_exeext conftest.$ac_ext
16511 ac_ext=c
16512 ac_cpp='$CPP $CPPFLAGS'
16513 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
16514 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
16515 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16516
16517 fi
16518
16519
16520
16521
16522
16523 if test "x$have_libcheck" = x1; then :
16524
16525 fi
16526
16527 LIBS="$getdns_LIBS"
16528 LDFLAGS="$getdns_LDFLAGS"
16529 # end libevent extension
16530
16531 #-------------------- libuv extension
16532 # if user says nothing about libuv, or specifies --with-libuv=no or --without-libuv
16533 # then we do not want libuv extensions built
16534 # if user specifies --with-libuv then search for it
16535 # if user specifies --with-libuv=/path then check the lib at that path
16536
16537 # Check whether --with-libuv was given.
16538 if test "${with_libuv+set}" = set; then :
16539 withval=$with_libuv; with_libuv=search
16540 else
16541 withval=no
16542 fi
16543
16544
16545 have_libuv=0
16546 EXTENSION_LIBUV_EXT_LIBS=""
16547 EXTENSION_LIBUV_LIB=""
16548 EXTENSION_LIBUV_LDFLAGS=""
16549 CHECK_UV_PROG=""
16550 if test x_$withval = x_no; then :
16551
16552 else
16553 if test x_$withval = x_yes; then :
16554 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing uv_run" >&5
16555 $as_echo_n "checking for library containing uv_run... " >&6; }
16556 if ${ac_cv_search_uv_run+:} false; then :
16557 $as_echo_n "(cached) " >&6
16558 else
16559 ac_func_search_save_LIBS=$LIBS
16560 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16561 /* end confdefs.h. */
16562
16563 /* Override any GCC internal prototype to avoid an error.
16564 Use char because int might match the return type of a GCC
16565 builtin and then its argument prototype would still apply. */
16566 #ifdef __cplusplus
16567 extern "C"
16568 #endif
16569 char uv_run ();
16570 int
16571 main ()
16572 {
16573 return uv_run ();
16574 ;
16575 return 0;
16576 }
16577 _ACEOF
16578 for ac_lib in '' uv; do
16579 if test -z "$ac_lib"; then
16580 ac_res="none required"
16581 else
16582 ac_res=-l$ac_lib
16583 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
16584 fi
16585 if ac_fn_c_try_link "$LINENO"; then :
16586 ac_cv_search_uv_run=$ac_res
16587 fi
16588 rm -f core conftest.err conftest.$ac_objext \
16589 conftest$ac_exeext
16590 if ${ac_cv_search_uv_run+:} false; then :
16591 break
16592 fi
16593 done
16594 if ${ac_cv_search_uv_run+:} false; then :
16595
16596 else
16597 ac_cv_search_uv_run=no
16598 fi
16599 rm conftest.$ac_ext
16600 LIBS=$ac_func_search_save_LIBS
16601 fi
16602 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uv_run" >&5
16603 $as_echo "$ac_cv_search_uv_run" >&6; }
16604 ac_res=$ac_cv_search_uv_run
16605 if test "$ac_res" != no; then :
16606 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
16607 for ac_header in uv.h
16608 do :
16609 ac_fn_c_check_header_compile "$LINENO" "uv.h" "ac_cv_header_uv_h" "$ac_includes_default
16610 "
16611 if test "x$ac_cv_header_uv_h" = xyes; then :
16612 cat >>confdefs.h <<_ACEOF
16613 #define HAVE_UV_H 1
16614 _ACEOF
16615 have_libuv=1
16616 EXTENSION_LIBUV_EXT_LIBS="$ac_cv_search_uv_run"
16617 else
16618 as_fn_error $? "uv.h missing, try without libuv" "$LINENO" 5
16619 have_libuv=0
16620 fi
16621
16622 done
16623
16624 else
16625 as_fn_error $? "libuv missing, try without libuv" "$LINENO" 5
16626
16627 fi
16628
16629 else
16630 have_libuv=1
16631 { $as_echo "$as_me:${as_lineno-$LINENO}: assuming libuv in $withval" >&5
16632 $as_echo "$as_me: assuming libuv in $withval" >&6;}
16633 CFLAGS="$CFLAGS -I$withval/include"
16634 EXTENSION_LIBUV_LDFLAGS="-L$withval/lib"
16635 EXTENSION_LIBUV_EXT_LIBS="-luv"
16636 fi
16637
16638 fi
16639
16640 if test x_$have_libuv = x_1; then :
16641 EXTENSION_LIBUV_LIB="libgetdns_ext_uv.la"
16642 CHECK_UV_PROG=check_getdns_uv
16643 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for new signature of uv_timer_cb" >&5
16644 $as_echo_n "checking for new signature of uv_timer_cb... " >&6; }
16645 ac_ext=c
16646 ac_cpp='$CPP $CPPFLAGS'
16647 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
16648 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
16649 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16650
16651 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16652 /* end confdefs.h. */
16653 #include <uv.h>
16654 void test_cb(uv_timer_t *handle);
16655 int
16656 main ()
16657 {
16658 uv_timer_cb cb = test_cb;
16659 (*cb)(0);
16660 ;
16661 return 0;
16662 }
16663
16664 _ACEOF
16665 if ac_fn_c_try_compile "$LINENO"; then :
16666 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
16667 $as_echo "yes" >&6; }
16668
16669 $as_echo "#define HAVE_NEW_UV_TIMER_CB 1" >>confdefs.h
16670
16671
16672 else
16673 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
16674 $as_echo "no" >&6; }
16675
16676 fi
16677 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16678 ac_ext=c
16679 ac_cpp='$CPP $CPPFLAGS'
16680 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
16681 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
16682 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16683
16684
16685 fi
16686
16687
16688
16689
16690
16691 if test "x$have_libcheck" = x1; then :
16692
16693 fi
16694
16695 LIBS="$getdns_LIBS"
16696 LDFLAGS="$getdns_LDFLAGS"
16697 # end libuv extension
16698
16699 #-------------------- libev extension
16700
16701 # Check whether --with-libev was given.
16702 if test "${with_libev+set}" = set; then :
16703 withval=$with_libev; with_libev=search
16704 else
16705 withval=no
16706 fi
16707
16708
16709 have_libev=0
16710 EXTENSION_LIBEV_EXT_LIBS=""
16711 EXTENSION_LIBEV_LIB=""
16712 EXTENSION_LIBEV_LDFLAGS=""
16713 CHECK_EV_PROG=""
16714 if test x_$withval = x_no; then :
16715
16716 else
16717 if test x_$withval = x_yes; then :
16718 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ev_run" >&5
16719 $as_echo_n "checking for library containing ev_run... " >&6; }
16720 if ${ac_cv_search_ev_run+:} false; then :
16721 $as_echo_n "(cached) " >&6
16722 else
16723 ac_func_search_save_LIBS=$LIBS
16724 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16725 /* end confdefs.h. */
16726
16727 /* Override any GCC internal prototype to avoid an error.
16728 Use char because int might match the return type of a GCC
16729 builtin and then its argument prototype would still apply. */
16730 #ifdef __cplusplus
16731 extern "C"
16732 #endif
16733 char ev_run ();
16734 int
16735 main ()
16736 {
16737 return ev_run ();
16738 ;
16739 return 0;
16740 }
16741 _ACEOF
16742 for ac_lib in '' ev; do
16743 if test -z "$ac_lib"; then
16744 ac_res="none required"
16745 else
16746 ac_res=-l$ac_lib
16747 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
16748 fi
16749 if ac_fn_c_try_link "$LINENO"; then :
16750 ac_cv_search_ev_run=$ac_res
16751 fi
16752 rm -f core conftest.err conftest.$ac_objext \
16753 conftest$ac_exeext
16754 if ${ac_cv_search_ev_run+:} false; then :
16755 break
16756 fi
16757 done
16758 if ${ac_cv_search_ev_run+:} false; then :
16759
16760 else
16761 ac_cv_search_ev_run=no
16762 fi
16763 rm conftest.$ac_ext
16764 LIBS=$ac_func_search_save_LIBS
16765 fi
16766 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ev_run" >&5
16767 $as_echo "$ac_cv_search_ev_run" >&6; }
16768 ac_res=$ac_cv_search_ev_run
16769 if test "$ac_res" != no; then :
16770 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
16771 for ac_header in ev.h
16772 do :
16773 ac_fn_c_check_header_compile "$LINENO" "ev.h" "ac_cv_header_ev_h" "$ac_includes_default
16774 "
16775 if test "x$ac_cv_header_ev_h" = xyes; then :
16776 cat >>confdefs.h <<_ACEOF
16777 #define HAVE_EV_H 1
16778 _ACEOF
16779 have_libev=1
16780 EXTENSION_LIBEV_EXT_LIBS="$ac_cv_search_ev_run"
16781 else
16782 for ac_header in libev/ev.h
16783 do :
16784 ac_fn_c_check_header_compile "$LINENO" "libev/ev.h" "ac_cv_header_libev_ev_h" "$ac_includes_default
16785 "
16786 if test "x$ac_cv_header_libev_ev_h" = xyes; then :
16787 cat >>confdefs.h <<_ACEOF
16788 #define HAVE_LIBEV_EV_H 1
16789 _ACEOF
16790 have_libev=1
16791 EXTENSION_LIBEV_EXT_LIBS="$ac_cv_search_ev_run"
16792 else
16793 as_fn_error $? "ev.h missing, try without libev" "$LINENO" 5
16794 have_libev=0
16795 fi
16796
16797 done
16798
16799
16800 fi
16801
16802 done
16803
16804
16805 else
16806 as_fn_error $? "libev missing, try without libev" "$LINENO" 5
16807
16808 fi
16809
16810 else
16811 have_libev=1
16812 { $as_echo "$as_me:${as_lineno-$LINENO}: assuming libev in $withval" >&5
16813 $as_echo "$as_me: assuming libev in $withval" >&6;}
16814 CFLAGS="$CFLAGS -I$withval/include"
16815 EXTENSION_LIBEV_LDFLAGS="-L$withval/lib"
16816 EXTENSION_LIBEV_EXT_LIBS="-lev"
16817 fi
16818
16819 fi
16820
16821 if test x_$have_libev = x_1; then :
16822 EXTENSION_LIBEV_LIB="libgetdns_ext_ev.la"
16823 CHECK_EV_PROG=check_getdns_ev
16824 fi
16825
16826
16827
16828
16829
16830 if test "x$have_libcheck" = x1; then :
16831
16832 fi
16833
16834 LIBS="$getdns_LIBS"
16835 LDFLAGS="$getdns_LDFLAGS"
16836 # end libev extension
16837
16838 # --with-trust-anchor=
16839
16840 $as_echo "#define SYSCONFDIR sysconfdir" >>confdefs.h
16841
16842
16843 # Check whether --with-trust-anchor was given.
16844 if test "${with_trust_anchor+set}" = set; then :
16845 withval=$with_trust_anchor;
16846 TRUST_ANCHOR_FILE="$withval"
16847
16848 else
16849
16850 if test "x$TRUST_ANCHOR_FILE" = "x"; then
16851 if test "x$sysconfdir" = 'x${prefix}/etc' ; then
16852 if test "x$prefix" = 'xNONE' ; then
16853 TRUST_ANCHOR_FILE="/etc/unbound/getdns-root.key"
16854 else
16855 TRUST_ANCHOR_FILE="${prefix}/etc/unbound/getdns-root.key"
16856 fi
16857 else
16858 TRUST_ANCHOR_FILE="${sysconfdir}/unbound/getdns-root.key"
16859 fi
16860 fi
16861
16862 fi
16863
16864
16865 cat >>confdefs.h <<_ACEOF
16866 #define TRUST_ANCHOR_FILE "$TRUST_ANCHOR_FILE"
16867 _ACEOF
16868
16869
16870 { $as_echo "$as_me:${as_lineno-$LINENO}: Default trust anchor: $TRUST_ANCHOR_FILE" >&5
16871 $as_echo "$as_me: Default trust anchor: $TRUST_ANCHOR_FILE" >&6;}
16872
16873
16874 # Check whether --with-getdns_query was given.
16875 if test "${with_getdns_query+set}" = set; then :
16876 withval=$with_getdns_query;
16877 else
16878 withval="yes"
16879 fi
16880
16881 if test x_$withval = x_no; then
16882 GETDNS_QUERY=""
16883 INSTALL_GETDNS_QUERY=""
16884 UNINSTALL_GETDNS_QUERY=""
16885 else
16886 GETDNS_QUERY="getdns_query"
16887 INSTALL_GETDNS_QUERY="install-getdns_query"
16888 UNINSTALL_GETDNS_QUERY="uninstall-getdns_query"
16889 fi
16890
16891
16892
16893
16894
16895 # Check whether --with-getdns_server_mon was given.
16896 if test "${with_getdns_server_mon+set}" = set; then :
16897 withval=$with_getdns_server_mon;
16898 else
16899 withval="yes"
16900 fi
16901
16902 if test x_$withval = x_no; then
16903 GETDNS_SERVER_MON=""
16904 INSTALL_GETDNS_SERVER_MON=""
16905 UNINSTALL_GETDNS_SERVER_MON=""
16906 else
16907 GETDNS_SERVER_MON="getdns_server_mon"
16908 INSTALL_GETDNS_SERVER_MON="install-getdns_server_mon"
16909 UNINSTALL_GETDNS_SERVER_MON="uninstall-getdns_server_mon"
16910 fi
16911
16912
16913
16914
16915 stubby_with_yaml=0
16916
16917 # Check whether --with-stubby was given.
16918 if test "${with_stubby+set}" = set; then :
16919 withval=$with_stubby;
16920 else
16921 withval="no"
16922 fi
16923
16924 if test x_$withval = x_yes; then
16925 STUBBY="stubby"
16926 INSTALL_STUBBY="install-stubby"
16927 UNINSTALL_STUBBY="uninstall-stubby"
16928 if test $my_with_yaml = 0
16929 then
16930 STUBBY_XTRA_OBJS="convert_yaml_to_json.lo gbuffer.lo"
16931 stubby_with_yaml=1
16932 my_with_yaml=1
16933 fi
16934 else
16935 STUBBY=""
16936 INSTALL_STUBBY=""
16937 UNINSTALL_STUBBY=""
16938 STUBBY_XTRA_OBJS=""
16939 fi
16940
16941
16942
16943
16944
16945 STUBBY_LIBS=""
16946 STUBBY_LDFLAGS=""
16947
16948 if test $my_with_yaml = 1
16949 then
16950 if test $stubby_with_yaml = 1
16951 then
16952 getdns_LIBS="$LIBS"
16953 getdns_LDFLAGS="$LDFLAGS"
16954 LIBS="$initial_LIBS"
16955 LDFLAGS="$initial_LDFLAGS"
16956 fi
16957
16958 # Check whether --with-libyaml was given.
16959 if test "${with_libyaml+set}" = set; then :
16960 withval=$with_libyaml;
16961 else
16962 withval="yes"
16963 fi
16964
16965 if test x_$withval = x_yes; then
16966 for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
16967 if test -f "$dir/include/yaml.h"; then
16968 CFLAGS="$CFLAGS -I$dir/include"
16969 LDFLAGS="$LDFLAGS -L$dir/lib"
16970 { $as_echo "$as_me:${as_lineno-$LINENO}: Found libyaml in $dir" >&5
16971 $as_echo "$as_me: Found libyaml in $dir" >&6;}
16972 break
16973 fi
16974 done
16975 else
16976 if test x_$withval != x_no; then
16977 CFLAGS="$CFLAGS -I$withval/include"
16978 LDFLAGS="$LDFLAGS -L$withval/lib"
16979 else
16980 if test $stubby_with_yaml = 1
16981 then
16982 as_fn_error $? "libyaml required for building Stubby" "$LINENO" 5
16983 fi
16984 my_with_yaml=0
16985 fi
16986 fi
16987 if test $my_with_yaml = 1
16988 then
16989 { $as_echo "$as_me:${as_lineno-$LINENO}: Checking for dependency libyaml" >&5
16990 $as_echo "$as_me: Checking for dependency libyaml" >&6;}
16991 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yaml_parser_parse in -lyaml" >&5
16992 $as_echo_n "checking for yaml_parser_parse in -lyaml... " >&6; }
16993 if ${ac_cv_lib_yaml_yaml_parser_parse+:} false; then :
16994 $as_echo_n "(cached) " >&6
16995 else
16996 ac_check_lib_save_LIBS=$LIBS
16997 LIBS="-lyaml $LIBS"
16998 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16999 /* end confdefs.h. */
17000
17001 /* Override any GCC internal prototype to avoid an error.
17002 Use char because int might match the return type of a GCC
17003 builtin and then its argument prototype would still apply. */
17004 #ifdef __cplusplus
17005 extern "C"
17006 #endif
17007 char yaml_parser_parse ();
17008 int
17009 main ()
17010 {
17011 return yaml_parser_parse ();
17012 ;
17013 return 0;
17014 }
17015 _ACEOF
17016 if ac_fn_c_try_link "$LINENO"; then :
17017 ac_cv_lib_yaml_yaml_parser_parse=yes
17018 else
17019 ac_cv_lib_yaml_yaml_parser_parse=no
17020 fi
17021 rm -f core conftest.err conftest.$ac_objext \
17022 conftest$ac_exeext conftest.$ac_ext
17023 LIBS=$ac_check_lib_save_LIBS
17024 fi
17025 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yaml_yaml_parser_parse" >&5
17026 $as_echo "$ac_cv_lib_yaml_yaml_parser_parse" >&6; }
17027 if test "x$ac_cv_lib_yaml_yaml_parser_parse" = xyes; then :
17028 cat >>confdefs.h <<_ACEOF
17029 #define HAVE_LIBYAML 1
17030 _ACEOF
17031
17032 LIBS="-lyaml $LIBS"
17033
17034 else
17035
17036 MISSING_DEPS="${MISSING_DEPS}${MISSING_SEP}libyaml"
17037 MISSING_SEP=", "
17038 found_all_libs=0
17039
17040 fi
17041
17042 fi
17043 if test $stubby_with_yaml = 1
17044 then
17045 STUBBY_LDFLAGS="$LDFLAGS"
17046 STUBBY_LIBS="$LIBS"
17047 LIBS="$getdns_LIBS"
17048 LDFLAGS="$getdns_LDFLAGS"
17049 fi
17050 fi
17051
17052
17053
17054 if test $found_all_libs = 0
17055 then
17056 as_fn_error $? "Missing dependencies: $MISSING_DEPS" "$LINENO" 5
17057 fi
17058
17059 ac_config_files="$ac_config_files Makefile src/Makefile src/version.c src/getdns/getdns.h src/getdns/getdns_extra.h spec/example/Makefile src/test/Makefile src/tools/Makefile doc/Makefile getdns.pc getdns_ext_event.pc"
17060
17061 if test -n "$DOXYGEN"
17062 then ac_config_files="$ac_config_files src/Doxyfile"
17063
17064 fi
17065
17066 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler (${CC-cc}) supports the __func__ variable" >&5
17067 $as_echo_n "checking whether the C compiler (${CC-cc}) supports the __func__ variable... " >&6; }
17068 ac_ext=c
17069 ac_cpp='$CPP $CPPFLAGS'
17070 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
17071 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
17072 ac_compiler_gnu=$ac_cv_c_compiler_gnu
17073
17074 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17075 /* end confdefs.h. */
17076 char*s=__func__;
17077 int
17078 main ()
17079 {
17080
17081 ;
17082 return 0;
17083 }
17084 _ACEOF
17085 if ac_fn_c_try_compile "$LINENO"; then :
17086 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
17087 $as_echo "yes" >&6; }
17088
17089 $as_echo "#define HAVE___FUNC__ 1" >>confdefs.h
17090
17091 else
17092 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17093 $as_echo "no" >&6; }
17094 fi
17095 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17096 ac_ext=c
17097 ac_cpp='$CPP $CPPFLAGS'
17098 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
17099 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
17100 ac_compiler_gnu=$ac_cv_c_compiler_gnu
17101
17102
17103
17104 for ac_header in stdarg.h stdint.h netinet/in.h arpa/inet.h netdb.h sys/socket.h time.h sys/time.h sys/select.h endian.h limits.h sys/limits.h
17105 do :
17106 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
17107 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
17108 "
17109 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
17110 cat >>confdefs.h <<_ACEOF
17111 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
17112 _ACEOF
17113
17114 fi
17115
17116 done
17117
17118
17119 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler (${CC-cc}) accepts the \"format\" attribute" >&5
17120 $as_echo_n "checking whether the C compiler (${CC-cc}) accepts the \"format\" attribute... " >&6; }
17121 if ${ac_cv_c_format_attribute+:} false; then :
17122 $as_echo_n "(cached) " >&6
17123 else
17124 ac_cv_c_format_attribute=no
17125 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17126 /* end confdefs.h. */
17127 #include <stdio.h>
17128 void f (char *format, ...) __attribute__ ((format (printf, 1, 2)));
17129 void (*pf) (char *format, ...) __attribute__ ((format (printf, 1, 2)));
17130
17131 int
17132 main ()
17133 {
17134
17135 f ("%s", "str");
17136
17137 ;
17138 return 0;
17139 }
17140 _ACEOF
17141 if ac_fn_c_try_compile "$LINENO"; then :
17142 ac_cv_c_format_attribute="yes"
17143 else
17144 ac_cv_c_format_attribute="no"
17145 fi
17146 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17147
17148 fi
17149
17150 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_format_attribute" >&5
17151 $as_echo "$ac_cv_c_format_attribute" >&6; }
17152 if test $ac_cv_c_format_attribute = yes; then
17153
17154 $as_echo "#define HAVE_ATTR_FORMAT 1" >>confdefs.h
17155
17156 fi
17157
17158 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler (${CC-cc}) accepts the \"unused\" attribute" >&5
17159 $as_echo_n "checking whether the C compiler (${CC-cc}) accepts the \"unused\" attribute... " >&6; }
17160 if ${ac_cv_c_unused_attribute+:} false; then :
17161 $as_echo_n "(cached) " >&6
17162 else
17163 ac_cv_c_unused_attribute=no
17164 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17165 /* end confdefs.h. */
17166 #include <stdio.h>
17167 void f (char *u __attribute__((unused)));
17168
17169 int
17170 main ()
17171 {
17172
17173 f ("x");
17174
17175 ;
17176 return 0;
17177 }
17178 _ACEOF
17179 if ac_fn_c_try_compile "$LINENO"; then :
17180 ac_cv_c_unused_attribute="yes"
17181 else
17182 ac_cv_c_unused_attribute="no"
17183 fi
17184 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17185
17186 fi
17187
17188 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_unused_attribute" >&5
17189 $as_echo "$ac_cv_c_unused_attribute" >&6; }
17190 if test $ac_cv_c_unused_attribute = yes; then
17191
17192 $as_echo "#define HAVE_ATTR_UNUSED 1" >>confdefs.h
17193
17194 fi
17195 # Check for libbsd, so that the next function checks pick it as their
17196 # system implementation.
17197
17198 pkg_failed=no
17199 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBBSD" >&5
17200 $as_echo_n "checking for LIBBSD... " >&6; }
17201
17202 if test -n "$LIBBSD_CFLAGS"; then
17203 pkg_cv_LIBBSD_CFLAGS="$LIBBSD_CFLAGS"
17204 elif test -n "$PKG_CONFIG"; then
17205 if test -n "$PKG_CONFIG" && \
17206 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libbsd-overlay\""; } >&5
17207 ($PKG_CONFIG --exists --print-errors "libbsd-overlay") 2>&5
17208 ac_status=$?
17209 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
17210 test $ac_status = 0; }; then
17211 pkg_cv_LIBBSD_CFLAGS=`$PKG_CONFIG --cflags "libbsd-overlay" 2>/dev/null`
17212 test "x$?" != "x0" && pkg_failed=yes
17213 else
17214 pkg_failed=yes
17215 fi
17216 else
17217 pkg_failed=untried
17218 fi
17219 if test -n "$LIBBSD_LIBS"; then
17220 pkg_cv_LIBBSD_LIBS="$LIBBSD_LIBS"
17221 elif test -n "$PKG_CONFIG"; then
17222 if test -n "$PKG_CONFIG" && \
17223 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libbsd-overlay\""; } >&5
17224 ($PKG_CONFIG --exists --print-errors "libbsd-overlay") 2>&5
17225 ac_status=$?
17226 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
17227 test $ac_status = 0; }; then
17228 pkg_cv_LIBBSD_LIBS=`$PKG_CONFIG --libs "libbsd-overlay" 2>/dev/null`
17229 test "x$?" != "x0" && pkg_failed=yes
17230 else
17231 pkg_failed=yes
17232 fi
17233 else
17234 pkg_failed=untried
17235 fi
17236
17237
17238
17239 if test $pkg_failed = yes; then
17240 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17241 $as_echo "no" >&6; }
17242
17243 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
17244 _pkg_short_errors_supported=yes
17245 else
17246 _pkg_short_errors_supported=no
17247 fi
17248 if test $_pkg_short_errors_supported = yes; then
17249 LIBBSD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libbsd-overlay" 2>&1`
17250 else
17251 LIBBSD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libbsd-overlay" 2>&1`
17252 fi
17253 # Put the nasty error message in config.log where it belongs
17254 echo "$LIBBSD_PKG_ERRORS" >&5
17255
17256
17257 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libbsd not found or usable; using embedded code instead" >&5
17258 $as_echo "$as_me: WARNING: libbsd not found or usable; using embedded code instead" >&2;}
17259
17260 elif test $pkg_failed = untried; then
17261 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17262 $as_echo "no" >&6; }
17263
17264 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libbsd not found or usable; using embedded code instead" >&5
17265 $as_echo "$as_me: WARNING: libbsd not found or usable; using embedded code instead" >&2;}
17266
17267 else
17268 LIBBSD_CFLAGS=$pkg_cv_LIBBSD_CFLAGS
17269 LIBBSD_LIBS=$pkg_cv_LIBBSD_LIBS
17270 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
17271 $as_echo "yes" >&6; }
17272
17273 LIBS="$LIBS $LIBBSD_LIBS"
17274 STUBBY_LIBS="$STUBBY_LIBS $LIBBSD_LIBS"
17275 CFLAGS="$CFLAGS $LIBBSD_CFLAGS"
17276
17277 fi
17278 ac_fn_c_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "
17279 $ac_includes_default
17280 #ifdef HAVE_WS2TCPIP_H
17281 #include <ws2tcpip.h>
17282 #endif
17283
17284 "
17285 if test "x$ac_cv_have_decl_inet_pton" = xyes; then :
17286 ac_have_decl=1
17287 else
17288 ac_have_decl=0
17289 fi
17290
17291 cat >>confdefs.h <<_ACEOF
17292 #define HAVE_DECL_INET_PTON $ac_have_decl
17293 _ACEOF
17294 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "
17295 $ac_includes_default
17296 #ifdef HAVE_WS2TCPIP_H
17297 #include <ws2tcpip.h>
17298 #endif
17299
17300 "
17301 if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
17302 ac_have_decl=1
17303 else
17304 ac_have_decl=0
17305 fi
17306
17307 cat >>confdefs.h <<_ACEOF
17308 #define HAVE_DECL_INET_NTOP $ac_have_decl
17309 _ACEOF
17310 ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" "
17311 $ac_includes_default
17312 #ifdef HAVE_WS2TCPIP_H
17313 #include <ws2tcpip.h>
17314 #endif
17315
17316 "
17317 if test "x$ac_cv_have_decl_strlcpy" = xyes; then :
17318 ac_have_decl=1
17319 else
17320 ac_have_decl=0
17321 fi
17322
17323 cat >>confdefs.h <<_ACEOF
17324 #define HAVE_DECL_STRLCPY $ac_have_decl
17325 _ACEOF
17326 ac_fn_c_check_decl "$LINENO" "arc4random" "ac_cv_have_decl_arc4random" "
17327 $ac_includes_default
17328 #ifdef HAVE_WS2TCPIP_H
17329 #include <ws2tcpip.h>
17330 #endif
17331
17332 "
17333 if test "x$ac_cv_have_decl_arc4random" = xyes; then :
17334 ac_have_decl=1
17335 else
17336 ac_have_decl=0
17337 fi
17338
17339 cat >>confdefs.h <<_ACEOF
17340 #define HAVE_DECL_ARC4RANDOM $ac_have_decl
17341 _ACEOF
17342 ac_fn_c_check_decl "$LINENO" "arc4random_uniform" "ac_cv_have_decl_arc4random_uniform" "
17343 $ac_includes_default
17344 #ifdef HAVE_WS2TCPIP_H
17345 #include <ws2tcpip.h>
17346 #endif
17347
17348 "
17349 if test "x$ac_cv_have_decl_arc4random_uniform" = xyes; then :
17350 ac_have_decl=1
17351 else
17352 ac_have_decl=0
17353 fi
17354
17355 cat >>confdefs.h <<_ACEOF
17356 #define HAVE_DECL_ARC4RANDOM_UNIFORM $ac_have_decl
17357 _ACEOF
17358
17359 if test "x$ac_cv_have_decl_inet_pton" = xyes; then :
17360
17361 else
17362 ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton"
17363 if test "x$ac_cv_func_inet_pton" = xyes; then :
17364 $as_echo "#define HAVE_INET_PTON 1" >>confdefs.h
17365
17366 else
17367 case " $LIBOBJS " in
17368 *" inet_pton.$ac_objext "* ) ;;
17369 *) LIBOBJS="$LIBOBJS inet_pton.$ac_objext"
17370 ;;
17371 esac
17372
17373 fi
17374
17375
17376
17377 fi
17378 if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
17379
17380 else
17381 ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
17382 if test "x$ac_cv_func_inet_ntop" = xyes; then :
17383 $as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h
17384
17385 else
17386 case " $LIBOBJS " in
17387 *" inet_ntop.$ac_objext "* ) ;;
17388 *) LIBOBJS="$LIBOBJS inet_ntop.$ac_objext"
17389 ;;
17390 esac
17391
17392 fi
17393
17394
17395
17396 fi
17397 ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
17398 if test "x$ac_cv_func_strlcpy" = xyes; then :
17399 $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h
17400
17401 else
17402 case " $LIBOBJS " in
17403 *" strlcpy.$ac_objext "* ) ;;
17404 *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext"
17405 ;;
17406 esac
17407
17408 fi
17409
17410
17411 ac_fn_c_check_func "$LINENO" "arc4random" "ac_cv_func_arc4random"
17412 if test "x$ac_cv_func_arc4random" = xyes; then :
17413 $as_echo "#define HAVE_ARC4RANDOM 1" >>confdefs.h
17414
17415 else
17416 case " $LIBOBJS " in
17417 *" arc4random.$ac_objext "* ) ;;
17418 *) LIBOBJS="$LIBOBJS arc4random.$ac_objext"
17419 ;;
17420 esac
17421
17422 fi
17423
17424
17425 ac_fn_c_check_func "$LINENO" "arc4random_uniform" "ac_cv_func_arc4random_uniform"
17426 if test "x$ac_cv_func_arc4random_uniform" = xyes; then :
17427 $as_echo "#define HAVE_ARC4RANDOM_UNIFORM 1" >>confdefs.h
17428
17429 else
17430 case " $LIBOBJS " in
17431 *" arc4random_uniform.$ac_objext "* ) ;;
17432 *) LIBOBJS="$LIBOBJS arc4random_uniform.$ac_objext"
17433 ;;
17434 esac
17435
17436 fi
17437
17438
17439 if test "$ac_cv_func_arc4random" = "no"; then
17440 case " $LIBOBJS " in
17441 *" explicit_bzero.$ac_objext "* ) ;;
17442 *) LIBOBJS="$LIBOBJS explicit_bzero.$ac_objext"
17443 ;;
17444 esac
17445
17446 case " $LIBOBJS " in
17447 *" arc4_lock.$ac_objext "* ) ;;
17448 *) LIBOBJS="$LIBOBJS arc4_lock.$ac_objext"
17449 ;;
17450 esac
17451
17452 for ac_func in getentropy
17453 do :
17454 ac_fn_c_check_func "$LINENO" "getentropy" "ac_cv_func_getentropy"
17455 if test "x$ac_cv_func_getentropy" = xyes; then :
17456 cat >>confdefs.h <<_ACEOF
17457 #define HAVE_GETENTROPY 1
17458 _ACEOF
17459
17460 else
17461
17462 if test "$USE_WINSOCK" = 1; then
17463 case " $LIBOBJS " in
17464 *" getentropy_win.$ac_objext "* ) ;;
17465 *) LIBOBJS="$LIBOBJS getentropy_win.$ac_objext"
17466 ;;
17467 esac
17468
17469 else
17470 case `uname` in
17471 Darwin)
17472 case " $LIBOBJS " in
17473 *" getentropy_osx.$ac_objext "* ) ;;
17474 *) LIBOBJS="$LIBOBJS getentropy_osx.$ac_objext"
17475 ;;
17476 esac
17477
17478 ;;
17479 SunOS)
17480 case " $LIBOBJS " in
17481 *" getentropy_solaris.$ac_objext "* ) ;;
17482 *) LIBOBJS="$LIBOBJS getentropy_solaris.$ac_objext"
17483 ;;
17484 esac
17485
17486 for ac_header in sys/sha2.h
17487 do :
17488 ac_fn_c_check_header_compile "$LINENO" "sys/sha2.h" "ac_cv_header_sys_sha2_h" "$ac_includes_default
17489 "
17490 if test "x$ac_cv_header_sys_sha2_h" = xyes; then :
17491 cat >>confdefs.h <<_ACEOF
17492 #define HAVE_SYS_SHA2_H 1
17493 _ACEOF
17494
17495 else
17496
17497 for ac_func in SHA512_Update
17498 do :
17499 ac_fn_c_check_func "$LINENO" "SHA512_Update" "ac_cv_func_SHA512_Update"
17500 if test "x$ac_cv_func_SHA512_Update" = xyes; then :
17501 cat >>confdefs.h <<_ACEOF
17502 #define HAVE_SHA512_UPDATE 1
17503 _ACEOF
17504
17505 else
17506
17507 case " $LIBOBJS " in
17508 *" sha512.$ac_objext "* ) ;;
17509 *) LIBOBJS="$LIBOBJS sha512.$ac_objext"
17510 ;;
17511 esac
17512
17513
17514 fi
17515 done
17516
17517
17518 fi
17519
17520 done
17521
17522 if test "$ac_cv_header_sys_sha2_h" = "yes"; then
17523 # this lib needed for sha2 on solaris
17524 LIBS="$LIBS -lmd"
17525 fi
17526 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
17527 $as_echo_n "checking for library containing clock_gettime... " >&6; }
17528 if ${ac_cv_search_clock_gettime+:} false; then :
17529 $as_echo_n "(cached) " >&6
17530 else
17531 ac_func_search_save_LIBS=$LIBS
17532 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17533 /* end confdefs.h. */
17534
17535 /* Override any GCC internal prototype to avoid an error.
17536 Use char because int might match the return type of a GCC
17537 builtin and then its argument prototype would still apply. */
17538 #ifdef __cplusplus
17539 extern "C"
17540 #endif
17541 char clock_gettime ();
17542 int
17543 main ()
17544 {
17545 return clock_gettime ();
17546 ;
17547 return 0;
17548 }
17549 _ACEOF
17550 for ac_lib in '' rt; do
17551 if test -z "$ac_lib"; then
17552 ac_res="none required"
17553 else
17554 ac_res=-l$ac_lib
17555 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
17556 fi
17557 if ac_fn_c_try_link "$LINENO"; then :
17558 ac_cv_search_clock_gettime=$ac_res
17559 fi
17560 rm -f core conftest.err conftest.$ac_objext \
17561 conftest$ac_exeext
17562 if ${ac_cv_search_clock_gettime+:} false; then :
17563 break
17564 fi
17565 done
17566 if ${ac_cv_search_clock_gettime+:} false; then :
17567
17568 else
17569 ac_cv_search_clock_gettime=no
17570 fi
17571 rm conftest.$ac_ext
17572 LIBS=$ac_func_search_save_LIBS
17573 fi
17574 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
17575 $as_echo "$ac_cv_search_clock_gettime" >&6; }
17576 ac_res=$ac_cv_search_clock_gettime
17577 if test "$ac_res" != no; then :
17578 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
17579
17580 fi
17581
17582 ;;
17583 Linux|*)
17584 case " $LIBOBJS " in
17585 *" getentropy_linux.$ac_objext "* ) ;;
17586 *) LIBOBJS="$LIBOBJS getentropy_linux.$ac_objext"
17587 ;;
17588 esac
17589
17590 for ac_header in sys/sysctl.h
17591 do :
17592 ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "$ac_includes_default
17593 "
17594 if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
17595 cat >>confdefs.h <<_ACEOF
17596 #define HAVE_SYS_SYSCTL_H 1
17597 _ACEOF
17598
17599 fi
17600
17601 done
17602
17603 for ac_func in getauxval
17604 do :
17605 ac_fn_c_check_func "$LINENO" "getauxval" "ac_cv_func_getauxval"
17606 if test "x$ac_cv_func_getauxval" = xyes; then :
17607 cat >>confdefs.h <<_ACEOF
17608 #define HAVE_GETAUXVAL 1
17609 _ACEOF
17610
17611 fi
17612 done
17613
17614 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
17615 $as_echo_n "checking for library containing clock_gettime... " >&6; }
17616 if ${ac_cv_search_clock_gettime+:} false; then :
17617 $as_echo_n "(cached) " >&6
17618 else
17619 ac_func_search_save_LIBS=$LIBS
17620 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17621 /* end confdefs.h. */
17622
17623 /* Override any GCC internal prototype to avoid an error.
17624 Use char because int might match the return type of a GCC
17625 builtin and then its argument prototype would still apply. */
17626 #ifdef __cplusplus
17627 extern "C"
17628 #endif
17629 char clock_gettime ();
17630 int
17631 main ()
17632 {
17633 return clock_gettime ();
17634 ;
17635 return 0;
17636 }
17637 _ACEOF
17638 for ac_lib in '' rt; do
17639 if test -z "$ac_lib"; then
17640 ac_res="none required"
17641 else
17642 ac_res=-l$ac_lib
17643 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
17644 fi
17645 if ac_fn_c_try_link "$LINENO"; then :
17646 ac_cv_search_clock_gettime=$ac_res
17647 fi
17648 rm -f core conftest.err conftest.$ac_objext \
17649 conftest$ac_exeext
17650 if ${ac_cv_search_clock_gettime+:} false; then :
17651 break
17652 fi
17653 done
17654 if ${ac_cv_search_clock_gettime+:} false; then :
17655
17656 else
17657 ac_cv_search_clock_gettime=no
17658 fi
17659 rm conftest.$ac_ext
17660 LIBS=$ac_func_search_save_LIBS
17661 fi
17662 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
17663 $as_echo "$ac_cv_search_clock_gettime" >&6; }
17664 ac_res=$ac_cv_search_clock_gettime
17665 if test "$ac_res" != no; then :
17666 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
17667
17668 fi
17669
17670 ;;
17671 esac
17672 fi
17673
17674 fi
17675 done
17676
17677 fi
17678
17679 { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
17680 $as_echo_n "checking return type of signal handlers... " >&6; }
17681 if ${ac_cv_type_signal+:} false; then :
17682 $as_echo_n "(cached) " >&6
17683 else
17684 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17685 /* end confdefs.h. */
17686 #include <sys/types.h>
17687 #include <signal.h>
17688
17689 int
17690 main ()
17691 {
17692 return *(signal (0, 0)) (0) == 1;
17693 ;
17694 return 0;
17695 }
17696 _ACEOF
17697 if ac_fn_c_try_compile "$LINENO"; then :
17698 ac_cv_type_signal=int
17699 else
17700 ac_cv_type_signal=void
17701 fi
17702 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17703 fi
17704 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
17705 $as_echo "$ac_cv_type_signal" >&6; }
17706
17707 cat >>confdefs.h <<_ACEOF
17708 #define RETSIGTYPE $ac_cv_type_signal
17709 _ACEOF
17710
17711
17712
17713 case `uname` in
17714 FreeBSD)
17715 C99COMPATFLAGS=""
17716 ;;
17717 *)
17718 C99COMPATFLAGS="-D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600"
17719 ;;
17720 esac
17721
17722
17723
17724 cat >>confdefs.h <<_ACEOF
17725 #define MAX_CNAME_REFERRALS 100
17726 _ACEOF
17727
17728
17729 cat >>confdefs.h <<_ACEOF
17730 #define DRAFT_RRTYPES 1
17731 _ACEOF
17732
17733
17734
17735
17736
17737
17738 ac_config_headers="$ac_config_headers src/config.h"
17739
17740 cat >confcache <<\_ACEOF
17741 # This file is a shell script that caches the results of configure
17742 # tests run on this system so they can be shared between configure
17743 # scripts and configure runs, see configure's option --config-cache.
17744 # It is not useful on other systems. If it contains results you don't
17745 # want to keep, you may remove or edit it.
17746 #
17747 # config.status only pays attention to the cache file if you give it
17748 # the --recheck option to rerun configure.
17749 #
17750 # `ac_cv_env_foo' variables (set or unset) will be overridden when
17751 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17752 # following values.
17753
17754 _ACEOF
17755
17756 # The following way of writing the cache mishandles newlines in values,
17757 # but we know of no workaround that is simple, portable, and efficient.
17758 # So, we kill variables containing newlines.
17759 # Ultrix sh set writes to stderr and can't be redirected directly,
17760 # and sets the high bit in the cache file unless we assign to the vars.
17761 (
17762 for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
17763 eval ac_val=\$$ac_var
17764 case $ac_val in #(
17765 *${as_nl}*)
17766 case $ac_var in #(
17767 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
17768 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
17769 esac
17770 case $ac_var in #(
17771 _ | IFS | as_nl) ;; #(
17772 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
17773 *) { eval $ac_var=; unset $ac_var;} ;;
17774 esac ;;
17775 esac
17776 done
17777
17778 (set) 2>&1 |
17779 case $as_nl`(ac_space=' '; set) 2>&1` in #(
17780 *${as_nl}ac_space=\ *)
17781 # `set' does not quote correctly, so add quotes: double-quote
17782 # substitution turns \\\\ into \\, and sed turns \\ into \.
17783 sed -n \
17784 "s/'/'\\\\''/g;
17785 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17786 ;; #(
17787 *)
17788 # `set' quotes correctly as required by POSIX, so do not add quotes.
17789 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
17790 ;;
17791 esac |
17792 sort
17793 ) |
17794 sed '
17795 /^ac_cv_env_/b end
17796 t clear
17797 :clear
17798 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17799 t end
17800 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17801 :end' >>confcache
17802 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
17803 if test -w "$cache_file"; then
17804 if test "x$cache_file" != "x/dev/null"; then
17805 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
17806 $as_echo "$as_me: updating cache $cache_file" >&6;}
17807 if test ! -f "$cache_file" || test -h "$cache_file"; then
17808 cat confcache >"$cache_file"
17809 else
17810 case $cache_file in #(
17811 */* | ?:*)
17812 mv -f confcache "$cache_file"$$ &&
17813 mv -f "$cache_file"$$ "$cache_file" ;; #(
17814 *)
17815 mv -f confcache "$cache_file" ;;
17816 esac
17817 fi
17818 fi
17819 else
17820 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
17821 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
17822 fi
17823 fi
17824 rm -f confcache
17825
17826 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17827 # Let make expand exec_prefix.
17828 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17829
17830 DEFS=-DHAVE_CONFIG_H
17831
17832 ac_libobjs=
17833 ac_ltlibobjs=
17834 U=
17835 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
17836 # 1. Remove the extension, and $U if already installed.
17837 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
17838 ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
17839 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
17840 # will be set to the directory where LIBOBJS objects are built.
17841 as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
17842 as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
17843 done
17844 LIBOBJS=$ac_libobjs
17845
17846 LTLIBOBJS=$ac_ltlibobjs
17847
17848
17849
17850 : "${CONFIG_STATUS=./config.status}"
17851 ac_write_fail=0
17852 ac_clean_files_save=$ac_clean_files
17853 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17854 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
17855 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
17856 as_write_fail=0
17857 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
17858 #! $SHELL
17859 # Generated by $as_me.
17860 # Run this file to recreate the current configuration.
17861 # Compiler output produced by configure, useful for debugging
17862 # configure, is in config.log if it exists.
17863
17864 debug=false
17865 ac_cs_recheck=false
17866 ac_cs_silent=false
17867
17868 SHELL=\${CONFIG_SHELL-$SHELL}
17869 export SHELL
17870 _ASEOF
17871 cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
17872 ## -------------------- ##
17873 ## M4sh Initialization. ##
17874 ## -------------------- ##
17875
17876 # Be more Bourne compatible
17877 DUALCASE=1; export DUALCASE # for MKS sh
17878 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
17879 emulate sh
17880 NULLCMD=:
17881 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
17882 # is contrary to our usage. Disable this feature.
17883 alias -g '${1+"$@"}'='"$@"'
17884 setopt NO_GLOB_SUBST
17885 else
17886 case `(set -o) 2>/dev/null` in #(
17887 *posix*) :
17888 set -o posix ;; #(
17889 *) :
17890 ;;
17891 esac
17892 fi
17893
17894
17895 as_nl='
17896 '
17897 export as_nl
17898 # Printing a long string crashes Solaris 7 /usr/bin/printf.
17899 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
17900 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
17901 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
17902 # Prefer a ksh shell builtin over an external printf program on Solaris,
17903 # but without wasting forks for bash or zsh.
17904 if test -z "$BASH_VERSION$ZSH_VERSION" \
17905 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
17906 as_echo='print -r --'
17907 as_echo_n='print -rn --'
17908 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
17909 as_echo='printf %s\n'
17910 as_echo_n='printf %s'
17911 else
17912 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
17913 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
17914 as_echo_n='/usr/ucb/echo -n'
17915 else
17916 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
17917 as_echo_n_body='eval
17918 arg=$1;
17919 case $arg in #(
17920 *"$as_nl"*)
17921 expr "X$arg" : "X\\(.*\\)$as_nl";
17922 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
17923 esac;
17924 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
17925 '
17926 export as_echo_n_body
17927 as_echo_n='sh -c $as_echo_n_body as_echo'
17928 fi
17929 export as_echo_body
17930 as_echo='sh -c $as_echo_body as_echo'
17931 fi
17932
17933 # The user is always right.
17934 if test "${PATH_SEPARATOR+set}" != set; then
17935 PATH_SEPARATOR=:
17936 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
17937 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
17938 PATH_SEPARATOR=';'
17939 }
17940 fi
17941
17942
17943 # IFS
17944 # We need space, tab and new line, in precisely that order. Quoting is
17945 # there to prevent editors from complaining about space-tab.
17946 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
17947 # splitting by setting IFS to empty value.)
17948 IFS=" "" $as_nl"
17949
17950 # Find who we are. Look in the path if we contain no directory separator.
17951 as_myself=
17952 case $0 in #((
17953 *[\\/]* ) as_myself=$0 ;;
17954 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
17955 for as_dir in $PATH
17956 do
17957 IFS=$as_save_IFS
17958 test -z "$as_dir" && as_dir=.
17959 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
17960 done
17961 IFS=$as_save_IFS
17962
17963 ;;
17964 esac
17965 # We did not find ourselves, most probably we were run as `sh COMMAND'
17966 # in which case we are not to be found in the path.
17967 if test "x$as_myself" = x; then
17968 as_myself=$0
17969 fi
17970 if test ! -f "$as_myself"; then
17971 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
17972 exit 1
17973 fi
17974
17975 # Unset variables that we do not need and which cause bugs (e.g. in
17976 # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
17977 # suppresses any "Segmentation fault" message there. '((' could
17978 # trigger a bug in pdksh 5.2.14.
17979 for as_var in BASH_ENV ENV MAIL MAILPATH
17980 do eval test x\${$as_var+set} = xset \
17981 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
17982 done
17983 PS1='$ '
17984 PS2='> '
17985 PS4='+ '
17986
17987 # NLS nuisances.
17988 LC_ALL=C
17989 export LC_ALL
17990 LANGUAGE=C
17991 export LANGUAGE
17992
17993 # CDPATH.
17994 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
17995
17996
17997 # as_fn_error STATUS ERROR [LINENO LOG_FD]
17998 # ----------------------------------------
17999 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
18000 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
18001 # script with STATUS, using 1 if that was 0.
18002 as_fn_error ()
18003 {
18004 as_status=$1; test $as_status -eq 0 && as_status=1
18005 if test "$4"; then
18006 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
18007 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
18008 fi
18009 $as_echo "$as_me: error: $2" >&2
18010 as_fn_exit $as_status
18011 } # as_fn_error
18012
18013
18014 # as_fn_set_status STATUS
18015 # -----------------------
18016 # Set $? to STATUS, without forking.
18017 as_fn_set_status ()
18018 {
18019 return $1
18020 } # as_fn_set_status
18021
18022 # as_fn_exit STATUS
18023 # -----------------
18024 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
18025 as_fn_exit ()
18026 {
18027 set +e
18028 as_fn_set_status $1
18029 exit $1
18030 } # as_fn_exit
18031
18032 # as_fn_unset VAR
18033 # ---------------
18034 # Portably unset VAR.
18035 as_fn_unset ()
18036 {
18037 { eval $1=; unset $1;}
18038 }
18039 as_unset=as_fn_unset
18040 # as_fn_append VAR VALUE
18041 # ----------------------
18042 # Append the text in VALUE to the end of the definition contained in VAR. Take
18043 # advantage of any shell optimizations that allow amortized linear growth over
18044 # repeated appends, instead of the typical quadratic growth present in naive
18045 # implementations.
18046 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
18047 eval 'as_fn_append ()
18048 {
18049 eval $1+=\$2
18050 }'
18051 else
18052 as_fn_append ()
18053 {
18054 eval $1=\$$1\$2
18055 }
18056 fi # as_fn_append
18057
18058 # as_fn_arith ARG...
18059 # ------------------
18060 # Perform arithmetic evaluation on the ARGs, and store the result in the
18061 # global $as_val. Take advantage of shells that can avoid forks. The arguments
18062 # must be portable across $(()) and expr.
18063 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
18064 eval 'as_fn_arith ()
18065 {
18066 as_val=$(( $* ))
18067 }'
18068 else
18069 as_fn_arith ()
18070 {
18071 as_val=`expr "$@" || test $? -eq 1`
18072 }
18073 fi # as_fn_arith
18074
18075
18076 if expr a : '\(a\)' >/dev/null 2>&1 &&
18077 test "X`expr 00001 : '.*\(...\)'`" = X001; then
18078 as_expr=expr
18079 else
18080 as_expr=false
18081 fi
18082
18083 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
18084 as_basename=basename
18085 else
18086 as_basename=false
18087 fi
18088
18089 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
18090 as_dirname=dirname
18091 else
18092 as_dirname=false
18093 fi
18094
18095 as_me=`$as_basename -- "$0" ||
18096 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
18097 X"$0" : 'X\(//\)$' \| \
18098 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
18099 $as_echo X/"$0" |
18100 sed '/^.*\/\([^/][^/]*\)\/*$/{
18101 s//\1/
18102 q
18103 }
18104 /^X\/\(\/\/\)$/{
18105 s//\1/
18106 q
18107 }
18108 /^X\/\(\/\).*/{
18109 s//\1/
18110 q
18111 }
18112 s/.*/./; q'`
18113
18114 # Avoid depending upon Character Ranges.
18115 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
18116 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
18117 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
18118 as_cr_digits='0123456789'
18119 as_cr_alnum=$as_cr_Letters$as_cr_digits
18120
18121 ECHO_C= ECHO_N= ECHO_T=
18122 case `echo -n x` in #(((((
18123 -n*)
18124 case `echo 'xy\c'` in
18125 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
18126 xy) ECHO_C='\c';;
18127 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
18128 ECHO_T=' ';;
18129 esac;;
18130 *)
18131 ECHO_N='-n';;
18132 esac
18133
18134 rm -f conf$$ conf$$.exe conf$$.file
18135 if test -d conf$$.dir; then
18136 rm -f conf$$.dir/conf$$.file
18137 else
18138 rm -f conf$$.dir
18139 mkdir conf$$.dir 2>/dev/null
18140 fi
18141 if (echo >conf$$.file) 2>/dev/null; then
18142 if ln -s conf$$.file conf$$ 2>/dev/null; then
18143 as_ln_s='ln -s'
18144 # ... but there are two gotchas:
18145 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
18146 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
18147 # In both cases, we have to default to `cp -pR'.
18148 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
18149 as_ln_s='cp -pR'
18150 elif ln conf$$.file conf$$ 2>/dev/null; then
18151 as_ln_s=ln
18152 else
18153 as_ln_s='cp -pR'
18154 fi
18155 else
18156 as_ln_s='cp -pR'
18157 fi
18158 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
18159 rmdir conf$$.dir 2>/dev/null
18160
18161
18162 # as_fn_mkdir_p
18163 # -------------
18164 # Create "$as_dir" as a directory, including parents if necessary.
18165 as_fn_mkdir_p ()
18166 {
18167
18168 case $as_dir in #(
18169 -*) as_dir=./$as_dir;;
18170 esac
18171 test -d "$as_dir" || eval $as_mkdir_p || {
18172 as_dirs=
18173 while :; do
18174 case $as_dir in #(
18175 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
18176 *) as_qdir=$as_dir;;
18177 esac
18178 as_dirs="'$as_qdir' $as_dirs"
18179 as_dir=`$as_dirname -- "$as_dir" ||
18180 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18181 X"$as_dir" : 'X\(//\)[^/]' \| \
18182 X"$as_dir" : 'X\(//\)$' \| \
18183 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
18184 $as_echo X"$as_dir" |
18185 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
18186 s//\1/
18187 q
18188 }
18189 /^X\(\/\/\)[^/].*/{
18190 s//\1/
18191 q
18192 }
18193 /^X\(\/\/\)$/{
18194 s//\1/
18195 q
18196 }
18197 /^X\(\/\).*/{
18198 s//\1/
18199 q
18200 }
18201 s/.*/./; q'`
18202 test -d "$as_dir" && break
18203 done
18204 test -z "$as_dirs" || eval "mkdir $as_dirs"
18205 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
18206
18207
18208 } # as_fn_mkdir_p
18209 if mkdir -p . 2>/dev/null; then
18210 as_mkdir_p='mkdir -p "$as_dir"'
18211 else
18212 test -d ./-p && rmdir ./-p
18213 as_mkdir_p=false
18214 fi
18215
18216
18217 # as_fn_executable_p FILE
18218 # -----------------------
18219 # Test if FILE is an executable regular file.
18220 as_fn_executable_p ()
18221 {
18222 test -f "$1" && test -x "$1"
18223 } # as_fn_executable_p
18224 as_test_x='test -x'
18225 as_executable_p=as_fn_executable_p
18226
18227 # Sed expression to map a string onto a valid CPP name.
18228 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
18229
18230 # Sed expression to map a string onto a valid variable name.
18231 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
18232
18233
18234 exec 6>&1
18235 ## ----------------------------------- ##
18236 ## Main body of $CONFIG_STATUS script. ##
18237 ## ----------------------------------- ##
18238 _ASEOF
18239 test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
18240
18241 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
18242 # Save the log message, to keep $0 and so on meaningful, and to
18243 # report actual input values of CONFIG_FILES etc. instead of their
18244 # values after options handling.
18245 ac_log="
18246 This file was extended by getdns $as_me 1.5.2, which was
18247 generated by GNU Autoconf 2.69. Invocation command line was
18248
18249 CONFIG_FILES = $CONFIG_FILES
18250 CONFIG_HEADERS = $CONFIG_HEADERS
18251 CONFIG_LINKS = $CONFIG_LINKS
18252 CONFIG_COMMANDS = $CONFIG_COMMANDS
18253 $ $0 $@
18254
18255 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18256 "
18257
18258 _ACEOF
18259
18260 case $ac_config_files in *"
18261 "*) set x $ac_config_files; shift; ac_config_files=$*;;
18262 esac
18263
18264 case $ac_config_headers in *"
18265 "*) set x $ac_config_headers; shift; ac_config_headers=$*;;
18266 esac
18267
18268
18269 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
18270 # Files that config.status was made for.
18271 config_files="$ac_config_files"
18272 config_headers="$ac_config_headers"
18273 config_commands="$ac_config_commands"
18274
18275 _ACEOF
18276
18277 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
18278 ac_cs_usage="\
18279 \`$as_me' instantiates files and other configuration actions
18280 from templates according to the current configuration. Unless the files
18281 and actions are specified as TAGs, all are instantiated by default.
18282
18283 Usage: $0 [OPTION]... [TAG]...
18284
18285 -h, --help print this help, then exit
18286 -V, --version print version number and configuration settings, then exit
18287 --config print configuration, then exit
18288 -q, --quiet, --silent
18289 do not print progress messages
18290 -d, --debug don't remove temporary files
18291 --recheck update $as_me by reconfiguring in the same conditions
18292 --file=FILE[:TEMPLATE]
18293 instantiate the configuration file FILE
18294 --header=FILE[:TEMPLATE]
18295 instantiate the configuration header FILE
18296
18297 Configuration files:
18298 $config_files
18299
18300 Configuration headers:
18301 $config_headers
18302
18303 Configuration commands:
18304 $config_commands
18305
18306 Report bugs to <team@getdnsapi.net>.
18307 getdns home page: <https://getdnsapi.net>."
18308
18309 _ACEOF
18310 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
18311 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
18312 ac_cs_version="\\
18313 getdns config.status 1.5.2
18314 configured by $0, generated by GNU Autoconf 2.69,
18315 with options \\"\$ac_cs_config\\"
18316
18317 Copyright (C) 2012 Free Software Foundation, Inc.
18318 This config.status script is free software; the Free Software Foundation
18319 gives unlimited permission to copy, distribute and modify it."
18320
18321 ac_pwd='$ac_pwd'
18322 srcdir='$srcdir'
18323 INSTALL='$INSTALL'
18324 AWK='$AWK'
18325 test -n "\$AWK" || AWK=awk
18326 _ACEOF
18327
18328 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
18329 # The default lists apply if the user does not specify any file.
18330 ac_need_defaults=:
18331 while test $# != 0
18332 do
18333 case $1 in
18334 --*=?*)
18335 ac_option=`expr "X$1" : 'X\([^=]*\)='`
18336 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
18337 ac_shift=:
18338 ;;
18339 --*=)
18340 ac_option=`expr "X$1" : 'X\([^=]*\)='`
18341 ac_optarg=
18342 ac_shift=:
18343 ;;
18344 *)
18345 ac_option=$1
18346 ac_optarg=$2
18347 ac_shift=shift
18348 ;;
18349 esac
18350
18351 case $ac_option in
18352 # Handling of the options.
18353 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18354 ac_cs_recheck=: ;;
18355 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
18356 $as_echo "$ac_cs_version"; exit ;;
18357 --config | --confi | --conf | --con | --co | --c )
18358 $as_echo "$ac_cs_config"; exit ;;
18359 --debug | --debu | --deb | --de | --d | -d )
18360 debug=: ;;
18361 --file | --fil | --fi | --f )
18362 $ac_shift
18363 case $ac_optarg in
18364 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
18365 '') as_fn_error $? "missing file argument" ;;
18366 esac
18367 as_fn_append CONFIG_FILES " '$ac_optarg'"
18368 ac_need_defaults=false;;
18369 --header | --heade | --head | --hea )
18370 $ac_shift
18371 case $ac_optarg in
18372 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
18373 esac
18374 as_fn_append CONFIG_HEADERS " '$ac_optarg'"
18375 ac_need_defaults=false;;
18376 --he | --h)
18377 # Conflict between --help and --header
18378 as_fn_error $? "ambiguous option: \`$1'
18379 Try \`$0 --help' for more information.";;
18380 --help | --hel | -h )
18381 $as_echo "$ac_cs_usage"; exit ;;
18382 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
18383 | -silent | --silent | --silen | --sile | --sil | --si | --s)
18384 ac_cs_silent=: ;;
18385
18386 # This is an error.
18387 -*) as_fn_error $? "unrecognized option: \`$1'
18388 Try \`$0 --help' for more information." ;;
18389
18390 *) as_fn_append ac_config_targets " $1"
18391 ac_need_defaults=false ;;
18392
18393 esac
18394 shift
18395 done
18396
18397 ac_configure_extra_args=
18398
18399 if $ac_cs_silent; then
18400 exec 6>/dev/null
18401 ac_configure_extra_args="$ac_configure_extra_args --silent"
18402 fi
18403
18404 _ACEOF
18405 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
18406 if \$ac_cs_recheck; then
18407 set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
18408 shift
18409 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
18410 CONFIG_SHELL='$SHELL'
18411 export CONFIG_SHELL
18412 exec "\$@"
18413 fi
18414
18415 _ACEOF
18416 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
18417 exec 5>>config.log
18418 {
18419 echo
18420 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
18421 ## Running $as_me. ##
18422 _ASBOX
18423 $as_echo "$ac_log"
18424 } >&5
18425
18426 _ACEOF
18427 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
18428 #
18429 # INIT-COMMANDS
18430 #
18431
18432
18433 # The HP-UX ksh and POSIX shell print the target directory to stdout
18434 # if CDPATH is set.
18435 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
18436
18437 sed_quote_subst='$sed_quote_subst'
18438 double_quote_subst='$double_quote_subst'
18439 delay_variable_subst='$delay_variable_subst'
18440 macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
18441 macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
18442 enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
18443 enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
18444 pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
18445 enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
18446 shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
18447 SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
18448 ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
18449 PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
18450 host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
18451 host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
18452 host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
18453 build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
18454 build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
18455 build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
18456 SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
18457 Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
18458 GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
18459 EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
18460 FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
18461 LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
18462 NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
18463 LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
18464 max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
18465 ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
18466 exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
18467 lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
18468 lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
18469 lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
18470 lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
18471 lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
18472 reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
18473 reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
18474 OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
18475 deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
18476 file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
18477 file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
18478 want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
18479 DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
18480 sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
18481 AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
18482 AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
18483 archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
18484 STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
18485 RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
18486 old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
18487 old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
18488 old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
18489 lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
18490 CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
18491 CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
18492 compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
18493 GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
18494 lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
18495 lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
18496 lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
18497 lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
18498 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
18499 lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
18500 nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
18501 lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
18502 lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
18503 objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
18504 MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
18505 lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
18506 lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
18507 lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
18508 lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
18509 lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
18510 need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
18511 MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
18512 DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
18513 NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
18514 LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
18515 OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
18516 OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
18517 libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
18518 shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
18519 extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
18520 archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
18521 enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
18522 export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
18523 whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
18524 compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
18525 old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
18526 old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
18527 archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
18528 archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
18529 module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
18530 module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
18531 with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
18532 allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
18533 no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
18534 hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
18535 hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
18536 hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
18537 hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
18538 hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
18539 hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
18540 hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
18541 inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
18542 link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
18543 always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
18544 export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
18545 exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
18546 include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
18547 prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
18548 postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
18549 file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
18550 variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
18551 need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
18552 need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
18553 version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
18554 runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
18555 shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
18556 shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
18557 libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
18558 library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
18559 soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
18560 install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
18561 postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
18562 postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
18563 finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
18564 finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
18565 hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
18566 sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
18567 configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
18568 configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
18569 hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
18570 enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
18571 enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
18572 enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
18573 old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
18574 striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
18575
18576 LTCC='$LTCC'
18577 LTCFLAGS='$LTCFLAGS'
18578 compiler='$compiler_DEFAULT'
18579
18580 # A function that is used when there is no print builtin or printf.
18581 func_fallback_echo ()
18582 {
18583 eval 'cat <<_LTECHO_EOF
18584 \$1
18585 _LTECHO_EOF'
18586 }
18587
18588 # Quote evaled strings.
18589 for var in SHELL \
18590 ECHO \
18591 PATH_SEPARATOR \
18592 SED \
18593 GREP \
18594 EGREP \
18595 FGREP \
18596 LD \
18597 NM \
18598 LN_S \
18599 lt_SP2NL \
18600 lt_NL2SP \
18601 reload_flag \
18602 OBJDUMP \
18603 deplibs_check_method \
18604 file_magic_cmd \
18605 file_magic_glob \
18606 want_nocaseglob \
18607 DLLTOOL \
18608 sharedlib_from_linklib_cmd \
18609 AR \
18610 AR_FLAGS \
18611 archiver_list_spec \
18612 STRIP \
18613 RANLIB \
18614 CC \
18615 CFLAGS \
18616 compiler \
18617 lt_cv_sys_global_symbol_pipe \
18618 lt_cv_sys_global_symbol_to_cdecl \
18619 lt_cv_sys_global_symbol_to_import \
18620 lt_cv_sys_global_symbol_to_c_name_address \
18621 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
18622 lt_cv_nm_interface \
18623 nm_file_list_spec \
18624 lt_cv_truncate_bin \
18625 lt_prog_compiler_no_builtin_flag \
18626 lt_prog_compiler_pic \
18627 lt_prog_compiler_wl \
18628 lt_prog_compiler_static \
18629 lt_cv_prog_compiler_c_o \
18630 need_locks \
18631 MANIFEST_TOOL \
18632 DSYMUTIL \
18633 NMEDIT \
18634 LIPO \
18635 OTOOL \
18636 OTOOL64 \
18637 shrext_cmds \
18638 export_dynamic_flag_spec \
18639 whole_archive_flag_spec \
18640 compiler_needs_object \
18641 with_gnu_ld \
18642 allow_undefined_flag \
18643 no_undefined_flag \
18644 hardcode_libdir_flag_spec \
18645 hardcode_libdir_separator \
18646 exclude_expsyms \
18647 include_expsyms \
18648 file_list_spec \
18649 variables_saved_for_relink \
18650 libname_spec \
18651 library_names_spec \
18652 soname_spec \
18653 install_override_mode \
18654 finish_eval \
18655 old_striplib \
18656 striplib; do
18657 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
18658 *[\\\\\\\`\\"\\\$]*)
18659 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
18660 ;;
18661 *)
18662 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
18663 ;;
18664 esac
18665 done
18666
18667 # Double-quote double-evaled strings.
18668 for var in reload_cmds \
18669 old_postinstall_cmds \
18670 old_postuninstall_cmds \
18671 old_archive_cmds \
18672 extract_expsyms_cmds \
18673 old_archive_from_new_cmds \
18674 old_archive_from_expsyms_cmds \
18675 archive_cmds \
18676 archive_expsym_cmds \
18677 module_cmds \
18678 module_expsym_cmds \
18679 export_symbols_cmds \
18680 prelink_cmds \
18681 postlink_cmds \
18682 postinstall_cmds \
18683 postuninstall_cmds \
18684 finish_cmds \
18685 sys_lib_search_path_spec \
18686 configure_time_dlsearch_path \
18687 configure_time_lt_sys_library_path; do
18688 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
18689 *[\\\\\\\`\\"\\\$]*)
18690 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
18691 ;;
18692 *)
18693 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
18694 ;;
18695 esac
18696 done
18697
18698 ac_aux_dir='$ac_aux_dir'
18699
18700 # See if we are running on zsh, and set the options that allow our
18701 # commands through without removal of \ escapes INIT.
18702 if test -n "\${ZSH_VERSION+set}"; then
18703 setopt NO_GLOB_SUBST
18704 fi
18705
18706
18707 PACKAGE='$PACKAGE'
18708 VERSION='$VERSION'
18709 RM='$RM'
18710 ofile='$ofile'
18711
18712
18713
18714
18715 _ACEOF
18716
18717 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
18718
18719 # Handling of arguments.
18720 for ac_config_target in $ac_config_targets
18721 do
18722 case $ac_config_target in
18723 "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
18724 "disable-rpath") CONFIG_COMMANDS="$CONFIG_COMMANDS disable-rpath" ;;
18725 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18726 "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
18727 "src/version.c") CONFIG_FILES="$CONFIG_FILES src/version.c" ;;
18728 "src/getdns/getdns.h") CONFIG_FILES="$CONFIG_FILES src/getdns/getdns.h" ;;
18729 "src/getdns/getdns_extra.h") CONFIG_FILES="$CONFIG_FILES src/getdns/getdns_extra.h" ;;
18730 "spec/example/Makefile") CONFIG_FILES="$CONFIG_FILES spec/example/Makefile" ;;
18731 "src/test/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/Makefile" ;;
18732 "src/tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/tools/Makefile" ;;
18733 "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
18734 "getdns.pc") CONFIG_FILES="$CONFIG_FILES getdns.pc" ;;
18735 "getdns_ext_event.pc") CONFIG_FILES="$CONFIG_FILES getdns_ext_event.pc" ;;
18736 "src/Doxyfile") CONFIG_FILES="$CONFIG_FILES src/Doxyfile" ;;
18737 "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
18738
18739 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
18740 esac
18741 done
18742
18743
18744 # If the user did not use the arguments to specify the items to instantiate,
18745 # then the envvar interface is used. Set only those that are not.
18746 # We use the long form for the default assignment because of an extremely
18747 # bizarre bug on SunOS 4.1.3.
18748 if $ac_need_defaults; then
18749 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18750 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18751 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18752 fi
18753
18754 # Have a temporary directory for convenience. Make it in the build tree
18755 # simply because there is no reason against having it here, and in addition,
18756 # creating and moving files from /tmp can sometimes cause problems.
18757 # Hook for its removal unless debugging.
18758 # Note that there is a small window in which the directory will not be cleaned:
18759 # after its creation but before its name has been assigned to `$tmp'.
18760 $debug ||
18761 {
18762 tmp= ac_tmp=
18763 trap 'exit_status=$?
18764 : "${ac_tmp:=$tmp}"
18765 { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
18766 ' 0
18767 trap 'as_fn_exit 1' 1 2 13 15
18768 }
18769 # Create a (secure) tmp directory for tmp files.
18770
18771 {
18772 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
18773 test -d "$tmp"
18774 } ||
18775 {
18776 tmp=./conf$$-$RANDOM
18777 (umask 077 && mkdir "$tmp")
18778 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
18779 ac_tmp=$tmp
18780
18781 # Set up the scripts for CONFIG_FILES section.
18782 # No need to generate them if there are no CONFIG_FILES.
18783 # This happens for instance with `./config.status config.h'.
18784 if test -n "$CONFIG_FILES"; then
18785
18786
18787 ac_cr=`echo X | tr X '\015'`
18788 # On cygwin, bash can eat \r inside `` if the user requested igncr.
18789 # But we know of no other shell where ac_cr would be empty at this
18790 # point, so we can use a bashism as a fallback.
18791 if test "x$ac_cr" = x; then
18792 eval ac_cr=\$\'\\r\'
18793 fi
18794 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
18795 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
18796 ac_cs_awk_cr='\\r'
18797 else
18798 ac_cs_awk_cr=$ac_cr
18799 fi
18800
18801 echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
18802 _ACEOF
18803
18804
18805 {
18806 echo "cat >conf$$subs.awk <<_ACEOF" &&
18807 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
18808 echo "_ACEOF"
18809 } >conf$$subs.sh ||
18810 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
18811 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
18812 ac_delim='%!_!# '
18813 for ac_last_try in false false false false false :; do
18814 . ./conf$$subs.sh ||
18815 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
18816
18817 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
18818 if test $ac_delim_n = $ac_delim_num; then
18819 break
18820 elif $ac_last_try; then
18821 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
18822 else
18823 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
18824 fi
18825 done
18826 rm -f conf$$subs.sh
18827
18828 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
18829 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
18830 _ACEOF
18831 sed -n '
18832 h
18833 s/^/S["/; s/!.*/"]=/
18834 p
18835 g
18836 s/^[^!]*!//
18837 :repl
18838 t repl
18839 s/'"$ac_delim"'$//
18840 t delim
18841 :nl
18842 h
18843 s/\(.\{148\}\)..*/\1/
18844 t more1
18845 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
18846 p
18847 n
18848 b repl
18849 :more1
18850 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
18851 p
18852 g
18853 s/.\{148\}//
18854 t nl
18855 :delim
18856 h
18857 s/\(.\{148\}\)..*/\1/
18858 t more2
18859 s/["\\]/\\&/g; s/^/"/; s/$/"/
18860 p
18861 b
18862 :more2
18863 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
18864 p
18865 g
18866 s/.\{148\}//
18867 t delim
18868 ' <conf$$subs.awk | sed '
18869 /^[^""]/{
18870 N
18871 s/\n//
18872 }
18873 ' >>$CONFIG_STATUS || ac_write_fail=1
18874 rm -f conf$$subs.awk
18875 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
18876 _ACAWK
18877 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
18878 for (key in S) S_is_set[key] = 1
18879 FS = ""
18880
18881 }
18882 {
18883 line = $ 0
18884 nfields = split(line, field, "@")
18885 substed = 0
18886 len = length(field[1])
18887 for (i = 2; i < nfields; i++) {
18888 key = field[i]
18889 keylen = length(key)
18890 if (S_is_set[key]) {
18891 value = S[key]
18892 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
18893 len += length(value) + length(field[++i])
18894 substed = 1
18895 } else
18896 len += 1 + keylen
18897 }
18898
18899 print line
18900 }
18901
18902 _ACAWK
18903 _ACEOF
18904 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
18905 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
18906 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
18907 else
18908 cat
18909 fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
18910 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
18911 _ACEOF
18912
18913 # VPATH may cause trouble with some makes, so we remove sole $(srcdir),
18914 # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
18915 # trailing colons and then remove the whole line if VPATH becomes empty
18916 # (actually we leave an empty line to preserve line numbers).
18917 if test "x$srcdir" = x.; then
18918 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
18919 h
18920 s///
18921 s/^/:/
18922 s/[ ]*$/:/
18923 s/:\$(srcdir):/:/g
18924 s/:\${srcdir}:/:/g
18925 s/:@srcdir@:/:/g
18926 s/^:*//
18927 s/:*$//
18928 x
18929 s/\(=[ ]*\).*/\1/
18930 G
18931 s/\n//
18932 s/^[^=]*=[ ]*$//
18933 }'
18934 fi
18935
18936 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
18937 fi # test -n "$CONFIG_FILES"
18938
18939 # Set up the scripts for CONFIG_HEADERS section.
18940 # No need to generate them if there are no CONFIG_HEADERS.
18941 # This happens for instance with `./config.status Makefile'.
18942 if test -n "$CONFIG_HEADERS"; then
18943 cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
18944 BEGIN {
18945 _ACEOF
18946
18947 # Transform confdefs.h into an awk script `defines.awk', embedded as
18948 # here-document in config.status, that substitutes the proper values into
18949 # config.h.in to produce config.h.
18950
18951 # Create a delimiter string that does not exist in confdefs.h, to ease
18952 # handling of long lines.
18953 ac_delim='%!_!# '
18954 for ac_last_try in false false :; do
18955 ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
18956 if test -z "$ac_tt"; then
18957 break
18958 elif $ac_last_try; then
18959 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
18960 else
18961 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
18962 fi
18963 done
18964
18965 # For the awk script, D is an array of macro values keyed by name,
18966 # likewise P contains macro parameters if any. Preserve backslash
18967 # newline sequences.
18968
18969 ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
18970 sed -n '
18971 s/.\{148\}/&'"$ac_delim"'/g
18972 t rset
18973 :rset
18974 s/^[ ]*#[ ]*define[ ][ ]*/ /
18975 t def
18976 d
18977 :def
18978 s/\\$//
18979 t bsnl
18980 s/["\\]/\\&/g
18981 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
18982 D["\1"]=" \3"/p
18983 s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
18984 d
18985 :bsnl
18986 s/["\\]/\\&/g
18987 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
18988 D["\1"]=" \3\\\\\\n"\\/p
18989 t cont
18990 s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
18991 t cont
18992 d
18993 :cont
18994 n
18995 s/.\{148\}/&'"$ac_delim"'/g
18996 t clear
18997 :clear
18998 s/\\$//
18999 t bsnlc
19000 s/["\\]/\\&/g; s/^/"/; s/$/"/p
19001 d
19002 :bsnlc
19003 s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
19004 b cont
19005 ' <confdefs.h | sed '
19006 s/'"$ac_delim"'/"\\\
19007 "/g' >>$CONFIG_STATUS || ac_write_fail=1
19008
19009 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19010 for (key in D) D_is_set[key] = 1
19011 FS = ""
19012 }
19013 /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
19014 line = \$ 0
19015 split(line, arg, " ")
19016 if (arg[1] == "#") {
19017 defundef = arg[2]
19018 mac1 = arg[3]
19019 } else {
19020 defundef = substr(arg[1], 2)
19021 mac1 = arg[2]
19022 }
19023 split(mac1, mac2, "(") #)
19024 macro = mac2[1]
19025 prefix = substr(line, 1, index(line, defundef) - 1)
19026 if (D_is_set[macro]) {
19027 # Preserve the white space surrounding the "#".
19028 print prefix "define", macro P[macro] D[macro]
19029 next
19030 } else {
19031 # Replace #undef with comments. This is necessary, for example,
19032 # in the case of _POSIX_SOURCE, which is predefined and required
19033 # on some systems where configure will not decide to define it.
19034 if (defundef == "undef") {
19035 print "/*", prefix defundef, macro, "*/"
19036 next
19037 }
19038 }
19039 }
19040 { print }
19041 _ACAWK
19042 _ACEOF
19043 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19044 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
19045 fi # test -n "$CONFIG_HEADERS"
19046
19047
19048 eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
19049 shift
19050 for ac_tag
19051 do
19052 case $ac_tag in
19053 :[FHLC]) ac_mode=$ac_tag; continue;;
19054 esac
19055 case $ac_mode$ac_tag in
19056 :[FHL]*:*);;
19057 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
19058 :[FH]-) ac_tag=-:-;;
19059 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
19060 esac
19061 ac_save_IFS=$IFS
19062 IFS=:
19063 set x $ac_tag
19064 IFS=$ac_save_IFS
19065 shift
19066 ac_file=$1
19067 shift
19068
19069 case $ac_mode in
19070 :L) ac_source=$1;;
19071 :[FH])
19072 ac_file_inputs=
19073 for ac_f
19074 do
19075 case $ac_f in
19076 -) ac_f="$ac_tmp/stdin";;
19077 *) # Look for the file first in the build tree, then in the source tree
19078 # (if the path is not absolute). The absolute path cannot be DOS-style,
19079 # because $ac_f cannot contain `:'.
19080 test -f "$ac_f" ||
19081 case $ac_f in
19082 [\\/$]*) false;;
19083 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
19084 esac ||
19085 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
19086 esac
19087 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
19088 as_fn_append ac_file_inputs " '$ac_f'"
19089 done
19090
19091 # Let's still pretend it is `configure' which instantiates (i.e., don't
19092 # use $as_me), people would be surprised to read:
19093 # /* config.h. Generated by config.status. */
19094 configure_input='Generated from '`
19095 $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
19096 `' by configure.'
19097 if test x"$ac_file" != x-; then
19098 configure_input="$ac_file. $configure_input"
19099 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
19100 $as_echo "$as_me: creating $ac_file" >&6;}
19101 fi
19102 # Neutralize special characters interpreted by sed in replacement strings.
19103 case $configure_input in #(
19104 *\&* | *\|* | *\\* )
19105 ac_sed_conf_input=`$as_echo "$configure_input" |
19106 sed 's/[\\\\&|]/\\\\&/g'`;; #(
19107 *) ac_sed_conf_input=$configure_input;;
19108 esac
19109
19110 case $ac_tag in
19111 *:-:* | *:-) cat >"$ac_tmp/stdin" \
19112 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
19113 esac
19114 ;;
19115 esac
19116
19117 ac_dir=`$as_dirname -- "$ac_file" ||
19118 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19119 X"$ac_file" : 'X\(//\)[^/]' \| \
19120 X"$ac_file" : 'X\(//\)$' \| \
19121 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
19122 $as_echo X"$ac_file" |
19123 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
19124 s//\1/
19125 q
19126 }
19127 /^X\(\/\/\)[^/].*/{
19128 s//\1/
19129 q
19130 }
19131 /^X\(\/\/\)$/{
19132 s//\1/
19133 q
19134 }
19135 /^X\(\/\).*/{
19136 s//\1/
19137 q
19138 }
19139 s/.*/./; q'`
19140 as_dir="$ac_dir"; as_fn_mkdir_p
19141 ac_builddir=.
19142
19143 case "$ac_dir" in
19144 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
19145 *)
19146 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
19147 # A ".." for each directory in $ac_dir_suffix.
19148 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
19149 case $ac_top_builddir_sub in
19150 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
19151 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
19152 esac ;;
19153 esac
19154 ac_abs_top_builddir=$ac_pwd
19155 ac_abs_builddir=$ac_pwd$ac_dir_suffix
19156 # for backward compatibility:
19157 ac_top_builddir=$ac_top_build_prefix
19158
19159 case $srcdir in
19160 .) # We are building in place.
19161 ac_srcdir=.
19162 ac_top_srcdir=$ac_top_builddir_sub
19163 ac_abs_top_srcdir=$ac_pwd ;;
19164 [\\/]* | ?:[\\/]* ) # Absolute name.
19165 ac_srcdir=$srcdir$ac_dir_suffix;
19166 ac_top_srcdir=$srcdir
19167 ac_abs_top_srcdir=$srcdir ;;
19168 *) # Relative name.
19169 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
19170 ac_top_srcdir=$ac_top_build_prefix$srcdir
19171 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
19172 esac
19173 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
19174
19175
19176 case $ac_mode in
19177 :F)
19178 #
19179 # CONFIG_FILE
19180 #
19181
19182 case $INSTALL in
19183 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19184 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
19185 esac
19186 _ACEOF
19187
19188 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19189 # If the template does not know about datarootdir, expand it.
19190 # FIXME: This hack should be removed a few years after 2.60.
19191 ac_datarootdir_hack=; ac_datarootdir_seen=
19192 ac_sed_dataroot='
19193 /datarootdir/ {
19194 p
19195 q
19196 }
19197 /@datadir@/p
19198 /@docdir@/p
19199 /@infodir@/p
19200 /@localedir@/p
19201 /@mandir@/p'
19202 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
19203 *datarootdir*) ac_datarootdir_seen=yes;;
19204 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
19205 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
19206 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
19207 _ACEOF
19208 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19209 ac_datarootdir_hack='
19210 s&@datadir@&$datadir&g
19211 s&@docdir@&$docdir&g
19212 s&@infodir@&$infodir&g
19213 s&@localedir@&$localedir&g
19214 s&@mandir@&$mandir&g
19215 s&\\\${datarootdir}&$datarootdir&g' ;;
19216 esac
19217 _ACEOF
19218
19219 # Neutralize VPATH when `$srcdir' = `.'.
19220 # Shell code in configure.ac might set extrasub.
19221 # FIXME: do we really want to maintain this feature?
19222 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19223 ac_sed_extra="$ac_vpsub
19224 $extrasub
19225 _ACEOF
19226 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19227 :t
19228 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19229 s|@configure_input@|$ac_sed_conf_input|;t t
19230 s&@top_builddir@&$ac_top_builddir_sub&;t t
19231 s&@top_build_prefix@&$ac_top_build_prefix&;t t
19232 s&@srcdir@&$ac_srcdir&;t t
19233 s&@abs_srcdir@&$ac_abs_srcdir&;t t
19234 s&@top_srcdir@&$ac_top_srcdir&;t t
19235 s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
19236 s&@builddir@&$ac_builddir&;t t
19237 s&@abs_builddir@&$ac_abs_builddir&;t t
19238 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
19239 s&@INSTALL@&$ac_INSTALL&;t t
19240 $ac_datarootdir_hack
19241 "
19242 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
19243 >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
19244
19245 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
19246 { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
19247 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
19248 "$ac_tmp/out"`; test -z "$ac_out"; } &&
19249 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
19250 which seems to be undefined. Please make sure it is defined" >&5
19251 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
19252 which seems to be undefined. Please make sure it is defined" >&2;}
19253
19254 rm -f "$ac_tmp/stdin"
19255 case $ac_file in
19256 -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
19257 *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
19258 esac \
19259 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
19260 ;;
19261 :H)
19262 #
19263 # CONFIG_HEADER
19264 #
19265 if test x"$ac_file" != x-; then
19266 {
19267 $as_echo "/* $configure_input */" \
19268 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
19269 } >"$ac_tmp/config.h" \
19270 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
19271 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
19272 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
19273 $as_echo "$as_me: $ac_file is unchanged" >&6;}
19274 else
19275 rm -f "$ac_file"
19276 mv "$ac_tmp/config.h" "$ac_file" \
19277 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
19278 fi
19279 else
19280 $as_echo "/* $configure_input */" \
19281 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
19282 || as_fn_error $? "could not create -" "$LINENO" 5
19283 fi
19284 ;;
19285
19286 :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
19287 $as_echo "$as_me: executing $ac_file commands" >&6;}
19288 ;;
19289 esac
19290
19291
19292 case $ac_file$ac_mode in
19293 "libtool":C)
19294
19295 # See if we are running on zsh, and set the options that allow our
19296 # commands through without removal of \ escapes.
19297 if test -n "${ZSH_VERSION+set}"; then
19298 setopt NO_GLOB_SUBST
19299 fi
19300
19301 cfgfile=${ofile}T
19302 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
19303 $RM "$cfgfile"
19304
19305 cat <<_LT_EOF >> "$cfgfile"
19306 #! $SHELL
19307 # Generated automatically by $as_me ($PACKAGE) $VERSION
19308 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
19309
19310 # Provide generalized library-building support services.
19311 # Written by Gordon Matzigkeit, 1996
19312
19313 # Copyright (C) 2014 Free Software Foundation, Inc.
19314 # This is free software; see the source for copying conditions. There is NO
19315 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19316
19317 # GNU Libtool is free software; you can redistribute it and/or modify
19318 # it under the terms of the GNU General Public License as published by
19319 # the Free Software Foundation; either version 2 of of the License, or
19320 # (at your option) any later version.
19321 #
19322 # As a special exception to the GNU General Public License, if you
19323 # distribute this file as part of a program or library that is built
19324 # using GNU Libtool, you may include this file under the same
19325 # distribution terms that you use for the rest of that program.
19326 #
19327 # GNU Libtool is distributed in the hope that it will be useful, but
19328 # WITHOUT ANY WARRANTY; without even the implied warranty of
19329 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19330 # GNU General Public License for more details.
19331 #
19332 # You should have received a copy of the GNU General Public License
19333 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19334
19335
19336 # The names of the tagged configurations supported by this script.
19337 available_tags=''
19338
19339 # Configured defaults for sys_lib_dlsearch_path munging.
19340 : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
19341
19342 # ### BEGIN LIBTOOL CONFIG
19343
19344 # Which release of libtool.m4 was used?
19345 macro_version=$macro_version
19346 macro_revision=$macro_revision
19347
19348 # Whether or not to build shared libraries.
19349 build_libtool_libs=$enable_shared
19350
19351 # Whether or not to build static libraries.
19352 build_old_libs=$enable_static
19353
19354 # What type of objects to build.
19355 pic_mode=$pic_mode
19356
19357 # Whether or not to optimize for fast installation.
19358 fast_install=$enable_fast_install
19359
19360 # Shared archive member basename,for filename based shared library versioning on AIX.
19361 shared_archive_member_spec=$shared_archive_member_spec
19362
19363 # Shell to use when invoking shell scripts.
19364 SHELL=$lt_SHELL
19365
19366 # An echo program that protects backslashes.
19367 ECHO=$lt_ECHO
19368
19369 # The PATH separator for the build system.
19370 PATH_SEPARATOR=$lt_PATH_SEPARATOR
19371
19372 # The host system.
19373 host_alias=$host_alias
19374 host=$host
19375 host_os=$host_os
19376
19377 # The build system.
19378 build_alias=$build_alias
19379 build=$build
19380 build_os=$build_os
19381
19382 # A sed program that does not truncate output.
19383 SED=$lt_SED
19384
19385 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
19386 Xsed="\$SED -e 1s/^X//"
19387
19388 # A grep program that handles long lines.
19389 GREP=$lt_GREP
19390
19391 # An ERE matcher.
19392 EGREP=$lt_EGREP
19393
19394 # A literal string matcher.
19395 FGREP=$lt_FGREP
19396
19397 # A BSD- or MS-compatible name lister.
19398 NM=$lt_NM
19399
19400 # Whether we need soft or hard links.
19401 LN_S=$lt_LN_S
19402
19403 # What is the maximum length of a command?
19404 max_cmd_len=$max_cmd_len
19405
19406 # Object file suffix (normally "o").
19407 objext=$ac_objext
19408
19409 # Executable file suffix (normally "").
19410 exeext=$exeext
19411
19412 # whether the shell understands "unset".
19413 lt_unset=$lt_unset
19414
19415 # turn spaces into newlines.
19416 SP2NL=$lt_lt_SP2NL
19417
19418 # turn newlines into spaces.
19419 NL2SP=$lt_lt_NL2SP
19420
19421 # convert \$build file names to \$host format.
19422 to_host_file_cmd=$lt_cv_to_host_file_cmd
19423
19424 # convert \$build files to toolchain format.
19425 to_tool_file_cmd=$lt_cv_to_tool_file_cmd
19426
19427 # An object symbol dumper.
19428 OBJDUMP=$lt_OBJDUMP
19429
19430 # Method to check whether dependent libraries are shared objects.
19431 deplibs_check_method=$lt_deplibs_check_method
19432
19433 # Command to use when deplibs_check_method = "file_magic".
19434 file_magic_cmd=$lt_file_magic_cmd
19435
19436 # How to find potential files when deplibs_check_method = "file_magic".
19437 file_magic_glob=$lt_file_magic_glob
19438
19439 # Find potential files using nocaseglob when deplibs_check_method = "file_magic".
19440 want_nocaseglob=$lt_want_nocaseglob
19441
19442 # DLL creation program.
19443 DLLTOOL=$lt_DLLTOOL
19444
19445 # Command to associate shared and link libraries.
19446 sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
19447
19448 # The archiver.
19449 AR=$lt_AR
19450
19451 # Flags to create an archive.
19452 AR_FLAGS=$lt_AR_FLAGS
19453
19454 # How to feed a file listing to the archiver.
19455 archiver_list_spec=$lt_archiver_list_spec
19456
19457 # A symbol stripping program.
19458 STRIP=$lt_STRIP
19459
19460 # Commands used to install an old-style archive.
19461 RANLIB=$lt_RANLIB
19462 old_postinstall_cmds=$lt_old_postinstall_cmds
19463 old_postuninstall_cmds=$lt_old_postuninstall_cmds
19464
19465 # Whether to use a lock for old archive extraction.
19466 lock_old_archive_extraction=$lock_old_archive_extraction
19467
19468 # A C compiler.
19469 LTCC=$lt_CC
19470
19471 # LTCC compiler flags.
19472 LTCFLAGS=$lt_CFLAGS
19473
19474 # Take the output of nm and produce a listing of raw symbols and C names.
19475 global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
19476
19477 # Transform the output of nm in a proper C declaration.
19478 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
19479
19480 # Transform the output of nm into a list of symbols to manually relocate.
19481 global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
19482
19483 # Transform the output of nm in a C name address pair.
19484 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
19485
19486 # Transform the output of nm in a C name address pair when lib prefix is needed.
19487 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
19488
19489 # The name lister interface.
19490 nm_interface=$lt_lt_cv_nm_interface
19491
19492 # Specify filename containing input files for \$NM.
19493 nm_file_list_spec=$lt_nm_file_list_spec
19494
19495 # The root where to search for dependent libraries,and where our libraries should be installed.
19496 lt_sysroot=$lt_sysroot
19497
19498 # Command to truncate a binary pipe.
19499 lt_truncate_bin=$lt_lt_cv_truncate_bin
19500
19501 # The name of the directory that contains temporary libtool files.
19502 objdir=$objdir
19503
19504 # Used to examine libraries when file_magic_cmd begins with "file".
19505 MAGIC_CMD=$MAGIC_CMD
19506
19507 # Must we lock files when doing compilation?
19508 need_locks=$lt_need_locks
19509
19510 # Manifest tool.
19511 MANIFEST_TOOL=$lt_MANIFEST_TOOL
19512
19513 # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
19514 DSYMUTIL=$lt_DSYMUTIL
19515
19516 # Tool to change global to local symbols on Mac OS X.
19517 NMEDIT=$lt_NMEDIT
19518
19519 # Tool to manipulate fat objects and archives on Mac OS X.
19520 LIPO=$lt_LIPO
19521
19522 # ldd/readelf like tool for Mach-O binaries on Mac OS X.
19523 OTOOL=$lt_OTOOL
19524
19525 # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
19526 OTOOL64=$lt_OTOOL64
19527
19528 # Old archive suffix (normally "a").
19529 libext=$libext
19530
19531 # Shared library suffix (normally ".so").
19532 shrext_cmds=$lt_shrext_cmds
19533
19534 # The commands to extract the exported symbol list from a shared archive.
19535 extract_expsyms_cmds=$lt_extract_expsyms_cmds
19536
19537 # Variables whose values should be saved in libtool wrapper scripts and
19538 # restored at link time.
19539 variables_saved_for_relink=$lt_variables_saved_for_relink
19540
19541 # Do we need the "lib" prefix for modules?
19542 need_lib_prefix=$need_lib_prefix
19543
19544 # Do we need a version for libraries?
19545 need_version=$need_version
19546
19547 # Library versioning type.
19548 version_type=$version_type
19549
19550 # Shared library runtime path variable.
19551 runpath_var=$runpath_var
19552
19553 # Shared library path variable.
19554 shlibpath_var=$shlibpath_var
19555
19556 # Is shlibpath searched before the hard-coded library search path?
19557 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
19558
19559 # Format of library name prefix.
19560 libname_spec=$lt_libname_spec
19561
19562 # List of archive names. First name is the real one, the rest are links.
19563 # The last name is the one that the linker finds with -lNAME
19564 library_names_spec=$lt_library_names_spec
19565
19566 # The coded name of the library, if different from the real name.
19567 soname_spec=$lt_soname_spec
19568
19569 # Permission mode override for installation of shared libraries.
19570 install_override_mode=$lt_install_override_mode
19571
19572 # Command to use after installation of a shared archive.
19573 postinstall_cmds=$lt_postinstall_cmds
19574
19575 # Command to use after uninstallation of a shared archive.
19576 postuninstall_cmds=$lt_postuninstall_cmds
19577
19578 # Commands used to finish a libtool library installation in a directory.
19579 finish_cmds=$lt_finish_cmds
19580
19581 # As "finish_cmds", except a single script fragment to be evaled but
19582 # not shown.
19583 finish_eval=$lt_finish_eval
19584
19585 # Whether we should hardcode library paths into libraries.
19586 hardcode_into_libs=$hardcode_into_libs
19587
19588 # Compile-time system search path for libraries.
19589 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
19590
19591 # Detected run-time system search path for libraries.
19592 sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
19593
19594 # Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
19595 configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
19596
19597 # Whether dlopen is supported.
19598 dlopen_support=$enable_dlopen
19599
19600 # Whether dlopen of programs is supported.
19601 dlopen_self=$enable_dlopen_self
19602
19603 # Whether dlopen of statically linked programs is supported.
19604 dlopen_self_static=$enable_dlopen_self_static
19605
19606 # Commands to strip libraries.
19607 old_striplib=$lt_old_striplib
19608 striplib=$lt_striplib
19609
19610
19611 # The linker used to build libraries.
19612 LD=$lt_LD
19613
19614 # How to create reloadable object files.
19615 reload_flag=$lt_reload_flag
19616 reload_cmds=$lt_reload_cmds
19617
19618 # Commands used to build an old-style archive.
19619 old_archive_cmds=$lt_old_archive_cmds
19620
19621 # A language specific compiler.
19622 CC=$lt_compiler
19623
19624 # Is the compiler the GNU compiler?
19625 with_gcc=$GCC
19626
19627 # Compiler flag to turn off builtin functions.
19628 no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
19629
19630 # Additional compiler flags for building library objects.
19631 pic_flag=$lt_lt_prog_compiler_pic
19632
19633 # How to pass a linker flag through the compiler.
19634 wl=$lt_lt_prog_compiler_wl
19635
19636 # Compiler flag to prevent dynamic linking.
19637 link_static_flag=$lt_lt_prog_compiler_static
19638
19639 # Does compiler simultaneously support -c and -o options?
19640 compiler_c_o=$lt_lt_cv_prog_compiler_c_o
19641
19642 # Whether or not to add -lc for building shared libraries.
19643 build_libtool_need_lc=$archive_cmds_need_lc
19644
19645 # Whether or not to disallow shared libs when runtime libs are static.
19646 allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
19647
19648 # Compiler flag to allow reflexive dlopens.
19649 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
19650
19651 # Compiler flag to generate shared objects directly from archives.
19652 whole_archive_flag_spec=$lt_whole_archive_flag_spec
19653
19654 # Whether the compiler copes with passing no objects directly.
19655 compiler_needs_object=$lt_compiler_needs_object
19656
19657 # Create an old-style archive from a shared archive.
19658 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
19659
19660 # Create a temporary old-style archive to link instead of a shared archive.
19661 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
19662
19663 # Commands used to build a shared archive.
19664 archive_cmds=$lt_archive_cmds
19665 archive_expsym_cmds=$lt_archive_expsym_cmds
19666
19667 # Commands used to build a loadable module if different from building
19668 # a shared archive.
19669 module_cmds=$lt_module_cmds
19670 module_expsym_cmds=$lt_module_expsym_cmds
19671
19672 # Whether we are building with GNU ld or not.
19673 with_gnu_ld=$lt_with_gnu_ld
19674
19675 # Flag that allows shared libraries with undefined symbols to be built.
19676 allow_undefined_flag=$lt_allow_undefined_flag
19677
19678 # Flag that enforces no undefined symbols.
19679 no_undefined_flag=$lt_no_undefined_flag
19680
19681 # Flag to hardcode \$libdir into a binary during linking.
19682 # This must work even if \$libdir does not exist
19683 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
19684
19685 # Whether we need a single "-rpath" flag with a separated argument.
19686 hardcode_libdir_separator=$lt_hardcode_libdir_separator
19687
19688 # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
19689 # DIR into the resulting binary.
19690 hardcode_direct=$hardcode_direct
19691
19692 # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
19693 # DIR into the resulting binary and the resulting library dependency is
19694 # "absolute",i.e impossible to change by setting \$shlibpath_var if the
19695 # library is relocated.
19696 hardcode_direct_absolute=$hardcode_direct_absolute
19697
19698 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
19699 # into the resulting binary.
19700 hardcode_minus_L=$hardcode_minus_L
19701
19702 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
19703 # into the resulting binary.
19704 hardcode_shlibpath_var=$hardcode_shlibpath_var
19705
19706 # Set to "yes" if building a shared library automatically hardcodes DIR
19707 # into the library and all subsequent libraries and executables linked
19708 # against it.
19709 hardcode_automatic=$hardcode_automatic
19710
19711 # Set to yes if linker adds runtime paths of dependent libraries
19712 # to runtime path list.
19713 inherit_rpath=$inherit_rpath
19714
19715 # Whether libtool must link a program against all its dependency libraries.
19716 link_all_deplibs=$link_all_deplibs
19717
19718 # Set to "yes" if exported symbols are required.
19719 always_export_symbols=$always_export_symbols
19720
19721 # The commands to list exported symbols.
19722 export_symbols_cmds=$lt_export_symbols_cmds
19723
19724 # Symbols that should not be listed in the preloaded symbols.
19725 exclude_expsyms=$lt_exclude_expsyms
19726
19727 # Symbols that must always be exported.
19728 include_expsyms=$lt_include_expsyms
19729
19730 # Commands necessary for linking programs (against libraries) with templates.
19731 prelink_cmds=$lt_prelink_cmds
19732
19733 # Commands necessary for finishing linking programs.
19734 postlink_cmds=$lt_postlink_cmds
19735
19736 # Specify filename containing input files.
19737 file_list_spec=$lt_file_list_spec
19738
19739 # How to hardcode a shared library path into an executable.
19740 hardcode_action=$hardcode_action
19741
19742 # ### END LIBTOOL CONFIG
19743
19744 _LT_EOF
19745
19746 cat <<'_LT_EOF' >> "$cfgfile"
19747
19748 # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
19749
19750 # func_munge_path_list VARIABLE PATH
19751 # -----------------------------------
19752 # VARIABLE is name of variable containing _space_ separated list of
19753 # directories to be munged by the contents of PATH, which is string
19754 # having a format:
19755 # "DIR[:DIR]:"
19756 # string "DIR[ DIR]" will be prepended to VARIABLE
19757 # ":DIR[:DIR]"
19758 # string "DIR[ DIR]" will be appended to VARIABLE
19759 # "DIRP[:DIRP]::[DIRA:]DIRA"
19760 # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
19761 # "DIRA[ DIRA]" will be appended to VARIABLE
19762 # "DIR[:DIR]"
19763 # VARIABLE will be replaced by "DIR[ DIR]"
19764 func_munge_path_list ()
19765 {
19766 case x$2 in
19767 x)
19768 ;;
19769 *:)
19770 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
19771 ;;
19772 x:*)
19773 eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
19774 ;;
19775 *::*)
19776 eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
19777 eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
19778 ;;
19779 *)
19780 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
19781 ;;
19782 esac
19783 }
19784
19785
19786 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
19787 func_cc_basename ()
19788 {
19789 for cc_temp in $*""; do
19790 case $cc_temp in
19791 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
19792 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
19793 \-*) ;;
19794 *) break;;
19795 esac
19796 done
19797 func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
19798 }
19799
19800
19801 # ### END FUNCTIONS SHARED WITH CONFIGURE
19802
19803 _LT_EOF
19804
19805 case $host_os in
19806 aix3*)
19807 cat <<\_LT_EOF >> "$cfgfile"
19808 # AIX sometimes has problems with the GCC collect2 program. For some
19809 # reason, if we set the COLLECT_NAMES environment variable, the problems
19810 # vanish in a puff of smoke.
19811 if test set != "${COLLECT_NAMES+set}"; then
19812 COLLECT_NAMES=
19813 export COLLECT_NAMES
19814 fi
19815 _LT_EOF
19816 ;;
19817 esac
19818
19819
19820 ltmain=$ac_aux_dir/ltmain.sh
19821
19822
19823 # We use sed instead of cat because bash on DJGPP gets confused if
19824 # if finds mixed CR/LF and LF-only lines. Since sed operates in
19825 # text mode, it properly converts lines to CR/LF. This bash problem
19826 # is reportedly fixed, but why not run on old versions too?
19827 sed '$q' "$ltmain" >> "$cfgfile" \
19828 || (rm -f "$cfgfile"; exit 1)
19829
19830 mv -f "$cfgfile" "$ofile" ||
19831 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
19832 chmod +x "$ofile"
19833
19834 ;;
19835 "disable-rpath":C)
19836 sed < libtool > libtool-2 \
19837 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_RPATH_SED__ "/'
19838 mv libtool-2 libtool
19839 chmod 755 libtool
19840 libtool="./libtool"
19841 ;;
19842
19843 esac
19844 done # for ac_tag
19845
19846
19847 as_fn_exit 0
19848 _ACEOF
19849 ac_clean_files=$ac_clean_files_save
19850
19851 test $ac_write_fail = 0 ||
19852 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
19853
19854
19855 # configure is writing to config.log, and then calls config.status.
19856 # config.status does its own redirection, appending to config.log.
19857 # Unfortunately, on DOS this fails, as config.log is still kept open
19858 # by configure, so config.status won't be able to write to it; its
19859 # output is simply discarded. So we exec the FD to /dev/null,
19860 # effectively closing config.log, so it can be properly (re)opened and
19861 # appended to by config.status. When coming back to configure, we
19862 # need to make the FD available again.
19863 if test "$no_create" != yes; then
19864 ac_cs_success=:
19865 ac_config_status_args=
19866 test "$silent" = yes &&
19867 ac_config_status_args="$ac_config_status_args --quiet"
19868 exec 5>/dev/null
19869 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
19870 exec 5>>config.log
19871 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19872 # would make configure fail if this is the last instruction.
19873 $ac_cs_success || as_fn_exit 1
19874 fi
19875 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
19876 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
19877 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
19878 fi
19879
+0
-1888
configure.ac less more
0 # -*- Autoconf -*-
1 # Process this file with autoconf to produce a configure script.
2 # known to work with autconf version: autoconf (GNU Autoconf) 2.69
3 #
4 # @configure_input@
5 #
6 # Copyright (c) 2013, Verisign, Inc., NLnet Labs
7 # All rights reserved.
8 #
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions are met:
11 # * Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # * Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in the
15 # documentation and/or other materials provided with the distribution.
16 # * Neither the names of the copyright holders nor the
17 # names of its contributors may be used to endorse or promote products
18 # derived from this software without specific prior written permission.
19 #
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 # DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
24 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31 AC_PREREQ([2.68])
32 AC_CONFIG_MACRO_DIRS([m4])
33 sinclude(./m4/acx_openssl.m4)
34 sinclude(./m4/acx_getaddrinfo.m4)
35 sinclude(./m4/ac_lib_nettle.m4)
36 sinclude(./m4/ax_check_compile_flag.m4)
37 sinclude(./m4/pkg.m4)
38
39 AC_INIT([getdns], [1.5.2], [team@getdnsapi.net], [getdns], [https://getdnsapi.net])
40
41 # Autoconf 2.70 will have set up runstatedir. 2.69 is frequently (Debian)
42 # patched to do the same, but frequently (MacOS) not. So add a with option
43 # for pid file location, and default it to runstatedir if present.
44 default_piddir=${runstatedir:-"${localstatedir}/run"}
45 AC_ARG_WITH([piddir],
46 [AS_HELP_STRING([--with-piddir=DIR],
47 [directory for pid files @<:@default=RUNSTATEDIR or LOCALSTATEDIR/run@:>@])],
48 [],
49 [with_piddir=${default_piddir}])
50 AC_SUBST([runstatedir], [$with_piddir])
51
52 # Don't forget to put a dash in front of the release candidate!!!
53 # That is how it is done with semantic versioning!
54 #
55 AC_SUBST(RELEASE_CANDIDATE, [])
56 AC_SUBST(STUBBY_RELEASE_CANDIDATE, [])
57
58 # Set current date from system if not set
59 AC_ARG_WITH([current-date],
60 [AS_HELP_STRING([--with-current-date]
61 [current date of the compilation, set to fixed date for reproducible builds @<:@default=system@:>@])],
62 [CURRENT_DATE="$with_current_date"],
63 [CURRENT_DATE="`date -u +%Y-%m-%dT%H:%M:%SZ`"])
64
65 AC_SUBST(GETDNS_VERSION, ["AC_PACKAGE_VERSION$RELEASE_CANDIDATE"])
66 AC_SUBST(GETDNS_NUMERIC_VERSION, [0x01050200])
67 AC_SUBST(API_VERSION, ["December 2015"])
68 AC_SUBST(API_NUMERIC_VERSION, [0x07df0c00])
69 GETDNS_COMPILATION_COMMENT="AC_PACKAGE_NAME $GETDNS_VERSION configured on $CURRENT_DATE for the $API_VERSION version of the API"
70
71 AC_DEFINE_UNQUOTED([STUBBY_PACKAGE], ["stubby"], [Stubby package])
72 AC_DEFINE_UNQUOTED([STUBBY_PACKAGE_STRING], ["0.2.6$STUBBY_RELEASE_CANDIDATE"], [Stubby package string])
73
74 # Library version
75 # ---------------
76 # current:revision:age
77 # (binary-api-number):(which-binary-api-version):(how-many-nrs-backwardscompat)
78 # if source code changes increment revision
79 # if any interfaces have been added/removed/changed since last update then
80 # increment current and set revision to 0
81 # if any interfaces have been added since the last public release then increment age
82 # if any interfaces have been removed or changed since the last public release then
83 # set age to 0
84 #
85 # getdns-0.1.4 had libversion 0:0:0
86 # getdns-0.1.5 had libversion 1:0:0
87 # getdns-0.1.6 had libversion 1:1:0
88 # getdns-0.1.7 had libversion 1:2:1 (but should have had 2:0:1)
89 # getdns-0.1.8 had libversion 1:3:0 (but should have had 2:1:1)
90 # getdns-0.2.0 had libversion 2:2:1
91 # getdns-0.3.0 had libversion 3:3:2
92 # getdns-0.3.1 had libversion 3:4:2
93 # getdns-0.3.2 had libversion 3:5:2
94 # getdns-0.3.3 had libversion 3:6:2
95 # getdns-0.5.0 had libversion 4:0:3
96 # getdns-0.5.1 had libversion 4:1:3 (but should have been getdns-0.6.0)
97 # getdns-0.9.0 had libversion 5:0:4
98 # getdns-1.0.0 had libversion 5:1:4
99 # getdns-1.1.0 had libversion 6:0:0
100 # getdns-1.1.1 had libversion 6:1:0
101 # getdns-1.1.2 had libversion 7:0:1
102 # getdns-1.1.3 had libversion 7:1:1
103 # getdns-1.2.0 had libversion 8:0:2
104 # getdns-1.2.1 had libversion 8:1:2
105 # getdns-1.3.0 had libversion 9:0:3
106 # getdns-1.4.0 had libversion 10:0:0
107 # getdns-1.4.1 had libversion 10:1:0
108 # getdns-1.4.2 had libversion 10:2:0
109 # getdns-1.5.0 had libversion 11:0:1
110 # getdns-1.5.1 had libversion 11:1:1
111 # getdns-1.5.2 has libversion 11:2:1
112 GETDNS_LIBVERSION=11:2:1
113
114 AC_SUBST(GETDNS_COMPILATION_COMMENT)
115 AC_SUBST(GETDNS_LIBVERSION)
116 AC_CONFIG_SRCDIR([src/getdns/getdns.h.in])
117 # AM_INIT_AUTOMAKE
118 # LT_INIT
119 AC_CONFIG_MACRO_DIR([m4])
120
121 AC_PROG_CC
122 AC_PROG_CPP
123
124 # Checks for programs.
125 HOSTOS="unix"
126 AC_CANONICAL_HOST
127 case "${host_os}" in
128 cygwin*|mingw*)
129 HOSTOS=windows
130 ;;
131 darwin*)
132 HOSTOS=macos
133 ;;
134 esac
135 AC_SUBST(HOSTOS)
136
137
138 CFLAGS="$CFLAGS"
139 WPEDANTICFLAG=""
140 WNOERRORFLAG=""
141 AC_PROG_CC_C99
142 AX_CHECK_COMPILE_FLAG([-xc99],[CFLAGS="$CFLAGS -xc99"],[],[])
143 AX_CHECK_COMPILE_FLAG([-Wall],[CFLAGS="$CFLAGS -Wall"],[],[])
144 AX_CHECK_COMPILE_FLAG([-Wextra],[CFLAGS="$CFLAGS -Wextra"],[],[])
145 AX_CHECK_COMPILE_FLAG([-Wpedantic],[WPEDANTICFLAG="-Wpedantic"],[],[])
146 AX_CHECK_COMPILE_FLAG([-Wno-error=unused-parameter],[WNOERRORFLAG="-Wno-error=unused-parameter"],[],[])
147 AX_CHECK_COMPILE_FLAG([-Wno-unused-parameter],[WNOERRORFLAG="$WNOERRORFLAG -Wno-unused-parameter"],[],[])
148 AC_SUBST(WPEDANTICFLAG)
149 AC_SUBST(WNOERRORFLAG)
150
151 case "$host_os" in
152 linux* ) CFLAGS="$CFLAGS -D_BSD_SOURCE -D_DEFAULT_SOURCE"
153 ;;
154 solaris* ) CFLAGS="$CFLAGS -D__EXTENSIONS__" # for strdup() from <string.h>
155 ;;
156 darwin* ) CFLAGS="$CFLAGS -D_DARWIN_C_SOURCE" # for strlcpy() from <string.h>
157 ;;
158 esac
159
160 # always use ./libtool unless override from commandline (libtool=mylibtool)
161 if test -z "$libtool"; then
162 libtool="`pwd`/libtool"
163 fi
164 AC_SUBST(libtool)
165 AC_PROG_LIBTOOL
166 AC_PROG_INSTALL
167
168
169 initial_LIBS="$LIBS"
170 initial_LDFLAGS="$LDFLAGS"
171
172 dnl Add option to disable the evil rpath. Check whether to use rpath or not.
173 dnl Adds the --disable-rpath option. Uses trick to edit the ./libtool.
174 AC_DEFUN([ACX_ARG_RPATH],
175 [
176 AC_ARG_ENABLE(rpath,
177 [ --disable-rpath disable hardcoded rpath (default=enabled)],
178 enable_rpath="$enableval", enable_rpath=yes)
179 if test "x$enable_rpath" = xno; then
180 dnl AC_MSG_RESULT([Fixing libtool for -rpath problems.])
181 AC_CONFIG_COMMANDS([disable-rpath], [
182 sed < libtool > libtool-2 \
183 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_RPATH_SED__ "/'
184 mv libtool-2 libtool
185 chmod 755 libtool
186 libtool="./libtool"
187 ])
188 fi
189 ])
190 ACX_ARG_RPATH
191
192 AC_ARG_ENABLE(debug-req, AC_HELP_STRING([--enable-debug-req], [Enable request debugging]))
193 AC_ARG_ENABLE(debug-sched, AC_HELP_STRING([--enable-debug-sched], [Enable scheduling debugging messages]))
194 AC_ARG_ENABLE(debug-stub, AC_HELP_STRING([--enable-debug-stub], [Enable stub debugging messages]))
195 AC_ARG_ENABLE(debug-daemon, AC_HELP_STRING([--enable-debug-daemon], [Enable daemon debugging messages]))
196 AC_ARG_ENABLE(debug-sec, AC_HELP_STRING([--enable-debug-sec], [Enable dnssec debugging messages]))
197 AC_ARG_ENABLE(debug-server, AC_HELP_STRING([--enable-debug-server], [Enable server debugging messages]))
198 AC_ARG_ENABLE(debug-anchor, AC_HELP_STRING([--enable-debug-anchor], [Enable anchor debugging messages]))
199 AC_ARG_ENABLE(all-debugging, AC_HELP_STRING([--enable-all-debugging], [Enable scheduling, stub and dnssec debugging]))
200 case "$enable_all_debugging" in
201 yes)
202 enable_debug_req=yes
203 enable_debug_sched=yes
204 enable_debug_stub=yes
205 enable_debug_daemon=yes
206 enable_debug_sec=yes
207 enable_debug_server=yes
208 enable_debug_anchor=yes
209 ;;
210 no|*)
211 ;;
212 esac
213 case "$enable_debug_req" in
214 yes)
215 AC_DEFINE_UNQUOTED([REQ_DEBUG], [1], [Define this to enable printing of request debugging messages.])
216 ;;
217 no|*)
218 ;;
219 esac
220 case "$enable_debug_sched" in
221 yes)
222 AC_DEFINE_UNQUOTED([SCHED_DEBUG], [1], [Define this to enable printing of scheduling debugging messages.])
223 ;;
224 no|*)
225 ;;
226 esac
227 case "$enable_debug_stub" in
228 yes)
229 AC_DEFINE_UNQUOTED([STUB_DEBUG], [1], [Define this to enable printing of stub debugging messages.])
230 ;;
231 no|*)
232 ;;
233 esac
234 case "$enable_debug_daemon" in
235 yes)
236 AC_DEFINE_UNQUOTED([DAEMON_DEBUG], [1], [Define this to enable printing of daemon debugging messages.])
237 ;;
238 no|*)
239 ;;
240 esac
241 case "$enable_debug_sec" in
242 yes)
243 AC_DEFINE_UNQUOTED([SEC_DEBUG], [1], [Define this to enable printing of dnssec debugging messages.])
244 ;;
245 no|*)
246 ;;
247 esac
248 case "$enable_debug_server" in
249 yes)
250 AC_DEFINE_UNQUOTED([SERVER_DEBUG], [1], [Define this enable printing of server debugging messages.])
251 ;;
252 no|*)
253 ;;
254 esac
255 case "$enable_debug_anchor" in
256 yes)
257 AC_DEFINE_UNQUOTED([ANCHOR_DEBUG], [1], [Define this enable printing of anchor debugging messages.])
258 ;;
259 no|*)
260 ;;
261 esac
262
263
264 dnl Hidden debugging options
265 dnl
266 AC_ARG_ENABLE(debug-keep-connections-open,[])
267 case "$enable_debug_keep_connections_open" in
268 yes)
269 AC_DEFINE_UNQUOTED([KEEP_CONNECTIONS_OPEN_DEBUG], [1], [Do not set this])
270 ;;
271 no)
272 ;;
273 esac
274
275
276 DEFAULT_EVENTLOOP=select_eventloop
277 AC_CHECK_HEADERS([signal.h sys/poll.h poll.h sys/resource.h sys/types.h sys/stat.h],,, [AC_INCLUDES_DEFAULT])
278 AC_ARG_ENABLE(poll-eventloop, AC_HELP_STRING([--disable-poll-eventloop], [Disable default eventloop based on poll (default=enabled if available)]))
279 case "$enable_poll_eventloop" in
280 no)
281 ;;
282 yes|*)
283 AC_MSG_CHECKING(for poll)
284 AC_LINK_IFELSE([AC_LANG_PROGRAM([
285 #ifdef HAVE_SYS_POLL_H
286 #include <sys/poll.h>
287 #else
288 #include <poll.h>
289 #endif
290 ], [int rc; rc = poll((struct pollfd *)(0), 0, 0);])], [
291 AC_MSG_RESULT(yes)
292 AC_DEFINE_UNQUOTED([USE_POLL_DEFAULT_EVENTLOOP], [1], [Define this to enable a default eventloop based on poll().])
293 DEFAULT_EVENTLOOP=poll_eventloop
294 ],[AC_MSG_RESULT(no)])
295 ;;
296 esac
297 AC_SUBST(DEFAULT_EVENTLOOP)
298
299 AC_ARG_ENABLE(tcp-fastopen, AC_HELP_STRING([--disable-tcp-fastopen], Disable TCP Fast Open (default=enabled if available)),
300 enable_tcp_fastopen="$enableval", enable_tcp_fastopen=yes)
301 if test "x$enable_tcp_fastopen" = xno; then
302 AC_MSG_WARN([TCP Fast Open is disabled])
303 else
304 case `uname` in
305 Darwin) AC_CHECK_DECL([CONNECT_RESUME_ON_READ_WRITE], [AC_DEFINE_UNQUOTED([USE_OSX_TCP_FASTOPEN], [1], [Define this to enable TCP fast open.])],
306 [AC_MSG_WARN([TCP Fast Open is not available, continuing without])], [#include <sys/socket.h>])
307 ;;
308 *)
309 AC_CHECK_HEADERS([sys/socket.h netinet/tcp.h],,, [AC_INCLUDES_DEFAULT])
310 AC_CHECK_DECL([TCP_FASTOPEN], [
311 AC_DEFINE_UNQUOTED([USE_TCP_FASTOPEN], [1], [Define this to enable TCP fast open.])
312 AC_CHECK_DECLS([TCP_FASTOPEN,MSG_FASTOPEN,TCP_FASTOPEN_CONNECT], [], [], [AC_INCLUDES_DEFAULT
313 #ifdef HAVE_SYS_SOCKET_H
314 # include <sys/socket.h>
315 #endif
316 #ifdef HAVE_NETINET_TCP_H
317 # include <netinet/tcp.h>
318 #endif
319 ])
320 ], [
321 AC_MSG_WARN([TCP Fast Open is not available, continuing without])
322 ], [AC_INCLUDES_DEFAULT
323 #ifdef HAVE_SYS_SOCKET_H
324 # include <sys/socket.h>
325 #endif
326 #ifdef HAVE_NETINET_TCP_H
327 # include <netinet/tcp.h>
328 #endif
329 ])
330 ;;
331 esac
332 fi
333
334 AC_ARG_ENABLE(native-stub-dnssec, AC_HELP_STRING([--disable-native-stub-dnssec], [Disable native stub DNSSEC support]))
335 case "$enable_native_stub_dnssec" in
336 no)
337 ;;
338 yes|*)
339 AC_DEFINE_UNQUOTED([STUB_NATIVE_DNSSEC], [1], [Define this to enable native stub DNSSEC support.])
340 ;;
341 esac
342
343 # check wether strptime also works
344 AC_DEFUN([AC_CHECK_STRPTIME_WORKS],
345 [AC_REQUIRE([AC_PROG_CC])
346 AC_MSG_CHECKING(whether strptime works)
347 if test c${cross_compiling} = cno; then
348 AC_RUN_IFELSE([AC_LANG_SOURCE([[
349 #define _XOPEN_SOURCE 600
350 #include <time.h>
351 int main(void) { struct tm tm; char *res;
352 res = strptime("2010-07-15T00:00:00+00:00", "%t%Y%t-%t%m%t-%t%d%tT%t%H%t:%t%M%t:%t%S%t", &tm);
353 if (!res) return 2;
354 res = strptime("20070207111842", "%Y%m%d%H%M%S", &tm);
355 if (!res) return 1; return 0; }
356 ]])] , [eval "ac_cv_c_strptime_works=yes"], [eval "ac_cv_c_strptime_works=no"])
357 else
358 eval "ac_cv_c_strptime_works=maybe"
359 fi
360 AC_MSG_RESULT($ac_cv_c_strptime_works)
361 if test $ac_cv_c_strptime_works = no; then
362 AC_LIBOBJ(strptime)
363 else
364 AC_DEFINE_UNQUOTED([STRPTIME_WORKS], 1, [use default strptime.])
365 fi
366 ])dnl
367
368 AC_CHECK_FUNCS([strptime],[AC_CHECK_STRPTIME_WORKS],[AC_LIBOBJ([strptime])])
369
370 # search to set include and library paths right
371 # find libidn (no libidn on windows though)
372 AC_CHECK_HEADERS([windows.h winsock.h stdio.h winsock2.h ws2tcpip.h],,, [AC_INCLUDES_DEFAULT])
373 ACX_CHECK_GETADDRINFO_WITH_INCLUDES
374
375 AC_ARG_WITH(resolvconf, AS_HELP_STRING([--with-resolvconf=PATH],
376 [Set the resolver configuration file path. Defaults to /etc/resolv.conf or values retrieved via GetNetworkParams() on Windows]),
377 [], [withval="/etc/resolv.conf"])
378 AC_DEFINE_UNQUOTED([GETDNS_FN_RESOLVCONF], ["$withval"], [Path to resolver configuration file])
379
380 AC_ARG_WITH(hosts, AS_HELP_STRING([--with-hosts=PATH],
381 [Set the static table lookup for hostnames path. Defaults to /etc/hosts or C:\Windows\System32\Drivers\etc\hosts on Windows]),
382 [], [
383 if test "$USE_WINSOCK" = 1; then
384 withval="C:\\\\Windows\\\\System32\\\\Drivers\\\\etc\\\\hosts"
385 else
386 withval="/etc/hosts"
387 fi
388 ])
389 AC_DEFINE_UNQUOTED([GETDNS_FN_HOSTS], ["$withval"], [Path to static table lookup for hostnames])
390
391 AC_ARG_WITH(fd-setsize, AS_HELP_STRING([--with-fd-setsize=size],
392 [Set maximum file descriptor number that can be used by select]),
393 [], [withval="no"])
394 case "$withval" in
395 no)
396 ;;
397 *)
398 AC_DEFINE_UNQUOTED([FD_SETSIZE], [$withval], [Alternate value for the FD_SETSIZE])
399 my_enable_unbound_event_api=1
400 ;;
401 esac
402
403 AC_ARG_WITH(max-udp-backoff, AS_HELP_STRING([--with-max-udp-backoff=<number of queries>],
404 [Set the maximum number of messages that can be sent to other upstreams before the upstream which has previously timed out will be tried again. (defaults to 1000)]),, [withval="1000"])
405 AC_DEFINE_UNQUOTED([UDP_MAX_BACKOFF], [$withval], [Maximum number of queries an failed UDP upstream passes before it will retry])
406
407 #---- check for pthreads library
408 AC_ARG_WITH(libpthread, AS_HELP_STRING([--without-libpthread],
409 [Disable libpthread (default is autodetect)]),
410 [], [withval="yes"])
411
412 case "$withval" in
413 yes)
414 AC_SEARCH_LIBS([pthread_mutex_init],[pthread], [
415 AC_DEFINE([HAVE_PTHREAD], [1], [Have pthreads library])
416 LIBS="-lpthread $LIBS"
417 ], [AC_MSG_WARN([pthreads not available])])
418 ;;
419 *)
420 ;;
421 esac
422
423 USE_NSS="no"
424 dnl AC_ARG_WITH([nss], AC_HELP_STRING([--with-nss=path],
425 dnl [use libnss instead of openssl, installed at path.]),
426 dnl [
427 dnl USE_NSS="yes"
428 dnl AC_DEFINE(HAVE_NSS, 1, [Use libnss for crypto])
429 dnl if test "$withval" != "" -a "$withval" != "yes"; then
430 dnl CPPFLAGS="$CPPFLAGS -I$withval/include/nss3"
431 dnl LDFLAGS="$LDFLAGS -L$withval/lib"
432 dnl ACX_RUNTIME_PATH_ADD([$withval/lib])
433 dnl CPPFLAGS="-I$withval/include/nspr4 $CPPFLAGS"
434 dnl else
435 dnl CPPFLAGS="$CPPFLAGS -I/usr/include/nss3"
436 dnl CPPFLAGS="-I/usr/include/nspr4 $CPPFLAGS"
437 dnl fi
438 dnl LIBS="$LIBS -lnss3 -lnspr4"
439 dnl SSLLIB=""
440 dnl ]
441 dnl )
442
443 # libnettle
444 USE_NETTLE="no"
445 dnl AC_ARG_WITH([nettle], AC_HELP_STRING([--with-nettle=path],
446 dnl [use libnettle as crypto library, installed at path.]),
447 dnl [
448 dnl USE_NETTLE="yes"
449 dnl AC_DEFINE(HAVE_NETTLE, 1, [Use libnettle for crypto])
450 dnl AC_CHECK_HEADERS([nettle/dsa-compat.h],,, [AC_INCLUDES_DEFAULT])
451 dnl if test "$withval" != "" -a "$withval" != "yes"; then
452 dnl CPPFLAGS="$CPPFLAGS -I$withval/include/nettle"
453 dnl LDFLAGS="$LDFLAGS -L$withval/lib"
454 dnl ACX_RUNTIME_PATH_ADD([$withval/lib])
455 dnl else
456 dnl CPPFLAGS="$CPPFLAGS -I/usr/include/nettle"
457 dnl fi
458 dnl LIBS="$LIBS -lhogweed -lnettle -lgmp"
459 dnl SSLLIB=""
460 dnl ]
461 dnl )
462
463 # Which TLS and crypto libs to use.
464 AC_ARG_WITH([gnutls],
465 [AS_HELP_STRING([--with-gnutls],
466 [use GnuTLS instead of OpenSSL])],
467 [
468 PKG_CHECK_MODULES([libgnutls], [gnutls >= 3.5.0])
469 PKG_CHECK_MODULES([libgnutlsdane], [gnutls-dane >= 3.5.0])
470 LIBS="$libgnutls_LIBS $libgnutlsdane_LIBS $LIBS"
471 CFLAGS="$libgnutls_CFLAGS $libgnutlsdane_CFLAGS $CFLAGS"
472 AC_SUBST([TLSDIR], 'gnutls')
473 AC_DEFINE([USE_GNUTLS], [1], [Use the GnuTLS library])
474 if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
475
476 AX_LIB_NETTLE(yes)
477 USE_NETTLE="yes"
478 AC_DEFINE(HAVE_NETTLE, 1, [Use libnettle for crypto])
479 AC_CHECK_HEADERS([nettle/dsa-compat.h],,, [AC_INCLUDES_DEFAULT])
480 fi
481 # Zero configuration DNSSEC we still need libcrypto
482 AC_CHECK_HEADERS([openssl/x509.h],,, [AC_INCLUDES_DEFAULT])
483 AC_CHECK_LIB([crypto], [X509_STORE_new], [
484 AC_DEFINE_UNQUOTED([HAVE_LIBCRYPTO], [2], [Define to 1 if you have the `crypto' library (-lcrypto).]) dnl
485 LIBS="-lcrypto $LIBS"
486 ], [
487 AC_MSG_ERROR([libcrypto still needed for Zero configuration DNSSEC])
488 ])
489 ],
490 [
491 if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
492 ACX_WITH_SSL
493 fi
494 ACX_LIB_SSL
495 AC_SUBST([TLSDIR], 'openssl')
496
497 # Verify OpenSSL is at least version 1.0.2.
498 # We also check it's not LibreSSL, but that's a little later, not here.
499 AC_CHECK_FUNCS([X509_check_host SSL_dane_enable])
500 if test "x$ac_cv_func_X509_check_host" != xyes; then
501 AC_MSG_ERROR([getdns requires OpenSSL version 1.0.2 or later])
502 fi
503
504 AC_MSG_CHECKING([whether we need to compile/link DANE support])
505 DANESSL_XTRA_OBJS=""
506 if test "x$ac_cv_func_SSL_dane_enable" = xyes; then
507 AC_MSG_RESULT([no])
508 else
509 AC_MSG_RESULT([yes])
510 AC_DEFINE([USE_DANESSL], [1], [Define this to use DANE functions from the ssl_dane/danessl library.])
511 DANESSL_XTRA_OBJS="danessl.lo"
512 fi
513 AC_SUBST(DANESSL_XTRA_OBJS)
514 ])
515
516
517 # openssl
518 if test $USE_NSS = "no" -a $USE_NETTLE = "no" ; then
519 AC_MSG_CHECKING([for LibreSSL])
520 if grep VERSION_TEXT $ssldir/include/openssl/opensslv.h | grep "LibreSSL" >/dev/null; then
521 AC_MSG_RESULT([yes])
522 AC_MSG_ERROR([getdns does not support LibreSSL])
523 else
524 AC_MSG_RESULT([no])
525 fi
526 AC_CHECK_HEADERS([openssl/conf.h openssl/ssl.h],,, [AC_INCLUDES_DEFAULT])
527 AC_CHECK_HEADERS([openssl/engine.h],,, [AC_INCLUDES_DEFAULT])
528 AC_CHECK_HEADERS([openssl/bn.h openssl/rsa.h openssl/dsa.h],,, [AC_INCLUDES_DEFAULT])
529 AC_CHECK_FUNCS([OPENSSL_config EVP_md5 EVP_sha1 EVP_sha224 EVP_sha256 EVP_sha384 EVP_sha512 FIPS_mode ENGINE_load_cryptodev EVP_PKEY_keygen ECDSA_SIG_get0 EVP_MD_CTX_new EVP_PKEY_base_id HMAC_CTX_new HMAC_CTX_free TLS_client_method DSA_SIG_set0 EVP_dss1 EVP_DigestVerify OpenSSL_version_num OpenSSL_version SSL_CTX_dane_enable SSL_dane_enable SSL_dane_tlsa_add X509_check_host X509_get_notAfter X509_get0_notAfter SSL_CTX_set_ciphersuites SSL_set_ciphersuites OPENSSL_init_crypto DSA_set0_pqg DSA_set0_key RSA_set0_key])
530 AC_CHECK_DECLS([SSL_COMP_get_compression_methods,sk_SSL_COMP_pop_free,SSL_CTX_set_ecdh_auto,SSL_CTX_set1_curves_list,SSL_set1_curves_list,SSL_set_min_proto_version,SSL_get_min_proto_version], [], [], [
531 AC_INCLUDES_DEFAULT
532 #ifdef HAVE_OPENSSL_ERR_H
533 #include <openssl/err.h>
534 #endif
535
536 #ifdef HAVE_OPENSSL_RAND_H
537 #include <openssl/rand.h>
538 #endif
539
540 #ifdef HAVE_OPENSSL_CONF_H
541 #include <openssl/conf.h>
542 #endif
543
544 #ifdef HAVE_OPENSSL_ENGINE_H
545 #include <openssl/engine.h>
546 #endif
547 #include <openssl/ssl.h>
548 #include <openssl/evp.h>
549 ])
550 fi
551
552 AC_ARG_ENABLE(sha1, AC_HELP_STRING([--disable-sha1], [Disable SHA1 RRSIG support, does not disable nsec3 support]))
553 case "$enable_sha1" in
554 no)
555 ;;
556 yes|*)
557 AC_DEFINE([USE_SHA1], [1], [Define this to enable SHA1 support.])
558 ;;
559 esac
560
561 AC_ARG_ENABLE(sha2, AC_HELP_STRING([--disable-sha2], [Disable SHA256 and SHA512 RRSIG support]))
562 case "$enable_sha2" in
563 no)
564 ;;
565 yes|*)
566 AC_DEFINE([USE_SHA2], [1], [Define this to enable SHA256 and SHA512 support.])
567 ;;
568 esac
569
570 # check wether gost also works
571 AC_DEFUN([AC_CHECK_GOST_WORKS],
572 [AC_REQUIRE([AC_PROG_CC])
573 AC_MSG_CHECKING([if GOST works])
574 if test c${cross_compiling} = cno; then
575 BAKCFLAGS="$CFLAGS"
576 if test -n "$ssldir"; then
577 CFLAGS="$CFLAGS -Wl,-rpath,$ssldir/lib"
578 fi
579 AC_RUN_IFELSE([AC_LANG_SOURCE([[
580 #include <string.h>
581 #include <openssl/ssl.h>
582 #include <openssl/evp.h>
583 #include <openssl/engine.h>
584 #include <openssl/conf.h>
585 /* routine to load gost (from gldns) */
586 int load_gost_id(void)
587 {
588 static int gost_id = 0;
589 const EVP_PKEY_ASN1_METHOD* meth;
590 ENGINE* e;
591
592 if(gost_id) return gost_id;
593
594 /* see if configuration loaded gost implementation from other engine*/
595 meth = EVP_PKEY_asn1_find_str(NULL, "gost2001", -1);
596 if(meth) {
597 EVP_PKEY_asn1_get0_info(&gost_id, NULL, NULL, NULL, NULL, meth);
598 return gost_id;
599 }
600
601 /* see if engine can be loaded already */
602 e = ENGINE_by_id("gost");
603 if(!e) {
604 /* load it ourself, in case statically linked */
605 ENGINE_load_builtin_engines();
606 ENGINE_load_dynamic();
607 e = ENGINE_by_id("gost");
608 }
609 if(!e) {
610 /* no gost engine in openssl */
611 return 0;
612 }
613 if(!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
614 ENGINE_finish(e);
615 ENGINE_free(e);
616 return 0;
617 }
618
619 meth = EVP_PKEY_asn1_find_str(&e, "gost2001", -1);
620 if(!meth) {
621 /* algo not found */
622 ENGINE_finish(e);
623 ENGINE_free(e);
624 return 0;
625 }
626 EVP_PKEY_asn1_get0_info(&gost_id, NULL, NULL, NULL, NULL, meth);
627 return gost_id;
628 }
629 int main(void) {
630 EVP_MD_CTX* ctx;
631 const EVP_MD* md;
632 unsigned char digest[64]; /* its a 256-bit digest, so uses 32 bytes */
633 const char* str = "Hello world";
634 const unsigned char check[] = {
635 0x40 , 0xed , 0xf8 , 0x56 , 0x5a , 0xc5 , 0x36 , 0xe1 ,
636 0x33 , 0x7c , 0x7e , 0x87 , 0x62 , 0x1c , 0x42 , 0xe0 ,
637 0x17 , 0x1b , 0x5e , 0xce , 0xa8 , 0x46 , 0x65 , 0x4d ,
638 0x8d , 0x3e , 0x22 , 0x9b , 0xe1 , 0x30 , 0x19 , 0x9d
639 };
640 OPENSSL_config(NULL);
641 (void)load_gost_id();
642 md = EVP_get_digestbyname("md_gost94");
643 if(!md) return 1;
644 memset(digest, 0, sizeof(digest));
645 ctx = EVP_MD_CTX_create();
646 if(!ctx) return 2;
647 if(!EVP_DigestInit_ex(ctx, md, NULL)) return 3;
648 if(!EVP_DigestUpdate(ctx, str, 10)) return 4;
649 if(!EVP_DigestFinal_ex(ctx, digest, NULL)) return 5;
650 /* uncomment to see the hash calculated.
651 {int i;
652 for(i=0; i<32; i++)
653 printf(" %2.2x", (int)digest[i]);
654 printf("\n");}
655 */
656 if(memcmp(digest, check, sizeof(check)) != 0)
657 return 6;
658 return 0;
659 }
660 ]])] , [eval "ac_cv_c_gost_works=yes"], [eval "ac_cv_c_gost_works=no"])
661 CFLAGS="$BAKCFLAGS"
662 else
663 eval "ac_cv_c_gost_works=maybe"
664 fi
665 AC_MSG_RESULT($ac_cv_c_gost_works)
666 ])dnl
667
668 AC_ARG_ENABLE(gost, AC_HELP_STRING([--disable-gost], [Disable GOST support]))
669 use_gost="no"
670 if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
671 case "$enable_gost" in
672 no)
673 ;;
674 *)
675 AC_CHECK_FUNC(EVP_PKEY_set_type_str, [:],[AC_MSG_ERROR([OpenSSL 1.0.0 is needed for GOST support])])
676 AC_CHECK_FUNC(EC_KEY_new, [], [AC_MSG_ERROR([OpenSSL does not support ECC, needed for GOST support])])
677 AC_CHECK_GOST_WORKS
678 if test "$ac_cv_c_gost_works" != no; then
679 use_gost="yes"
680 AC_DEFINE([USE_GOST], [1], [Define this to enable GOST support.])
681 fi
682 ;;
683 esac
684 fi dnl !USE_NSS && !USE_NETTLE
685
686 AC_ARG_ENABLE(ecdsa, AC_HELP_STRING([--disable-ecdsa], [Disable ECDSA support]))
687 use_ecdsa="no"
688 case "$enable_ecdsa" in
689 no)
690 ;;
691 *)
692 if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
693 AC_CHECK_FUNC(ECDSA_sign, [], [AC_MSG_ERROR([OpenSSL does not support ECDSA: please upgrade or rerun with --disable-ecdsa])])
694 AC_CHECK_FUNC(SHA384_Init, [], [AC_MSG_ERROR([OpenSSL does not support SHA384: please upgrade or rerun with --disable-ecdsa])])
695 AC_CHECK_DECLS([NID_X9_62_prime256v1, NID_secp384r1], [], [AC_MSG_ERROR([OpenSSL does not support the ECDSA curves: please upgrade or rerun with --disable-ecdsa])], [AC_INCLUDES_DEFAULT
696 #include <openssl/evp.h>
697 ])
698 # see if OPENSSL 1.0.0 or later (has EVP MD and Verify independency)
699 AC_MSG_CHECKING([if openssl supports SHA2 and ECDSA with EVP])
700 if grep OPENSSL_VERSION_TEXT $ssldir/include/openssl/opensslv.h | grep "OpenSSL" >/dev/null; then
701 if grep OPENSSL_VERSION_NUMBER $ssldir/include/openssl/opensslv.h | grep 0x0 >/dev/null; then
702 AC_MSG_RESULT([no])
703 AC_DEFINE_UNQUOTED([USE_ECDSA_EVP_WORKAROUND], [1], [Define this to enable an EVP workaround for older openssl])
704 else
705 AC_MSG_RESULT([yes])
706 fi
707 else
708 # not OpenSSL, thus likely LibreSSL, which supports it
709 AC_MSG_RESULT([yes])
710 fi
711 fi
712 # we now know we have ECDSA and the required curves.
713 AC_DEFINE_UNQUOTED([USE_ECDSA], [1], [Define this to enable ECDSA support.])
714 use_ecdsa="yes"
715 ;;
716 esac
717
718 AC_ARG_ENABLE(dsa, AC_HELP_STRING([--disable-dsa], [Disable DSA support]))
719 case "$enable_dsa" in
720 no)
721 ;;
722 *) dnl default
723 # detect if DSA is supported, and turn it off if not.
724 if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
725 AC_CHECK_FUNC(DSA_SIG_new, [
726 AC_CHECK_TYPE(DSA_SIG*, [
727 AC_DEFINE_UNQUOTED([USE_DSA], [1], [Define this to enable DSA support.])
728 ], [if test "x$enable_dsa" = "xyes"; then AC_MSG_ERROR([OpenSSL does not support DSA and you used --enable-dsa.])
729 fi ], [
730 AC_INCLUDES_DEFAULT
731 #ifdef HAVE_OPENSSL_ENGINE_H
732 # include <openssl/engine.h>
733 #endif
734
735 #ifdef HAVE_OPENSSL_RAND_H
736 #include <openssl/rand.h>
737 #endif
738
739 #ifdef HAVE_OPENSSL_CONF_H
740 #include <openssl/conf.h>
741 #endif
742
743 #ifdef HAVE_OPENSSL_ENGINE_H
744 #include <openssl/engine.h>
745 #endif
746 ])
747 ], [if test "x$enable_dsa" = "xyes"; then AC_MSG_ERROR([OpenSSL does not support DSA and you used --enable-dsa.])
748 fi ])
749 else
750 AC_DEFINE_UNQUOTED([USE_DSA], [1], [Define this to enable DSA support.])
751 fi
752 ;;
753 esac
754
755 AC_ARG_ENABLE(ed25519, AC_HELP_STRING([--disable-ed25519], [Disable ED25519 support]))
756 use_ed25519="no"
757 case "$enable_ed25519" in
758 no)
759 ;;
760 *)
761 if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
762 AC_CHECK_DECLS([NID_ED25519], [
763 use_ed25519="yes"
764 ], [ if test "x$enable_ed25519" = "xyes"; then AC_MSG_ERROR([OpenSSL does not support ED25519 and you used --enable-ed25519.])
765 fi ], [AC_INCLUDES_DEFAULT
766 #include <openssl/evp.h>
767 ])
768 fi
769 if test $USE_NETTLE = "yes"; then
770 AC_CHECK_HEADERS([nettle/eddsa.h], use_ed25519="yes",, [AC_INCLUDES_DEFAULT])
771 fi
772 if test $use_ed25519 = "yes"; then
773 AC_DEFINE_UNQUOTED([USE_ED25519], [1], [Define this to enable ED25519 support.])
774 fi
775 ;;
776 esac
777
778 AC_ARG_ENABLE(ed448, AC_HELP_STRING([--disable-ed448], [Disable ED448 support]))
779 use_ed448="no"
780 case "$enable_ed448" in
781 no)
782 ;;
783 *)
784 if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
785 AC_CHECK_DECLS([NID_ED448], [
786 use_ed448="yes"
787 ], [ if test "x$enable_ed448" = "xyes"; then AC_MSG_ERROR([OpenSSL does not support ED448 and you used --enable-ed448.])
788 fi ], [AC_INCLUDES_DEFAULT
789 #include <openssl/evp.h>
790 ])
791 fi
792 if test $use_ed448 = "yes"; then
793 AC_DEFINE_UNQUOTED([USE_ED448], [1], [Define this to enable ED448 support.])
794 fi
795 ;;
796 esac
797
798 AC_ARG_ENABLE(all-drafts, AC_HELP_STRING([--enable-all-drafts], [Enables the draft mdns client support]))
799 case "$enable_all_drafts" in
800 yes)
801 AC_DEFINE_UNQUOTED([HAVE_MDNS_SUPPORT], [1], [Define this to enable the draft mdns client support.])
802 ;;
803 no|*)
804 ;;
805 esac
806 AC_ARG_ENABLE(dnssec-roadblock-avoidance, AC_HELP_STRING([--disable-dnssec-roadblock-avoidance], [Disable dnssec roadblock avoidance]))
807 case "$enable_dnssec_roadblock_avoidance" in
808 no)
809 ;;
810 yes|*)
811 AC_DEFINE_UNQUOTED([DNSSEC_ROADBLOCK_AVOIDANCE], [1], [Define this to enable the experimental dnssec roadblock avoidance.])
812 ;;
813 esac
814
815 AC_ARG_ENABLE(edns-cookies, AC_HELP_STRING([--disable-edns-cookies], [Disable edns cookies]))
816 case "$enable_edns_cookies" in
817 no)
818 ;;
819 yes|*)
820 if test "x_$HAVE_SSL" != "x_yes" -a $USE_NETTLE = "no"; then
821 AC_MSG_ERROR([edns cookies needs crypto library which is not available, please rerun with --disable-edns-cookies])
822 fi
823 AC_DEFINE_UNQUOTED([EDNS_COOKIES], [1], [Define this to enable the experimental edns cookies.])
824 ;;
825 esac
826 AC_DEFINE_UNQUOTED([EDNS_COOKIE_OPCODE], [10], [The edns cookie option code.])
827 AC_DEFINE_UNQUOTED([EDNS_COOKIE_ROLLOVER_TIME], [(24 * 60 * 60)], [How often the edns client cookie is refreshed.])
828
829 AC_DEFINE_UNQUOTED([MAXIMUM_UPSTREAM_OPTION_SPACE], [3000], [limit for dynamically-generated DNS options])
830 AC_DEFINE_UNQUOTED([EDNS_PADDING_OPCODE], [12], [The edns padding option code.])
831
832 AC_ARG_ENABLE(draft-mdns-support, AC_HELP_STRING([--enable-draft-mdns-support], [Enable draft mdns client support]))
833 case "$enable_draft_mdns_support" in
834 yes)
835 AC_DEFINE_UNQUOTED([HAVE_MDNS_SUPPORT], [1], [Define this to enable the draft mdns client support.])
836 ;;
837 no|*)
838 ;;
839 esac
840
841 my_with_libunbound=1
842 AC_ARG_ENABLE(stub-only, AC_HELP_STRING([--enable-stub-only], [Restricts resolution modes to STUB (which will be the default mode). Removes the libunbound dependency.]))
843 case "$enable_stub_only" in
844 yes)
845 my_with_libunbound=0
846 ;;
847 no|*)
848 ;;
849 esac
850
851 my_with_yaml=0
852 AC_ARG_ENABLE(yaml-config,)
853 case "$enable_yaml_config" in
854 yes)
855 AC_DEFINE_UNQUOTED([USE_YAML_CONFIG], [1], [Define this to enable YAML config support.])
856 AC_DEFINE_UNQUOTED([HAVE_GETDNS_YAML2DICT], [1], [Define this to enable getdns_yaml2dict function.])
857
858 GETDNS_XTRA_OBJS="convert_yaml_to_json.lo"
859 my_with_yaml=1
860 ;;
861 no|*)
862 GETDNS_XTRA_OBJS=""
863 ;;
864 esac
865 AC_SUBST(GETDNS_XTRA_OBJS)
866
867 if test "$USE_WINSOCK" = 1; then
868 AC_MSG_NOTICE([ Building on Windows ... YES! ])
869 AC_DEFINE_UNQUOTED([GETDNS_ON_WINDOWS], [1], [Define this to enable Windows build.])
870 AC_DEFINE_UNQUOTED([STUB_NATIVE_DNSSEC], [1])
871 LIBS="$LIBS -lgdi32 -liphlpapi"
872 fi
873
874 dnl sigset_t or _sigset_t? MinGW is latter by default.
875 AC_CHECK_TYPES([sigset_t],
876 [],
877 [AC_CHECK_TYPES([_sigset_t],
878 [],
879 [AC_MSG_ERROR([Can't find type `sigset_t' or type `_sigset_t'])],
880 [AC_INCLUDES_DEFAULT
881 #ifdef HAVE_SIGNAL_H
882 #include <signal.h>
883 #endif
884 #ifdef HAVE_SYS_TYPES_H
885 #include <sys/types.h>
886 #endif
887 ])
888 ],
889 [AC_INCLUDES_DEFAULT
890 #ifdef HAVE_SIGNAL_H
891 #include <signal.h>
892 #endif
893 #ifdef HAVE_SYS_TYPES_H
894 #include <sys/types.h>
895 #endif
896 ])
897 AC_CHECK_FUNCS(sigemptyset sigfillset sigaddset)
898
899 my_with_libidn=1
900 AC_ARG_WITH(libidn, AS_HELP_STRING([--with-libidn=pathname],
901 [path to libidn (default: search /usr/local ..)]),
902 [], [withval="yes"])
903 if test x_$withval = x_yes; then
904 for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
905 if test -f "$dir/include/idna.h"; then
906 CFLAGS="$CFLAGS -I$dir/include"
907 LDFLAGS="$LDFLAGS -L$dir/lib"
908 AC_MSG_NOTICE([Found libidn in $dir])
909 break
910 fi
911 if test -f "$dir/include/idn/idna.h"; then
912 CFLAGS="$CFLAGS -I$dir/include/idn"
913 LDFLAGS="$LDFLAGS -L$dir/lib"
914 AC_MSG_NOTICE([Found libidn in $dir])
915 break
916 fi
917 done
918 if test -f "/usr/include/idn/idna.h"; then
919 CFLAGS="$CFLAGS -I/usr/include/idn"
920 #LDFLAGS="$LDFLAGS -L/usr/lib"
921 AC_MSG_NOTICE([Found libidn in /usr])
922 fi
923 else
924 if test x_$withval != x_no; then
925 CFLAGS="$CFLAGS -I$withval/include"
926 LDFLAGS="$LDFLAGS -L$withval/lib"
927 else
928 my_with_libidn=0
929 fi
930 fi
931
932 my_with_libidn2=1
933 AC_ARG_WITH(libidn2, AS_HELP_STRING([--with-libidn2=pathname],
934 [path to libidn2 (default: search /usr/local ..)]),
935 [], [withval="yes"])
936 if test x_$withval = x_yes; then
937 for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
938 if test -f "$dir/include/idn2.h"; then
939 CFLAGS="$CFLAGS -I$dir/include"
940 LDFLAGS="$LDFLAGS -L$dir/lib"
941 AC_MSG_NOTICE([Found libidn2 in $dir])
942 break
943 fi
944 if test -f "$dir/include/idn2/idn2.h"; then
945 CFLAGS="$CFLAGS -I$dir/include/idn2"
946 LDFLAGS="$LDFLAGS -L$dir/lib"
947 AC_MSG_NOTICE([Found libidn2 in $dir])
948 break
949 fi
950 done
951 if test -f "/usr/include/idn2/idn2.h"; then
952 CFLAGS="$CFLAGS -I/usr/include/idn2"
953 #LDFLAGS="$LDFLAGS -L/usr/lib"
954 AC_MSG_NOTICE([Found libidn2 in /usr])
955 fi
956 else
957 if test x_$withval != x_no; then
958 CFLAGS="$CFLAGS -I$withval/include"
959 LDFLAGS="$LDFLAGS -L$withval/lib"
960 else
961 my_with_libidn2=0
962 fi
963 fi
964
965 if test $my_with_libunbound = 1
966 then
967 # find libunbound
968 AC_ARG_WITH(libunbound, AS_HELP_STRING([--with-libunbound=pathname],
969 [path to libunbound (default: search /usr/local ..)]),
970 [], [withval="yes"])
971 if test x_$withval = x_yes; then
972 for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
973 if test -f "$dir/include/unbound.h"; then
974 CFLAGS="$CFLAGS -I$dir/include"
975 LDFLAGS="$LDFLAGS -L$dir/lib"
976 AC_MSG_NOTICE([Found libunbound in $dir])
977 break
978 fi
979 done
980 else
981 if test x_$withval != x_no; then
982 CFLAGS="$CFLAGS -I$withval/include"
983 LDFLAGS="$LDFLAGS -L$withval/lib"
984 else
985 AC_DEFINE_UNQUOTED([DISABLE_RESOLUTION_RECURSING], [1], [Define this to disable recursing resolution type.])
986 my_with_libunbound=0
987 fi
988 fi
989 fi
990
991 # Checks for libraries.
992 found_all_libs=1
993 MISSING_DEPS=""
994 MISSING_SEP=""
995
996 working_libidn2=0
997 if test $my_with_libidn2 = 1
998 then
999 AC_MSG_NOTICE([Checking for dependency libidn2])
1000 AC_CHECK_LIB([idn2], [idn2_to_unicode_8z8z], [
1001 working_libidn2=1
1002 LIBS="-lidn2 $LIBS"
1003 AC_DEFINE_UNQUOTED([HAVE_LIBIDN2], [1], [Define to 1 if you have the `idn2' library (-lidn).]) dnl `
1004 ], [
1005 MISSING_DEPS="${MISSING_DEPS}${MISSING_SEP}libidn2 (version 2.0.0 or higher)"
1006 MISSING_SEP=", "
1007 ])
1008 fi
1009 if test $working_libidn2 = 0
1010 then
1011 if test $my_with_libidn = 1
1012 then
1013 AC_MSG_NOTICE([Checking for dependency libidn])
1014 AC_CHECK_LIB([idn], [idna_to_ascii_8z], [], [
1015 MISSING_DEPS="${MISSING_DEPS}${MISSING_SEP}libidn"
1016 MISSING_SEP=", "
1017 found_all_libs=0
1018 ])
1019 else
1020 if test $my_with_libidn2 = 1
1021 then
1022 found_all_libs=0
1023 fi
1024 fi
1025 fi
1026
1027 AC_ARG_ENABLE(unbound-event-api, AC_HELP_STRING([--disable-unbound-event-api], [Disable usage of libunbounds event API]))
1028 case "$enable_unbound_event_api" in
1029 no)
1030 my_enable_unbound_event_api=0
1031 ;;
1032 yes|*)
1033 my_enable_unbound_event_api=1
1034 ;;
1035 esac
1036
1037
1038 if test $my_with_libunbound = 1
1039 then
1040 AC_CHECK_HEADERS([unbound-event.h],,, [AC_INCLUDES_DEFAULT])
1041 AC_MSG_NOTICE([Checking for dependency libunbound])
1042 AC_CHECK_LIB([unbound], [ub_fd], [
1043 AC_DEFINE_UNQUOTED([HAVE_LIBUNBOUND], [1], [Define to 1 if you have the `unbound' library (-lunbound).]) dnl `
1044 LIBS="-lunbound $LIBS"
1045
1046 if test $my_enable_unbound_event_api = 1
1047 then
1048 AC_CHECK_FUNC([ub_ctx_create_ub_event], [
1049 AC_DEFINE_UNQUOTED([HAVE_UNBOUND_EVENT_API], [1], [Define this when libunbound is compiled with the --enable-event-api option.])
1050 ])
1051 fi
1052 AC_CHECK_FUNCS([ub_ctx_set_stub])
1053 ], [
1054 MISSING_DEPS="${MISSING_DEPS}${MISSING_SEP}libunbound"
1055 MISSING_SEP=", "
1056 found_all_libs=0
1057 ])
1058 fi
1059
1060 AC_PATH_PROG([DOXYGEN], [doxygen])
1061 if test -z "$DOXYGEN";
1062 then AC_MSG_WARN([doxygen not found, continuing without])
1063 fi
1064
1065 # Checks for header files.
1066 AC_CHECK_HEADERS([inttypes.h netinet/in.h stdint.h stdlib.h string.h],,, [AC_INCLUDES_DEFAULT])
1067
1068 # Checks for typedefs, structures, and compiler characteristics.
1069 AC_TYPE_SIZE_T
1070 AC_TYPE_UINT16_T
1071 AC_TYPE_UINT32_T
1072 AC_TYPE_UINT64_T
1073 AC_TYPE_UINT8_T
1074 AC_CHECK_TYPES([u_char])
1075
1076 AC_CHECK_FUNCS([fcntl])
1077 # check ioctlsocket
1078 AC_MSG_CHECKING(for ioctlsocket)
1079 AC_LINK_IFELSE([AC_LANG_PROGRAM([
1080 #ifdef HAVE_WINSOCK2_H
1081 #include <winsock2.h>
1082 #endif
1083 ], [
1084 (void)ioctlsocket(0, 0, NULL);
1085 ])], [
1086 AC_MSG_RESULT(yes)
1087 AC_DEFINE(HAVE_IOCTLSOCKET, 1, [if the function 'ioctlsocket' is available])
1088 ],[AC_MSG_RESULT(no)])
1089
1090
1091 # Check for libraries for other things than libgetdns after this point,
1092 # so the getdns libraries can be reset with:
1093 #
1094 # LIBS="$getdns_LIBS"
1095 # LDFLAGS="$getdns_LDFLAGS"
1096 #
1097 # afterwards.
1098 getdns_LIBS="$LIBS"
1099 getdns_LDFLAGS="$LDFLAGS"
1100 getdns_CFLAGS="$CFLAGS"
1101
1102 #-------------------- libraries needed for libcheck
1103 LIBS="$initial_LIBS"
1104
1105 CHECK_GETDNS=""
1106 CHECK_LIBS=""
1107 CHECK_CFLAGS=""
1108
1109 PKG_CHECK_MODULES([CHECK],[check >= 0.9.6],[CHECK_GETDNS="check_getdns"],[
1110 AC_SEARCH_LIBS([floor], [m])
1111 AC_SEARCH_LIBS([timer_create], [rt])
1112 AC_SEARCH_LIBS([pthread_create], [pthread])
1113 AC_SEARCH_LIBS([srunner_create],[check check_pic],[
1114 CHECK_GETDNS="check_getdns"
1115 CHECK_LIBS="$LIBS"],[
1116 AC_SUBST(NOLIBCHECK, [nolibcheck])
1117 AC_MSG_WARN([libcheck not found or usable; unit tests will not be compiled and run])])])
1118
1119 LIBS="$getdns_LIBS"
1120
1121 AC_SUBST([CHECK_GETDNS])
1122 AC_SUBST([CHECK_LIBS])
1123 AC_SUBST([CHECK_CFLAGS])
1124 # end libraries needed for libcheck
1125
1126 #-------------------- libevent extension
1127 AC_ARG_WITH([libevent],
1128 [AS_HELP_STRING([--with-libevent], [path to libevent (default: search /usr/local ..)])],
1129 [with_libevent=search],
1130 [withval=no])
1131
1132 # libevent 1.x requires a u_char typedef which is not always available
1133 # on some systems so our check is a little complicated
1134 # we further need to ensure that this is included in the getdns headers
1135 # that get installed later so some users may not be building in an
1136 # environment that has the generated config.h SO we need to generate
1137 # this one extra header in that case
1138
1139 have_libevent=0
1140 EXTENSION_LIBEVENT_EXT_LIBS=""
1141 EXTENSION_LIBEVENT_LIB=""
1142 EXTENSION_LIBEVENT_LDFLAGS=""
1143 CHECK_EVENT_PROG=""
1144 AS_IF([test x_$withval = x_no],
1145 [],
1146 [AS_IF([test x_$withval = x_yes],
1147 [AC_SEARCH_LIBS([event_loop],
1148 [event_core event],
1149 [AC_CHECK_FUNCS([event_base_new event_base_free])]
1150 [AC_CHECK_HEADERS([event2/event.h],
1151 [have_libevent=1]
1152 [AS_IF([test "x_$ac_cv_search_event_loop" = "x_none required"],[],[EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop"])],
1153 [AC_CHECK_HEADERS([event.h],
1154 [have_libevent=1]
1155 [AS_IF([test "x_$ac_cv_search_event_loop" = "x_none required"],[],[EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop"])],
1156 [AC_MSG_ERROR([event2/event.h and event.h missing, try without libevent])]
1157 [have_libevent=0],
1158 [AC_INCLUDES_DEFAULT]
1159 [#ifndef HAVE_U_CHAR
1160 typedef unsigned char u_char;
1161 #endif])],
1162 [AC_INCLUDES_DEFAULT])],
1163 [AC_MSG_ERROR([libevent missing, try without libevent])]
1164 )],
1165 [have_libevent=1]
1166 [AC_MSG_NOTICE([assuming libevent in $withval])]
1167 [CFLAGS="$CFLAGS -I$withval/include"]
1168 [EXTENSION_LIBEVENT_LDFLAGS="-L$withval/lib"]
1169 [EXTENSION_LIBEVENT_EXT_LIBS="-levent"])]
1170 )
1171
1172 AS_IF([test x_$have_libevent = x_1],
1173 [EXTENSION_LIBEVENT_LIB="libgetdns_ext_event.la"]
1174 [CHECK_EVENT_PROG=check_getdns_event]
1175 # libunbound version 1.4.22 and older, not linked against libevent, on FreeBSD,
1176 # =============================================================================
1177 # cannot be linked against a program that also links libevent, because of
1178 # symbol clash. Libunbound has a libevent clone (called mini_event) build when
1179 # not linked against libevent that uses the same symbols as libevent.
1180
1181 # First detect if the libevent symbols are visible when linking with libunbound
1182 [LIBS="$getdns_LIBS"]
1183 [LDFLAGS="$getdns_LDFLAGS"]
1184 [AC_MSG_CHECKING([if event_get_version symbol is leaking from libunbound])]
1185 [AC_LANG_PUSH(C)]
1186 AC_LINK_IFELSE(
1187 [AC_LANG_PROGRAM(
1188 [[const char *event_get_version(void);]],
1189 [[const char *v = event_get_version();]])
1190 ],[[AC_MSG_RESULT([yes])]
1191 [AC_MSG_CHECKING([if libunbound is linked against libevent])]
1192 AC_RUN_IFELSE(
1193 [AC_LANG_PROGRAM(
1194 [[const char *event_get_version(void);]],
1195 [[const char *v = event_get_version();]
1196 [return v@<:@0@:>@ == 'm' && v@<:@1@:>@ == 'i' &&
1197 v@<:@2@:>@ == 'n' && v@<:@3@:>@ == 'i' ? 1 : 0;]])
1198 ],[[AC_MSG_RESULT([yes])]
1199 ],[[AC_MSG_RESULT([no])]
1200 [AC_MSG_FAILURE([
1201 ***
1202 *** On this system, when using libevent, libunbound must
1203 *** also have been compiled with libevent. Please recompile
1204 *** libunbound with libevent, or configure --without-libevent.
1205 ***])]
1206 ]
1207 )
1208 ],[[AC_MSG_RESULT([no])]
1209 ]
1210 )
1211 [AC_LANG_POP(C)])
1212
1213 AC_SUBST(have_libevent)
1214 AC_SUBST(EXTENSION_LIBEVENT_LIB)
1215 AC_SUBST(EXTENSION_LIBEVENT_EXT_LIBS)
1216 AC_SUBST(EXTENSION_LIBEVENT_LDFLAGS)
1217 AS_IF([test "x$have_libcheck" = x1], [AC_SUBST(CHECK_EVENT_PROG)])
1218
1219 LIBS="$getdns_LIBS"
1220 LDFLAGS="$getdns_LDFLAGS"
1221 # end libevent extension
1222
1223 #-------------------- libuv extension
1224 # if user says nothing about libuv, or specifies --with-libuv=no or --without-libuv
1225 # then we do not want libuv extensions built
1226 # if user specifies --with-libuv then search for it
1227 # if user specifies --with-libuv=/path then check the lib at that path
1228 AC_ARG_WITH([libuv],
1229 [AS_HELP_STRING([--with-libuv], [path to libuv (default: search /usr/local ..)])],
1230 [with_libuv=search],
1231 [withval=no])
1232
1233 have_libuv=0
1234 EXTENSION_LIBUV_EXT_LIBS=""
1235 EXTENSION_LIBUV_LIB=""
1236 EXTENSION_LIBUV_LDFLAGS=""
1237 CHECK_UV_PROG=""
1238 AS_IF([test x_$withval = x_no],
1239 [],
1240 [AS_IF([test x_$withval = x_yes],
1241 [AC_SEARCH_LIBS([uv_run],
1242 [uv],
1243 [AC_CHECK_HEADERS([uv.h],
1244 [have_libuv=1]
1245 [EXTENSION_LIBUV_EXT_LIBS="$ac_cv_search_uv_run"],
1246 [AC_MSG_ERROR([uv.h missing, try without libuv])]
1247 [have_libuv=0],
1248 [AC_INCLUDES_DEFAULT])],
1249 [AC_MSG_ERROR([libuv missing, try without libuv])]
1250 )],
1251 [have_libuv=1]
1252 [AC_MSG_NOTICE([assuming libuv in $withval])]
1253 [CFLAGS="$CFLAGS -I$withval/include"]
1254 [EXTENSION_LIBUV_LDFLAGS="-L$withval/lib"]
1255 [EXTENSION_LIBUV_EXT_LIBS="-luv"])]
1256 )
1257
1258 AS_IF([test x_$have_libuv = x_1],
1259 [EXTENSION_LIBUV_LIB="libgetdns_ext_uv.la"]
1260 [CHECK_UV_PROG=check_getdns_uv]
1261 [AC_MSG_CHECKING([for new signature of uv_timer_cb])
1262 AC_LANG_PUSH(C)
1263 AC_COMPILE_IFELSE(
1264 [AC_LANG_PROGRAM(
1265 [[#include <uv.h>]
1266 [void test_cb(uv_timer_t *handle);]],
1267 [[uv_timer_cb cb = test_cb;]
1268 [(*cb)(0);]])
1269 ],[AC_MSG_RESULT([yes])
1270 AC_DEFINE(HAVE_NEW_UV_TIMER_CB, [1], [Does libuv have the new uv_time_cb signature])
1271 ],[AC_MSG_RESULT([no])
1272 ])
1273 AC_LANG_POP(C)]
1274 )
1275
1276 AC_SUBST(have_libuv)
1277 AC_SUBST(EXTENSION_LIBUV_LIB)
1278 AC_SUBST(EXTENSION_LIBUV_EXT_LIBS)
1279 AC_SUBST(EXTENSION_LIBUV_LDFLAGS)
1280 AS_IF([test "x$have_libcheck" = x1], [AC_SUBST(CHECK_UV_PROG)])
1281
1282 LIBS="$getdns_LIBS"
1283 LDFLAGS="$getdns_LDFLAGS"
1284 # end libuv extension
1285
1286 #-------------------- libev extension
1287 AC_ARG_WITH([libev],
1288 [AS_HELP_STRING([--with-libev], [path to libev (default: search /usr/local ..)])],
1289 [with_libev=search],
1290 [withval=no])
1291
1292 have_libev=0
1293 EXTENSION_LIBEV_EXT_LIBS=""
1294 EXTENSION_LIBEV_LIB=""
1295 EXTENSION_LIBEV_LDFLAGS=""
1296 CHECK_EV_PROG=""
1297 AS_IF([test x_$withval = x_no],
1298 [],
1299 [AS_IF([test x_$withval = x_yes],
1300 [AC_SEARCH_LIBS([ev_run],
1301 [ev],
1302 [AC_CHECK_HEADERS([ev.h],
1303 [have_libev=1]
1304 [EXTENSION_LIBEV_EXT_LIBS="$ac_cv_search_ev_run"],
1305 [AC_CHECK_HEADERS([libev/ev.h],
1306 [have_libev=1]
1307 [EXTENSION_LIBEV_EXT_LIBS="$ac_cv_search_ev_run"],
1308 [AC_MSG_ERROR([ev.h missing, try without libev])]
1309 [have_libev=0],
1310 [AC_INCLUDES_DEFAULT])
1311 ],
1312 [AC_INCLUDES_DEFAULT])
1313 ],
1314 [AC_MSG_ERROR([libev missing, try without libev])]
1315 )],
1316 [have_libev=1]
1317 [AC_MSG_NOTICE([assuming libev in $withval])]
1318 [CFLAGS="$CFLAGS -I$withval/include"]
1319 [EXTENSION_LIBEV_LDFLAGS="-L$withval/lib"]
1320 [EXTENSION_LIBEV_EXT_LIBS="-lev"])]
1321 )
1322
1323 AS_IF([test x_$have_libev = x_1],
1324 [EXTENSION_LIBEV_LIB="libgetdns_ext_ev.la"]
1325 [CHECK_EV_PROG=check_getdns_ev])
1326
1327 AC_SUBST(have_libev)
1328 AC_SUBST(EXTENSION_LIBEV_LIB)
1329 AC_SUBST(EXTENSION_LIBEV_EXT_LIBS)
1330 AC_SUBST(EXTENSION_LIBEV_LDFLAGS)
1331 AS_IF([test "x$have_libcheck" = x1], [AC_SUBST(CHECK_EV_PROG)])
1332
1333 LIBS="$getdns_LIBS"
1334 LDFLAGS="$getdns_LDFLAGS"
1335 # end libev extension
1336
1337 # --with-trust-anchor=
1338 AC_DEFINE([SYSCONFDIR], [sysconfdir], [System configuration dir])
1339 AC_ARG_WITH(trust-anchor, AS_HELP_STRING([--with-trust-anchor=KEYFILE], [Default location of the trust anchor file. [default=SYSCONFDIR/unbound/getdns-root.key]]), [
1340 TRUST_ANCHOR_FILE="$withval"
1341 ],[
1342 if test "x$TRUST_ANCHOR_FILE" = "x"; then
1343 if test "x$sysconfdir" = 'x${prefix}/etc' ; then
1344 if test "x$prefix" = 'xNONE' ; then
1345 TRUST_ANCHOR_FILE="/etc/unbound/getdns-root.key"
1346 else
1347 TRUST_ANCHOR_FILE="${prefix}/etc/unbound/getdns-root.key"
1348 fi
1349 else
1350 TRUST_ANCHOR_FILE="${sysconfdir}/unbound/getdns-root.key"
1351 fi
1352 fi
1353 ])
1354 AC_DEFINE_UNQUOTED([TRUST_ANCHOR_FILE], ["$TRUST_ANCHOR_FILE"], [Default trust anchor file])
1355 AC_SUBST(TRUST_ANCHOR_FILE)
1356 AC_MSG_NOTICE([Default trust anchor: $TRUST_ANCHOR_FILE])
1357
1358 AC_ARG_WITH(getdns_query, AS_HELP_STRING([--without-getdns_query],
1359 [Do not compile and install the getdns_query tool]),
1360 [], [withval="yes"])
1361 if test x_$withval = x_no; then
1362 GETDNS_QUERY=""
1363 INSTALL_GETDNS_QUERY=""
1364 UNINSTALL_GETDNS_QUERY=""
1365 else
1366 GETDNS_QUERY="getdns_query"
1367 INSTALL_GETDNS_QUERY="install-getdns_query"
1368 UNINSTALL_GETDNS_QUERY="uninstall-getdns_query"
1369 fi
1370 AC_SUBST(GETDNS_QUERY)
1371 AC_SUBST(INSTALL_GETDNS_QUERY)
1372 AC_SUBST(UNINSTALL_GETDNS_QUERY)
1373
1374 AC_ARG_WITH(getdns_server_mon, AS_HELP_STRING([--without-getdns_server_mon],
1375 [Do not compile and install the getdns_server_mon tool]),
1376 [], [withval="yes"])
1377 if test x_$withval = x_no; then
1378 GETDNS_SERVER_MON=""
1379 INSTALL_GETDNS_SERVER_MON=""
1380 UNINSTALL_GETDNS_SERVER_MON=""
1381 else
1382 GETDNS_SERVER_MON="getdns_server_mon"
1383 INSTALL_GETDNS_SERVER_MON="install-getdns_server_mon"
1384 UNINSTALL_GETDNS_SERVER_MON="uninstall-getdns_server_mon"
1385 fi
1386 AC_SUBST(GETDNS_SERVER_MON)
1387 AC_SUBST(INSTALL_GETDNS_SERVER_MON)
1388 AC_SUBST(UNINSTALL_GETDNS_SERVER_MON)
1389
1390 stubby_with_yaml=0
1391 AC_ARG_WITH(stubby, AS_HELP_STRING([--with-stubby],
1392 [Compile and install stubby, the (stub) resolver daemon]),
1393 [], [withval="no"])
1394 if test x_$withval = x_yes; then
1395 STUBBY="stubby"
1396 INSTALL_STUBBY="install-stubby"
1397 UNINSTALL_STUBBY="uninstall-stubby"
1398 if test $my_with_yaml = 0
1399 then
1400 STUBBY_XTRA_OBJS="convert_yaml_to_json.lo gbuffer.lo"
1401 stubby_with_yaml=1
1402 my_with_yaml=1
1403 fi
1404 else
1405 STUBBY=""
1406 INSTALL_STUBBY=""
1407 UNINSTALL_STUBBY=""
1408 STUBBY_XTRA_OBJS=""
1409 fi
1410 AC_SUBST(STUBBY)
1411 AC_SUBST(INSTALL_STUBBY)
1412 AC_SUBST(UNINSTALL_STUBBY)
1413 AC_SUBST(STUBBY_XTRA_OBJS)
1414
1415 STUBBY_LIBS=""
1416 STUBBY_LDFLAGS=""
1417
1418 if test $my_with_yaml = 1
1419 then
1420 if test $stubby_with_yaml = 1
1421 then
1422 getdns_LIBS="$LIBS"
1423 getdns_LDFLAGS="$LDFLAGS"
1424 LIBS="$initial_LIBS"
1425 LDFLAGS="$initial_LDFLAGS"
1426 fi
1427 AC_ARG_WITH(libyaml, AS_HELP_STRING([--with-libyaml=pathname],
1428 [path to libyaml (default: search /usr/local ..)]),
1429 [], [withval="yes"])
1430 if test x_$withval = x_yes; then
1431 for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
1432 if test -f "$dir/include/yaml.h"; then
1433 CFLAGS="$CFLAGS -I$dir/include"
1434 LDFLAGS="$LDFLAGS -L$dir/lib"
1435 AC_MSG_NOTICE([Found libyaml in $dir])
1436 break
1437 fi
1438 done
1439 else
1440 if test x_$withval != x_no; then
1441 CFLAGS="$CFLAGS -I$withval/include"
1442 LDFLAGS="$LDFLAGS -L$withval/lib"
1443 else
1444 if test $stubby_with_yaml = 1
1445 then
1446 AC_MSG_ERROR([libyaml required for building Stubby])
1447 fi
1448 my_with_yaml=0
1449 fi
1450 fi
1451 if test $my_with_yaml = 1
1452 then
1453 AC_MSG_NOTICE([Checking for dependency libyaml])
1454 AC_CHECK_LIB([yaml], [yaml_parser_parse], [], [
1455 MISSING_DEPS="${MISSING_DEPS}${MISSING_SEP}libyaml"
1456 MISSING_SEP=", "
1457 found_all_libs=0
1458 ])
1459 fi
1460 if test $stubby_with_yaml = 1
1461 then
1462 STUBBY_LDFLAGS="$LDFLAGS"
1463 STUBBY_LIBS="$LIBS"
1464 LIBS="$getdns_LIBS"
1465 LDFLAGS="$getdns_LDFLAGS"
1466 fi
1467 fi
1468 AC_SUBST(STUBBY_LDFLAGS)
1469 AC_SUBST(STUBBY_LIBS)
1470
1471 if test $found_all_libs = 0
1472 then
1473 AC_MSG_ERROR([Missing dependencies: $MISSING_DEPS])
1474 fi
1475
1476 AC_CONFIG_FILES([Makefile src/Makefile src/version.c src/getdns/getdns.h src/getdns/getdns_extra.h spec/example/Makefile src/test/Makefile src/tools/Makefile doc/Makefile getdns.pc getdns_ext_event.pc])
1477 if [ test -n "$DOXYGEN" ]
1478 then AC_CONFIG_FILES([src/Doxyfile])
1479 fi
1480
1481 AC_MSG_CHECKING([whether the C compiler (${CC-cc}) supports the __func__ variable])
1482 AC_LANG_PUSH(C)
1483 AC_COMPILE_IFELSE(
1484 [AC_LANG_PROGRAM([[char*s=__func__;]],[[]])],
1485 [AC_MSG_RESULT([yes])
1486 AC_DEFINE(HAVE___FUNC__, [1], [Whether the C compiler support the __func__ variable])],
1487 [AC_MSG_RESULT([no])])
1488 AC_LANG_POP(C)
1489
1490 dnl -----
1491 dnl ----- Start of "Things needed for gldns" section
1492 dnl -----
1493 dnl ---------------------------------------------------------------------------
1494
1495 AC_CHECK_HEADERS([stdarg.h stdint.h netinet/in.h arpa/inet.h netdb.h sys/socket.h time.h sys/time.h sys/select.h endian.h limits.h sys/limits.h],,, [AC_INCLUDES_DEFAULT])
1496
1497 dnl Check the printf-format attribute (if any)
1498 dnl result in HAVE_ATTR_FORMAT.
1499 dnl
1500 AC_MSG_CHECKING(whether the C compiler (${CC-cc}) accepts the "format" attribute)
1501 AC_CACHE_VAL(ac_cv_c_format_attribute,
1502 [ac_cv_c_format_attribute=no
1503 AC_TRY_COMPILE(
1504 [#include <stdio.h>
1505 void f (char *format, ...) __attribute__ ((format (printf, 1, 2)));
1506 void (*pf) (char *format, ...) __attribute__ ((format (printf, 1, 2)));
1507 ], [
1508 f ("%s", "str");
1509 ],
1510 [ac_cv_c_format_attribute="yes"],
1511 [ac_cv_c_format_attribute="no"])
1512 ])
1513 AC_MSG_RESULT($ac_cv_c_format_attribute)
1514 if test $ac_cv_c_format_attribute = yes; then
1515 AC_DEFINE(HAVE_ATTR_FORMAT, 1, [Whether the C compiler accepts the "format" attribute])
1516 fi
1517
1518 AC_MSG_CHECKING(whether the C compiler (${CC-cc}) accepts the "unused" attribute)
1519 AC_CACHE_VAL(ac_cv_c_unused_attribute,
1520 [ac_cv_c_unused_attribute=no
1521 AC_TRY_COMPILE(
1522 [#include <stdio.h>
1523 void f (char *u __attribute__((unused)));
1524 ], [
1525 f ("x");
1526 ],
1527 [ac_cv_c_unused_attribute="yes"],
1528 [ac_cv_c_unused_attribute="no"])
1529 ])
1530 AC_MSG_RESULT($ac_cv_c_unused_attribute)
1531 if test $ac_cv_c_unused_attribute = yes; then
1532 AC_DEFINE(HAVE_ATTR_UNUSED, 1, [Whether the C compiler accepts the "unused" attribute])
1533 fi
1534 # Check for libbsd, so that the next function checks pick it as their
1535 # system implementation.
1536 PKG_CHECK_MODULES([LIBBSD],[libbsd-overlay],[
1537 LIBS="$LIBS $LIBBSD_LIBS"
1538 STUBBY_LIBS="$STUBBY_LIBS $LIBBSD_LIBS"
1539 CFLAGS="$CFLAGS $LIBBSD_CFLAGS"
1540 ],[
1541 AC_MSG_WARN([libbsd not found or usable; using embedded code instead])
1542 ])
1543 AC_CHECK_DECLS([inet_pton,inet_ntop,strlcpy,arc4random,arc4random_uniform], [], [], [
1544 AC_INCLUDES_DEFAULT
1545 #ifdef HAVE_WS2TCPIP_H
1546 #include <ws2tcpip.h>
1547 #endif
1548 ])
1549 AS_IF([test "x$ac_cv_have_decl_inet_pton" = xyes],
1550 [],
1551 [AC_REPLACE_FUNCS(inet_pton)]
1552 )
1553 AS_IF([test "x$ac_cv_have_decl_inet_ntop" = xyes],
1554 [],
1555 [AC_REPLACE_FUNCS(inet_ntop)]
1556 )
1557 AC_REPLACE_FUNCS(strlcpy)
1558 AC_REPLACE_FUNCS(arc4random)
1559 AC_REPLACE_FUNCS(arc4random_uniform)
1560 if test "$ac_cv_func_arc4random" = "no"; then
1561 AC_LIBOBJ(explicit_bzero)
1562 AC_LIBOBJ(arc4_lock)
1563 AC_CHECK_FUNCS([getentropy],,[
1564 if test "$USE_WINSOCK" = 1; then
1565 AC_LIBOBJ(getentropy_win)
1566 else
1567 case `uname` in
1568 Darwin)
1569 AC_LIBOBJ(getentropy_osx)
1570 ;;
1571 SunOS)
1572 AC_LIBOBJ(getentropy_solaris)
1573 AC_CHECK_HEADERS([sys/sha2.h],, [
1574 AC_CHECK_FUNCS([SHA512_Update],,[
1575 AC_LIBOBJ(sha512)
1576 ])
1577 ], [AC_INCLUDES_DEFAULT])
1578 if test "$ac_cv_header_sys_sha2_h" = "yes"; then
1579 # this lib needed for sha2 on solaris
1580 LIBS="$LIBS -lmd"
1581 fi
1582 AC_SEARCH_LIBS([clock_gettime], [rt])
1583 ;;
1584 Linux|*)
1585 AC_LIBOBJ(getentropy_linux)
1586 dnl AC_CHECK_FUNCS([SHA512_Update],,[
1587 dnl AC_DEFINE([COMPAT_SHA512], [1], [Do sha512 definitions in config.h])
1588 dnl AC_LIBOBJ(sha512)
1589 dnl])
1590 AC_CHECK_HEADERS([sys/sysctl.h],,, [AC_INCLUDES_DEFAULT])
1591 AC_CHECK_FUNCS([getauxval])
1592 AC_SEARCH_LIBS([clock_gettime], [rt])
1593 ;;
1594 esac
1595 fi
1596 ])
1597 fi
1598
1599 AC_TYPE_SIGNAL
1600
1601 case `uname` in
1602 FreeBSD)
1603 C99COMPATFLAGS=""
1604 ;;
1605 *)
1606 C99COMPATFLAGS="-D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600"
1607 ;;
1608 esac
1609 AC_SUBST(C99COMPATFLAGS)
1610
1611 AC_DEFINE_UNQUOTED([MAX_CNAME_REFERRALS], [100], [The maximum number of cname referrals.])
1612 AC_DEFINE_UNQUOTED([DRAFT_RRTYPES], [1], [Define this to enable all rrtypes in gldns.])
1613
1614 AH_BOTTOM([
1615
1616 #ifdef HAVE___FUNC__
1617 #define __FUNC__ __func__
1618 #else
1619 #define __FUNC__ __FUNCTION__
1620 #endif
1621
1622 #ifdef GETDNS_ON_WINDOWS
1623 /* On windows it is allowed to increase the FD_SETSIZE
1624 * (and necessary to make our custom eventloop work)
1625 * See: https://support.microsoft.com/en-us/kb/111855
1626 */
1627 # ifndef FD_SETSIZE
1628 # define FD_SETSIZE 1024
1629 # endif
1630
1631 /* the version of the windows API enabled */
1632 # ifndef WINVER
1633 # define WINVER 0x0600 // 0x0502
1634 # endif
1635 # ifndef _WIN32_WINNT
1636 # define _WIN32_WINNT 0x0600 // 0x0502
1637 # endif
1638 # ifdef HAVE_WS2TCPIP_H
1639 # include <ws2tcpip.h>
1640 # endif
1641
1642 # ifdef _MSC_VER
1643 # if _MSC_VER >= 1800
1644 # define PRIsz "zu"
1645 # else
1646 # define PRIsz "Iu"
1647 # endif
1648 # else
1649 # define PRIsz "Iu"
1650 # endif
1651
1652 # ifdef HAVE_WINSOCK2_H
1653 # include <winsock2.h>
1654 # endif
1655
1656 /* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
1657 # ifdef HAVE_WINSOCK2_H
1658 # define FD_SET_T (u_int)
1659 # else
1660 # define FD_SET_T
1661 # endif
1662
1663 /* Windows wants us to use _strdup instead of strdup */
1664 # ifndef strdup
1665 # define strdup _strdup
1666 # endif
1667 #else
1668 # define PRIsz "zu"
1669 #endif
1670
1671 #include <stdint.h>
1672 #include <stdio.h>
1673 #include <unistd.h>
1674 #include <assert.h>
1675 #include <string.h>
1676
1677 #ifdef __cplusplus
1678 extern "C" {
1679 #endif
1680
1681 #if STDC_HEADERS
1682 #include <stdlib.h>
1683 #include <stddef.h>
1684 #endif
1685
1686 #if !defined(HAVE_STRLCPY) || !HAVE_DECL_STRLCPY || !defined(strlcpy)
1687 size_t strlcpy(char *dst, const char *src, size_t siz);
1688 #else
1689 #ifndef __BSD_VISIBLE
1690 #define __BSD_VISIBLE 1
1691 #endif
1692 #endif
1693 #if !defined(HAVE_ARC4RANDOM) || !HAVE_DECL_ARC4RANDOM
1694 uint32_t arc4random(void);
1695 #endif
1696 #if !defined(HAVE_ARC4RANDOM_UNIFORM) || !HAVE_DECL_ARC4RANDOM_UNIFORM
1697 uint32_t arc4random_uniform(uint32_t upper_bound);
1698 #endif
1699 #ifndef HAVE_ARC4RANDOM
1700 void explicit_bzero(void* buf, size_t len);
1701 int getentropy(void* buf, size_t len);
1702 void arc4random_buf(void* buf, size_t n);
1703 void _ARC4_LOCK(void);
1704 void _ARC4_UNLOCK(void);
1705 #endif
1706 #ifdef COMPAT_SHA512
1707 #ifndef SHA512_DIGEST_LENGTH
1708 #define SHA512_BLOCK_LENGTH 128
1709 #define SHA512_DIGEST_LENGTH 64
1710 #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
1711 typedef struct _SHA512_CTX {
1712 uint64_t state[8];
1713 uint64_t bitcount[2];
1714 uint8_t buffer[SHA512_BLOCK_LENGTH];
1715 } SHA512_CTX;
1716 #endif /* SHA512_DIGEST_LENGTH */
1717 void SHA512_Init(SHA512_CTX*);
1718 void SHA512_Update(SHA512_CTX*, void*, size_t);
1719 void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
1720 unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
1721 #endif /* COMPAT_SHA512 */
1722
1723 #ifndef HAVE_DECL_INET_PTON
1724 int inet_pton(int af, const char* src, void* dst);
1725 #endif /* HAVE_INET_PTON */
1726
1727 #ifndef HAVE_DECL_INET_NTOP
1728 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
1729 #endif
1730
1731 #ifdef USE_WINSOCK
1732 # ifndef _CUSTOM_VSNPRINTF
1733 # define _CUSTOM_VSNPRINTF
1734 static inline int _gldns_custom_vsnprintf(char *str, size_t size, const char *format, va_list ap)
1735 { int r = vsnprintf(str, size, format, ap); return r == -1 ? _vscprintf(format, ap) : r; }
1736 # define vsnprintf _gldns_custom_vsnprintf
1737 # endif
1738 #endif
1739
1740 #ifdef __cplusplus
1741 }
1742 #endif
1743
1744 /** Use on-board gldns */
1745 #define USE_GLDNS 1
1746 #ifdef HAVE_SSL
1747 # define GLDNS_BUILD_CONFIG_HAVE_SSL 1
1748 #endif
1749
1750 #ifdef HAVE_STDARG_H
1751 #include <stdarg.h>
1752 #endif
1753
1754 #include <errno.h>
1755
1756 #ifdef HAVE_SYS_SOCKET_H
1757 #include <sys/socket.h>
1758 #endif
1759
1760 #ifdef HAVE_NETINET_TCP_H
1761 #include <netinet/tcp.h>
1762 #endif
1763
1764 #ifdef HAVE_SYS_SELECT_H
1765 #include <sys/select.h>
1766 #endif
1767
1768 #ifdef HAVE_SYS_TYPES_H
1769 #include <sys/types.h>
1770 #endif
1771
1772 #ifdef HAVE_SYS_STAT_H
1773 #include <sys/stat.h>
1774 #endif
1775
1776 #ifdef HAVE_NETINET_IN_H
1777 #include <netinet/in.h>
1778 #endif
1779
1780 #ifdef HAVE_ARPA_INET_H
1781 #include <arpa/inet.h>
1782 #endif
1783
1784 #ifdef HAVE_INTTYPES_H
1785 #include <inttypes.h>
1786 #endif
1787
1788 #ifdef HAVE_LIMITS_H
1789 #include <limits.h>
1790 #endif
1791
1792 #ifdef HAVE_SYS_LIMITS_H
1793 #include <sys/limits.h>
1794 #endif
1795
1796 #ifdef PATH_MAX
1797 #define _GETDNS_PATH_MAX PATH_MAX
1798 #else
1799 #define _GETDNS_PATH_MAX 2048
1800 #endif
1801
1802 #ifndef PRIu64
1803 #define PRIu64 "llu"
1804 #endif
1805
1806 #ifdef HAVE_ATTR_FORMAT
1807 # define ATTR_FORMAT(archetype, string_index, first_to_check) \
1808 __attribute__ ((format (archetype, string_index, first_to_check)))
1809 #else /* !HAVE_ATTR_FORMAT */
1810 # define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
1811 #endif /* !HAVE_ATTR_FORMAT */
1812
1813 #if defined(DOXYGEN)
1814 # define ATTR_UNUSED(x) x
1815 #elif defined(__cplusplus)
1816 # define ATTR_UNUSED(x)
1817 #elif defined(HAVE_ATTR_UNUSED)
1818 # define ATTR_UNUSED(x) x __attribute__((unused))
1819 #else /* !HAVE_ATTR_UNUSED */
1820 # define ATTR_UNUSED(x) x
1821 #endif /* !HAVE_ATTR_UNUSED */
1822
1823 #ifdef TIME_WITH_SYS_TIME
1824 # include <sys/time.h>
1825 # include <time.h>
1826 #else
1827 # ifdef HAVE_SYS_TIME_H
1828 # include <sys/time.h>
1829 # else
1830 # include <time.h>
1831 # endif
1832 #endif
1833
1834 #ifdef __cplusplus
1835 extern "C" {
1836 #endif
1837
1838 #if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
1839 #define strptime unbound_strptime
1840 struct tm;
1841 char *strptime(const char *s, const char *format, struct tm *tm);
1842 #endif
1843
1844 #if !defined(HAVE_SIGSET_T) && defined(HAVE__SIGSET_T)
1845 typedef _sigset_t sigset_t;
1846 #endif
1847 #if !defined(HAVE_SIGEMPTYSET)
1848 # define sigemptyset(pset) (*(pset) = 0)
1849 #endif
1850 #if !defined(HAVE_SIGFILLSET)
1851 # define sigfillset(pset) (*(pset) = (sigset_t)-1)
1852 #endif
1853 #if !defined(HAVE_SIGADDSET)
1854 # define sigaddset(pset, num) (*(pset) |= (1L<<(num)))
1855 #endif
1856
1857 #ifdef HAVE_LIBUNBOUND
1858 # include <unbound.h>
1859 # ifdef HAVE_UNBOUND_EVENT_H
1860 # include <unbound-event.h>
1861 # else
1862 # ifdef HAVE_UNBOUND_EVENT_API
1863 # ifndef _UB_EVENT_PRIMITIVES
1864 # define _UB_EVENT_PRIMITIVES
1865 struct ub_event_base;
1866 struct ub_ctx* ub_ctx_create_ub_event(struct ub_event_base* base);
1867 typedef void (*ub_event_callback_t)(void*, int, void*, int, int, char*);
1868 int ub_resolve_event(struct ub_ctx* ctx, const char* name, int rrtype,
1869 int rrclass, void* mydata, ub_event_callback_t callback, int* async_id);
1870 # endif
1871 # endif
1872 # endif
1873 #endif
1874
1875 #ifdef __cplusplus
1876 }
1877 #endif
1878 ])
1879
1880 dnl ---------------------------------------------------------------------------
1881 dnl -----
1882 dnl ----- End of "Things needed for gldns" section
1883 dnl -----
1884
1885
1886 AC_CONFIG_HEADER([src/config.h])
1887 AC_OUTPUT
+0
-93
doc/Makefile.in less more
0 #
1 # @configure_input@
2 #
3 #
4 # Copyright (c) 2013, Verisign, Inc., NLnet Labs
5 # All rights reserved.
6 #
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions are met:
9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # * Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
14 # * Neither the names of the copyright holders nor the
15 # names of its contributors may be used to endorse or promote products
16 # derived from this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 # DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
22 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 package = @PACKAGE_NAME@
30 version = @PACKAGE_VERSION@
31 tarname = @PACKAGE_TARNAME@
32 distdir = $(tarname)-$(version)
33
34 api_version = @API_VERSION@
35
36 prefix = @prefix@
37 exec_prefix = @exec_prefix@
38 bindir = @bindir@
39 # datarootdir is here to please some checkers
40 datarootdir=@datarootdir@
41 mandir = @mandir@
42 INSTALL = @INSTALL@
43
44 srcdir = @srcdir@
45 VPATH = @srcdir@
46
47 EDITS=-e 's/@''version@/$(version)/g'
48 DOXYGEN = @DOXYGEN@
49
50 DOCDIRS = html latex man
51 MANPAGES3 = libgetdns.3 getdns_address.3 getdns_cancel_callback.3 getdns_context.3 getdns_context_set.3 getdns_context_set_context_update_callback.3 getdns_convert.3 getdns_dict.3 getdns_dict_get.3 getdns_dict_set.3 getdns_display_ip_address.3 getdns_general.3 getdns_hostname.3 getdns_list.3 getdns_list_get.3 getdns_list_set.3 getdns_pretty_print_dict.3 getdns_root_trust_anchor.3 getdns_service.3 getdns_validate_dnssec.3
52
53 default: all
54
55 all: doc
56
57 doc: $(MANPAGES3)
58 if test x_$(DOXYGEN) != x_ ; then cd ../src; doxygen; fi
59
60 .SUFFIXES: .3.in .3
61 .3.in.3:
62 sed $(EDITS) -e "s/@date@/$(api_version)/g" $< > $@
63
64 # we assume that we want a separate file for each "name" specified for each man page
65 # and consider these "alternate names" simple copies of the main man page
66 install: $(MANPAGES3)
67 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)
68 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man3
69 for x in $(MANPAGES3); do echo $(INSTALL) -m 644 $$x $(DESTDIR)$(mandir)/man3; $(INSTALL) -m 644 $$x $(DESTDIR)$(mandir)/man3; for altpg in $$($(srcdir)/manpgaltnames $$x); do cp $$x $$altpg; echo $(INSTALL) -m 644 $$altpg $(DESTDIR)$(mandir)/man3; $(INSTALL) -m 644 $$altpg $(DESTDIR)$(mandir)/man3; done; done
70
71 check: $(MANPAGES3)
72 for x in $(MANPAGES3); do LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 man --warnings -E UTF-8 -l -Tutf8 -Z $$x 2>&1 >/dev/null | awk "-vpage=$$x" '{printf("%s: ", page);print}'; if ! lexgrog $$x >/dev/null 2>&1 ; then echo $$x: manpage-has-bad-whatis-entry; fi; done
73
74 uninstall:
75 for x in $(MANPAGES3); do echo rm -f $(DESTDIR)$(mandir)/man3/$$x; rm -f $(DESTDIR)$(mandir)/man3/$$x; for altpg in $$($(srcdir)/manpgaltnames $$x); do echo rm -f $(DESTDIR)$(mandir)/man3/$$altpg; rm -f $(DESTDIR)$(mandir)/man3/$$altpg; done; done
76
77 clean:
78 for x in $(MANPAGES3); do rm -f $$($(srcdir)/manpgaltnames $$x); done
79 rm -f tagfile
80 rm -rf $(DOCDIRS) $(MANPAGES3)
81
82 distclean : clean
83 rm -f Makefile config.status config.log
84 rm -Rf autom4te.cache
85
86 Makefile: Makefile.in ../config.status
87 cd .. && ./config.status $@
88
89 configure.status: configure
90 cd .. && ./config.status --recheck
91
92 .PHONY: clean $(DOC)
+0
-518
install-sh less more
0 #!/bin/sh
1 # install - install a program, script, or datafile
2
3 scriptversion=2018-03-11.20; # UTC
4
5 # This originates from X11R5 (mit/util/scripts/install.sh), which was
6 # later released in X11R6 (xc/config/util/install.sh) with the
7 # following copyright and license.
8 #
9 # Copyright (C) 1994 X Consortium
10 #
11 # Permission is hereby granted, free of charge, to any person obtaining a copy
12 # of this software and associated documentation files (the "Software"), to
13 # deal in the Software without restriction, including without limitation the
14 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
15 # sell copies of the Software, and to permit persons to whom the Software is
16 # furnished to do so, subject to the following conditions:
17 #
18 # The above copyright notice and this permission notice shall be included in
19 # all copies or substantial portions of the Software.
20 #
21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
25 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
26 # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #
28 # Except as contained in this notice, the name of the X Consortium shall not
29 # be used in advertising or otherwise to promote the sale, use or other deal-
30 # ings in this Software without prior written authorization from the X Consor-
31 # tium.
32 #
33 #
34 # FSF changes to this file are in the public domain.
35 #
36 # Calling this script install-sh is preferred over install.sh, to prevent
37 # 'make' implicit rules from creating a file called install from it
38 # when there is no Makefile.
39 #
40 # This script is compatible with the BSD install script, but was written
41 # from scratch.
42
43 tab=' '
44 nl='
45 '
46 IFS=" $tab$nl"
47
48 # Set DOITPROG to "echo" to test this script.
49
50 doit=${DOITPROG-}
51 doit_exec=${doit:-exec}
52
53 # Put in absolute file names if you don't have them in your path;
54 # or use environment vars.
55
56 chgrpprog=${CHGRPPROG-chgrp}
57 chmodprog=${CHMODPROG-chmod}
58 chownprog=${CHOWNPROG-chown}
59 cmpprog=${CMPPROG-cmp}
60 cpprog=${CPPROG-cp}
61 mkdirprog=${MKDIRPROG-mkdir}
62 mvprog=${MVPROG-mv}
63 rmprog=${RMPROG-rm}
64 stripprog=${STRIPPROG-strip}
65
66 posix_mkdir=
67
68 # Desired mode of installed file.
69 mode=0755
70
71 chgrpcmd=
72 chmodcmd=$chmodprog
73 chowncmd=
74 mvcmd=$mvprog
75 rmcmd="$rmprog -f"
76 stripcmd=
77
78 src=
79 dst=
80 dir_arg=
81 dst_arg=
82
83 copy_on_change=false
84 is_target_a_directory=possibly
85
86 usage="\
87 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
88 or: $0 [OPTION]... SRCFILES... DIRECTORY
89 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
90 or: $0 [OPTION]... -d DIRECTORIES...
91
92 In the 1st form, copy SRCFILE to DSTFILE.
93 In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
94 In the 4th, create DIRECTORIES.
95
96 Options:
97 --help display this help and exit.
98 --version display version info and exit.
99
100 -c (ignored)
101 -C install only if different (preserve the last data modification time)
102 -d create directories instead of installing files.
103 -g GROUP $chgrpprog installed files to GROUP.
104 -m MODE $chmodprog installed files to MODE.
105 -o USER $chownprog installed files to USER.
106 -s $stripprog installed files.
107 -t DIRECTORY install into DIRECTORY.
108 -T report an error if DSTFILE is a directory.
109
110 Environment variables override the default commands:
111 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
112 RMPROG STRIPPROG
113 "
114
115 while test $# -ne 0; do
116 case $1 in
117 -c) ;;
118
119 -C) copy_on_change=true;;
120
121 -d) dir_arg=true;;
122
123 -g) chgrpcmd="$chgrpprog $2"
124 shift;;
125
126 --help) echo "$usage"; exit $?;;
127
128 -m) mode=$2
129 case $mode in
130 *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
131 echo "$0: invalid mode: $mode" >&2
132 exit 1;;
133 esac
134 shift;;
135
136 -o) chowncmd="$chownprog $2"
137 shift;;
138
139 -s) stripcmd=$stripprog;;
140
141 -t)
142 is_target_a_directory=always
143 dst_arg=$2
144 # Protect names problematic for 'test' and other utilities.
145 case $dst_arg in
146 -* | [=\(\)!]) dst_arg=./$dst_arg;;
147 esac
148 shift;;
149
150 -T) is_target_a_directory=never;;
151
152 --version) echo "$0 $scriptversion"; exit $?;;
153
154 --) shift
155 break;;
156
157 -*) echo "$0: invalid option: $1" >&2
158 exit 1;;
159
160 *) break;;
161 esac
162 shift
163 done
164
165 # We allow the use of options -d and -T together, by making -d
166 # take the precedence; this is for compatibility with GNU install.
167
168 if test -n "$dir_arg"; then
169 if test -n "$dst_arg"; then
170 echo "$0: target directory not allowed when installing a directory." >&2
171 exit 1
172 fi
173 fi
174
175 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
176 # When -d is used, all remaining arguments are directories to create.
177 # When -t is used, the destination is already specified.
178 # Otherwise, the last argument is the destination. Remove it from $@.
179 for arg
180 do
181 if test -n "$dst_arg"; then
182 # $@ is not empty: it contains at least $arg.
183 set fnord "$@" "$dst_arg"
184 shift # fnord
185 fi
186 shift # arg
187 dst_arg=$arg
188 # Protect names problematic for 'test' and other utilities.
189 case $dst_arg in
190 -* | [=\(\)!]) dst_arg=./$dst_arg;;
191 esac
192 done
193 fi
194
195 if test $# -eq 0; then
196 if test -z "$dir_arg"; then
197 echo "$0: no input file specified." >&2
198 exit 1
199 fi
200 # It's OK to call 'install-sh -d' without argument.
201 # This can happen when creating conditional directories.
202 exit 0
203 fi
204
205 if test -z "$dir_arg"; then
206 if test $# -gt 1 || test "$is_target_a_directory" = always; then
207 if test ! -d "$dst_arg"; then
208 echo "$0: $dst_arg: Is not a directory." >&2
209 exit 1
210 fi
211 fi
212 fi
213
214 if test -z "$dir_arg"; then
215 do_exit='(exit $ret); exit $ret'
216 trap "ret=129; $do_exit" 1
217 trap "ret=130; $do_exit" 2
218 trap "ret=141; $do_exit" 13
219 trap "ret=143; $do_exit" 15
220
221 # Set umask so as not to create temps with too-generous modes.
222 # However, 'strip' requires both read and write access to temps.
223 case $mode in
224 # Optimize common cases.
225 *644) cp_umask=133;;
226 *755) cp_umask=22;;
227
228 *[0-7])
229 if test -z "$stripcmd"; then
230 u_plus_rw=
231 else
232 u_plus_rw='% 200'
233 fi
234 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
235 *)
236 if test -z "$stripcmd"; then
237 u_plus_rw=
238 else
239 u_plus_rw=,u+rw
240 fi
241 cp_umask=$mode$u_plus_rw;;
242 esac
243 fi
244
245 for src
246 do
247 # Protect names problematic for 'test' and other utilities.
248 case $src in
249 -* | [=\(\)!]) src=./$src;;
250 esac
251
252 if test -n "$dir_arg"; then
253 dst=$src
254 dstdir=$dst
255 test -d "$dstdir"
256 dstdir_status=$?
257 else
258
259 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
260 # might cause directories to be created, which would be especially bad
261 # if $src (and thus $dsttmp) contains '*'.
262 if test ! -f "$src" && test ! -d "$src"; then
263 echo "$0: $src does not exist." >&2
264 exit 1
265 fi
266
267 if test -z "$dst_arg"; then
268 echo "$0: no destination specified." >&2
269 exit 1
270 fi
271 dst=$dst_arg
272
273 # If destination is a directory, append the input filename.
274 if test -d "$dst"; then
275 if test "$is_target_a_directory" = never; then
276 echo "$0: $dst_arg: Is a directory" >&2
277 exit 1
278 fi
279 dstdir=$dst
280 dstbase=`basename "$src"`
281 case $dst in
282 */) dst=$dst$dstbase;;
283 *) dst=$dst/$dstbase;;
284 esac
285 dstdir_status=0
286 else
287 dstdir=`dirname "$dst"`
288 test -d "$dstdir"
289 dstdir_status=$?
290 fi
291 fi
292
293 case $dstdir in
294 */) dstdirslash=$dstdir;;
295 *) dstdirslash=$dstdir/;;
296 esac
297
298 obsolete_mkdir_used=false
299
300 if test $dstdir_status != 0; then
301 case $posix_mkdir in
302 '')
303 # Create intermediate dirs using mode 755 as modified by the umask.
304 # This is like FreeBSD 'install' as of 1997-10-28.
305 umask=`umask`
306 case $stripcmd.$umask in
307 # Optimize common cases.
308 *[2367][2367]) mkdir_umask=$umask;;
309 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
310
311 *[0-7])
312 mkdir_umask=`expr $umask + 22 \
313 - $umask % 100 % 40 + $umask % 20 \
314 - $umask % 10 % 4 + $umask % 2
315 `;;
316 *) mkdir_umask=$umask,go-w;;
317 esac
318
319 # With -d, create the new directory with the user-specified mode.
320 # Otherwise, rely on $mkdir_umask.
321 if test -n "$dir_arg"; then
322 mkdir_mode=-m$mode
323 else
324 mkdir_mode=
325 fi
326
327 posix_mkdir=false
328 case $umask in
329 *[123567][0-7][0-7])
330 # POSIX mkdir -p sets u+wx bits regardless of umask, which
331 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
332 ;;
333 *)
334 # Note that $RANDOM variable is not portable (e.g. dash); Use it
335 # here however when possible just to lower collision chance.
336 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
337
338 trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
339
340 # Because "mkdir -p" follows existing symlinks and we likely work
341 # directly in world-writeable /tmp, make sure that the '$tmpdir'
342 # directory is successfully created first before we actually test
343 # 'mkdir -p' feature.
344 if (umask $mkdir_umask &&
345 $mkdirprog $mkdir_mode "$tmpdir" &&
346 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
347 then
348 if test -z "$dir_arg" || {
349 # Check for POSIX incompatibilities with -m.
350 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
351 # other-writable bit of parent directory when it shouldn't.
352 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
353 test_tmpdir="$tmpdir/a"
354 ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
355 case $ls_ld_tmpdir in
356 d????-?r-*) different_mode=700;;
357 d????-?--*) different_mode=755;;
358 *) false;;
359 esac &&
360 $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
361 ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
362 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
363 }
364 }
365 then posix_mkdir=:
366 fi
367 rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
368 else
369 # Remove any dirs left behind by ancient mkdir implementations.
370 rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
371 fi
372 trap '' 0;;
373 esac;;
374 esac
375
376 if
377 $posix_mkdir && (
378 umask $mkdir_umask &&
379 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
380 )
381 then :
382 else
383
384 # The umask is ridiculous, or mkdir does not conform to POSIX,
385 # or it failed possibly due to a race condition. Create the
386 # directory the slow way, step by step, checking for races as we go.
387
388 case $dstdir in
389 /*) prefix='/';;
390 [-=\(\)!]*) prefix='./';;
391 *) prefix='';;
392 esac
393
394 oIFS=$IFS
395 IFS=/
396 set -f
397 set fnord $dstdir
398 shift
399 set +f
400 IFS=$oIFS
401
402 prefixes=
403
404 for d
405 do
406 test X"$d" = X && continue
407
408 prefix=$prefix$d
409 if test -d "$prefix"; then
410 prefixes=
411 else
412 if $posix_mkdir; then
413 (umask=$mkdir_umask &&
414 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
415 # Don't fail if two instances are running concurrently.
416 test -d "$prefix" || exit 1
417 else
418 case $prefix in
419 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
420 *) qprefix=$prefix;;
421 esac
422 prefixes="$prefixes '$qprefix'"
423 fi
424 fi
425 prefix=$prefix/
426 done
427
428 if test -n "$prefixes"; then
429 # Don't fail if two instances are running concurrently.
430 (umask $mkdir_umask &&
431 eval "\$doit_exec \$mkdirprog $prefixes") ||
432 test -d "$dstdir" || exit 1
433 obsolete_mkdir_used=true
434 fi
435 fi
436 fi
437
438 if test -n "$dir_arg"; then
439 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
440 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
441 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
442 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
443 else
444
445 # Make a couple of temp file names in the proper directory.
446 dsttmp=${dstdirslash}_inst.$$_
447 rmtmp=${dstdirslash}_rm.$$_
448
449 # Trap to clean up those temp files at exit.
450 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
451
452 # Copy the file name to the temp name.
453 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
454
455 # and set any options; do chmod last to preserve setuid bits.
456 #
457 # If any of these fail, we abort the whole thing. If we want to
458 # ignore errors from any of these, just make sure not to ignore
459 # errors from the above "$doit $cpprog $src $dsttmp" command.
460 #
461 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
462 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
463 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
464 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
465
466 # If -C, don't bother to copy if it wouldn't change the file.
467 if $copy_on_change &&
468 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
469 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
470 set -f &&
471 set X $old && old=:$2:$4:$5:$6 &&
472 set X $new && new=:$2:$4:$5:$6 &&
473 set +f &&
474 test "$old" = "$new" &&
475 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
476 then
477 rm -f "$dsttmp"
478 else
479 # Rename the file to the real destination.
480 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
481
482 # The rename failed, perhaps because mv can't rename something else
483 # to itself, or perhaps because mv is so ancient that it does not
484 # support -f.
485 {
486 # Now remove or move aside any old file at destination location.
487 # We try this two ways since rm can't unlink itself on some
488 # systems and the destination file might be busy for other
489 # reasons. In this case, the final cleanup might fail but the new
490 # file should still install successfully.
491 {
492 test ! -f "$dst" ||
493 $doit $rmcmd -f "$dst" 2>/dev/null ||
494 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
495 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
496 } ||
497 { echo "$0: cannot unlink or rename $dst" >&2
498 (exit 1); exit 1
499 }
500 } &&
501
502 # Now rename the file to the real destination.
503 $doit $mvcmd "$dsttmp" "$dst"
504 }
505 fi || exit 1
506
507 trap '' 0
508 fi
509 done
510
511 # Local variables:
512 # eval: (add-hook 'before-save-hook 'time-stamp)
513 # time-stamp-start: "scriptversion="
514 # time-stamp-format: "%:y-%02m-%02d.%02H"
515 # time-stamp-time-zone: "UTC0"
516 # time-stamp-end: "; # UTC"
517 # End:
+0
-81
m4/acx_getaddrinfo.m4 less more
0 # Taken from acx_nlnetlabs.m4 - common macros for configure checks
1 # Copyright 2009, Wouter Wijngaards, NLnet Labs.
2 # BSD licensed.
3 #
4
5 dnl Check getaddrinfo.
6 dnl Works on linux, solaris, bsd and windows(links winsock).
7 dnl defines HAVE_GETADDRINFO, USE_WINSOCK.
8 AC_DEFUN([ACX_CHECK_GETADDRINFO_WITH_INCLUDES],
9 [AC_REQUIRE([AC_PROG_CC])
10 AC_MSG_CHECKING(for getaddrinfo)
11 ac_cv_func_getaddrinfo=no
12 AC_LINK_IFELSE(
13 [AC_LANG_SOURCE([[
14 #ifdef __cplusplus
15 extern "C"
16 {
17 #endif
18 char* getaddrinfo();
19 char* (*f) () = getaddrinfo;
20 #ifdef __cplusplus
21 }
22 #endif
23 int main() {
24 ;
25 return 0;
26 }
27 ]])],
28 dnl this case on linux, solaris, bsd
29 [ac_cv_func_getaddrinfo="yes"
30 dnl see if on windows
31 if test "$ac_cv_header_windows_h" = "yes"; then
32 AC_DEFINE(USE_WINSOCK, 1, [Whether the windows socket API is used])
33 USE_WINSOCK="1"
34 LIBS="$LIBS -lws2_32 -lcrypt32"
35 fi
36 ],
37 dnl no quick getaddrinfo, try mingw32 and winsock2 library.
38 ORIGLIBS="$LIBS"
39 LIBS="$LIBS -lws2_32 -lcrypt32"
40 AC_LINK_IFELSE(
41 [AC_LANG_PROGRAM(
42 [
43 #define _WIN32_WINNT 0x0501
44 #ifdef HAVE_WINDOWS_H
45 #include <windows.h>
46 #endif
47 #ifdef HAVE_WINSOCK_H
48 #include <winsock.h>
49 #endif
50 #ifdef HAVE_WINSOCK2_H
51 #include <winsock2.h>
52 #endif
53 #include <stdio.h>
54 #ifdef HAVE_WS2TCPIP_H
55 #include <ws2tcpip.h>
56 #endif
57 ],
58 [
59 (void)getaddrinfo(NULL, NULL, NULL, NULL);
60 ]
61 )],
62 [
63 ac_cv_func_getaddrinfo="yes"
64 dnl already: LIBS="$LIBS -lws2_32 -lcrypt32"
65 AC_DEFINE(USE_WINSOCK, 1, [Whether the windows socket API is used])
66 USE_WINSOCK="1"
67 ],
68 [
69 ac_cv_func_getaddrinfo="no"
70 LIBS="$ORIGLIBS"
71 ])
72 )
73
74 AC_MSG_RESULT($ac_cv_func_getaddrinfo)
75 if test $ac_cv_func_getaddrinfo = yes; then
76 AC_DEFINE(HAVE_GETADDRINFO, 1, [Whether getaddrinfo is available])
77 fi
78 ])dnl Endof AC_CHECK_GETADDRINFO_WITH_INCLUDES
79
80 dnl End of file
+0
-164
m4/acx_openssl.m4 less more
0 # Taken from acx_nlnetlabs.m4 - common macros for configure checks
1 # Copyright 2009, Wouter Wijngaards, NLnet Labs.
2 # BSD licensed.
3 #
4 dnl Add a -R to the RUNTIME_PATH. Only if rpath is enabled and it is
5 dnl an absolute path.
6 dnl $1: the pathname to add.
7 AC_DEFUN([ACX_RUNTIME_PATH_ADD], [
8 if test "x$enable_rpath" = xyes; then
9 if echo "$1" | grep "^/" >/dev/null; then
10 RUNTIME_PATH="$RUNTIME_PATH -R$1"
11 fi
12 fi
13 ])
14 dnl Common code for both ACX_WITH_SSL and ACX_WITH_SSL_OPTIONAL
15 dnl Takes one argument; the withval checked in those 2 functions
16 dnl sets up the environment for the given openssl path
17 AC_DEFUN([ACX_SSL_CHECKS], [
18 withval=$1
19 if test x_$withval != x_no; then
20 AC_MSG_CHECKING(for SSL)
21 if test x_$withval = x_ -o x_$withval = x_yes; then
22 withval="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr"
23 fi
24 for dir in $withval; do
25 ssldir="$dir"
26 if test -f "$dir/include/openssl/ssl.h"; then
27 found_ssl="yes"
28 AC_DEFINE_UNQUOTED([HAVE_SSL], [], [Define if you have the SSL libraries installed.])
29 dnl assume /usr/include is already in the include-path.
30 if test "$ssldir" != "/usr"; then
31 CPPFLAGS="$CPPFLAGS -I$ssldir/include"
32 LIBSSL_CPPFLAGS="$LIBSSL_CPPFLAGS -I$ssldir/include"
33 fi
34 break;
35 fi
36 done
37 if test x_$found_ssl != x_yes; then
38 AC_MSG_ERROR(Cannot find the SSL libraries in $withval)
39 else
40 AC_MSG_RESULT(found in $ssldir)
41 HAVE_SSL=yes
42 dnl assume /usr is already in the lib and dynlib paths.
43 if test "$ssldir" != "/usr" -a "$ssldir" != ""; then
44 LDFLAGS="$LDFLAGS -L$ssldir/lib"
45 LIBSSL_LDFLAGS="$LIBSSL_LDFLAGS -L$ssldir/lib"
46 ACX_RUNTIME_PATH_ADD([$ssldir/lib])
47 fi
48
49 AC_MSG_CHECKING([for HMAC_Update in -lcrypto])
50 LIBS="-lssl -lcrypto $LIBS"
51 LIBSSL_LIBS="-lssl -lcrypto $LIBSSL_LIBS"
52 AC_TRY_LINK(, [
53 int HMAC_Update(void);
54 (void)HMAC_Update();
55 ], [
56 AC_DEFINE([HAVE_HMAC_UPDATE], 1,
57 [If you have HMAC_Update])
58 AC_MSG_RESULT(yes)
59 ], [
60 AC_MSG_RESULT(no)
61 # check if -lwsock32 or -lgdi32 are needed.
62 BAKLIBS="$LIBS"
63 BAKSSLLIBS="$LIBSSL_LIBS"
64 LIBS="$LIBS -lgdi32"
65 LIBSSL_LIBS="$LIBSSL_LIBS -lgdi32"
66 AC_MSG_CHECKING([if -lcrypto needs -lgdi32])
67 AC_TRY_LINK([], [
68 int HMAC_Update(void);
69 (void)HMAC_Update();
70 ],[
71 AC_DEFINE([HAVE_HMAC_UPDATE], 1,
72 [If you have HMAC_Update])
73 AC_MSG_RESULT(yes)
74 ],[
75 AC_MSG_RESULT(no)
76 LIBS="$BAKLIBS"
77 LIBSSL_LIBS="$BAKSSLLIBS"
78 LIBS="$LIBS -ldl"
79 LIBSSL_LIBS="$LIBSSL_LIBS -ldl"
80 AC_MSG_CHECKING([if -lcrypto needs -ldl])
81 AC_TRY_LINK([], [
82 int HMAC_Update(void);
83 (void)HMAC_Update();
84 ],[
85 AC_DEFINE([HAVE_HMAC_UPDATE], 1,
86 [If you have HMAC_Update])
87 AC_MSG_RESULT(yes)
88 ],[
89 AC_MSG_RESULT(no)
90 AC_MSG_ERROR([OpenSSL found in $ssldir, but version 0.9.7 or higher is required])
91 ])
92 ])
93 ])
94 fi
95 AC_SUBST(HAVE_SSL)
96 AC_SUBST(RUNTIME_PATH)
97 fi
98 AC_CHECK_HEADERS([openssl/ssl.h],,, [AC_INCLUDES_DEFAULT])
99 AC_CHECK_HEADERS([openssl/err.h],,, [AC_INCLUDES_DEFAULT])
100 AC_CHECK_HEADERS([openssl/rand.h],,, [AC_INCLUDES_DEFAULT])
101
102 dnl TLS v1.2 requires OpenSSL 1.0.1
103 AC_CHECK_FUNC(TLSv1_2_client_method,AC_DEFINE([HAVE_TLS_v1_2], [1],
104 [Define if you have libssl with tls 1.2]),[AC_MSG_WARN([Cannot find TLSv1_2_client_method in libssl library. TLS will not be available.])])
105
106 dnl Native OpenSSL hostname verification requires OpenSSL 1.0.2
107 AC_CHECK_FUNC(SSL_CTX_get0_param,AC_DEFINE([HAVE_SSL_HN_AUTH], [1],
108 [Define if you have libssl with host name verification]),[AC_MSG_WARN([Cannot find SSL_CTX_get0_param in libssl library. TLS hostname verification will not be available.])])
109 ])
110
111 dnl Check for SSL, where SSL is mandatory
112 dnl Adds --with-ssl option, searches for openssl and defines HAVE_SSL if found
113 dnl Setup of CPPFLAGS, CFLAGS. Adds -lcrypto to LIBS.
114 dnl Checks main header files of SSL.
115 dnl
116 AC_DEFUN([ACX_WITH_SSL],
117 [
118 AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname],
119 [enable SSL (will check /usr/local/ssl
120 /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr)]),[
121 ],[
122 withval="yes"
123 ])
124 if test x_$withval = x_no; then
125 AC_MSG_ERROR([Need SSL library to do digital signature cryptography])
126 fi
127 ACX_SSL_CHECKS($withval)
128 ])dnl End of ACX_WITH_SSL
129
130 dnl Check for SSL, where ssl is optional (--without-ssl is allowed)
131 dnl Adds --with-ssl option, searches for openssl and defines HAVE_SSL if found
132 dnl Setup of CPPFLAGS, CFLAGS. Adds -lcrypto to LIBS.
133 dnl Checks main header files of SSL.
134 dnl
135 AC_DEFUN([ACX_WITH_SSL_OPTIONAL],
136 [
137 AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname],
138 [enable SSL (will check /usr/local/ssl
139 /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr)]),[
140 ],[
141 withval="yes"
142 ])
143 ACX_SSL_CHECKS($withval)
144 ])dnl End of ACX_WITH_SSL_OPTIONAL
145
146 dnl Setup to use -lssl
147 dnl To use -lcrypto, use the ACX_WITH_SSL setup (before this one).
148 AC_DEFUN([ACX_LIB_SSL],
149 [
150 # check if libssl needs libdl
151 BAKLIBS="$LIBS"
152 LIBS="-lssl $LIBS"
153 AC_MSG_CHECKING([if libssl needs libdl])
154 AC_TRY_LINK_FUNC([SSL_CTX_new], [
155 AC_MSG_RESULT([no])
156 LIBS="$BAKLIBS"
157 ] , [
158 AC_MSG_RESULT([yes])
159 LIBS="$BAKLIBS"
160 AC_SEARCH_LIBS([dlopen], [dl])
161 ]) ])dnl End of ACX_LIB_SSL
162
163
+0
-74
m4/ax_check_compile_flag.m4 less more
0 # ===========================================================================
1 # http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
2 # ===========================================================================
3 #
4 # SYNOPSIS
5 #
6 # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
7 #
8 # DESCRIPTION
9 #
10 # Check whether the given FLAG works with the current language's compiler
11 # or gives an error. (Warnings, however, are ignored)
12 #
13 # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
14 # success/failure.
15 #
16 # If EXTRA-FLAGS is defined, it is added to the current language's default
17 # flags (e.g. CFLAGS) when the check is done. The check is thus made with
18 # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
19 # force the compiler to issue an error when a bad flag is given.
20 #
21 # INPUT gives an alternative input source to AC_COMPILE_IFELSE.
22 #
23 # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
24 # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
25 #
26 # LICENSE
27 #
28 # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
29 # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
30 #
31 # This program is free software: you can redistribute it and/or modify it
32 # under the terms of the GNU General Public License as published by the
33 # Free Software Foundation, either version 3 of the License, or (at your
34 # option) any later version.
35 #
36 # This program is distributed in the hope that it will be useful, but
37 # WITHOUT ANY WARRANTY; without even the implied warranty of
38 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
39 # Public License for more details.
40 #
41 # You should have received a copy of the GNU General Public License along
42 # with this program. If not, see <http://www.gnu.org/licenses/>.
43 #
44 # As a special exception, the respective Autoconf Macro's copyright owner
45 # gives unlimited permission to copy, distribute and modify the configure
46 # scripts that are the output of Autoconf when processing the Macro. You
47 # need not follow the terms of the GNU General Public License when using
48 # or distributing such scripts, even though portions of the text of the
49 # Macro appear in them. The GNU General Public License (GPL) does govern
50 # all other use of the material that constitutes the Autoconf Macro.
51 #
52 # This special exception to the GPL applies to versions of the Autoconf
53 # Macro released by the Autoconf Archive. When you make and distribute a
54 # modified version of the Autoconf Macro, you may extend this special
55 # exception to the GPL to apply to your modified version as well.
56
57 #serial 3
58
59 AC_DEFUN([AX_CHECK_COMPILE_FLAG],
60 [AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
61 AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
62 AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
63 ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
64 _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
65 AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
66 [AS_VAR_SET(CACHEVAR,[yes])],
67 [AS_VAR_SET(CACHEVAR,[no])])
68 _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
69 AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
70 [m4_default([$2], :)],
71 [m4_default([$3], :)])
72 AS_VAR_POPDEF([CACHEVAR])dnl
73 ])dnl AX_CHECK_COMPILE_FLAGS
+0
-80
m4/ax_lib_nettle.m4 less more
0 # ===========================================================================
1 # https://www.gnu.org/software/autoconf-archive/ax_lib_nettle.html
2 # ===========================================================================
3 #
4 # SYNOPSIS
5 #
6 # AX_LIB_NETTLE([yes|no|auto])
7 #
8 # DESCRIPTION
9 #
10 # Searches for the 'nettle' library with the --with... option.
11 #
12 # If found, define HAVE_NETTLE and macro NETTLE_LIBS. Also defines
13 # NETTLE_WITH_<algo> for the algorithms found available. Possible
14 # algorithms: AES ARCTWO BLOWFISH CAST128 DES DES3 SERPENT TWOFISH MD2 MD4
15 # MD5 SHA1 SHA256.
16 #
17 # The argument is used if no --with...-nettle option is set. Value "yes"
18 # requires the configuration by default. Value "no" does not require it by
19 # default. Value "auto" configures the library only if available.
20 #
21 # See also AX_LIB_BEECRYPT, AX_LIB_CRYPTO, and AX_LIB_GCRYPT.
22 #
23 # LICENSE
24 #
25 # Copyright (c) 2009 Fabien Coelho <autoconf.archive@coelho.net>
26 #
27 # Copying and distribution of this file, with or without modification, are
28 # permitted in any medium without royalty provided the copyright notice
29 # and this notice are preserved. This file is offered as-is, without any
30 # warranty.
31
32 #serial 10
33
34 # AX_CHECK_NETTLE_ALGO([name],[function])
35 AC_DEFUN([AX_CHECK_NETTLE_ALGO],[
36 AC_CHECK_LIB([nettle], [nettle_$2],
37 AC_DEFINE([NETTLE_WITH_$1],[1],[Algorithm $1 in nettle library]))
38 ])
39
40 # AX_LIB_NETTLE([yes|no|auto])
41 AC_DEFUN([AX_LIB_NETTLE],[
42 AC_MSG_CHECKING([whether nettle is enabled])
43 AC_ARG_WITH([nettle],
44 AC_HELP_STRING([--with-nettle], [Require nettle library (required with GnuTLS)]),[
45 AC_MSG_RESULT([$withval])
46 ax_with_nettle=$withval
47 ],[
48 AC_MSG_RESULT([$1])
49 ax_with_nettle=$1
50 ])
51 if test "$ax_with_nettle" = "yes" -o "$ax_with_nettle" = "auto" ; then
52 AC_CHECK_HEADERS([nettle/nettle-meta.h],[
53 AC_CHECK_LIB([nettle],[nettle_base64_encode_final],[
54 AC_DEFINE([HAVE_NETTLE],[1],[Nettle library is available])
55 HAVE_NETTLE=1
56 AC_SUBST([NETTLE_LIBS],[-lnettle])
57 # ciphers
58 AX_CHECK_NETTLE_ALGO([AES],[aes_encrypt])
59 AX_CHECK_NETTLE_ALGO([ARCTWO],[arctwo_encrypt])
60 AX_CHECK_NETTLE_ALGO([BLOWFISH],[blowfish_encrypt])
61 AX_CHECK_NETTLE_ALGO([CAST128],[cast128_encrypt])
62 AX_CHECK_NETTLE_ALGO([DES],[des_encrypt])
63 AX_CHECK_NETTLE_ALGO([DES3],[des3_encrypt])
64 AX_CHECK_NETTLE_ALGO([SERPENT],[serpent_encrypt])
65 AX_CHECK_NETTLE_ALGO([TWOFISH],[twofish_encrypt])
66 # digests
67 AX_CHECK_NETTLE_ALGO([MD2],[md2_digest])
68 AX_CHECK_NETTLE_ALGO([MD4],[md4_digest])
69 AX_CHECK_NETTLE_ALGO([MD5],[md5_digest])
70 AX_CHECK_NETTLE_ALGO([SHA1],[sha1_digest])
71 AX_CHECK_NETTLE_ALGO([SHA256],[sha256_digest])
72 ])
73 ])
74 # complain only if explicitly required
75 if test "$ax_with_nettle" = "yes" -a "x$HAVE_NETTLE" = "x" ; then
76 AC_MSG_ERROR([cannot configure required nettle library])
77 fi
78 fi
79 ])
+0
-214
m4/pkg.m4 less more
0 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1 # serial 1 (pkg-config-0.24)
2 #
3 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program that contains a
21 # configuration script generated by Autoconf, you may include it under
22 # the same distribution terms that you use for the rest of that program.
23
24 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
25 # ----------------------------------
26 AC_DEFUN([PKG_PROG_PKG_CONFIG],
27 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
28 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
29 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
30 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
31 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
32 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
33
34 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
35 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
36 fi
37 if test -n "$PKG_CONFIG"; then
38 _pkg_min_version=m4_default([$1], [0.9.0])
39 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
40 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
41 AC_MSG_RESULT([yes])
42 else
43 AC_MSG_RESULT([no])
44 PKG_CONFIG=""
45 fi
46 fi[]dnl
47 ])# PKG_PROG_PKG_CONFIG
48
49 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
50 #
51 # Check to see whether a particular set of modules exists. Similar
52 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
53 #
54 # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
55 # only at the first occurence in configure.ac, so if the first place
56 # it's called might be skipped (such as if it is within an "if", you
57 # have to call PKG_CHECK_EXISTS manually
58 # --------------------------------------------------------------
59 AC_DEFUN([PKG_CHECK_EXISTS],
60 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
61 if test -n "$PKG_CONFIG" && \
62 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
63 m4_default([$2], [:])
64 m4_ifvaln([$3], [else
65 $3])dnl
66 fi])
67
68 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
69 # ---------------------------------------------
70 m4_define([_PKG_CONFIG],
71 [if test -n "$$1"; then
72 pkg_cv_[]$1="$$1"
73 elif test -n "$PKG_CONFIG"; then
74 PKG_CHECK_EXISTS([$3],
75 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
76 test "x$?" != "x0" && pkg_failed=yes ],
77 [pkg_failed=yes])
78 else
79 pkg_failed=untried
80 fi[]dnl
81 ])# _PKG_CONFIG
82
83 # _PKG_SHORT_ERRORS_SUPPORTED
84 # -----------------------------
85 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
86 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
87 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
88 _pkg_short_errors_supported=yes
89 else
90 _pkg_short_errors_supported=no
91 fi[]dnl
92 ])# _PKG_SHORT_ERRORS_SUPPORTED
93
94
95 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
96 # [ACTION-IF-NOT-FOUND])
97 #
98 #
99 # Note that if there is a possibility the first call to
100 # PKG_CHECK_MODULES might not happen, you should be sure to include an
101 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
102 #
103 #
104 # --------------------------------------------------------------
105 AC_DEFUN([PKG_CHECK_MODULES],
106 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
107 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
108 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
109
110 pkg_failed=no
111 AC_MSG_CHECKING([for $1])
112
113 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
114 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
115
116 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
117 and $1[]_LIBS to avoid the need to call pkg-config.
118 See the pkg-config man page for more details.])
119
120 if test $pkg_failed = yes; then
121 AC_MSG_RESULT([no])
122 _PKG_SHORT_ERRORS_SUPPORTED
123 if test $_pkg_short_errors_supported = yes; then
124 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
125 else
126 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
127 fi
128 # Put the nasty error message in config.log where it belongs
129 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
130
131 m4_default([$4], [AC_MSG_ERROR(
132 [Package requirements ($2) were not met:
133
134 $$1_PKG_ERRORS
135
136 Consider adjusting the PKG_CONFIG_PATH environment variable if you
137 installed software in a non-standard prefix.
138
139 _PKG_TEXT])[]dnl
140 ])
141 elif test $pkg_failed = untried; then
142 AC_MSG_RESULT([no])
143 m4_default([$4], [AC_MSG_FAILURE(
144 [The pkg-config script could not be found or is too old. Make sure it
145 is in your PATH or set the PKG_CONFIG environment variable to the full
146 path to pkg-config.
147
148 _PKG_TEXT
149
150 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
151 ])
152 else
153 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
154 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
155 AC_MSG_RESULT([yes])
156 $3
157 fi[]dnl
158 ])# PKG_CHECK_MODULES
159
160
161 # PKG_INSTALLDIR(DIRECTORY)
162 # -------------------------
163 # Substitutes the variable pkgconfigdir as the location where a module
164 # should install pkg-config .pc files. By default the directory is
165 # $libdir/pkgconfig, but the default can be changed by passing
166 # DIRECTORY. The user can override through the --with-pkgconfigdir
167 # parameter.
168 AC_DEFUN([PKG_INSTALLDIR],
169 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
170 m4_pushdef([pkg_description],
171 [pkg-config installation directory @<:@]pkg_default[@:>@])
172 AC_ARG_WITH([pkgconfigdir],
173 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
174 [with_pkgconfigdir=]pkg_default)
175 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
176 m4_popdef([pkg_default])
177 m4_popdef([pkg_description])
178 ]) dnl PKG_INSTALLDIR
179
180
181 # PKG_NOARCH_INSTALLDIR(DIRECTORY)
182 # -------------------------
183 # Substitutes the variable noarch_pkgconfigdir as the location where a
184 # module should install arch-independent pkg-config .pc files. By
185 # default the directory is $datadir/pkgconfig, but the default can be
186 # changed by passing DIRECTORY. The user can override through the
187 # --with-noarch-pkgconfigdir parameter.
188 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
189 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
190 m4_pushdef([pkg_description],
191 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
192 AC_ARG_WITH([noarch-pkgconfigdir],
193 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
194 [with_noarch_pkgconfigdir=]pkg_default)
195 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
196 m4_popdef([pkg_default])
197 m4_popdef([pkg_description])
198 ]) dnl PKG_NOARCH_INSTALLDIR
199
200
201 # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
202 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
203 # -------------------------------------------
204 # Retrieves the value of the pkg-config variable for the given module.
205 AC_DEFUN([PKG_CHECK_VAR],
206 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
207 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
208
209 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
210 AS_VAR_COPY([$1], [pkg_cv_][$1])
211
212 AS_VAR_IF([$1], [""], [$5], [$4])dnl
213 ])# PKG_CHECK_VAR
+0
-172
spec/example/Makefile.in less more
0 #
1 # @configure_input@
2 #
3 # Copyright (c) 2013, Verisign, Inc., NLNet Labs
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are met:
8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
13 # * Neither the names of the copyright holders nor the
14 # names of its contributors may be used to endorse or promote products
15 # derived from this software without specific prior written permission.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 # DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
21 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28 package = @PACKAGE_NAME@
29 version = @PACKAGE_VERSION@
30 tarname = @PACKAGE_TARNAME@
31 distdir = $(tarname)-$(version)
32
33 prefix = @prefix@
34 exec_prefix = @exec_prefix@
35 bindir = @bindir@
36 LIBTOOL = ../../libtool
37
38 srcdir = @srcdir@
39
40 EXTENSION_LIBEVENT_EXT_LIBS=@EXTENSION_LIBEVENT_EXT_LIBS@
41 EXTENSION_LIBEVENT_LDFLAGS=@EXTENSION_LIBEVENT_LDFLAGS@
42 EXTENSION_LIBEVENT_LIB=../../src/libgetdns_ext_event.la
43
44 CC=@CC@
45 CFLAGS=-I$(srcdir) -I$(srcdir)/../../src -I../../src @CFLAGS@
46 LDFLAGS=@LDFLAGS@ -L../../src
47 LDLIBS=../../src/libgetdns.la @LIBS@
48
49
50 OBJS=example-all-functions.lo example-simple-answers.lo example-tree.lo example-synchronous.lo example-reverse.lo
51
52 PROGRAMS=example-all-functions example-synchronous example-simple-answers example-tree example-reverse
53
54 .SUFFIXES: .c .o .a .lo .h
55
56 .c.o:
57 $(CC) $(CFLAGS) -c $< -o $@
58
59 .c.lo:
60 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $< -o $@
61
62 default: all
63 example: all
64
65 all: $(PROGRAMS)
66
67 $(OBJS):
68 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/$(@:.lo=.c) -o $@
69
70 example-all-functions: example-all-functions.lo
71 $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ example-all-functions.lo
72
73 example-synchronous: example-synchronous.lo
74 $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ example-synchronous.lo
75
76 $(EXTENSION_LIBEVENT_LIB):
77 @echo "***"
78 @echo "*** Three examples from the specification need libevent."
79 @echo "*** libevent was not found or usable at configure time."
80 @echo "*** To compile and run all examples from the spec, make sure"
81 @echo "*** libevent is available and usable during configuration."
82 @echo "***"
83 @false
84
85 example-simple-answers: example-simple-answers.lo $(EXTENSION_LIBEVENT_LIB)
86 $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(EXTENSION_LIBEVENT_LIB) $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) $(LDLIBS) -o $@ example-simple-answers.lo
87
88 example-tree: example-tree.lo $(EXTENSION_LIBEVENT_LIB)
89 $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(EXTENSION_LIBEVENT_LIB) $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) $(LDLIBS) -o $@ example-tree.lo
90
91 example-reverse: example-reverse.lo $(EXTENSION_LIBEVENT_LIB)
92 $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(EXTENSION_LIBEVENT_LIB) $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) $(LDLIBS) -o $@ example-reverse.lo
93
94 clean:
95 rm -f *.o *.lo $(PROGRAMS)
96 rm -rf .libs
97
98 distclean : clean
99 rm -f Makefile config.status config.log
100 rm -Rf autom4te.cache
101
102 $(distdir): FORCE
103 mkdir -p $(distdir)/src
104 cp configure.ac $(distdir)
105 cp configure $(distdir)
106 cp Makefile.in $(distdir)
107 cp src/Makefile.in $(distdir)/src
108
109 distcheck: $(distdir).tar.gz
110 gzip -cd $(distdir).tar.gz | tar xvf -
111 cd $(distdir) && ./configure
112 cd $(distdir) && $(MAKE) all
113 cd $(distdir) && $(MAKE) check
114 cd $(distdir) && $(MAKE) DESTDIR=$${PWD}/_inst install
115 cd $(distdir) && $(MAKE) DESTDIR=$${PWD}/_inst uninstall
116 @remaining="`find $${PWD}/$(distdir)/_inst -type f | wc -l`"; \
117 if test "$${remaining}" -ne 0; then
118 echo "@@@ $${remaining} file(s) remaining in stage directory!"; \
119 exit 1; \
120 fi
121 cd $(distdir) && $(MAKE) clean
122 rm -rf $(distdir)
123 @echo "*** Package $(distdir).tar.gz is ready for distribution"
124
125 Makefile: $(srcdir)/Makefile.in ../../config.status
126 cd ../.. && ./config.status spec/example/Makefile
127
128 configure.status: configure
129 cd ../.. && ./config.status --recheck
130
131 .PHONY: clean
132
133 depend:
134 (cd $(srcdir) ; awk 'BEGIN{P=1}{if(P)print}/^# Dependencies/{P=0}' Makefile.in > Makefile.in.new )
135 (blddir=`pwd`; cd $(srcdir) ; gcc -MM -I. -I../../src -I"$$blddir"/../../src *.c | \
136 sed -e "s? $$blddir/? ?g" \
137 -e 's? \([a-z_-]*\)\.\([ch]\)? $$(srcdir)/\1.\2?g' \
138 -e 's? \$$(srcdir)/\.\./\.\./src/config\.h? ../../src/config.h?g' \
139 -e 's? $$(srcdir)/\.\./\.\./src/getdns/getdns_extra\.h? ../../src/getdns/getdns_extra.h?g' \
140 -e 's? \.\./\.\./src/getdns/getdns_ext_libevent\.h? $$(srcdir)/../../src/getdns/getdns_ext_libevent.h?g' \
141 -e 's? \.\./\.\./src/getdns/getdns_ext_libev\.h? $$(srcdir)/../../src/getdns/getdns_ext_libev.h?g' \
142 -e 's? \.\./\.\./src/getdns/getdns_ext_libuv\.h? $$(srcdir)/../../src/getdns/getdns_ext_libuv.h?g' \
143 -e 's? \.\./\.\./src/debug\.h? $$(srcdir)/../../src/debug.h?g' \
144 -e 's!\(.*\)\.o[ :]*!\1.lo \1.o: !g' >> Makefile.in.new )
145 (cd $(srcdir) ; diff Makefile.in.new Makefile.in && rm Makefile.in.new \
146 || mv Makefile.in.new Makefile.in )
147
148
149 # Dependencies for the examples
150 example-all-functions.lo example-all-functions.o: $(srcdir)/example-all-functions.c $(srcdir)/getdns_libevent.h \
151 ../../src/config.h \
152 ../../src/getdns/getdns.h \
153 $(srcdir)/../../src/getdns/getdns_ext_libevent.h \
154 ../../src/getdns/getdns_extra.h
155 example-reverse.lo example-reverse.o: $(srcdir)/example-reverse.c $(srcdir)/getdns_libevent.h \
156 ../../src/config.h \
157 ../../src/getdns/getdns.h \
158 $(srcdir)/../../src/getdns/getdns_ext_libevent.h \
159 ../../src/getdns/getdns_extra.h
160 example-simple-answers.lo example-simple-answers.o: $(srcdir)/example-simple-answers.c $(srcdir)/getdns_libevent.h \
161 ../../src/config.h \
162 ../../src/getdns/getdns.h \
163 $(srcdir)/../../src/getdns/getdns_ext_libevent.h \
164 ../../src/getdns/getdns_extra.h
165 example-synchronous.lo example-synchronous.o: $(srcdir)/example-synchronous.c $(srcdir)/getdns_core_only.h \
166 ../../src/getdns/getdns.h
167 example-tree.lo example-tree.o: $(srcdir)/example-tree.c $(srcdir)/getdns_libevent.h \
168 ../../src/config.h \
169 ../../src/getdns/getdns.h \
170 $(srcdir)/../../src/getdns/getdns_ext_libevent.h \
171 ../../src/getdns/getdns_extra.h
5757 # entered, it will be relative to the location where doxygen was started. If
5858 # left blank the current directory will be used.
5959
60 OUTPUT_DIRECTORY = ../doc
60 OUTPUT_DIRECTORY = doc
6161
6262 # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
6363 # directories (in 2 levels) under the output directory of each output format and
+0
-612
src/Makefile.in less more
0 #
1 # @configure_input@
2 #
3 # Copyright (c) 2013, Verisign, Inc., NLnet Labs
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are met:
8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
13 # * Neither the names of the copyright holders nor the
14 # names of its contributors may be used to endorse or promote products
15 # derived from this software without specific prior written permission.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 # DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
21 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28 package = @PACKAGE_NAME@
29 version = @PACKAGE_VERSION@
30 tarname = @PACKAGE_TARNAME@
31 distdir = $(tarname)-$(version)
32 libversion = @GETDNS_LIBVERSION@
33
34 prefix = @prefix@
35 exec_prefix = @exec_prefix@
36 bindir = @bindir@
37 sbindir = @sbindir@
38 libdir = @libdir@
39 includedir = @includedir@
40 sysconfdir = @sysconfdir@
41 localstatedir = @localstatedir@
42 runstatedir = @runstatedir@
43 stubbyconfdir = $(sysconfdir)/stubby
44 have_libevent = @have_libevent@
45 have_libuv = @have_libuv@
46 have_libev = @have_libev@
47 # datarootdir is here to please some checkers
48 datarootdir=@datarootdir@
49 mandir=@mandir@
50 INSTALL = @INSTALL@
51 INSTALL_DATA = @INSTALL_DATA@
52
53 srcdir = @srcdir@
54 tlsdir = @TLSDIR@
55 stubbysrcdir = $(srcdir)/../stubby
56 LIBTOOL = ../libtool
57
58 CC=@CC@
59 CFLAGS=-I$(srcdir) -I. -I$(srcdir)/util/auxiliary -I$(srcdir)/tls -I$(srcdir)/$(tlsdir) -I$(stubbysrcdir)/src @CFLAGS@ @CPPFLAGS@ $(XTRA_CFLAGS)
60 WPEDANTICFLAG=@WPEDANTICFLAG@
61 WNOERRORFLAG=@WNOERRORFLAG@
62 LDFLAGS=@LDFLAGS@ @LIBS@
63
64 STUBBY_LDFLAGS=@STUBBY_LDFLAGS@ @STUBBY_LIBS@
65
66 EXTENSION_LIBEVENT_LIB=@EXTENSION_LIBEVENT_LIB@
67 EXTENSION_LIBEVENT_EXT_LIBS=@EXTENSION_LIBEVENT_EXT_LIBS@
68 EXTENSION_LIBEVENT_LDFLAGS=@EXTENSION_LIBEVENT_LDFLAGS@
69 EXTENSION_LIBEV_LIB=@EXTENSION_LIBEV_LIB@
70 EXTENSION_LIBEV_EXT_LIBS=@EXTENSION_LIBEV_EXT_LIBS@
71 EXTENSION_LIBEV_LDFLAGS=@EXTENSION_LIBEV_LDFLAGS@
72 EXTENSION_LIBUV_LIB=@EXTENSION_LIBUV_LIB@
73 EXTENSION_LIBUV_EXT_LIBS=@EXTENSION_LIBUV_EXT_LIBS@
74 EXTENSION_LIBUV_LDFLAGS=@EXTENSION_LIBUV_LDFLAGS@
75
76 C99COMPATFLAGS=@C99COMPATFLAGS@
77
78 DEFAULT_EVENTLOOP_OBJ=@DEFAULT_EVENTLOOP@.lo
79
80 GETDNS_OBJ=const-info.lo convert.lo dict.lo dnssec.lo general.lo \
81 list.lo request-internal.lo platform.lo rr-dict.lo \
82 rr-iter.lo server.lo stub.lo sync.lo ub_loop.lo util-internal.lo \
83 mdns.lo pubkey-pinning.lo
84
85 GLDNS_OBJ=keyraw.lo gbuffer.lo wire2str.lo parse.lo parseutil.lo rrdef.lo \
86 str2wire.lo
87
88 PROGRAMS=@STUBBY@
89
90 LIBOBJDIR=
91 LIBOBJS=@LIBOBJS@
92 COMPAT_OBJ=$(LIBOBJS:.o=.lo)
93
94 UTIL_OBJ=rbtree.lo lruhash.lo lookup3.lo locks.lo
95
96 JSMN_OBJ=jsmn.lo
97 TLS_OBJ=tls.lo pubkey-pinning-internal.lo keyraw-internal.lo
98 TLS_COMMON_OBJ=val_secalgo.lo anchor-internal.lo
99 YXML_OBJ=yxml.lo
100
101 YAML_OBJ=convert_yaml_to_json.lo
102 DANESSL_OBJ=danessl.lo
103
104 GETDNS_XTRA_OBJS=@GETDNS_XTRA_OBJS@ @DANESSL_XTRA_OBJS@
105 STUBBY_XTRA_OBJS=@STUBBY_XTRA_OBJS@
106
107 EXTENSION_OBJ=$(DEFAULT_EVENTLOOP_OBJ) libevent.lo libev.lo
108
109 NON_C99_OBJS=libuv.lo context.lo anchor.lo
110
111 .SUFFIXES: .c .o .a .lo .h
112
113 .c.o:
114 $(CC) $(CFLAGS) $(WPEDANTICFLAG) -c $< -o $@
115
116 .c.lo:
117 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(WPEDANTICFLAG) -c $< -o $@
118
119 default: all
120
121 all: libgetdns.la $(EXTENSION_LIBEVENT_LIB) $(EXTENSION_LIBUV_LIB) $(EXTENSION_LIBEV_LIB) $(PROGRAMS)
122
123 $(GETDNS_OBJ):
124 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(WPEDANTICFLAG) -c $(srcdir)/$(@:.lo=.c) -o $@
125
126 $(GLDNS_OBJ):
127 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(WPEDANTICFLAG) -c $(srcdir)/gldns/$(@:.lo=.c) -o $@
128
129 $(COMPAT_OBJ):
130 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/compat/$(@:.lo=.c) -o $@
131
132 $(UTIL_OBJ):
133 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(WNOERRORFLAG) -c $(srcdir)/util/$(@:.lo=.c) -o $@
134
135 $(JSMN_OBJ):
136 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -DJSMN_GETDNS -c $(srcdir)/jsmn/$(@:.lo=.c) -o $@
137
138 $(TLS_OBJ):
139 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/$(tlsdir)/$(@:.lo=.c) -o $@
140
141 $(TLS_COMMON_OBJ):
142 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/tls/$(@:.lo=.c) -o $@
143
144 $(YAML_OBJ):
145 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $(stubbysrcdir)/src/yaml/$(@:.lo=.c) -o $@
146
147 $(DANESSL_OBJ):
148 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(WNOERRORFLAG) -c $(srcdir)/ssl_dane/$(@:.lo=.c) -o $@
149
150 $(YXML_OBJ):
151 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -I$(srcdir)/yxml -DYXML_GETDNS -Wno-unused-parameter -c $(srcdir)/yxml/$(@:.lo=.c) -o $@
152
153 $(EXTENSION_OBJ):
154 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(WPEDANTICFLAG) -c $(srcdir)/extension/$(@:.lo=.c) -o $@
155
156 anchor.lo:
157 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(WPEDANTICFLAG) $(C99COMPATFLAGS) -c $(srcdir)/anchor.c -o anchor.lo
158
159 context.lo:
160 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(WPEDANTICFLAG) $(C99COMPATFLAGS) -c $(srcdir)/context.c -o context.lo
161
162 libuv.lo:
163 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(WPEDANTICFLAG) $(C99COMPATFLAGS) -c $(srcdir)/extension/libuv.c -o libuv.lo
164
165 install-headers: getdns/getdns.h getdns/getdns_extra.h
166 $(INSTALL) -m 755 -d $(DESTDIR)$(includedir)
167 $(INSTALL) -m 755 -d $(DESTDIR)$(includedir)/getdns
168 $(INSTALL) -m 644 getdns/getdns.h $(DESTDIR)$(includedir)/getdns/getdns.h
169 $(INSTALL) -m 644 getdns/getdns_extra.h $(DESTDIR)$(includedir)/getdns/getdns_extra.h
170 if test $(have_libevent) = 1 ; then $(INSTALL) -m 644 $(srcdir)/getdns/getdns_ext_libevent.h $(DESTDIR)$(includedir)/getdns/ ; fi
171 if test $(have_libuv) = 1 ; then $(INSTALL) -m 644 $(srcdir)/getdns/getdns_ext_libuv.h $(DESTDIR)$(includedir)/getdns/ ; fi
172 if test $(have_libev) = 1 ; then $(INSTALL) -m 644 $(srcdir)/getdns/getdns_ext_libev.h $(DESTDIR)$(includedir)/getdns/ ; fi
173
174 uninstall-headers:
175 rm -rf $(DESTDIR)$(includedir)/getdns
176
177 install-libs: libgetdns.la $(EXTENSION_LIBEVENT_LIB) $(EXTENSION_LIBUV_LIB) $(EXTENSION_LIBEV_LIB)
178 $(INSTALL) -m 755 -d $(DESTDIR)$(libdir)
179 $(LIBTOOL) --mode=install cp libgetdns.la $(DESTDIR)$(libdir)
180 if test $(have_libevent) = 1 ; then $(LIBTOOL) --mode=install cp $(EXTENSION_LIBEVENT_LIB) $(DESTDIR)$(libdir) ; fi
181 if test $(have_libuv) = 1 ; then $(LIBTOOL) --mode=install cp $(EXTENSION_LIBUV_LIB) $(DESTDIR)$(libdir) ; fi
182 if test $(have_libev) = 1 ; then $(LIBTOOL) --mode=install cp $(EXTENSION_LIBEV_LIB) $(DESTDIR)$(libdir) ; fi
183 $(LIBTOOL) --mode=finish $(DESTDIR)$(libdir)
184
185 uninstall-libs:
186 if test $(have_libevent) = 1; then $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(EXTENSION_LIBEVENT_LIB) ; fi
187 if test $(have_libuv) = 1; then $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(EXTENSION_LIBUV_LIB) ; fi
188 if test $(have_libev) = 1; then $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(EXTENSION_LIBEV_LIB) ; fi
189 $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/libgetdns.la
190
191 install: install-libs install-headers @INSTALL_STUBBY@
192
193 uninstall: @UNINSTALL_STUBBY@ uninstall-headers uninstall-libs
194
195 libgetdns_ext_event.la: libgetdns.la libevent.lo
196 $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ libevent.lo libgetdns.la $(LDFLAGS) $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/extension/libevent.symbols
197
198 libgetdns_ext_uv.la: libgetdns.la libuv.lo
199 $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ libuv.lo libgetdns.la $(LDFLAGS) $(EXTENSION_LIBUV_LDFLAGS) $(EXTENSION_LIBUV_EXT_LIBS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/extension/libuv.symbols
200
201
202 libgetdns_ext_ev.la: libgetdns.la libev.lo
203 $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ libev.lo libgetdns.la $(LDFLAGS) $(EXTENSION_LIBEV_LDFLAGS) $(EXTENSION_LIBEV_EXT_LIBS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/extension/libev.symbols
204
205 libgetdns.la: $(GETDNS_OBJ) version.lo context.lo anchor.lo $(DEFAULT_EVENTLOOP_OBJ) $(GLDNS_OBJ) $(COMPAT_OBJ) $(UTIL_OBJ) $(JSMN_OBJ) $(TLS_OBJ) $(TLS_COMMON_OBJ) $(YXML_OBJ) $(GETDNS_XTRA_OBJS)
206 $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(GETDNS_OBJ) version.lo context.lo anchor.lo $(DEFAULT_EVENTLOOP_OBJ) $(GLDNS_OBJ) $(COMPAT_OBJ) $(UTIL_OBJ) $(JSMN_OBJ) $(TLS_OBJ) $(TLS_COMMON_OBJ) $(YXML_OBJ) $(GETDNS_XTRA_OBJS) $(LDFLAGS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/libgetdns.symbols
207
208 test: default
209 cd test && $(MAKE) $@
210
211 getdns_query: default
212 cd tools && $(MAKE) $@
213
214 getdns_server_mon: default
215 cd tools && $(MAKE) $@
216
217 stubby.1: $(stubbysrcdir)/doc/stubby.1.in
218 sed -e "s|@ETCDIR@|$(stubbyconfdir)|g" $(stubbysrcdir)/doc/stubby.1.in > $@
219
220 stubby.lo: $(stubbysrcdir)/src/stubby.c
221 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(WPEDANTICFLAG) -DSTUBBYCONFDIR='"$(sysconfdir)/stubby"' -DRUNSTATEDIR='"$(runstatedir)"' -c $(stubbysrcdir)/src/stubby.c -o $@
222
223 stubby: stubby.lo libgetdns.la $(STUBBY_XTRA_OBJS)
224 $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ stubby.lo $(STUBBY_XTRA_OBJS) $(STUBBY_LDFLAGS) libgetdns.la
225
226 install-stubby-files-unix: $(stubbysrcdir)/stubby.yml.example
227 $(INSTALL) -m 755 -d $(DESTDIR)$(stubbyconfdir)
228 test -f $(DESTDIR)$(stubbyconfdir)/stubby.yml || \
229 $(INSTALL_DATA) $(stubbysrcdir)/stubby.yml.example $(DESTDIR)$(stubbyconfdir)/stubby.yml
230
231 install-stubby-files-macos: $(stubbysrcdir)/macos/stubby-setdns-macos.sh install-stubby-files-unix
232 $(INSTALL) -m 755 -d $(DESTDIR)$(sbindir)
233 $(INSTALL) -m 755 $(stubbysrcdir)/macos/stubby-setdns-macos.sh $(DESTDIR)$(sbindir)
234
235 stubby.yml.windows: $(stubbysrcdir)/stubby.yml.example
236 awk "{sub(/$$/,\"\r\")}1" $(stubbysrcdir)/stubby.yml.example > stubby.yml.windows
237
238 install-stubby-files-windows: stubby.yml.windows
239 $(INSTALL) -m 755 -d $(DESTDIR)$(stubbyconfdir)
240 test -f $(DESTDIR)$(stubbyconfdir)/stubby.yml || \
241 $(INSTALL_DATA) stubby.yml.windows $(DESTDIR)$(stubbyconfdir)/stubby.yml
242
243 install-stubby: stubby stubby.1 install-stubby-files-@HOSTOS@
244 $(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
245 $(LIBTOOL) --mode=install cp stubby $(DESTDIR)$(bindir)
246 $(INSTALL) -m 755 -d $(DESTDIR)$(runstatedir)
247 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)
248 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
249 $(INSTALL) -m 644 stubby\.1 $(DESTDIR)$(mandir)/man1
250
251 uninstall-stubby:
252 $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/stubby
253 rm -f $(DESTDIR)$(sbindir)/stubby-setdns-macos.sh
254 rm -f $(DESTDIR)$(mandir)/man1/stubby.1
255
256 scratchpad: default
257 cd test && $(MAKE) $@
258
259 pad: scratchpad
260
261 clean:
262 cd tools && $(MAKE) $@
263 cd test && $(MAKE) $@
264 rm -f *.o *.lo extension/*.lo extension/*.o $(PROGRAMS) libgetdns.la libgetdns_ext_*.la
265 rm -rf .libs extension/.libs
266
267 distclean : clean
268 cd tools && $(MAKE) $@
269 cd test && $(MAKE) $@
270 rmdir test 2>/dev/null || true
271 rm -f Makefile config.status config.log Doxyfile config.h version.c getdns/Makefile getdns/getdns.h getdns/getdns_extra.h
272 rmdir getdns 2>/dev/null || true
273 rmdir extension 2>/dev/null || true
274 rm -Rf autom4te.cache
275
276 Makefile: $(srcdir)/Makefile.in ../config.status
277 cd .. && ./config.status src/Makefile
278
279 depend:
280 (cd $(srcdir) ; awk 'BEGIN{P=1}{if(P)print}/^# Dependencies/{P=0}' Makefile.in > Makefile.in.new )
281
282 (blddir=`pwd`; cd $(srcdir) ; gcc -MM -I. -I"$$blddir" -Itls -I$(tlsdir) -Iyxml -Iutil/auxiliary -I../stubby/src *.c gldns/*.c compat/*.c util/*.c jsmn/*.c $(tlsdir)/*.c yxml/*.c extension/*.c ../stubby/src/*.c | \
283 sed -e "s? $$blddir/? ?g" \
284 -e 's? gldns/? $$(srcdir)/gldns/?g' \
285 -e 's? compat/? $$(srcdir)/compat/?g' \
286 -e 's? util/auxiliary/util/? $$(srcdir)/util/auxiliary/util/?g' \
287 -e 's? util/? $$(srcdir)/util/?g' \
288 -e 's? jsmn/? $$(srcdir)/jsmn/?g' \
289 -e 's? tls/? $$(srcdir)/tls/?g' \
290 -e 's? $(tlsdir)/? $$(srcdir)/$$(tlsdir)/?g' \
291 -e 's? yxml/? $$(srcdir)/yxml/?g' \
292 -e 's? extension/? $$(srcdir)/extension/?g' \
293 -e 's? \.\./stubby/? $$(stubbysrcdir)/?g' \
294 -e 's? \([a-z_-]*\)\.\([ch]\)? $$(srcdir)/\1.\2?g' \
295 -e 's? \$$(srcdir)/config\.h? config.h?g' \
296 -e 's? \$$(srcdir)/getdns/getdns_extra\.h? getdns/getdns_extra.h?g' \
297 -e 's? \$$(srcdir)/version\.c? version.c?g' \
298 -e 's? getdns/getdns_ext_libevent\.h? $$(srcdir)/getdns/getdns_ext_libevent.h?g' \
299 -e 's? getdns/getdns_ext_libev\.h? $$(srcdir)/getdns/getdns_ext_libev.h?g' \
300 -e 's? getdns/getdns_ext_libuv\.h? $$(srcdir)/getdns/getdns_ext_libuv.h?g' \
301 -e 's!\(.*\)\.o[ :]*!\1.lo \1.o: !g' >> Makefile.in.new )
302 (cd $(srcdir) ; diff Makefile.in.new Makefile.in && rm Makefile.in.new \
303 || mv Makefile.in.new Makefile.in )
304 cd tools && $(MAKE) $@
305 cd test && $(MAKE) $@
306
307 .PHONY: clean test
308 FORCE:
309
310 # Dependencies for gldns, utils, the extensions and compat functions
311 anchor.lo anchor.o: $(srcdir)/anchor.c \
312 config.h $(srcdir)/debug.h \
313 $(srcdir)/anchor.h \
314 getdns/getdns.h \
315 getdns/getdns_extra.h \
316 $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/types-internal.h \
317 $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/context.h \
318 $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \
319 $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/server.h $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h \
320 $(srcdir)/dnssec.h $(srcdir)/gldns/rrdef.h $(srcdir)/yxml/yxml.h $(srcdir)/gldns/parseutil.h $(srcdir)/gldns/str2wire.h \
321 $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/wire2str.h $(srcdir)/gldns/keyraw.h $(srcdir)/$(tlsdir)/keyraw-internal.h \
322 $(srcdir)/general.h $(srcdir)/util-internal.h $(srcdir)/platform.h
323 const-info.lo const-info.o: $(srcdir)/const-info.c \
324 getdns/getdns.h \
325 getdns/getdns_extra.h \
326 $(srcdir)/const-info.h
327 context.lo context.o: $(srcdir)/context.c \
328 config.h $(srcdir)/anchor.h \
329 getdns/getdns.h \
330 getdns/getdns_extra.h \
331 $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/types-internal.h \
332 $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/debug.h $(srcdir)/gldns/str2wire.h \
333 $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/wire2str.h $(srcdir)/context.h $(srcdir)/extension/default_eventloop.h \
334 $(srcdir)/extension/poll_eventloop.h $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/server.h $(srcdir)/tls.h \
335 $(srcdir)/$(tlsdir)/tls-internal.h $(srcdir)/util-internal.h $(srcdir)/platform.h $(srcdir)/dnssec.h $(srcdir)/gldns/rrdef.h \
336 $(srcdir)/stub.h $(srcdir)/list.h $(srcdir)/dict.h $(srcdir)/pubkey-pinning.h $(srcdir)/const-info.h
337 convert.lo convert.o: $(srcdir)/convert.c \
338 config.h \
339 getdns/getdns.h \
340 getdns/getdns_extra.h \
341 $(srcdir)/util-internal.h $(srcdir)/context.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h \
342 $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/extension/default_eventloop.h \
343 $(srcdir)/extension/poll_eventloop.h $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/debug.h $(srcdir)/server.h \
344 $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/anchor.h $(srcdir)/tls.h \
345 $(srcdir)/$(tlsdir)/tls-internal.h $(srcdir)/gldns/wire2str.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h \
346 $(srcdir)/gldns/parseutil.h $(srcdir)/const-info.h $(srcdir)/dict.h $(srcdir)/list.h $(srcdir)/jsmn/jsmn.h $(srcdir)/convert.h
347 dict.lo dict.o: $(srcdir)/dict.c \
348 config.h \
349 $(srcdir)/types-internal.h \
350 getdns/getdns.h \
351 getdns/getdns_extra.h \
352 $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/util-internal.h $(srcdir)/context.h \
353 $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \
354 $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/debug.h $(srcdir)/server.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
355 $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/anchor.h $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h \
356 $(srcdir)/dict.h $(srcdir)/list.h $(srcdir)/const-info.h $(srcdir)/gldns/wire2str.h $(srcdir)/gldns/parseutil.h
357 dnssec.lo dnssec.o: $(srcdir)/dnssec.c \
358 config.h $(srcdir)/debug.h \
359 getdns/getdns.h \
360 $(srcdir)/context.h \
361 getdns/getdns_extra.h \
362 $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h \
363 $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \
364 $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/server.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h \
365 $(srcdir)/gldns/pkthdr.h $(srcdir)/anchor.h $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h $(srcdir)/util-internal.h \
366 $(srcdir)/dnssec.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/wire2str.h \
367 $(srcdir)/gldns/keyraw.h $(srcdir)/$(tlsdir)/keyraw-internal.h $(srcdir)/gldns/parseutil.h $(srcdir)/general.h \
368 $(srcdir)/dict.h $(srcdir)/list.h $(srcdir)/util/val_secalgo.h $(srcdir)/gldns/gbuffer.h
369 general.lo general.o: $(srcdir)/general.c \
370 config.h $(srcdir)/general.h \
371 getdns/getdns.h \
372 $(srcdir)/types-internal.h \
373 getdns/getdns_extra.h \
374 $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/ub_loop.h $(srcdir)/debug.h \
375 $(srcdir)/gldns/wire2str.h $(srcdir)/context.h $(srcdir)/extension/default_eventloop.h \
376 $(srcdir)/extension/poll_eventloop.h $(srcdir)/types-internal.h $(srcdir)/server.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
377 $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/anchor.h $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h \
378 $(srcdir)/util-internal.h $(srcdir)/dnssec.h $(srcdir)/gldns/rrdef.h $(srcdir)/stub.h $(srcdir)/dict.h $(srcdir)/mdns.h
379 list.lo list.o: $(srcdir)/list.c $(srcdir)/types-internal.h \
380 getdns/getdns.h \
381 getdns/getdns_extra.h \
382 $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/util-internal.h \
383 config.h $(srcdir)/context.h \
384 $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \
385 $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/debug.h $(srcdir)/server.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
386 $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/anchor.h $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h \
387 $(srcdir)/list.h $(srcdir)/dict.h
388 mdns.lo mdns.o: $(srcdir)/mdns.c \
389 config.h $(srcdir)/debug.h \
390 $(srcdir)/context.h \
391 getdns/getdns.h \
392 getdns/getdns_extra.h \
393 $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h \
394 $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \
395 $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/server.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h \
396 $(srcdir)/gldns/pkthdr.h $(srcdir)/anchor.h $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h $(srcdir)/general.h \
397 $(srcdir)/gldns/rrdef.h $(srcdir)/util-internal.h $(srcdir)/platform.h $(srcdir)/mdns.h
398 platform.lo platform.o: $(srcdir)/platform.c $(srcdir)/platform.h \
399 config.h
400 pubkey-pinning.lo pubkey-pinning.o: $(srcdir)/pubkey-pinning.c \
401 config.h $(srcdir)/debug.h \
402 getdns/getdns.h \
403 $(srcdir)/context.h \
404 getdns/getdns_extra.h \
405 $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h \
406 $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \
407 $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/server.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h \
408 $(srcdir)/gldns/pkthdr.h $(srcdir)/anchor.h $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h $(srcdir)/util-internal.h \
409 $(srcdir)/gldns/parseutil.h $(srcdir)/pubkey-pinning.h $(srcdir)/tls/pubkey-pinning-internal.h
410 request-internal.lo request-internal.o: $(srcdir)/request-internal.c \
411 config.h \
412 $(srcdir)/types-internal.h \
413 getdns/getdns.h \
414 getdns/getdns_extra.h \
415 $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/util-internal.h $(srcdir)/context.h \
416 $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \
417 $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/debug.h $(srcdir)/server.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
418 $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/anchor.h $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h \
419 $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/dict.h $(srcdir)/convert.h $(srcdir)/general.h
420 rr-dict.lo rr-dict.o: $(srcdir)/rr-dict.c $(srcdir)/rr-dict.h \
421 config.h \
422 getdns/getdns.h \
423 $(srcdir)/gldns/gbuffer.h $(srcdir)/util-internal.h $(srcdir)/context.h \
424 getdns/getdns_extra.h \
425 $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h \
426 $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \
427 $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/debug.h $(srcdir)/server.h $(srcdir)/rr-iter.h $(srcdir)/gldns/pkthdr.h \
428 $(srcdir)/anchor.h $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h $(srcdir)/dict.h
429 rr-iter.lo rr-iter.o: $(srcdir)/rr-iter.c $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
430 config.h \
431 getdns/getdns.h \
432 $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/rrdef.h
433 server.lo server.o: $(srcdir)/server.c \
434 config.h \
435 getdns/getdns_extra.h \
436 getdns/getdns.h \
437 $(srcdir)/context.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h \
438 $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \
439 $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/debug.h $(srcdir)/server.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
440 $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/anchor.h $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h \
441 $(srcdir)/util-internal.h $(srcdir)/platform.h
442 stub.lo stub.o: $(srcdir)/stub.c \
443 config.h $(srcdir)/debug.h \
444 $(srcdir)/stub.h \
445 getdns/getdns.h \
446 $(srcdir)/types-internal.h \
447 getdns/getdns_extra.h \
448 $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h \
449 $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/wire2str.h $(srcdir)/rr-iter.h \
450 $(srcdir)/rr-dict.h $(srcdir)/context.h $(srcdir)/extension/default_eventloop.h \
451 $(srcdir)/extension/poll_eventloop.h $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/server.h $(srcdir)/anchor.h \
452 $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h $(srcdir)/util-internal.h $(srcdir)/platform.h $(srcdir)/general.h \
453 $(srcdir)/pubkey-pinning.h
454 sync.lo sync.o: $(srcdir)/sync.c \
455 getdns/getdns.h \
456 config.h $(srcdir)/context.h \
457 getdns/getdns_extra.h \
458 $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h \
459 $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \
460 $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/debug.h $(srcdir)/server.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
461 $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/anchor.h $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h \
462 $(srcdir)/general.h $(srcdir)/util-internal.h $(srcdir)/dnssec.h $(srcdir)/gldns/rrdef.h $(srcdir)/stub.h $(srcdir)/gldns/wire2str.h
463 ub_loop.lo ub_loop.o: $(srcdir)/ub_loop.c $(srcdir)/ub_loop.h \
464 config.h \
465 getdns/getdns.h \
466 getdns/getdns_extra.h \
467 $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/debug.h
468 util-internal.lo util-internal.o: $(srcdir)/util-internal.c \
469 config.h \
470 getdns/getdns.h \
471 $(srcdir)/dict.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/types-internal.h \
472 getdns/getdns_extra.h \
473 $(srcdir)/list.h $(srcdir)/util-internal.h $(srcdir)/context.h $(srcdir)/extension/default_eventloop.h \
474 $(srcdir)/extension/poll_eventloop.h $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/debug.h $(srcdir)/server.h \
475 $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/anchor.h $(srcdir)/tls.h \
476 $(srcdir)/$(tlsdir)/tls-internal.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/dnssec.h \
477 $(srcdir)/gldns/rrdef.h
478 gbuffer.lo gbuffer.o: $(srcdir)/gldns/gbuffer.c \
479 config.h \
480 $(srcdir)/gldns/gbuffer.h
481 keyraw.lo keyraw.o: $(srcdir)/gldns/keyraw.c \
482 config.h \
483 $(srcdir)/gldns/keyraw.h $(srcdir)/$(tlsdir)/keyraw-internal.h $(srcdir)/gldns/rrdef.h
484 parse.lo parse.o: $(srcdir)/gldns/parse.c \
485 config.h \
486 $(srcdir)/gldns/parse.h $(srcdir)/gldns/parseutil.h $(srcdir)/gldns/gbuffer.h
487 parseutil.lo parseutil.o: $(srcdir)/gldns/parseutil.c \
488 config.h \
489 $(srcdir)/gldns/parseutil.h
490 rrdef.lo rrdef.o: $(srcdir)/gldns/rrdef.c \
491 config.h \
492 $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/parseutil.h
493 str2wire.lo str2wire.o: $(srcdir)/gldns/str2wire.c \
494 config.h \
495 $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/wire2str.h $(srcdir)/gldns/gbuffer.h \
496 $(srcdir)/gldns/parse.h $(srcdir)/gldns/parseutil.h
497 wire2str.lo wire2str.o: $(srcdir)/gldns/wire2str.c \
498 config.h \
499 $(srcdir)/gldns/wire2str.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/pkthdr.h \
500 $(srcdir)/gldns/parseutil.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/keyraw.h \
501 $(srcdir)/$(tlsdir)/keyraw-internal.h
502 arc4_lock.lo arc4_lock.o: $(srcdir)/compat/arc4_lock.c \
503 config.h
504 arc4random.lo arc4random.o: $(srcdir)/compat/arc4random.c \
505 config.h \
506 $(srcdir)/compat/chacha_private.h
507 arc4random_uniform.lo arc4random_uniform.o: $(srcdir)/compat/arc4random_uniform.c \
508 config.h
509 explicit_bzero.lo explicit_bzero.o: $(srcdir)/compat/explicit_bzero.c \
510 config.h
511 getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c \
512 config.h
513 getentropy_osx.lo getentropy_osx.o: $(srcdir)/compat/getentropy_osx.c \
514 config.h
515 getentropy_solaris.lo getentropy_solaris.o: $(srcdir)/compat/getentropy_solaris.c \
516 config.h
517 getentropy_win.lo getentropy_win.o: $(srcdir)/compat/getentropy_win.c
518 gettimeofday.lo gettimeofday.o: $(srcdir)/compat/gettimeofday.c \
519 config.h
520 inet_ntop.lo inet_ntop.o: $(srcdir)/compat/inet_ntop.c \
521 config.h
522 inet_pton.lo inet_pton.o: $(srcdir)/compat/inet_pton.c \
523 config.h
524 sha512.lo sha512.o: $(srcdir)/compat/sha512.c \
525 config.h
526 strlcpy.lo strlcpy.o: $(srcdir)/compat/strlcpy.c \
527 config.h
528 strptime.lo strptime.o: $(srcdir)/compat/strptime.c \
529 config.h
530 locks.lo locks.o: $(srcdir)/util/locks.c \
531 config.h $(srcdir)/util/locks.h \
532 $(srcdir)/util/orig-headers/locks.h $(srcdir)/util/auxiliary/util/log.h $(srcdir)/debug.h
533 lookup3.lo lookup3.o: $(srcdir)/util/lookup3.c \
534 config.h \
535 $(srcdir)/util/auxiliary/util/storage/lookup3.h $(srcdir)/util/lookup3.h \
536 $(srcdir)/util/orig-headers/lookup3.h
537 lruhash.lo lruhash.o: $(srcdir)/util/lruhash.c \
538 config.h \
539 $(srcdir)/util/auxiliary/util/storage/lruhash.h $(srcdir)/util/lruhash.h \
540 $(srcdir)/util/orig-headers/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/orig-headers/locks.h \
541 $(srcdir)/util/auxiliary/util/log.h $(srcdir)/debug.h $(srcdir)/util/auxiliary/util/fptr_wlist.h
542 rbtree.lo rbtree.o: $(srcdir)/util/rbtree.c \
543 config.h \
544 $(srcdir)/util/auxiliary/log.h $(srcdir)/util/auxiliary/util/log.h $(srcdir)/debug.h \
545 $(srcdir)/util/auxiliary/fptr_wlist.h $(srcdir)/util/auxiliary/util/fptr_wlist.h \
546 $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h
547 jsmn.lo jsmn.o: $(srcdir)/jsmn/jsmn.c $(srcdir)/jsmn/jsmn.h
548 keyraw-internal.lo keyraw-internal.o: $(srcdir)/$(tlsdir)/keyraw-internal.c \
549 config.h \
550 $(srcdir)/gldns/keyraw.h $(srcdir)/$(tlsdir)/keyraw-internal.h $(srcdir)/gldns/rrdef.h
551 pubkey-pinning-internal.lo pubkey-pinning-internal.o: $(srcdir)/$(tlsdir)/pubkey-pinning-internal.c \
552 config.h $(srcdir)/debug.h \
553 getdns/getdns.h \
554 $(srcdir)/context.h \
555 getdns/getdns_extra.h \
556 $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h \
557 $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \
558 $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/debug.h $(srcdir)/server.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
559 $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/anchor.h $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h \
560 $(srcdir)/util-internal.h $(srcdir)/context.h $(srcdir)/tls/pubkey-pinning-internal.h
561 tls.lo tls.o: $(srcdir)/$(tlsdir)/tls.c \
562 config.h $(srcdir)/debug.h \
563 $(srcdir)/context.h \
564 getdns/getdns.h \
565 getdns/getdns_extra.h \
566 $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h \
567 $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \
568 $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/debug.h $(srcdir)/server.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
569 $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/anchor.h $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h \
570 $(srcdir)/const-info.h $(srcdir)/tls.h
571 yxml.lo yxml.o: $(srcdir)/yxml/yxml.c $(srcdir)/yxml/yxml.h
572 libev.lo libev.o: $(srcdir)/extension/libev.c \
573 config.h \
574 $(srcdir)/types-internal.h \
575 getdns/getdns.h \
576 getdns/getdns_extra.h \
577 $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/getdns/getdns_ext_libev.h
578 libevent.lo libevent.o: $(srcdir)/extension/libevent.c \
579 config.h \
580 $(srcdir)/types-internal.h \
581 getdns/getdns.h \
582 getdns/getdns_extra.h \
583 $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/getdns/getdns_ext_libevent.h
584 libuv.lo libuv.o: $(srcdir)/extension/libuv.c \
585 config.h $(srcdir)/debug.h \
586 $(srcdir)/types-internal.h \
587 getdns/getdns.h \
588 getdns/getdns_extra.h \
589 $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/getdns/getdns_ext_libuv.h
590 poll_eventloop.lo poll_eventloop.o: $(srcdir)/extension/poll_eventloop.c \
591 config.h \
592 $(srcdir)/util-internal.h $(srcdir)/context.h \
593 getdns/getdns.h \
594 getdns/getdns_extra.h \
595 $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h \
596 $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \
597 $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/debug.h $(srcdir)/server.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
598 $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/anchor.h $(srcdir)/tls.h $(srcdir)/$(tlsdir)/tls-internal.h \
599 $(srcdir)/platform.h $(srcdir)/debug.h
600 select_eventloop.lo select_eventloop.o: $(srcdir)/extension/select_eventloop.c \
601 config.h $(srcdir)/debug.h \
602 $(srcdir)/types-internal.h \
603 getdns/getdns.h \
604 getdns/getdns_extra.h \
605 $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/platform.h \
606 $(srcdir)/extension/select_eventloop.h
607 stubby.lo stubby.o: $(stubbysrcdir)/src/stubby.c \
608 config.h \
609 getdns/getdns.h \
610 getdns/getdns_extra.h \
611 $(stubbysrcdir)/src/yaml/convert_yaml_to_json.h
3232 #include "debug.h"
3333 #include "anchor.h"
3434 #include <fcntl.h>
35 #include <strings.h>
35 #include <string.h>
3636 #include <time.h>
3737 #include "types-internal.h"
3838 #include "context.h"
12271227 {
12281228 getdns_return_t r;
12291229 size_t scheduled;
1230 char tas_hostname[256];
1230 char tas_hostname[256] = "";
12311231 const char *verify_CA;
12321232 const char *verify_email;
12331233
3030 #endif
3131 #include <stdlib.h>
3232 #include <string.h>
33 #ifndef GETDNS_ON_WINDOWS
3334 #include <unistd.h>
3435 #include <sys/types.h>
3536 #include <sys/param.h>
3637 #include <sys/time.h>
37 #ifndef GETDNS_ON_WINDOWS
3838 #include <sys/mman.h>
3939 #endif
4040 #if defined(GETDNS_ON_WINDOWS) && !defined(MAP_INHERIT_ZERO)
211211 static inline void
212212 _rs_stir_if_needed(size_t len)
213213 {
214 #ifndef MAP_INHERIT_ZERO
214 #if !defined(GETDNS_ON_WINDOWS) && !defined(MAP_INHERIT_ZERO)
215215 static pid_t _rs_pid = 0;
216216 pid_t pid = getpid();
217217
55 #include "config.h"
66 #include <string.h>
77
8 __attribute__((weak)) void
9 __explicit_bzero_hook(void *ATTR_UNUSED(buf), size_t ATTR_UNUSED(len))
10 {
11 }
12
138 void
149 explicit_bzero(void *buf, size_t len)
1510 {
16 #ifdef UB_ON_WINDOWS
11 #ifdef GETDNS_ON_WINDOWS
1712 SecureZeroMemory(buf, len);
13 #else
14 memset(buf, 0, len);
1815 #endif
19 memset(buf, 0, len);
20 __explicit_bzero_hook(buf, len);
2116 }
2020 */
2121 #include "config.h"
2222
23 #ifdef GETDNS_ON_WINDOWS
24 int gettimeofday(struct timeval* tv, struct timezone* tz)
23 #ifndef HAVE_GETTIMEOFDAY
24
25 int gettimeofday(struct timeval* tv, void* tz)
2526 {
2627 FILETIME ft;
2728 uint64_t now = 0;
6970
7071 return 0;
7172 }
72 #endif /* GETDNS_ON_WINDOWS */
73 #endif /* HAVE_GETTIMEOFDAY */
1717 /* OPENBSD ORIGINAL: lib/libc/net/inet_ntop.c */
1818
1919 #include <config.h>
20
21 #ifndef HAVE_INET_NTOP
2220
2321 #include <sys/param.h>
2422 #include <sys/types.h>
213211 strlcpy(dst, tmp, size);
214212 return (dst);
215213 }
216
217 #endif /* !HAVE_INET_NTOP */
1616 */
1717
1818 #include <config.h>
19
2019 #include <string.h>
2120 #include <stdio.h>
2221 #include <errno.h>
0 /**
1 * \file mkstemp.c
2 * @brief Implementation of mkstemp for Windows.
3 */
4
5 /*
6 * Copyright (c) 2019 Sinodun
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * * Neither the names of the copyright holders nor the
17 * names of its contributors may be used to endorse or promote products
18 * derived from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 * DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
24 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 #include <fcntl.h>
33 #include <stdio.h>
34 #include <string.h>
35 #include <sys/stat.h>
36
37 int mkstemp(char *template)
38 {
39 if (_mktemp_s(template, strlen(template) + 1) != 0)
40 return -1;
41 return open(template, _O_CREAT | _O_EXCL, _S_IWRITE);
42 }
1717 /* OPENBSD ORIGINAL: lib/libc/string/strlcpy.c */
1818
1919 #include <config.h>
20 #ifndef HAVE_STRLCPY
2120
2221 #include <sys/types.h>
2322 #include <string.h>
5251
5352 return(s - src - 1); /* count does not include NUL */
5453 }
55
56 #endif /* !HAVE_STRLCPY */
+0
-943
src/config.h.in less more
0 /* src/config.h.in. Generated from configure.ac by autoheader. */
1
2 /* Define this enable printing of anchor debugging messages. */
3 #undef ANCHOR_DEBUG
4
5 /* Define this to enable printing of daemon debugging messages. */
6 #undef DAEMON_DEBUG
7
8 /* Define this to disable recursing resolution type. */
9 #undef DISABLE_RESOLUTION_RECURSING
10
11 /* Define this to enable the experimental dnssec roadblock avoidance. */
12 #undef DNSSEC_ROADBLOCK_AVOIDANCE
13
14 /* Define this to enable all rrtypes in gldns. */
15 #undef DRAFT_RRTYPES
16
17 /* Define this to enable the experimental edns cookies. */
18 #undef EDNS_COOKIES
19
20 /* The edns cookie option code. */
21 #undef EDNS_COOKIE_OPCODE
22
23 /* How often the edns client cookie is refreshed. */
24 #undef EDNS_COOKIE_ROLLOVER_TIME
25
26 /* The edns padding option code. */
27 #undef EDNS_PADDING_OPCODE
28
29 /* Alternate value for the FD_SETSIZE */
30 #undef FD_SETSIZE
31
32 /* Path to static table lookup for hostnames */
33 #undef GETDNS_FN_HOSTS
34
35 /* Path to resolver configuration file */
36 #undef GETDNS_FN_RESOLVCONF
37
38 /* Define this to enable Windows build. */
39 #undef GETDNS_ON_WINDOWS
40
41 /* Define to 1 if you have the `arc4random' function. */
42 #undef HAVE_ARC4RANDOM
43
44 /* Define to 1 if you have the `arc4random_uniform' function. */
45 #undef HAVE_ARC4RANDOM_UNIFORM
46
47 /* Define to 1 if you have the <arpa/inet.h> header file. */
48 #undef HAVE_ARPA_INET_H
49
50 /* Whether the C compiler accepts the "format" attribute */
51 #undef HAVE_ATTR_FORMAT
52
53 /* Whether the C compiler accepts the "unused" attribute */
54 #undef HAVE_ATTR_UNUSED
55
56 /* Define to 1 if you have the declaration of `arc4random', and to 0 if you
57 don't. */
58 #undef HAVE_DECL_ARC4RANDOM
59
60 /* Define to 1 if you have the declaration of `arc4random_uniform', and to 0
61 if you don't. */
62 #undef HAVE_DECL_ARC4RANDOM_UNIFORM
63
64 /* Define to 1 if you have the declaration of `inet_ntop', and to 0 if you
65 don't. */
66 #undef HAVE_DECL_INET_NTOP
67
68 /* Define to 1 if you have the declaration of `inet_pton', and to 0 if you
69 don't. */
70 #undef HAVE_DECL_INET_PTON
71
72 /* Define to 1 if you have the declaration of `MSG_FASTOPEN', and to 0 if you
73 don't. */
74 #undef HAVE_DECL_MSG_FASTOPEN
75
76 /* Define to 1 if you have the declaration of `NID_ED25519', and to 0 if you
77 don't. */
78 #undef HAVE_DECL_NID_ED25519
79
80 /* Define to 1 if you have the declaration of `NID_ED448', and to 0 if you
81 don't. */
82 #undef HAVE_DECL_NID_ED448
83
84 /* Define to 1 if you have the declaration of `NID_secp384r1', and to 0 if you
85 don't. */
86 #undef HAVE_DECL_NID_SECP384R1
87
88 /* Define to 1 if you have the declaration of `NID_X9_62_prime256v1', and to 0
89 if you don't. */
90 #undef HAVE_DECL_NID_X9_62_PRIME256V1
91
92 /* Define to 1 if you have the declaration of `sk_SSL_COMP_pop_free', and to 0
93 if you don't. */
94 #undef HAVE_DECL_SK_SSL_COMP_POP_FREE
95
96 /* Define to 1 if you have the declaration of
97 `SSL_COMP_get_compression_methods', and to 0 if you don't. */
98 #undef HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
99
100 /* Define to 1 if you have the declaration of `SSL_CTX_set1_curves_list', and
101 to 0 if you don't. */
102 #undef HAVE_DECL_SSL_CTX_SET1_CURVES_LIST
103
104 /* Define to 1 if you have the declaration of `SSL_CTX_set_ecdh_auto', and to
105 0 if you don't. */
106 #undef HAVE_DECL_SSL_CTX_SET_ECDH_AUTO
107
108 /* Define to 1 if you have the declaration of `SSL_get_min_proto_version', and
109 to 0 if you don't. */
110 #undef HAVE_DECL_SSL_GET_MIN_PROTO_VERSION
111
112 /* Define to 1 if you have the declaration of `SSL_set1_curves_list', and to 0
113 if you don't. */
114 #undef HAVE_DECL_SSL_SET1_CURVES_LIST
115
116 /* Define to 1 if you have the declaration of `SSL_set_min_proto_version', and
117 to 0 if you don't. */
118 #undef HAVE_DECL_SSL_SET_MIN_PROTO_VERSION
119
120 /* Define to 1 if you have the declaration of `strlcpy', and to 0 if you
121 don't. */
122 #undef HAVE_DECL_STRLCPY
123
124 /* Define to 1 if you have the declaration of `TCP_FASTOPEN', and to 0 if you
125 don't. */
126 #undef HAVE_DECL_TCP_FASTOPEN
127
128 /* Define to 1 if you have the declaration of `TCP_FASTOPEN_CONNECT', and to 0
129 if you don't. */
130 #undef HAVE_DECL_TCP_FASTOPEN_CONNECT
131
132 /* Define to 1 if you have the <dlfcn.h> header file. */
133 #undef HAVE_DLFCN_H
134
135 /* Define to 1 if you have the `DSA_set0_key' function. */
136 #undef HAVE_DSA_SET0_KEY
137
138 /* Define to 1 if you have the `DSA_set0_pqg' function. */
139 #undef HAVE_DSA_SET0_PQG
140
141 /* Define to 1 if you have the `DSA_SIG_set0' function. */
142 #undef HAVE_DSA_SIG_SET0
143
144 /* Define to 1 if you have the `ECDSA_SIG_get0' function. */
145 #undef HAVE_ECDSA_SIG_GET0
146
147 /* Define to 1 if you have the <endian.h> header file. */
148 #undef HAVE_ENDIAN_H
149
150 /* Define to 1 if you have the `ENGINE_load_cryptodev' function. */
151 #undef HAVE_ENGINE_LOAD_CRYPTODEV
152
153 /* Define to 1 if you have the <event2/event.h> header file. */
154 #undef HAVE_EVENT2_EVENT_H
155
156 /* Define to 1 if you have the `event_base_free' function. */
157 #undef HAVE_EVENT_BASE_FREE
158
159 /* Define to 1 if you have the `event_base_new' function. */
160 #undef HAVE_EVENT_BASE_NEW
161
162 /* Define to 1 if you have the <event.h> header file. */
163 #undef HAVE_EVENT_H
164
165 /* Define to 1 if you have the `EVP_DigestVerify' function. */
166 #undef HAVE_EVP_DIGESTVERIFY
167
168 /* Define to 1 if you have the `EVP_dss1' function. */
169 #undef HAVE_EVP_DSS1
170
171 /* Define to 1 if you have the `EVP_md5' function. */
172 #undef HAVE_EVP_MD5
173
174 /* Define to 1 if you have the `EVP_MD_CTX_new' function. */
175 #undef HAVE_EVP_MD_CTX_NEW
176
177 /* Define to 1 if you have the `EVP_PKEY_base_id' function. */
178 #undef HAVE_EVP_PKEY_BASE_ID
179
180 /* Define to 1 if you have the `EVP_PKEY_keygen' function. */
181 #undef HAVE_EVP_PKEY_KEYGEN
182
183 /* Define to 1 if you have the `EVP_sha1' function. */
184 #undef HAVE_EVP_SHA1
185
186 /* Define to 1 if you have the `EVP_sha224' function. */
187 #undef HAVE_EVP_SHA224
188
189 /* Define to 1 if you have the `EVP_sha256' function. */
190 #undef HAVE_EVP_SHA256
191
192 /* Define to 1 if you have the `EVP_sha384' function. */
193 #undef HAVE_EVP_SHA384
194
195 /* Define to 1 if you have the `EVP_sha512' function. */
196 #undef HAVE_EVP_SHA512
197
198 /* Define to 1 if you have the <ev.h> header file. */
199 #undef HAVE_EV_H
200
201 /* Define to 1 if you have the `fcntl' function. */
202 #undef HAVE_FCNTL
203
204 /* Define to 1 if you have the `FIPS_mode' function. */
205 #undef HAVE_FIPS_MODE
206
207 /* Whether getaddrinfo is available */
208 #undef HAVE_GETADDRINFO
209
210 /* Define to 1 if you have the `getauxval' function. */
211 #undef HAVE_GETAUXVAL
212
213 /* Define this to enable getdns_yaml2dict function. */
214 #undef HAVE_GETDNS_YAML2DICT
215
216 /* Define to 1 if you have the `getentropy' function. */
217 #undef HAVE_GETENTROPY
218
219 /* Define to 1 if you have the `HMAC_CTX_free' function. */
220 #undef HAVE_HMAC_CTX_FREE
221
222 /* Define to 1 if you have the `HMAC_CTX_new' function. */
223 #undef HAVE_HMAC_CTX_NEW
224
225 /* If you have HMAC_Update */
226 #undef HAVE_HMAC_UPDATE
227
228 /* Define to 1 if you have the `inet_ntop' function. */
229 #undef HAVE_INET_NTOP
230
231 /* Define to 1 if you have the `inet_pton' function. */
232 #undef HAVE_INET_PTON
233
234 /* Define to 1 if you have the <inttypes.h> header file. */
235 #undef HAVE_INTTYPES_H
236
237 /* if the function 'ioctlsocket' is available */
238 #undef HAVE_IOCTLSOCKET
239
240 /* Define to 1 if you have the `crypto' library (-lcrypto). */
241 #undef HAVE_LIBCRYPTO
242
243 /* Define to 1 if you have the <libev/ev.h> header file. */
244 #undef HAVE_LIBEV_EV_H
245
246 /* Define to 1 if you have the `idn' library (-lidn). */
247 #undef HAVE_LIBIDN
248
249 /* Define to 1 if you have the `idn2' library (-lidn). */
250 #undef HAVE_LIBIDN2
251
252 /* Define to 1 if you have the `unbound' library (-lunbound). */
253 #undef HAVE_LIBUNBOUND
254
255 /* Define to 1 if you have the `yaml' library (-lyaml). */
256 #undef HAVE_LIBYAML
257
258 /* Define to 1 if you have the <limits.h> header file. */
259 #undef HAVE_LIMITS_H
260
261 /* Define this to enable the draft mdns client support. */
262 #undef HAVE_MDNS_SUPPORT
263
264 /* Define to 1 if you have the <memory.h> header file. */
265 #undef HAVE_MEMORY_H
266
267 /* Define to 1 if you have the <netdb.h> header file. */
268 #undef HAVE_NETDB_H
269
270 /* Define to 1 if you have the <netinet/in.h> header file. */
271 #undef HAVE_NETINET_IN_H
272
273 /* Define to 1 if you have the <netinet/tcp.h> header file. */
274 #undef HAVE_NETINET_TCP_H
275
276 /* Use libnettle for crypto */
277 #undef HAVE_NETTLE
278
279 /* Define to 1 if you have the <nettle/dsa-compat.h> header file. */
280 #undef HAVE_NETTLE_DSA_COMPAT_H
281
282 /* Define to 1 if you have the <nettle/eddsa.h> header file. */
283 #undef HAVE_NETTLE_EDDSA_H
284
285 /* Define to 1 if you have the <nettle/nettle-meta.h> header file. */
286 #undef HAVE_NETTLE_NETTLE_META_H
287
288 /* Does libuv have the new uv_time_cb signature */
289 #undef HAVE_NEW_UV_TIMER_CB
290
291 /* Define to 1 if you have the <openssl/bn.h> header file. */
292 #undef HAVE_OPENSSL_BN_H
293
294 /* Define to 1 if you have the `OPENSSL_config' function. */
295 #undef HAVE_OPENSSL_CONFIG
296
297 /* Define to 1 if you have the <openssl/conf.h> header file. */
298 #undef HAVE_OPENSSL_CONF_H
299
300 /* Define to 1 if you have the <openssl/dsa.h> header file. */
301 #undef HAVE_OPENSSL_DSA_H
302
303 /* Define to 1 if you have the <openssl/engine.h> header file. */
304 #undef HAVE_OPENSSL_ENGINE_H
305
306 /* Define to 1 if you have the <openssl/err.h> header file. */
307 #undef HAVE_OPENSSL_ERR_H
308
309 /* Define to 1 if you have the `OPENSSL_init_crypto' function. */
310 #undef HAVE_OPENSSL_INIT_CRYPTO
311
312 /* Define to 1 if you have the <openssl/rand.h> header file. */
313 #undef HAVE_OPENSSL_RAND_H
314
315 /* Define to 1 if you have the <openssl/rsa.h> header file. */
316 #undef HAVE_OPENSSL_RSA_H
317
318 /* Define to 1 if you have the <openssl/ssl.h> header file. */
319 #undef HAVE_OPENSSL_SSL_H
320
321 /* Define to 1 if you have the `OpenSSL_version' function. */
322 #undef HAVE_OPENSSL_VERSION
323
324 /* Define to 1 if you have the `OpenSSL_version_num' function. */
325 #undef HAVE_OPENSSL_VERSION_NUM
326
327 /* Define to 1 if you have the <openssl/x509.h> header file. */
328 #undef HAVE_OPENSSL_X509_H
329
330 /* Define to 1 if you have the <poll.h> header file. */
331 #undef HAVE_POLL_H
332
333 /* Have pthreads library */
334 #undef HAVE_PTHREAD
335
336 /* Define to 1 if you have the `RSA_set0_key' function. */
337 #undef HAVE_RSA_SET0_KEY
338
339 /* Define to 1 if you have the `SHA512_Update' function. */
340 #undef HAVE_SHA512_UPDATE
341
342 /* Define to 1 if you have the `sigaddset' function. */
343 #undef HAVE_SIGADDSET
344
345 /* Define to 1 if you have the `sigemptyset' function. */
346 #undef HAVE_SIGEMPTYSET
347
348 /* Define to 1 if you have the `sigfillset' function. */
349 #undef HAVE_SIGFILLSET
350
351 /* Define to 1 if you have the <signal.h> header file. */
352 #undef HAVE_SIGNAL_H
353
354 /* Define to 1 if the system has the type `sigset_t'. */
355 #undef HAVE_SIGSET_T
356
357 /* Define if you have the SSL libraries installed. */
358 #undef HAVE_SSL
359
360 /* Define to 1 if you have the `SSL_CTX_dane_enable' function. */
361 #undef HAVE_SSL_CTX_DANE_ENABLE
362
363 /* Define to 1 if you have the `SSL_CTX_set_ciphersuites' function. */
364 #undef HAVE_SSL_CTX_SET_CIPHERSUITES
365
366 /* Define to 1 if you have the `SSL_dane_enable' function. */
367 #undef HAVE_SSL_DANE_ENABLE
368
369 /* Define to 1 if you have the `SSL_dane_tlsa_add' function. */
370 #undef HAVE_SSL_DANE_TLSA_ADD
371
372 /* Define if you have libssl with host name verification */
373 #undef HAVE_SSL_HN_AUTH
374
375 /* Define to 1 if you have the `SSL_set_ciphersuites' function. */
376 #undef HAVE_SSL_SET_CIPHERSUITES
377
378 /* Define to 1 if you have the <stdarg.h> header file. */
379 #undef HAVE_STDARG_H
380
381 /* Define to 1 if you have the <stdint.h> header file. */
382 #undef HAVE_STDINT_H
383
384 /* Define to 1 if you have the <stdio.h> header file. */
385 #undef HAVE_STDIO_H
386
387 /* Define to 1 if you have the <stdlib.h> header file. */
388 #undef HAVE_STDLIB_H
389
390 /* Define to 1 if you have the <strings.h> header file. */
391 #undef HAVE_STRINGS_H
392
393 /* Define to 1 if you have the <string.h> header file. */
394 #undef HAVE_STRING_H
395
396 /* Define to 1 if you have the `strlcpy' function. */
397 #undef HAVE_STRLCPY
398
399 /* Define to 1 if you have the `strptime' function. */
400 #undef HAVE_STRPTIME
401
402 /* Define to 1 if you have the <sys/limits.h> header file. */
403 #undef HAVE_SYS_LIMITS_H
404
405 /* Define to 1 if you have the <sys/poll.h> header file. */
406 #undef HAVE_SYS_POLL_H
407
408 /* Define to 1 if you have the <sys/resource.h> header file. */
409 #undef HAVE_SYS_RESOURCE_H
410
411 /* Define to 1 if you have the <sys/select.h> header file. */
412 #undef HAVE_SYS_SELECT_H
413
414 /* Define to 1 if you have the <sys/sha2.h> header file. */
415 #undef HAVE_SYS_SHA2_H
416
417 /* Define to 1 if you have the <sys/socket.h> header file. */
418 #undef HAVE_SYS_SOCKET_H
419
420 /* Define to 1 if you have the <sys/stat.h> header file. */
421 #undef HAVE_SYS_STAT_H
422
423 /* Define to 1 if you have the <sys/sysctl.h> header file. */
424 #undef HAVE_SYS_SYSCTL_H
425
426 /* Define to 1 if you have the <sys/time.h> header file. */
427 #undef HAVE_SYS_TIME_H
428
429 /* Define to 1 if you have the <sys/types.h> header file. */
430 #undef HAVE_SYS_TYPES_H
431
432 /* Define to 1 if you have the <time.h> header file. */
433 #undef HAVE_TIME_H
434
435 /* Define to 1 if you have the `TLS_client_method' function. */
436 #undef HAVE_TLS_CLIENT_METHOD
437
438 /* Define if you have libssl with tls 1.2 */
439 #undef HAVE_TLS_v1_2
440
441 /* Define to 1 if you have the `ub_ctx_set_stub' function. */
442 #undef HAVE_UB_CTX_SET_STUB
443
444 /* Define this when libunbound is compiled with the --enable-event-api option.
445 */
446 #undef HAVE_UNBOUND_EVENT_API
447
448 /* Define to 1 if you have the <unbound-event.h> header file. */
449 #undef HAVE_UNBOUND_EVENT_H
450
451 /* Define to 1 if you have the <unistd.h> header file. */
452 #undef HAVE_UNISTD_H
453
454 /* Define to 1 if you have the <uv.h> header file. */
455 #undef HAVE_UV_H
456
457 /* Define to 1 if the system has the type `u_char'. */
458 #undef HAVE_U_CHAR
459
460 /* Define to 1 if you have the <windows.h> header file. */
461 #undef HAVE_WINDOWS_H
462
463 /* Define to 1 if you have the <winsock2.h> header file. */
464 #undef HAVE_WINSOCK2_H
465
466 /* Define to 1 if you have the <winsock.h> header file. */
467 #undef HAVE_WINSOCK_H
468
469 /* Define to 1 if you have the <ws2tcpip.h> header file. */
470 #undef HAVE_WS2TCPIP_H
471
472 /* Define to 1 if you have the `X509_check_host' function. */
473 #undef HAVE_X509_CHECK_HOST
474
475 /* Define to 1 if you have the `X509_get0_notAfter' function. */
476 #undef HAVE_X509_GET0_NOTAFTER
477
478 /* Define to 1 if you have the `X509_get_notAfter' function. */
479 #undef HAVE_X509_GET_NOTAFTER
480
481 /* Define to 1 if the system has the type `_sigset_t'. */
482 #undef HAVE__SIGSET_T
483
484 /* Whether the C compiler support the __func__ variable */
485 #undef HAVE___FUNC__
486
487 /* Do not set this */
488 #undef KEEP_CONNECTIONS_OPEN_DEBUG
489
490 /* Define to the sub-directory where libtool stores uninstalled libraries. */
491 #undef LT_OBJDIR
492
493 /* limit for dynamically-generated DNS options */
494 #undef MAXIMUM_UPSTREAM_OPTION_SPACE
495
496 /* The maximum number of cname referrals. */
497 #undef MAX_CNAME_REFERRALS
498
499 /* Algorithm AES in nettle library */
500 #undef NETTLE_WITH_AES
501
502 /* Algorithm ARCTWO in nettle library */
503 #undef NETTLE_WITH_ARCTWO
504
505 /* Algorithm BLOWFISH in nettle library */
506 #undef NETTLE_WITH_BLOWFISH
507
508 /* Algorithm CAST128 in nettle library */
509 #undef NETTLE_WITH_CAST128
510
511 /* Algorithm DES in nettle library */
512 #undef NETTLE_WITH_DES
513
514 /* Algorithm DES3 in nettle library */
515 #undef NETTLE_WITH_DES3
516
517 /* Algorithm MD2 in nettle library */
518 #undef NETTLE_WITH_MD2
519
520 /* Algorithm MD4 in nettle library */
521 #undef NETTLE_WITH_MD4
522
523 /* Algorithm MD5 in nettle library */
524 #undef NETTLE_WITH_MD5
525
526 /* Algorithm SERPENT in nettle library */
527 #undef NETTLE_WITH_SERPENT
528
529 /* Algorithm SHA1 in nettle library */
530 #undef NETTLE_WITH_SHA1
531
532 /* Algorithm SHA256 in nettle library */
533 #undef NETTLE_WITH_SHA256
534
535 /* Algorithm TWOFISH in nettle library */
536 #undef NETTLE_WITH_TWOFISH
537
538 /* Define to the address where bug reports for this package should be sent. */
539 #undef PACKAGE_BUGREPORT
540
541 /* Define to the full name of this package. */
542 #undef PACKAGE_NAME
543
544 /* Define to the full name and version of this package. */
545 #undef PACKAGE_STRING
546
547 /* Define to the one symbol short name of this package. */
548 #undef PACKAGE_TARNAME
549
550 /* Define to the home page for this package. */
551 #undef PACKAGE_URL
552
553 /* Define to the version of this package. */
554 #undef PACKAGE_VERSION
555
556 /* Define this to enable printing of request debugging messages. */
557 #undef REQ_DEBUG
558
559 /* Define as the return type of signal handlers (`int' or `void'). */
560 #undef RETSIGTYPE
561
562 /* Define this to enable printing of scheduling debugging messages. */
563 #undef SCHED_DEBUG
564
565 /* Define this to enable printing of dnssec debugging messages. */
566 #undef SEC_DEBUG
567
568 /* Define this enable printing of server debugging messages. */
569 #undef SERVER_DEBUG
570
571 /* Define to 1 if you have the ANSI C header files. */
572 #undef STDC_HEADERS
573
574 /* use default strptime. */
575 #undef STRPTIME_WORKS
576
577 /* Stubby package */
578 #undef STUBBY_PACKAGE
579
580 /* Stubby package string */
581 #undef STUBBY_PACKAGE_STRING
582
583 /* Define this to enable printing of stub debugging messages. */
584 #undef STUB_DEBUG
585
586 /* Define this to enable native stub DNSSEC support. */
587 #undef STUB_NATIVE_DNSSEC
588
589 /* System configuration dir */
590 #undef SYSCONFDIR
591
592 /* Default trust anchor file */
593 #undef TRUST_ANCHOR_FILE
594
595 /* Maximum number of queries an failed UDP upstream passes before it will
596 retry */
597 #undef UDP_MAX_BACKOFF
598
599 /* Define this to use DANE functions from the ssl_dane/danessl library. */
600 #undef USE_DANESSL
601
602 /* Define this to enable DSA support. */
603 #undef USE_DSA
604
605 /* Define this to enable ECDSA support. */
606 #undef USE_ECDSA
607
608 /* Define this to enable an EVP workaround for older openssl */
609 #undef USE_ECDSA_EVP_WORKAROUND
610
611 /* Define this to enable ED25519 support. */
612 #undef USE_ED25519
613
614 /* Define this to enable ED448 support. */
615 #undef USE_ED448
616
617 /* Use the GnuTLS library */
618 #undef USE_GNUTLS
619
620 /* Define this to enable GOST support. */
621 #undef USE_GOST
622
623 /* Define this to enable TCP fast open. */
624 #undef USE_OSX_TCP_FASTOPEN
625
626 /* Define this to enable a default eventloop based on poll(). */
627 #undef USE_POLL_DEFAULT_EVENTLOOP
628
629 /* Define this to enable SHA1 support. */
630 #undef USE_SHA1
631
632 /* Define this to enable SHA256 and SHA512 support. */
633 #undef USE_SHA2
634
635 /* Define this to enable TCP fast open. */
636 #undef USE_TCP_FASTOPEN
637
638 /* Whether the windows socket API is used */
639 #undef USE_WINSOCK
640
641 /* Define this to enable YAML config support. */
642 #undef USE_YAML_CONFIG
643
644 /* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
645 <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
646 #define below would cause a syntax error. */
647 #undef _UINT32_T
648
649 /* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
650 <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
651 #define below would cause a syntax error. */
652 #undef _UINT64_T
653
654 /* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
655 <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
656 #define below would cause a syntax error. */
657 #undef _UINT8_T
658
659 /* Define to `unsigned int' if <sys/types.h> does not define. */
660 #undef size_t
661
662 /* Define to the type of an unsigned integer type of width exactly 16 bits if
663 such a type exists and the standard includes do not define it. */
664 #undef uint16_t
665
666 /* Define to the type of an unsigned integer type of width exactly 32 bits if
667 such a type exists and the standard includes do not define it. */
668 #undef uint32_t
669
670 /* Define to the type of an unsigned integer type of width exactly 64 bits if
671 such a type exists and the standard includes do not define it. */
672 #undef uint64_t
673
674 /* Define to the type of an unsigned integer type of width exactly 8 bits if
675 such a type exists and the standard includes do not define it. */
676 #undef uint8_t
677
678
679
680 #ifdef HAVE___FUNC__
681 #define __FUNC__ __func__
682 #else
683 #define __FUNC__ __FUNCTION__
684 #endif
685
686 #ifdef GETDNS_ON_WINDOWS
687 /* On windows it is allowed to increase the FD_SETSIZE
688 * (and necessary to make our custom eventloop work)
689 * See: https://support.microsoft.com/en-us/kb/111855
690 */
691 # ifndef FD_SETSIZE
692 # define FD_SETSIZE 1024
693 # endif
694
695 /* the version of the windows API enabled */
696 # ifndef WINVER
697 # define WINVER 0x0600 // 0x0502
698 # endif
699 # ifndef _WIN32_WINNT
700 # define _WIN32_WINNT 0x0600 // 0x0502
701 # endif
702 # ifdef HAVE_WS2TCPIP_H
703 # include <ws2tcpip.h>
704 # endif
705
706 # ifdef _MSC_VER
707 # if _MSC_VER >= 1800
708 # define PRIsz "zu"
709 # else
710 # define PRIsz "Iu"
711 # endif
712 # else
713 # define PRIsz "Iu"
714 # endif
715
716 # ifdef HAVE_WINSOCK2_H
717 # include <winsock2.h>
718 # endif
719
720 /* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
721 # ifdef HAVE_WINSOCK2_H
722 # define FD_SET_T (u_int)
723 # else
724 # define FD_SET_T
725 # endif
726
727 /* Windows wants us to use _strdup instead of strdup */
728 # ifndef strdup
729 # define strdup _strdup
730 # endif
731 #else
732 # define PRIsz "zu"
733 #endif
734
735 #include <stdint.h>
736 #include <stdio.h>
737 #include <unistd.h>
738 #include <assert.h>
739 #include <string.h>
740
741 #ifdef __cplusplus
742 extern "C" {
743 #endif
744
745 #if STDC_HEADERS
746 #include <stdlib.h>
747 #include <stddef.h>
748 #endif
749
750 #if !defined(HAVE_STRLCPY) || !HAVE_DECL_STRLCPY || !defined(strlcpy)
751 size_t strlcpy(char *dst, const char *src, size_t siz);
752 #else
753 #ifndef __BSD_VISIBLE
754 #define __BSD_VISIBLE 1
755 #endif
756 #endif
757 #if !defined(HAVE_ARC4RANDOM) || !HAVE_DECL_ARC4RANDOM
758 uint32_t arc4random(void);
759 #endif
760 #if !defined(HAVE_ARC4RANDOM_UNIFORM) || !HAVE_DECL_ARC4RANDOM_UNIFORM
761 uint32_t arc4random_uniform(uint32_t upper_bound);
762 #endif
763 #ifndef HAVE_ARC4RANDOM
764 void explicit_bzero(void* buf, size_t len);
765 int getentropy(void* buf, size_t len);
766 void arc4random_buf(void* buf, size_t n);
767 void _ARC4_LOCK(void);
768 void _ARC4_UNLOCK(void);
769 #endif
770 #ifdef COMPAT_SHA512
771 #ifndef SHA512_DIGEST_LENGTH
772 #define SHA512_BLOCK_LENGTH 128
773 #define SHA512_DIGEST_LENGTH 64
774 #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
775 typedef struct _SHA512_CTX {
776 uint64_t state[8];
777 uint64_t bitcount[2];
778 uint8_t buffer[SHA512_BLOCK_LENGTH];
779 } SHA512_CTX;
780 #endif /* SHA512_DIGEST_LENGTH */
781 void SHA512_Init(SHA512_CTX*);
782 void SHA512_Update(SHA512_CTX*, void*, size_t);
783 void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
784 unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
785 #endif /* COMPAT_SHA512 */
786
787 #ifndef HAVE_DECL_INET_PTON
788 int inet_pton(int af, const char* src, void* dst);
789 #endif /* HAVE_INET_PTON */
790
791 #ifndef HAVE_DECL_INET_NTOP
792 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
793 #endif
794
795 #ifdef USE_WINSOCK
796 # ifndef _CUSTOM_VSNPRINTF
797 # define _CUSTOM_VSNPRINTF
798 static inline int _gldns_custom_vsnprintf(char *str, size_t size, const char *format, va_list ap)
799 { int r = vsnprintf(str, size, format, ap); return r == -1 ? _vscprintf(format, ap) : r; }
800 # define vsnprintf _gldns_custom_vsnprintf
801 # endif
802 #endif
803
804 #ifdef __cplusplus
805 }
806 #endif
807
808 /** Use on-board gldns */
809 #define USE_GLDNS 1
810 #ifdef HAVE_SSL
811 # define GLDNS_BUILD_CONFIG_HAVE_SSL 1
812 #endif
813
814 #ifdef HAVE_STDARG_H
815 #include <stdarg.h>
816 #endif
817
818 #include <errno.h>
819
820 #ifdef HAVE_SYS_SOCKET_H
821 #include <sys/socket.h>
822 #endif
823
824 #ifdef HAVE_NETINET_TCP_H
825 #include <netinet/tcp.h>
826 #endif
827
828 #ifdef HAVE_SYS_SELECT_H
829 #include <sys/select.h>
830 #endif
831
832 #ifdef HAVE_SYS_TYPES_H
833 #include <sys/types.h>
834 #endif
835
836 #ifdef HAVE_SYS_STAT_H
837 #include <sys/stat.h>
838 #endif
839
840 #ifdef HAVE_NETINET_IN_H
841 #include <netinet/in.h>
842 #endif
843
844 #ifdef HAVE_ARPA_INET_H
845 #include <arpa/inet.h>
846 #endif
847
848 #ifdef HAVE_INTTYPES_H
849 #include <inttypes.h>
850 #endif
851
852 #ifdef HAVE_LIMITS_H
853 #include <limits.h>
854 #endif
855
856 #ifdef HAVE_SYS_LIMITS_H
857 #include <sys/limits.h>
858 #endif
859
860 #ifdef PATH_MAX
861 #define _GETDNS_PATH_MAX PATH_MAX
862 #else
863 #define _GETDNS_PATH_MAX 2048
864 #endif
865
866 #ifndef PRIu64
867 #define PRIu64 "llu"
868 #endif
869
870 #ifdef HAVE_ATTR_FORMAT
871 # define ATTR_FORMAT(archetype, string_index, first_to_check) \
872 __attribute__ ((format (archetype, string_index, first_to_check)))
873 #else /* !HAVE_ATTR_FORMAT */
874 # define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
875 #endif /* !HAVE_ATTR_FORMAT */
876
877 #if defined(DOXYGEN)
878 # define ATTR_UNUSED(x) x
879 #elif defined(__cplusplus)
880 # define ATTR_UNUSED(x)
881 #elif defined(HAVE_ATTR_UNUSED)
882 # define ATTR_UNUSED(x) x __attribute__((unused))
883 #else /* !HAVE_ATTR_UNUSED */
884 # define ATTR_UNUSED(x) x
885 #endif /* !HAVE_ATTR_UNUSED */
886
887 #ifdef TIME_WITH_SYS_TIME
888 # include <sys/time.h>
889 # include <time.h>
890 #else
891 # ifdef HAVE_SYS_TIME_H
892 # include <sys/time.h>
893 # else
894 # include <time.h>
895 # endif
896 #endif
897
898 #ifdef __cplusplus
899 extern "C" {
900 #endif
901
902 #if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
903 #define strptime unbound_strptime
904 struct tm;
905 char *strptime(const char *s, const char *format, struct tm *tm);
906 #endif
907
908 #if !defined(HAVE_SIGSET_T) && defined(HAVE__SIGSET_T)
909 typedef _sigset_t sigset_t;
910 #endif
911 #if !defined(HAVE_SIGEMPTYSET)
912 # define sigemptyset(pset) (*(pset) = 0)
913 #endif
914 #if !defined(HAVE_SIGFILLSET)
915 # define sigfillset(pset) (*(pset) = (sigset_t)-1)
916 #endif
917 #if !defined(HAVE_SIGADDSET)
918 # define sigaddset(pset, num) (*(pset) |= (1L<<(num)))
919 #endif
920
921 #ifdef HAVE_LIBUNBOUND
922 # include <unbound.h>
923 # ifdef HAVE_UNBOUND_EVENT_H
924 # include <unbound-event.h>
925 # else
926 # ifdef HAVE_UNBOUND_EVENT_API
927 # ifndef _UB_EVENT_PRIMITIVES
928 # define _UB_EVENT_PRIMITIVES
929 struct ub_event_base;
930 struct ub_ctx* ub_ctx_create_ub_event(struct ub_event_base* base);
931 typedef void (*ub_event_callback_t)(void*, int, void*, int, int, char*);
932 int ub_resolve_event(struct ub_ctx* ctx, const char* name, int rrtype,
933 int rrclass, void* mydata, ub_event_callback_t callback, int* async_id);
934 # endif
935 # endif
936 # endif
937 #endif
938
939 #ifdef __cplusplus
940 }
941 #endif
942
5454
5555 #include <sys/stat.h>
5656 #include <string.h>
57 #include <strings.h>
5857 #include <stdio.h>
5958 #include <stdlib.h>
6059
925924
926925 /* For sharing a socket to this upstream with TCP */
927926 upstream->fd = -1;
927 upstream->expires = 0;
928928 upstream->tls_obj = NULL;
929929 upstream->tls_session = NULL;
930930 upstream->tls_cipher_list = NULL;
11121112 return GETDNS_RETURN_GOOD;
11131113 } /* set_os_defaults_windows */
11141114
1115 getdns_return_t
1116 getdns_context_set_resolvconf(getdns_context *context, const char *resolvconf)
1117 {
1118 return GETDNS_RETURN_NOT_IMPLEMENTED;
1119 }
1120
11151121 #else
11161122
11171123 getdns_return_t
11601166
11611167 memset(&hints, 0, sizeof(struct addrinfo));
11621168 hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */
1163 hints.ai_socktype = 0; /* Datagram socket */
1169 hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */
11641170 hints.ai_flags = AI_NUMERICHOST; /* No reverse name lookups */
11651171 hints.ai_protocol = 0; /* Any protocol */
11661172 hints.ai_canonname = NULL;
23892395 {
23902396 #ifdef HAVE_LIBUNBOUND
23912397 # ifndef HAVE_UB_CTX_SET_STUB
2392 char tmpfn[FILENAME_MAX] = P_tmpdir "/getdns-root-dns-servers-XXXXXX";
2398 char tmpfn[FILENAME_MAX];
2399
2400 # ifdef USE_WINSOCK
2401 GetTempPathA(FILENAME_MAX, tmpfn);
2402 strncat_s(tmpfn, FILENAME_MAX, "/getdns-root-dns-servers-XXXXXX", _TRUNCATE);
2403 # else
2404 strlcpy(tmpfn, P_tmpdir "/getdns-root-dns-servers-XXXXXX", FILENAME_MAX);
2405 # endif
2406
23932407 FILE *fh;
23942408 int fd;
23952409 size_t dst_len;
27352749 }
27362750 memset(&hints, 0, sizeof(struct addrinfo));
27372751 hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */
2738 hints.ai_socktype = 0; /* Datagram socket */
2752 hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */
27392753 hints.ai_flags = AI_NUMERICHOST; /* No reverse name lookups */
27402754 hints.ai_protocol = 0; /* Any protocol */
27412755 hints.ai_canonname = NULL;
34723486 ub_setup_recursing(struct ub_ctx *ctx, getdns_context *context)
34733487 {
34743488 _getdns_rr_iter rr_spc, *rr;
3475 char ta_str[8192];
3489 char ta_str[8192] = "";
34763490 int r;
34773491
34783492 if ((r = ub_ctx_set_fwd(ctx, NULL))) {
208208 _getdns_tls_session* tls_session;
209209 getdns_tls_hs_state_t tls_hs_state;
210210 getdns_auth_state_t tls_auth_state;
211
211 uint64_t expires; /* Expire time of waiting netreqs.
212 * This is how long a handshake may
213 * take.
214 */
212215 /* TLS settings */
213216 char *tls_cipher_list;
214217 char *tls_ciphersuites;
4040 #endif
4141 #if defined(HAVE_LIBIDN2)
4242 #include <idn2.h>
43 #elif defined(HAVE_LIBIDN)
44 #include <stringprep.h>
45 #include <idna.h>
4643 #endif
4744 #include "getdns/getdns.h"
4845 #include "getdns/getdns_extra.h"
123120
124121 if (idn2_lookup_u8((uint8_t *)ulabel, &alabel, IDN2_TRANSITIONAL) == IDN2_OK)
125122 return (char *)alabel;
126
127 #elif defined(HAVE_LIBIDN)
128 char *alabel;
129 char *prepped;
130 char prepped2[BUFSIZ];
131
132 if (!ulabel) return NULL;
133
134 setlocale(LC_ALL, "");
135 if ((prepped = stringprep_locale_to_utf8(ulabel))) {
136 if(strlen(prepped)+1 > BUFSIZ) {
137 free(prepped);
138 return NULL;
139 }
140 memcpy(prepped2, prepped, strlen(prepped)+1);
141 free(prepped);
142
143 /* convert to utf8 fails, which it can, but continue anyway */
144 } else if (strlen(ulabel)+1 > BUFSIZ)
145 return NULL;
146 else
147 memcpy(prepped2, ulabel, strlen(ulabel)+1);
148
149 if (stringprep(prepped2, BUFSIZ, 0, stringprep_nameprep) == STRINGPREP_OK
150 && idna_to_ascii_8z(prepped2, &alabel, 0) == IDNA_SUCCESS)
151 return alabel;
152123 #else
153124 (void)ulabel;
154125 #endif
169140 char *
170141 getdns_convert_alabel_to_ulabel(const char *alabel)
171142 {
172 #if defined(HAVE_LIBIDN2) || defined(HAVE_LIBIDN)
143 #if defined(HAVE_LIBIDN2)
173144 char *ulabel;
174145
175146 if (!alabel) return NULL;
176147
177 # if defined(HAVE_LIBIDN2)
178148 if (idn2_to_unicode_8z8z(alabel, &ulabel, 0) == IDN2_OK)
179 # else
180 if (idna_to_unicode_8z8z(alabel, &ulabel, 0) == IDNA_SUCCESS)
181 # endif
182149 return ulabel;
183150 #else
184151 (void)alabel;
459426 prev_str_len = *str_len;
460427 sz = (size_t)*str_len;
461428 sz_needed = gldns_wire2str_rr_scan(
462 &scan_buf, &scan_sz, str, &sz, NULL, 0);
429 &scan_buf, &scan_sz, str, &sz, NULL, 0, NULL);
463430
464431 if (sz_needed > prev_str_len) {
465432 *str = prev_str + sz_needed;
13881355
13891356 static int _jsmn_get_const(const char *js, jsmntok_t *t, uint32_t *value)
13901357 {
1391 char value_str[80];
1358 char value_str[80] = "";
13921359 int size = t->end - t->start;
13931360
13941361 if (size <= 0 || size >= (int)sizeof(value_str))
3737 #include "types-internal.h"
3838 #include <stdio.h>
3939
40 getdns_return_t
41 _getdns_wire2msg_dict_scan(struct mem_funcs *mf,
42 const uint8_t **wire, size_t *wire_len, getdns_dict **msg_dict);
43
4044 getdns_return_t _getdns_wire2rr_dict(struct mem_funcs *mf,
4145 const uint8_t *wire, size_t wire_len, getdns_dict **rr_dict);
4246
8282 static struct getdns_dict_item *
8383 _find_dict_item(const getdns_dict *dict, const char *jptr)
8484 {
85 char first_spc[1024], *first;
85 char first_spc[1024] = "", *first;
8686 struct getdns_dict_item *d;
8787
8888 first = _json_ptr_first(&dict->mf, jptr,
11481148 case t_bindata:
11491149 if ((strcmp(item->node.key, "address_data") == 0 ||
11501150 strcmp(item->node.key, "ipv4_address") == 0 ||
1151 strcmp(item->node.key, "ipv6_address") == 0 ) &&
1151 strcmp(item->node.key, "ipv6_address") == 0 ||
1152 strcmp(item->node.key, "answer_ipv4_address") == 0 ||
1153 strcmp(item->node.key, "answer_ipv6_address") == 0) &&
11521154 (item->i.data.bindata->size == 4 ||
11531155 item->i.data.bindata->size == 16 )) {
11541156
191191 #include "debug.h"
192192 #include <sys/types.h>
193193 #include <sys/stat.h>
194 #include <unistd.h>
195194 #include <ctype.h>
196195 #include "getdns/getdns.h"
197196 #include "context.h"
398397 }
399398 (void) gldns_wire2str_rr_scan(
400399 (UNCONST_UINT8_p *) &data, &data_len, &str, &str_len,
401 (UNCONST_UINT8_p) rr->pkt, rr->pkt_end - rr->pkt);
400 (UNCONST_UINT8_p) rr->pkt, rr->pkt_end - rr->pkt, NULL);
402401 DEBUG_SEC("%s%s", msg, str_spc);
403402 }
404403 static inline void debug_sec_print_dname(const char *msg, const uint8_t *label)
3232
3333 #include "config.h"
3434 #include "types-internal.h"
35 #ifndef USE_WINSOCK
3536 #include <sys/time.h>
37 #else
38 #include <winsock2.h>
39 #endif
3640 #include "getdns/getdns_ext_libevent.h"
3741
3842 #ifdef HAVE_EVENT2_EVENT_H
650650 req->is_dns_request = 0;
651651 _getdns_call_user_callback
652652 ( req, localnames_response);
653 if (return_netreq_p)
654 *return_netreq_p = NULL;
653655 break;
654656 }
655657 #ifdef HAVE_MDNS_SUPPORT
3535 #define _GETDNS_EXTRA_H_
3636
3737 #include <getdns/getdns.h>
38 #include <stdarg.h>
39 #include <stdio.h>
40 #if defined(_WIN32)
41 /* For struct timeval, see getdns_context_get_num_pending_requests */
42 #include <winsock2.h>
43 #else
3844 #include <sys/time.h>
39 #include <stdio.h>
40 #include <time.h>
41 #include <stdarg.h>
45 #endif
4246
4347 #ifdef __cplusplus
4448 extern "C" {
0 #!/bin/sh
1
2 # Meant to be run from this directory
3 rm -fr gldns
4 mkdir gldns
5 svn co https://github.com/NLnetLabs/unbound/trunk/sldns/
6 mv gbuffer.h sbuffer.h
7 mv gbuffer.c sbuffer.c
8 for f in sldns/*.[ch]
9 do
10 #sed -e 's/sldns_/gldns_/g' -e 's/LDNS_/GLDNS_/g' -e 's/include "ldns/include "gldns/g' -e 's/<ldns\/rrdef\.h>/"gldns\/rrdef.h"/g' -e 's/sbuffer\.h/gbuffer.h/g' ${f#sldns/} > gldns/${f#sldns/}
11 sed -e 's/gldns_/sldns_/g' \
12 -e 's/GLDNS_/LDNS_/g' \
13 -e 's/<gldns\/rrdef\.h>/<sldns\/rrdef.h>/g' \
14 -e 's/include "gldns/include "sldns/g' \
15 -e 's/gbuffer\.h/sbuffer.h/g' \
16 ${f#sldns/} > gldns/${f#sldns/}
17 done
18 mv sbuffer.h gbuffer.h
19 mv sbuffer.c gbuffer.c
20
1313 #include "config.h"
1414 #include "gldns/gbuffer.h"
1515 #include <stdarg.h>
16 #include <stdlib.h>
1617
1718 gldns_buffer *
1819 gldns_buffer_new(size_t capacity)
1111
1212 #ifndef GLDNS_SBUFFER_H
1313 #define GLDNS_SBUFFER_H
14
15 #include <stdint.h>
16 #if defined(_MSC_VER)
17 #include <BaseTsd.h>
18 typedef SSIZE_T ssize_t;
19 #endif
1420
1521 #ifdef __cplusplus
1622 extern "C" {
0 #!/bin/sh
1
2 # Meant to be run from this directory
3
4 if [ -d gldns ]
5 then
6 # Import synchronised files from comparison directory
7 for f in gldns/*.[ch]
8 do
9 sed -e 's/sldns_/gldns_/g' \
10 -e 's/LDNS_/GLDNS_/g' \
11 -e 's/include "sldns/include "gldns/g' \
12 -e 's/<sldns\/rrdef\.h>/<gldns\/rrdef.h>/g' \
13 -e 's/sbuffer\.h/gbuffer.h/g' $f > ${f#gldns/}
14 done
15 mv sbuffer.h gbuffer.h
16 mv sbuffer.c gbuffer.c
17 else
18 echo Run compare first
19 fi
1212 #include "gldns/gbuffer.h"
1313
1414 #include <limits.h>
15 #include <stdlib.h>
16 #ifdef HAVE_STRINGS_H
1517 #include <strings.h>
18 #endif
1619
1720 gldns_lookup_table gldns_directive_types[] = {
1821 { GLDNS_DIR_TTL, "$TTL" },
324327 if (c == '\n' && p != 0) {
325328 /* in parentheses */
326329 /* do not write ' ' if we want to skip spaces */
327 if(!(skipw && (strchr(skipw, c)||strchr(skipw, ' '))))
330 if(!(skipw && (strchr(skipw, c)||strchr(skipw, ' ')))) {
331 /* check for space for the space character */
332 if (limit > 0 && (i >= limit || (size_t)(t-token) >= limit)) {
333 *t = '\0';
334 return -1;
335 }
328336 *t++ = ' ';
337 }
329338 lc = c;
330339 continue;
331340 }
1313
1414 #include "config.h"
1515 #include "gldns/parseutil.h"
16 #ifdef HAVE_SYS_TIME_H
1617 #include <sys/time.h>
18 #endif
19 #ifdef HAVE_TIME_H
1720 #include <time.h>
21 #endif
1822 #include <ctype.h>
1923
2024 gldns_lookup_table *
1515 #include "gldns/rrdef.h"
1616 #include "gldns/parseutil.h"
1717
18 #include <stdlib.h>
19
1820 /* classes */
1921 static gldns_lookup_table gldns_rr_classes_data[] = {
2022 { GLDNS_RR_CLASS_IN, "IN" },
247249 */
248250 static gldns_rr_descriptor rdata_field_descriptors[] = {
249251 /* 0 */
250 { 0, NULL, 0, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
252 {(enum gldns_enum_rr_type)0, NULL, 0, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
251253 /* 1 */
252254 {GLDNS_RR_TYPE_A, "A", 1, 1, type_a_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
253255 /* 2 */
355357 /* 53 */
356358 {GLDNS_RR_TYPE_SMIMEA, "SMIMEA", 4, 4, type_tlsa_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
357359 /* 54 */
358 {GLDNS_RR_TYPE_NULL, "TYPE54", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
360 {(enum gldns_enum_rr_type)0, "TYPE54", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
359361 /* 55
360362 * Hip ends with 0 or more Rendezvous Servers represented as dname's.
361363 * Hence the GLDNS_RDF_TYPE_DNAME _variable field and the _maximum field
369371 /* 57 */
370372 {GLDNS_RR_TYPE_RKEY, "RKEY", 4, 4, type_key_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
371373 #else
372 {GLDNS_RR_TYPE_NULL, "TYPE56", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
373 {GLDNS_RR_TYPE_NULL, "TYPE57", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
374 {(enum gldns_enum_rr_type)0, "TYPE56", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
375 {(enum gldns_enum_rr_type)0, "TYPE57", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
374376 #endif
375377 /* 58 */
376378 {GLDNS_RR_TYPE_TALINK, "TALINK", 2, 2, type_talink_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 2 },
385387 {GLDNS_RR_TYPE_CSYNC, "CSYNC", 3, 3, type_csync_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
386388 /* 63 */
387389 {GLDNS_RR_TYPE_ZONEMD, "ZONEMD", 4, 4, type_zonemd_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
388 {GLDNS_RR_TYPE_NULL, "TYPE64", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
389 {GLDNS_RR_TYPE_NULL, "TYPE65", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
390 {GLDNS_RR_TYPE_NULL, "TYPE66", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
391 {GLDNS_RR_TYPE_NULL, "TYPE67", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
392 {GLDNS_RR_TYPE_NULL, "TYPE68", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
393 {GLDNS_RR_TYPE_NULL, "TYPE69", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
394 {GLDNS_RR_TYPE_NULL, "TYPE70", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
395 {GLDNS_RR_TYPE_NULL, "TYPE71", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
396 {GLDNS_RR_TYPE_NULL, "TYPE72", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
397 {GLDNS_RR_TYPE_NULL, "TYPE73", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
398 {GLDNS_RR_TYPE_NULL, "TYPE74", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
399 {GLDNS_RR_TYPE_NULL, "TYPE75", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
400 {GLDNS_RR_TYPE_NULL, "TYPE76", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
401 {GLDNS_RR_TYPE_NULL, "TYPE77", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
402 {GLDNS_RR_TYPE_NULL, "TYPE78", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
403 {GLDNS_RR_TYPE_NULL, "TYPE79", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
404 {GLDNS_RR_TYPE_NULL, "TYPE80", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
405 {GLDNS_RR_TYPE_NULL, "TYPE81", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
406 {GLDNS_RR_TYPE_NULL, "TYPE82", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
407 {GLDNS_RR_TYPE_NULL, "TYPE83", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
408 {GLDNS_RR_TYPE_NULL, "TYPE84", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
409 {GLDNS_RR_TYPE_NULL, "TYPE85", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
410 {GLDNS_RR_TYPE_NULL, "TYPE86", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
411 {GLDNS_RR_TYPE_NULL, "TYPE87", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
412 {GLDNS_RR_TYPE_NULL, "TYPE88", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
413 {GLDNS_RR_TYPE_NULL, "TYPE89", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
414 {GLDNS_RR_TYPE_NULL, "TYPE90", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
415 {GLDNS_RR_TYPE_NULL, "TYPE91", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
416 {GLDNS_RR_TYPE_NULL, "TYPE92", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
417 {GLDNS_RR_TYPE_NULL, "TYPE93", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
418 {GLDNS_RR_TYPE_NULL, "TYPE94", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
419 {GLDNS_RR_TYPE_NULL, "TYPE95", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
420 {GLDNS_RR_TYPE_NULL, "TYPE96", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
421 {GLDNS_RR_TYPE_NULL, "TYPE97", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
422 {GLDNS_RR_TYPE_NULL, "TYPE98", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
390 {(enum gldns_enum_rr_type)0, "TYPE64", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
391 {(enum gldns_enum_rr_type)0, "TYPE65", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
392 {(enum gldns_enum_rr_type)0, "TYPE66", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
393 {(enum gldns_enum_rr_type)0, "TYPE67", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
394 {(enum gldns_enum_rr_type)0, "TYPE68", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
395 {(enum gldns_enum_rr_type)0, "TYPE69", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
396 {(enum gldns_enum_rr_type)0, "TYPE70", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
397 {(enum gldns_enum_rr_type)0, "TYPE71", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
398 {(enum gldns_enum_rr_type)0, "TYPE72", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
399 {(enum gldns_enum_rr_type)0, "TYPE73", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
400 {(enum gldns_enum_rr_type)0, "TYPE74", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
401 {(enum gldns_enum_rr_type)0, "TYPE75", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
402 {(enum gldns_enum_rr_type)0, "TYPE76", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
403 {(enum gldns_enum_rr_type)0, "TYPE77", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
404 {(enum gldns_enum_rr_type)0, "TYPE78", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
405 {(enum gldns_enum_rr_type)0, "TYPE79", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
406 {(enum gldns_enum_rr_type)0, "TYPE80", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
407 {(enum gldns_enum_rr_type)0, "TYPE81", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
408 {(enum gldns_enum_rr_type)0, "TYPE82", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
409 {(enum gldns_enum_rr_type)0, "TYPE83", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
410 {(enum gldns_enum_rr_type)0, "TYPE84", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
411 {(enum gldns_enum_rr_type)0, "TYPE85", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
412 {(enum gldns_enum_rr_type)0, "TYPE86", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
413 {(enum gldns_enum_rr_type)0, "TYPE87", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
414 {(enum gldns_enum_rr_type)0, "TYPE88", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
415 {(enum gldns_enum_rr_type)0, "TYPE89", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
416 {(enum gldns_enum_rr_type)0, "TYPE90", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
417 {(enum gldns_enum_rr_type)0, "TYPE91", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
418 {(enum gldns_enum_rr_type)0, "TYPE92", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
419 {(enum gldns_enum_rr_type)0, "TYPE93", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
420 {(enum gldns_enum_rr_type)0, "TYPE94", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
421 {(enum gldns_enum_rr_type)0, "TYPE95", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
422 {(enum gldns_enum_rr_type)0, "TYPE96", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
423 {(enum gldns_enum_rr_type)0, "TYPE97", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
424 {(enum gldns_enum_rr_type)0, "TYPE98", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
423425
424426 /* 99 */
425427 {GLDNS_RR_TYPE_SPF, "SPF", 1, 0, NULL, GLDNS_RDF_TYPE_STR, GLDNS_RR_NO_COMPRESS, 0 },
426428
427429 /* UINFO [IANA-Reserved] */
428 {GLDNS_RR_TYPE_NULL, "TYPE100", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
430 {(enum gldns_enum_rr_type)0, "TYPE100", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
429431 /* UID [IANA-Reserved] */
430 {GLDNS_RR_TYPE_NULL, "TYPE101", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
432 {(enum gldns_enum_rr_type)0, "TYPE101", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
431433 /* GID [IANA-Reserved] */
432 {GLDNS_RR_TYPE_NULL, "TYPE102", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
434 {(enum gldns_enum_rr_type)0, "TYPE102", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
433435 /* UNSPEC [IANA-Reserved] */
434 {GLDNS_RR_TYPE_NULL, "TYPE103", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
436 {(enum gldns_enum_rr_type)0, "TYPE103", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
435437
436438 /* 104 */
437439 {GLDNS_RR_TYPE_NID, "NID", 2, 2, type_nid_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
447449 /* 109 */
448450 {GLDNS_RR_TYPE_EUI64, "EUI64", 1, 1, type_eui64_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
449451
450 {GLDNS_RR_TYPE_NULL, "TYPE110", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
451 {GLDNS_RR_TYPE_NULL, "TYPE111", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
452 {GLDNS_RR_TYPE_NULL, "TYPE112", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
453 {GLDNS_RR_TYPE_NULL, "TYPE113", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
454 {GLDNS_RR_TYPE_NULL, "TYPE114", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
455 {GLDNS_RR_TYPE_NULL, "TYPE115", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
456 {GLDNS_RR_TYPE_NULL, "TYPE116", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
457 {GLDNS_RR_TYPE_NULL, "TYPE117", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
458 {GLDNS_RR_TYPE_NULL, "TYPE118", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
459 {GLDNS_RR_TYPE_NULL, "TYPE119", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
460 {GLDNS_RR_TYPE_NULL, "TYPE120", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
461 {GLDNS_RR_TYPE_NULL, "TYPE121", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
462 {GLDNS_RR_TYPE_NULL, "TYPE122", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
463 {GLDNS_RR_TYPE_NULL, "TYPE123", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
464 {GLDNS_RR_TYPE_NULL, "TYPE124", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
465 {GLDNS_RR_TYPE_NULL, "TYPE125", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
466 {GLDNS_RR_TYPE_NULL, "TYPE126", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
467 {GLDNS_RR_TYPE_NULL, "TYPE127", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
468 {GLDNS_RR_TYPE_NULL, "TYPE128", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
469 {GLDNS_RR_TYPE_NULL, "TYPE129", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
470 {GLDNS_RR_TYPE_NULL, "TYPE130", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
471 {GLDNS_RR_TYPE_NULL, "TYPE131", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
472 {GLDNS_RR_TYPE_NULL, "TYPE132", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
473 {GLDNS_RR_TYPE_NULL, "TYPE133", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
474 {GLDNS_RR_TYPE_NULL, "TYPE134", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
475 {GLDNS_RR_TYPE_NULL, "TYPE135", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
476 {GLDNS_RR_TYPE_NULL, "TYPE136", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
477 {GLDNS_RR_TYPE_NULL, "TYPE137", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
478 {GLDNS_RR_TYPE_NULL, "TYPE138", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
479 {GLDNS_RR_TYPE_NULL, "TYPE139", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
480 {GLDNS_RR_TYPE_NULL, "TYPE140", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
481 {GLDNS_RR_TYPE_NULL, "TYPE141", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
482 {GLDNS_RR_TYPE_NULL, "TYPE142", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
483 {GLDNS_RR_TYPE_NULL, "TYPE143", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
484 {GLDNS_RR_TYPE_NULL, "TYPE144", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
485 {GLDNS_RR_TYPE_NULL, "TYPE145", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
486 {GLDNS_RR_TYPE_NULL, "TYPE146", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
487 {GLDNS_RR_TYPE_NULL, "TYPE147", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
488 {GLDNS_RR_TYPE_NULL, "TYPE148", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
489 {GLDNS_RR_TYPE_NULL, "TYPE149", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
490 {GLDNS_RR_TYPE_NULL, "TYPE150", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
491 {GLDNS_RR_TYPE_NULL, "TYPE151", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
492 {GLDNS_RR_TYPE_NULL, "TYPE152", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
493 {GLDNS_RR_TYPE_NULL, "TYPE153", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
494 {GLDNS_RR_TYPE_NULL, "TYPE154", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
495 {GLDNS_RR_TYPE_NULL, "TYPE155", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
496 {GLDNS_RR_TYPE_NULL, "TYPE156", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
497 {GLDNS_RR_TYPE_NULL, "TYPE157", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
498 {GLDNS_RR_TYPE_NULL, "TYPE158", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
499 {GLDNS_RR_TYPE_NULL, "TYPE159", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
500 {GLDNS_RR_TYPE_NULL, "TYPE160", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
501 {GLDNS_RR_TYPE_NULL, "TYPE161", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
502 {GLDNS_RR_TYPE_NULL, "TYPE162", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
503 {GLDNS_RR_TYPE_NULL, "TYPE163", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
504 {GLDNS_RR_TYPE_NULL, "TYPE164", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
505 {GLDNS_RR_TYPE_NULL, "TYPE165", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
506 {GLDNS_RR_TYPE_NULL, "TYPE166", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
507 {GLDNS_RR_TYPE_NULL, "TYPE167", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
508 {GLDNS_RR_TYPE_NULL, "TYPE168", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
509 {GLDNS_RR_TYPE_NULL, "TYPE169", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
510 {GLDNS_RR_TYPE_NULL, "TYPE170", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
511 {GLDNS_RR_TYPE_NULL, "TYPE171", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
512 {GLDNS_RR_TYPE_NULL, "TYPE172", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
513 {GLDNS_RR_TYPE_NULL, "TYPE173", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
514 {GLDNS_RR_TYPE_NULL, "TYPE174", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
515 {GLDNS_RR_TYPE_NULL, "TYPE175", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
516 {GLDNS_RR_TYPE_NULL, "TYPE176", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
517 {GLDNS_RR_TYPE_NULL, "TYPE177", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
518 {GLDNS_RR_TYPE_NULL, "TYPE178", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
519 {GLDNS_RR_TYPE_NULL, "TYPE179", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
520 {GLDNS_RR_TYPE_NULL, "TYPE180", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
521 {GLDNS_RR_TYPE_NULL, "TYPE181", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
522 {GLDNS_RR_TYPE_NULL, "TYPE182", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
523 {GLDNS_RR_TYPE_NULL, "TYPE183", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
524 {GLDNS_RR_TYPE_NULL, "TYPE184", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
525 {GLDNS_RR_TYPE_NULL, "TYPE185", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
526 {GLDNS_RR_TYPE_NULL, "TYPE186", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
527 {GLDNS_RR_TYPE_NULL, "TYPE187", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
528 {GLDNS_RR_TYPE_NULL, "TYPE188", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
529 {GLDNS_RR_TYPE_NULL, "TYPE189", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
530 {GLDNS_RR_TYPE_NULL, "TYPE190", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
531 {GLDNS_RR_TYPE_NULL, "TYPE191", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
532 {GLDNS_RR_TYPE_NULL, "TYPE192", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
533 {GLDNS_RR_TYPE_NULL, "TYPE193", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
534 {GLDNS_RR_TYPE_NULL, "TYPE194", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
535 {GLDNS_RR_TYPE_NULL, "TYPE195", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
536 {GLDNS_RR_TYPE_NULL, "TYPE196", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
537 {GLDNS_RR_TYPE_NULL, "TYPE197", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
538 {GLDNS_RR_TYPE_NULL, "TYPE198", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
539 {GLDNS_RR_TYPE_NULL, "TYPE199", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
540 {GLDNS_RR_TYPE_NULL, "TYPE200", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
541 {GLDNS_RR_TYPE_NULL, "TYPE201", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
542 {GLDNS_RR_TYPE_NULL, "TYPE202", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
543 {GLDNS_RR_TYPE_NULL, "TYPE203", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
544 {GLDNS_RR_TYPE_NULL, "TYPE204", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
545 {GLDNS_RR_TYPE_NULL, "TYPE205", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
546 {GLDNS_RR_TYPE_NULL, "TYPE206", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
547 {GLDNS_RR_TYPE_NULL, "TYPE207", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
548 {GLDNS_RR_TYPE_NULL, "TYPE208", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
549 {GLDNS_RR_TYPE_NULL, "TYPE209", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
550 {GLDNS_RR_TYPE_NULL, "TYPE210", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
551 {GLDNS_RR_TYPE_NULL, "TYPE211", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
552 {GLDNS_RR_TYPE_NULL, "TYPE212", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
553 {GLDNS_RR_TYPE_NULL, "TYPE213", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
554 {GLDNS_RR_TYPE_NULL, "TYPE214", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
555 {GLDNS_RR_TYPE_NULL, "TYPE215", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
556 {GLDNS_RR_TYPE_NULL, "TYPE216", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
557 {GLDNS_RR_TYPE_NULL, "TYPE217", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
558 {GLDNS_RR_TYPE_NULL, "TYPE218", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
559 {GLDNS_RR_TYPE_NULL, "TYPE219", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
560 {GLDNS_RR_TYPE_NULL, "TYPE220", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
561 {GLDNS_RR_TYPE_NULL, "TYPE221", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
562 {GLDNS_RR_TYPE_NULL, "TYPE222", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
563 {GLDNS_RR_TYPE_NULL, "TYPE223", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
564 {GLDNS_RR_TYPE_NULL, "TYPE224", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
565 {GLDNS_RR_TYPE_NULL, "TYPE225", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
566 {GLDNS_RR_TYPE_NULL, "TYPE226", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
567 {GLDNS_RR_TYPE_NULL, "TYPE227", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
568 {GLDNS_RR_TYPE_NULL, "TYPE228", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
569 {GLDNS_RR_TYPE_NULL, "TYPE229", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
570 {GLDNS_RR_TYPE_NULL, "TYPE230", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
571 {GLDNS_RR_TYPE_NULL, "TYPE231", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
572 {GLDNS_RR_TYPE_NULL, "TYPE232", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
573 {GLDNS_RR_TYPE_NULL, "TYPE233", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
574 {GLDNS_RR_TYPE_NULL, "TYPE234", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
575 {GLDNS_RR_TYPE_NULL, "TYPE235", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
576 {GLDNS_RR_TYPE_NULL, "TYPE236", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
577 {GLDNS_RR_TYPE_NULL, "TYPE237", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
578 {GLDNS_RR_TYPE_NULL, "TYPE238", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
579 {GLDNS_RR_TYPE_NULL, "TYPE239", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
580 {GLDNS_RR_TYPE_NULL, "TYPE240", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
581 {GLDNS_RR_TYPE_NULL, "TYPE241", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
582 {GLDNS_RR_TYPE_NULL, "TYPE242", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
583 {GLDNS_RR_TYPE_NULL, "TYPE243", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
584 {GLDNS_RR_TYPE_NULL, "TYPE244", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
585 {GLDNS_RR_TYPE_NULL, "TYPE245", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
586 {GLDNS_RR_TYPE_NULL, "TYPE246", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
587 {GLDNS_RR_TYPE_NULL, "TYPE247", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
588 {GLDNS_RR_TYPE_NULL, "TYPE248", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
452 {(enum gldns_enum_rr_type)0, "TYPE110", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
453 {(enum gldns_enum_rr_type)0, "TYPE111", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
454 {(enum gldns_enum_rr_type)0, "TYPE112", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
455 {(enum gldns_enum_rr_type)0, "TYPE113", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
456 {(enum gldns_enum_rr_type)0, "TYPE114", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
457 {(enum gldns_enum_rr_type)0, "TYPE115", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
458 {(enum gldns_enum_rr_type)0, "TYPE116", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
459 {(enum gldns_enum_rr_type)0, "TYPE117", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
460 {(enum gldns_enum_rr_type)0, "TYPE118", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
461 {(enum gldns_enum_rr_type)0, "TYPE119", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
462 {(enum gldns_enum_rr_type)0, "TYPE120", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
463 {(enum gldns_enum_rr_type)0, "TYPE121", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
464 {(enum gldns_enum_rr_type)0, "TYPE122", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
465 {(enum gldns_enum_rr_type)0, "TYPE123", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
466 {(enum gldns_enum_rr_type)0, "TYPE124", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
467 {(enum gldns_enum_rr_type)0, "TYPE125", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
468 {(enum gldns_enum_rr_type)0, "TYPE126", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
469 {(enum gldns_enum_rr_type)0, "TYPE127", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
470 {(enum gldns_enum_rr_type)0, "TYPE128", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
471 {(enum gldns_enum_rr_type)0, "TYPE129", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
472 {(enum gldns_enum_rr_type)0, "TYPE130", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
473 {(enum gldns_enum_rr_type)0, "TYPE131", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
474 {(enum gldns_enum_rr_type)0, "TYPE132", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
475 {(enum gldns_enum_rr_type)0, "TYPE133", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
476 {(enum gldns_enum_rr_type)0, "TYPE134", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
477 {(enum gldns_enum_rr_type)0, "TYPE135", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
478 {(enum gldns_enum_rr_type)0, "TYPE136", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
479 {(enum gldns_enum_rr_type)0, "TYPE137", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
480 {(enum gldns_enum_rr_type)0, "TYPE138", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
481 {(enum gldns_enum_rr_type)0, "TYPE139", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
482 {(enum gldns_enum_rr_type)0, "TYPE140", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
483 {(enum gldns_enum_rr_type)0, "TYPE141", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
484 {(enum gldns_enum_rr_type)0, "TYPE142", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
485 {(enum gldns_enum_rr_type)0, "TYPE143", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
486 {(enum gldns_enum_rr_type)0, "TYPE144", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
487 {(enum gldns_enum_rr_type)0, "TYPE145", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
488 {(enum gldns_enum_rr_type)0, "TYPE146", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
489 {(enum gldns_enum_rr_type)0, "TYPE147", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
490 {(enum gldns_enum_rr_type)0, "TYPE148", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
491 {(enum gldns_enum_rr_type)0, "TYPE149", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
492 {(enum gldns_enum_rr_type)0, "TYPE150", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
493 {(enum gldns_enum_rr_type)0, "TYPE151", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
494 {(enum gldns_enum_rr_type)0, "TYPE152", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
495 {(enum gldns_enum_rr_type)0, "TYPE153", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
496 {(enum gldns_enum_rr_type)0, "TYPE154", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
497 {(enum gldns_enum_rr_type)0, "TYPE155", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
498 {(enum gldns_enum_rr_type)0, "TYPE156", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
499 {(enum gldns_enum_rr_type)0, "TYPE157", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
500 {(enum gldns_enum_rr_type)0, "TYPE158", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
501 {(enum gldns_enum_rr_type)0, "TYPE159", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
502 {(enum gldns_enum_rr_type)0, "TYPE160", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
503 {(enum gldns_enum_rr_type)0, "TYPE161", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
504 {(enum gldns_enum_rr_type)0, "TYPE162", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
505 {(enum gldns_enum_rr_type)0, "TYPE163", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
506 {(enum gldns_enum_rr_type)0, "TYPE164", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
507 {(enum gldns_enum_rr_type)0, "TYPE165", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
508 {(enum gldns_enum_rr_type)0, "TYPE166", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
509 {(enum gldns_enum_rr_type)0, "TYPE167", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
510 {(enum gldns_enum_rr_type)0, "TYPE168", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
511 {(enum gldns_enum_rr_type)0, "TYPE169", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
512 {(enum gldns_enum_rr_type)0, "TYPE170", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
513 {(enum gldns_enum_rr_type)0, "TYPE171", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
514 {(enum gldns_enum_rr_type)0, "TYPE172", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
515 {(enum gldns_enum_rr_type)0, "TYPE173", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
516 {(enum gldns_enum_rr_type)0, "TYPE174", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
517 {(enum gldns_enum_rr_type)0, "TYPE175", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
518 {(enum gldns_enum_rr_type)0, "TYPE176", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
519 {(enum gldns_enum_rr_type)0, "TYPE177", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
520 {(enum gldns_enum_rr_type)0, "TYPE178", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
521 {(enum gldns_enum_rr_type)0, "TYPE179", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
522 {(enum gldns_enum_rr_type)0, "TYPE180", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
523 {(enum gldns_enum_rr_type)0, "TYPE181", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
524 {(enum gldns_enum_rr_type)0, "TYPE182", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
525 {(enum gldns_enum_rr_type)0, "TYPE183", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
526 {(enum gldns_enum_rr_type)0, "TYPE184", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
527 {(enum gldns_enum_rr_type)0, "TYPE185", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
528 {(enum gldns_enum_rr_type)0, "TYPE186", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
529 {(enum gldns_enum_rr_type)0, "TYPE187", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
530 {(enum gldns_enum_rr_type)0, "TYPE188", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
531 {(enum gldns_enum_rr_type)0, "TYPE189", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
532 {(enum gldns_enum_rr_type)0, "TYPE190", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
533 {(enum gldns_enum_rr_type)0, "TYPE191", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
534 {(enum gldns_enum_rr_type)0, "TYPE192", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
535 {(enum gldns_enum_rr_type)0, "TYPE193", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
536 {(enum gldns_enum_rr_type)0, "TYPE194", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
537 {(enum gldns_enum_rr_type)0, "TYPE195", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
538 {(enum gldns_enum_rr_type)0, "TYPE196", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
539 {(enum gldns_enum_rr_type)0, "TYPE197", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
540 {(enum gldns_enum_rr_type)0, "TYPE198", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
541 {(enum gldns_enum_rr_type)0, "TYPE199", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
542 {(enum gldns_enum_rr_type)0, "TYPE200", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
543 {(enum gldns_enum_rr_type)0, "TYPE201", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
544 {(enum gldns_enum_rr_type)0, "TYPE202", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
545 {(enum gldns_enum_rr_type)0, "TYPE203", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
546 {(enum gldns_enum_rr_type)0, "TYPE204", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
547 {(enum gldns_enum_rr_type)0, "TYPE205", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
548 {(enum gldns_enum_rr_type)0, "TYPE206", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
549 {(enum gldns_enum_rr_type)0, "TYPE207", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
550 {(enum gldns_enum_rr_type)0, "TYPE208", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
551 {(enum gldns_enum_rr_type)0, "TYPE209", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
552 {(enum gldns_enum_rr_type)0, "TYPE210", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
553 {(enum gldns_enum_rr_type)0, "TYPE211", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
554 {(enum gldns_enum_rr_type)0, "TYPE212", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
555 {(enum gldns_enum_rr_type)0, "TYPE213", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
556 {(enum gldns_enum_rr_type)0, "TYPE214", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
557 {(enum gldns_enum_rr_type)0, "TYPE215", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
558 {(enum gldns_enum_rr_type)0, "TYPE216", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
559 {(enum gldns_enum_rr_type)0, "TYPE217", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
560 {(enum gldns_enum_rr_type)0, "TYPE218", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
561 {(enum gldns_enum_rr_type)0, "TYPE219", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
562 {(enum gldns_enum_rr_type)0, "TYPE220", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
563 {(enum gldns_enum_rr_type)0, "TYPE221", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
564 {(enum gldns_enum_rr_type)0, "TYPE222", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
565 {(enum gldns_enum_rr_type)0, "TYPE223", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
566 {(enum gldns_enum_rr_type)0, "TYPE224", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
567 {(enum gldns_enum_rr_type)0, "TYPE225", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
568 {(enum gldns_enum_rr_type)0, "TYPE226", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
569 {(enum gldns_enum_rr_type)0, "TYPE227", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
570 {(enum gldns_enum_rr_type)0, "TYPE228", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
571 {(enum gldns_enum_rr_type)0, "TYPE229", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
572 {(enum gldns_enum_rr_type)0, "TYPE230", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
573 {(enum gldns_enum_rr_type)0, "TYPE231", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
574 {(enum gldns_enum_rr_type)0, "TYPE232", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
575 {(enum gldns_enum_rr_type)0, "TYPE233", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
576 {(enum gldns_enum_rr_type)0, "TYPE234", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
577 {(enum gldns_enum_rr_type)0, "TYPE235", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
578 {(enum gldns_enum_rr_type)0, "TYPE236", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
579 {(enum gldns_enum_rr_type)0, "TYPE237", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
580 {(enum gldns_enum_rr_type)0, "TYPE238", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
581 {(enum gldns_enum_rr_type)0, "TYPE239", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
582 {(enum gldns_enum_rr_type)0, "TYPE240", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
583 {(enum gldns_enum_rr_type)0, "TYPE241", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
584 {(enum gldns_enum_rr_type)0, "TYPE242", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
585 {(enum gldns_enum_rr_type)0, "TYPE243", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
586 {(enum gldns_enum_rr_type)0, "TYPE244", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
587 {(enum gldns_enum_rr_type)0, "TYPE245", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
588 {(enum gldns_enum_rr_type)0, "TYPE246", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
589 {(enum gldns_enum_rr_type)0, "TYPE247", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
590 {(enum gldns_enum_rr_type)0, "TYPE248", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
589591
590592 /* GLDNS_RDF_TYPE_INT16_DATA takes two fields (length and data) as one.
591593 * So, unlike RFC 2930 spec, we have 7 min/max rdf's i.s.o. 8/9.
621623 /* 260 */
622624 {GLDNS_RR_TYPE_AMTRELAY, "AMTRELAY", 1, 0, type_amtrelay_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
623625 #else
624 {GLDNS_RR_TYPE_NULL, "TYPE258", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
625 {GLDNS_RR_TYPE_NULL, "TYPE259", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
626 {GLDNS_RR_TYPE_NULL, "TYPE260", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
626 {(enum gldns_enum_rr_type)0, "TYPE258", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
627 {(enum gldns_enum_rr_type)0, "TYPE259", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
628 {(enum gldns_enum_rr_type)0, "TYPE260", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
627629 #endif
628630
629631 /* split in array, no longer contiguous */
632634 /* 32768 */
633635 {GLDNS_RR_TYPE_TA, "TA", 4, 4, type_ds_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
634636 #else
635 {GLDNS_RR_TYPE_NULL, "TYPE32768", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
637 {(enum gldns_enum_rr_type)0, "TYPE32768", 1, 1, type_0_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 },
636638 #endif
637639 /* 32769 */
638640 {GLDNS_RR_TYPE_DLV, "DLV", 4, 4, type_ds_wireformat, GLDNS_RDF_TYPE_NONE, GLDNS_RR_NO_COMPRESS, 0 }
728730
729731 /* special cases for query types */
730732 if (strlen(name) == 4 && strncasecmp(name, "IXFR", 4) == 0) {
731 return 251;
733 return GLDNS_RR_TYPE_IXFR;
732734 } else if (strlen(name) == 4 && strncasecmp(name, "AXFR", 4) == 0) {
733 return 252;
735 return GLDNS_RR_TYPE_AXFR;
734736 } else if (strlen(name) == 5 && strncasecmp(name, "MAILB", 5) == 0) {
735 return 253;
737 return GLDNS_RR_TYPE_MAILB;
736738 } else if (strlen(name) == 5 && strncasecmp(name, "MAILA", 5) == 0) {
737 return 254;
739 return GLDNS_RR_TYPE_MAILA;
738740 } else if (strlen(name) == 3 && strncasecmp(name, "ANY", 3) == 0) {
739 return 255;
740 }
741
742 return 0;
741 return GLDNS_RR_TYPE_ANY;
742 }
743
744 return (enum gldns_enum_rr_type)0;
743745 }
744746
745747 gldns_rr_class
2323 #ifdef HAVE_NETDB_H
2424 #include <netdb.h>
2525 #endif
26 #include <stdlib.h>
2627
2728 /** return an error */
2829 #define RET_ERR(e, off) ((int)((e)|((off)<<GLDNS_WIREPARSE_SHIFT)))
149150 if(s) return s;
150151
151152 if(rel && origin && dlen > 0) {
153 if((unsigned)dlen >= 0x00ffffffU ||
154 (unsigned)origin_len >= 0x00ffffffU)
155 /* guard against integer overflow in addition */
156 return RET_ERR(GLDNS_WIREPARSE_ERR_GENERAL, *len);
152157 if(dlen + origin_len - 1 > GLDNS_MAX_DOMAINLEN)
153158 return RET_ERR(GLDNS_WIREPARSE_ERR_DOMAINNAME_OVERFLOW,
154159 GLDNS_MAX_DOMAINLEN);
167172 uint8_t dname[GLDNS_MAX_DOMAINLEN+1];
168173 *len = sizeof(dname);
169174 if(gldns_str2wire_dname_buf(str, dname, len) == 0) {
170 uint8_t* r = (uint8_t*)malloc(*len);
175 uint8_t* r;
176 if(*len > sizeof(dname)) return NULL;
177 r = (uint8_t*)malloc(*len);
171178 if(r) return memcpy(r, dname, *len);
172179 }
173180 *len = 0;
186193 gldns_buffer_position(strbuf));
187194 }
188195
189 if(strcmp(token, "@") == 0) {
196 if(token_len < 2) /* make sure there is space to read "@" or "" */
197 return RET_ERR(GLDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
198 gldns_buffer_position(strbuf));
199 if(token[0]=='@' && token[1]=='\0') {
190200 uint8_t* tocopy;
191201 if (origin) {
192202 *dname_len = origin_len;
726736 {
727737 int status;
728738 int not_there = 0;
729 char token[GLDNS_MAX_RDFLEN+1];
739 char token[GLDNS_MAX_RDFLEN+1] = "";
730740 uint32_t ttl = 0;
731741 uint16_t tp = 0, cl = 0;
732742 size_t ddlen = 0;
10951105 while(gldns_parse_char(&ch, &s)) {
10961106 if(sl >= 255)
10971107 return RET_ERR(GLDNS_WIREPARSE_ERR_INVALID_STR, s-str);
1098 if(*len < sl+1)
1108 if(*len < sl+2)
10991109 return RET_ERR(GLDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
11001110 s-str);
11011111 rd[++sl] = ch;
20962106 char* s;
20972107 int n;
20982108 n = strtol(str, &s, 10);
2109 if(n < 0) /* negative number not allowed */
2110 return GLDNS_WIREPARSE_ERR_SYNTAX;
20992111 if(*len < ((size_t)n)+2)
21002112 return GLDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
21012113 if(n > 65535)
2424 #ifdef HAVE_TIME_H
2525 #include <time.h>
2626 #endif
27 #ifdef HAVE_SYS_TIME_H
2728 #include <sys/time.h>
29 #endif
2830 #include <stdarg.h>
2931 #include <ctype.h>
3032 #ifdef HAVE_NETDB_H
251253 int gldns_wire2str_rr_buf(uint8_t* d, size_t dlen, char* s, size_t slen)
252254 {
253255 /* use arguments as temporary variables */
254 return gldns_wire2str_rr_scan(&d, &dlen, &s, &slen, NULL, 0);
256 return gldns_wire2str_rr_scan(&d, &dlen, &s, &slen, NULL, 0, NULL);
255257 }
256258
257259 int gldns_wire2str_rrquestion_buf(uint8_t* d, size_t dlen, char* s, size_t slen)
258260 {
259261 /* use arguments as temporary variables */
260 return gldns_wire2str_rrquestion_scan(&d, &dlen, &s, &slen, NULL, 0);
262 return gldns_wire2str_rrquestion_scan(&d, &dlen, &s, &slen, NULL, 0, NULL);
261263 }
262264
263265 int gldns_wire2str_rdata_buf(uint8_t* rdata, size_t rdata_len, char* str,
265267 {
266268 /* use arguments as temporary variables */
267269 return gldns_wire2str_rdata_scan(&rdata, &rdata_len, &str, &str_len,
268 rrtype, NULL, 0);
270 rrtype, NULL, 0, NULL);
269271 }
270272
271273 int gldns_wire2str_rr_unknown_buf(uint8_t* d, size_t dlen, char* s, size_t slen)
272274 {
273275 /* use arguments as temporary variables */
274 return gldns_wire2str_rr_unknown_scan(&d, &dlen, &s, &slen, NULL, 0);
276 return gldns_wire2str_rr_unknown_scan(&d, &dlen, &s, &slen, NULL, 0, NULL);
275277 }
276278
277279 int gldns_wire2str_rr_comment_buf(uint8_t* rr, size_t rrlen, size_t dname_len,
309311 int gldns_wire2str_dname_buf(uint8_t* d, size_t dlen, char* s, size_t slen)
310312 {
311313 /* use arguments as temporary variables */
312 return gldns_wire2str_dname_scan(&d, &dlen, &s, &slen, NULL, 0);
314 return gldns_wire2str_dname_scan(&d, &dlen, &s, &slen, NULL, 0, NULL);
313315 }
314316
315317 int gldns_str_vprint(char** str, size_t* slen, const char* format, va_list args)
364366
365367 int gldns_wire2str_pkt_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen)
366368 {
367 int w = 0;
369 int w = 0, comprloop = 0;
368370 unsigned qdcount, ancount, nscount, arcount, i;
369371 uint8_t* pkt = *d;
370372 size_t pktlen = *dlen;
381383 w += gldns_str_print(s, slen, ";; QUESTION SECTION:\n");
382384 for(i=0; i<qdcount; i++) {
383385 w += gldns_wire2str_rrquestion_scan(d, dlen, s, slen,
384 pkt, pktlen);
386 pkt, pktlen, &comprloop);
385387 if(!*dlen) break;
386388 }
387389 w += gldns_str_print(s, slen, "\n");
388390 w += gldns_str_print(s, slen, ";; ANSWER SECTION:\n");
389391 for(i=0; i<ancount; i++) {
390 w += gldns_wire2str_rr_scan(d, dlen, s, slen, pkt, pktlen);
392 w += gldns_wire2str_rr_scan(d, dlen, s, slen, pkt, pktlen, &comprloop);
391393 if(!*dlen) break;
392394 }
393395 w += gldns_str_print(s, slen, "\n");
394396 w += gldns_str_print(s, slen, ";; AUTHORITY SECTION:\n");
395397 for(i=0; i<nscount; i++) {
396 w += gldns_wire2str_rr_scan(d, dlen, s, slen, pkt, pktlen);
398 w += gldns_wire2str_rr_scan(d, dlen, s, slen, pkt, pktlen, &comprloop);
397399 if(!*dlen) break;
398400 }
399401 w += gldns_str_print(s, slen, "\n");
400402 w += gldns_str_print(s, slen, ";; ADDITIONAL SECTION:\n");
401403 for(i=0; i<arcount; i++) {
402 w += gldns_wire2str_rr_scan(d, dlen, s, slen, pkt, pktlen);
404 w += gldns_wire2str_rr_scan(d, dlen, s, slen, pkt, pktlen, &comprloop);
403405 if(!*dlen) break;
404406 }
405407 /* other fields: WHEN(time), SERVER(IP) not available here. */
448450 }
449451
450452 int gldns_wire2str_rr_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen,
451 uint8_t* pkt, size_t pktlen)
453 uint8_t* pkt, size_t pktlen, int* comprloop)
452454 {
453455 int w = 0;
454456 uint8_t* rr = *d;
463465
464466 /* try to scan the rdata with pretty-printing, but if that fails, then
465467 * scan the rdata as an unknown RR type */
466 w += gldns_wire2str_dname_scan(d, dlen, s, slen, pkt, pktlen);
468 w += gldns_wire2str_dname_scan(d, dlen, s, slen, pkt, pktlen, comprloop);
467469 w += gldns_str_print(s, slen, "\t");
468470 dname_off = rrlen-(*dlen);
469471 if(*dlen == 4) {
507509 w += print_remainder_hex(";Error partial rdata 0x", d, dlen, s, slen);
508510 return w + gldns_str_print(s, slen, "\n");
509511 }
510 w += gldns_wire2str_rdata_scan(d, &rdlen, s, slen, rrtype, pkt, pktlen);
512 w += gldns_wire2str_rdata_scan(d, &rdlen, s, slen, rrtype, pkt, pktlen,
513 comprloop);
511514 (*dlen) -= (ordlen-rdlen);
512515
513516 /* default comment */
518521 }
519522
520523 int gldns_wire2str_rrquestion_scan(uint8_t** d, size_t* dlen, char** s,
521 size_t* slen, uint8_t* pkt, size_t pktlen)
524 size_t* slen, uint8_t* pkt, size_t pktlen, int* comprloop)
522525 {
523526 int w = 0;
524527 uint16_t t, c;
525 w += gldns_wire2str_dname_scan(d, dlen, s, slen, pkt, pktlen);
528 w += gldns_wire2str_dname_scan(d, dlen, s, slen, pkt, pktlen, comprloop);
526529 w += gldns_str_print(s, slen, "\t");
527530 if(*dlen < 4) {
528531 if(*dlen == 0)
542545 }
543546
544547 int gldns_wire2str_rr_unknown_scan(uint8_t** d, size_t* dlen, char** s,
545 size_t* slen, uint8_t* pkt, size_t pktlen)
548 size_t* slen, uint8_t* pkt, size_t pktlen, int* comprloop)
546549 {
547550 size_t rdlen, ordlen;
548551 int w = 0;
549 w += gldns_wire2str_dname_scan(d, dlen, s, slen, pkt, pktlen);
552 w += gldns_wire2str_dname_scan(d, dlen, s, slen, pkt, pktlen, comprloop);
550553 w += gldns_str_print(s, slen, "\t");
551554 w += gldns_rr_tcttl_scan(d, dlen, s, slen);
552555 w += gldns_str_print(s, slen, "\t");
584587 if(rrlen < dname_off + 10) return 0;
585588 rdlen = gldns_read_uint16(rr+dname_off+8);
586589 if(rrlen < dname_off + 10 + rdlen) return 0;
590 if(rdlen < 2) return 0;
587591 rdata = rr + dname_off + 10;
588592 flags = (int)gldns_read_uint16(rdata);
589593 w += gldns_str_print(s, slen, " ;{");
697701 }
698702
699703 int gldns_wire2str_rdata_scan(uint8_t** d, size_t* dlen, char** s,
700 size_t* slen, uint16_t rrtype, uint8_t* pkt, size_t pktlen)
704 size_t* slen, uint16_t rrtype, uint8_t* pkt, size_t pktlen,
705 int* comprloop)
701706 {
702707 /* try to prettyprint, but if that fails, use unknown format */
703708 uint8_t* origd = *d;
723728 if(r_cnt != 0)
724729 w += gldns_str_print(s, slen, " ");
725730 n = gldns_wire2str_rdf_scan(d, dlen, s, slen, rdftype,
726 pkt, pktlen);
731 pkt, pktlen, comprloop);
727732 if(n == -1) {
728733 failed:
729734 /* failed, use unknown format */
774779 }
775780
776781 int gldns_wire2str_dname_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen,
777 uint8_t* pkt, size_t pktlen)
782 uint8_t* pkt, size_t pktlen, int* comprloop)
778783 {
779784 int w = 0;
780785 /* spool labels onto the string, use compression if its there */
781786 uint8_t* pos = *d;
782787 unsigned i, counter=0;
783 const unsigned maxcompr = 1000; /* loop detection, max compr ptrs */
788 unsigned maxcompr = 1000; /* loop detection, max compr ptrs */
784789 int in_buf = 1;
790 if(comprloop) {
791 if(*comprloop != 0)
792 maxcompr = 30; /* for like ipv6 reverse name, per label */
793 if(*comprloop > 4)
794 maxcompr = 4; /* just don't want to spend time, any more */
795 }
785796 if(*dlen == 0) return gldns_str_print(s, slen, "ErrorMissingDname");
786797 if(*pos == 0) {
787798 (*d)++;
788799 (*dlen)--;
789800 return gldns_str_print(s, slen, ".");
790801 }
791 while(*pos) {
802 while((!pkt || pos < pkt+pktlen) && *pos) {
792803 /* read label length */
793804 uint8_t labellen = *pos++;
794805 if(in_buf) { (*d)++; (*dlen)--; }
927938 }
928939
929940 int gldns_wire2str_rdf_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen,
930 int rdftype, uint8_t* pkt, size_t pktlen)
941 int rdftype, uint8_t* pkt, size_t pktlen, int* comprloop)
931942 {
932943 if(*dlen == 0) return 0;
933944 switch(rdftype) {
934945 case GLDNS_RDF_TYPE_NONE:
935946 return 0;
936947 case GLDNS_RDF_TYPE_DNAME:
937 return gldns_wire2str_dname_scan(d, dlen, s, slen, pkt, pktlen);
948 return gldns_wire2str_dname_scan(d, dlen, s, slen, pkt, pktlen, comprloop);
938949 case GLDNS_RDF_TYPE_INT8:
939950 return gldns_wire2str_int8_scan(d, dlen, s, slen);
940951 case GLDNS_RDF_TYPE_INT16:
986997 return gldns_wire2str_atma_scan(d, dlen, s, slen);
987998 case GLDNS_RDF_TYPE_IPSECKEY:
988999 return gldns_wire2str_ipseckey_scan(d, dlen, s, slen, pkt,
989 pktlen);
1000 pktlen, comprloop);
9901001 case GLDNS_RDF_TYPE_HIP:
9911002 return gldns_wire2str_hip_scan(d, dlen, s, slen);
9921003 case GLDNS_RDF_TYPE_INT16_DATA:
10051016 return gldns_wire2str_long_str_scan(d, dlen, s, slen);
10061017 case GLDNS_RDF_TYPE_AMTRELAY:
10071018 return gldns_wire2str_amtrelay_scan(d, dlen, s, slen, pkt,
1008 pktlen);
1019 pktlen, comprloop);
10091020 case GLDNS_RDF_TYPE_TSIGERROR:
10101021 return gldns_wire2str_tsigerror_scan(d, dlen, s, slen);
10111022 }
15311542
15321543 /* internal scan routine that can modify arguments on failure */
15331544 static int gldns_wire2str_ipseckey_scan_internal(uint8_t** d, size_t* dl,
1534 char** s, size_t* sl, uint8_t* pkt, size_t pktlen)
1545 char** s, size_t* sl, uint8_t* pkt, size_t pktlen, int* comprloop)
15351546 {
15361547 /* http://www.ietf.org/internet-drafts/draft-ietf-ipseckey-rr-12.txt*/
15371548 uint8_t precedence, gateway_type, algorithm;
15591570 w += gldns_wire2str_aaaa_scan(d, dl, s, sl);
15601571 break;
15611572 case 3: /* dname */
1562 w += gldns_wire2str_dname_scan(d, dl, s, sl, pkt, pktlen);
1573 w += gldns_wire2str_dname_scan(d, dl, s, sl, pkt, pktlen, comprloop);
15631574 break;
15641575 default: /* unknown */
15651576 return -1;
15731584 }
15741585
15751586 int gldns_wire2str_ipseckey_scan(uint8_t** d, size_t* dl, char** s, size_t* sl,
1576 uint8_t* pkt, size_t pktlen)
1587 uint8_t* pkt, size_t pktlen, int* comprloop)
15771588 {
15781589 uint8_t* od = *d;
15791590 char* os = *s;
15801591 size_t odl = *dl, osl = *sl;
1581 int w=gldns_wire2str_ipseckey_scan_internal(d, dl, s, sl, pkt, pktlen);
1592 int w=gldns_wire2str_ipseckey_scan_internal(d, dl, s, sl, pkt, pktlen, comprloop);
15821593 if(w == -1) {
15831594 *d = od;
15841595 *s = os;
17111722
17121723 /* internal scan routine that can modify arguments on failure */
17131724 static int gldns_wire2str_amtrelay_scan_internal(uint8_t** d, size_t* dl,
1714 char** s, size_t* sl, uint8_t* pkt, size_t pktlen)
1725 char** s, size_t* sl, uint8_t* pkt, size_t pktlen, int* comprloop)
17151726 {
17161727 /* https://www.ietf.org/id/draft-ietf-mboned-driad-amt-discovery-01.txt */
17171728 uint8_t precedence, discovery_optional, relay_type;
17381749 w += gldns_wire2str_aaaa_scan(d, dl, s, sl);
17391750 break;
17401751 case 3: /* dname */
1741 w += gldns_wire2str_dname_scan(d, dl, s, sl, pkt, pktlen);
1752 w += gldns_wire2str_dname_scan(d, dl, s, sl, pkt, pktlen, comprloop);
17421753 break;
17431754 default: /* unknown */
17441755 return -1;
17471758 }
17481759
17491760 int gldns_wire2str_amtrelay_scan(uint8_t** d, size_t* dl, char** s, size_t* sl,
1750 uint8_t* pkt, size_t pktlen)
1761 uint8_t* pkt, size_t pktlen, int* comprloop)
17511762 {
17521763 uint8_t* od = *d;
17531764 char* os = *s;
17541765 size_t odl = *dl, osl = *sl;
1755 int w=gldns_wire2str_amtrelay_scan_internal(d, dl, s, sl, pkt, pktlen);
1766 int w=gldns_wire2str_amtrelay_scan_internal(d, dl, s, sl, pkt, pktlen, comprloop);
17561767 if(w == -1) {
17571768 *d = od;
17581769 *s = os;
19651976 return w;
19661977 }
19671978
1968 int gldns_wire2str_edns_keepalive_print(char** s, size_t* sl, uint8_t* data,
1969 size_t len)
1979 static int gldns_wire2str_edns_keepalive_print(char** s, size_t* sl,
1980 uint8_t* data, size_t len)
19701981 {
19711982 int w = 0;
19721983 uint16_t timeout;
155155 * @param str_len: length of string buffer.
156156 * @param pkt: packet for decompression, if NULL no decompression.
157157 * @param pktlen: length of packet buffer.
158 * @param comprloop: if pkt, bool detects compression loops.
158159 * @return number of characters (except null) needed to print.
159160 */
160161 int gldns_wire2str_rr_scan(uint8_t** data, size_t* data_len, char** str,
161 size_t* str_len, uint8_t* pkt, size_t pktlen);
162 size_t* str_len, uint8_t* pkt, size_t pktlen, int* comprloop);
162163
163164 /**
164165 * Scan wireformat question rr to string, with user buffers.
169170 * @param str_len: length of string buffer.
170171 * @param pkt: packet for decompression, if NULL no decompression.
171172 * @param pktlen: length of packet buffer.
173 * @param comprloop: if pkt, bool detects compression loops.
172174 * @return number of characters (except null) needed to print.
173175 */
174176 int gldns_wire2str_rrquestion_scan(uint8_t** data, size_t* data_len, char** str,
175 size_t* str_len, uint8_t* pkt, size_t pktlen);
177 size_t* str_len, uint8_t* pkt, size_t pktlen, int* comprloop);
176178
177179 /**
178180 * Scan wireformat RR to string in unknown RR format, with user buffers.
183185 * @param str_len: length of string buffer.
184186 * @param pkt: packet for decompression, if NULL no decompression.
185187 * @param pktlen: length of packet buffer.
188 * @param comprloop: if pkt, bool detects compression loops.
186189 * @return number of characters (except null) needed to print.
187190 */
188191 int gldns_wire2str_rr_unknown_scan(uint8_t** data, size_t* data_len, char** str,
189 size_t* str_len, uint8_t* pkt, size_t pktlen);
192 size_t* str_len, uint8_t* pkt, size_t pktlen, int* comprloop);
190193
191194 /**
192195 * Print to string the RR-information comment in default format,
227230 * @param rrtype: RR type of Rdata, host format.
228231 * @param pkt: packet for decompression, if NULL no decompression.
229232 * @param pktlen: length of packet buffer.
233 * @param comprloop: if pkt, bool detects compression loops.
230234 * @return number of characters (except null) needed to print.
231235 */
232236 int gldns_wire2str_rdata_scan(uint8_t** data, size_t* data_len, char** str,
233 size_t* str_len, uint16_t rrtype, uint8_t* pkt, size_t pktlen);
237 size_t* str_len, uint16_t rrtype, uint8_t* pkt, size_t pktlen,
238 int* comprloop);
234239
235240 /**
236241 * Scan wireformat rdata to string in unknown format, with user buffers.
253258 * @param str_len: length of string buffer.
254259 * @param pkt: packet for decompression, if NULL no decompression.
255260 * @param pktlen: length of packet buffer.
261 * @param comprloop: inout bool, that is set true if compression loop failure
262 * happens. Pass in 0, if passsed in as true, a lower bound is set
263 * on compression loops to stop arbitrary long packet parse times.
264 * This is meant so you can set it to 0 at the start of a list of dnames,
265 * and then scan all of them in sequence, if a loop happens, it becomes
266 * true and then it becomes more strict for the next dnames in the list.
267 * You can leave it at NULL if there is no pkt (pkt is NULL too).
256268 * @return number of characters (except null) needed to print.
257269 */
258270 int gldns_wire2str_dname_scan(uint8_t** data, size_t* data_len, char** str,
259 size_t* str_len, uint8_t* pkt, size_t pktlen);
271 size_t* str_len, uint8_t* pkt, size_t pktlen, int* comprloop);
260272
261273 /**
262274 * Scan wireformat rr type to string, with user buffers.
491503 * @param rdftype: the type of the rdata field, enum gldns_rdf_type.
492504 * @param pkt: packet for decompression, if NULL no decompression.
493505 * @param pktlen: length of packet buffer.
506 * @param comprloop: if pkt, bool detects compression loops.
494507 * @return number of characters (except null) needed to print.
495508 * Can return -1 on failure.
496509 */
497510 int gldns_wire2str_rdf_scan(uint8_t** data, size_t* data_len, char** str,
498 size_t* str_len, int rdftype, uint8_t* pkt, size_t pktlen);
511 size_t* str_len, int rdftype, uint8_t* pkt, size_t pktlen,
512 int* comprloop);
499513
500514 /**
501515 * Scan wireformat int8 field to string, with user buffers.
792806 * @param str_len: length of string buffer.
793807 * @param pkt: packet for decompression, if NULL no decompression.
794808 * @param pktlen: length of packet buffer.
809 * @param comprloop: if pkt, bool detects compression loops.
795810 * @return number of characters (except null) needed to print.
796811 * Can return -1 on failure.
797812 */
798813 int gldns_wire2str_ipseckey_scan(uint8_t** data, size_t* data_len, char** str,
799 size_t* str_len, uint8_t* pkt, size_t pktlen);
814 size_t* str_len, uint8_t* pkt, size_t pktlen, int* comprloop);
800815
801816 /**
802817 * Scan wireformat HIP (algo, HIT, pubkey) field to string, with user buffers.
924939 * @param str_len: length of string buffer.
925940 * @param pkt: packet for decompression, if NULL no decompression.
926941 * @param pktlen: length of packet buffer.
942 * @param comprloop: if pkt, bool detects compression loops.
927943 * @return number of characters (except null) needed to print.
928944 * Can return -1 on failure.
929945 */
930946 int gldns_wire2str_amtrelay_scan(uint8_t** data, size_t* data_len, char** str,
931 size_t* str_len, uint8_t* pkt, size_t pktlen);
947 size_t* str_len, uint8_t* pkt, size_t pktlen, int* comprloop);
932948
933949 /**
934950 * Print EDNS LLQ option data to string. User buffers, moves string pointers.
5252 #define HAVE_TLS_CTX_CURVES_LIST 0
5353 #define HAVE_TLS_CONN_CURVES_LIST 0
5454
55 typedef struct getdns_log_config getdns_log_config;
55 /* Forward declare type. */
56 struct getdns_log_config;
5657
5758 typedef struct _getdns_tls_context {
5859 struct mem_funcs* mfs;
6364 gnutls_protocol_t max_tls;
6465 char* ca_trust_file;
6566 char* ca_trust_path;
66 const getdns_log_config* log;
67 const struct getdns_log_config* log;
6768 } _getdns_tls_context;
6869
6970 typedef struct _getdns_tls_connection {
8081 dane_query_t dane_query;
8182 dane_state_t dane_state;
8283 char* tlsa;
83 const getdns_log_config* log;
84 const struct getdns_log_config* log;
8485 } _getdns_tls_connection;
8586
8687 typedef struct _getdns_tls_session {
5353
5454 #define GETDNS_TLS_MAX_DIGEST_LENGTH (EVP_MAX_MD_SIZE)
5555
56 typedef struct sha256_pin sha256_pin_t;
57 typedef struct getdns_log_config getdns_log_config;
56 /* Forward declare type. */
57 struct sha256_pin;
58 struct getdns_log_config;
5859
5960 typedef struct _getdns_tls_context {
6061 SSL_CTX* ssl;
61 const getdns_log_config* log;
62 const struct getdns_log_config* log;
6263 } _getdns_tls_context;
6364
6465 typedef struct _getdns_tls_connection {
6566 SSL* ssl;
66 const getdns_log_config* log;
67 const struct getdns_log_config* log;
6768 #if defined(USE_DANESSL)
6869 const char* auth_name;
69 const sha256_pin_t* pinset;
70 const struct sha256_pin* pinset;
7071 #endif
7172 } _getdns_tls_connection;
7273
6161 const char *_getdns_strerror(DWORD errnum);
6262 #else /* USE_WINSOCK */
6363
64 #ifdef HAVE_SYS_POLL_H
64 #ifndef HAVE_SYS_POLL_H
65 # include <poll.h>
66 #else
6567 # include <sys/poll.h>
66 #else
67 # include <poll.h>
6868 #endif
6969
7070 #define _getdns_EINTR (EINTR)
101101 struct sockaddr_storage remote_in;
102102 socklen_t addrlen;
103103
104 size_t max_udp_size;
105
104106 connection *next;
105107 connection **prev_next;
106108 };
325327 else if (conn->l->transport == GETDNS_TRANSPORT_UDP) {
326328 listener *l = conn->l;
327329
330 if (len > conn->max_udp_size) {
331 _getdns_rr_iter qi_spc, *qi;
332
333 (void)memset(buf + 6, 0, 6);
334 GLDNS_TC_SET(buf);
335 if ((qi = _getdns_rr_iter_init(&qi_spc, buf, len))) {
336 DEBUG_SERVER("Truncating reply to: %d\n",
337 (int)(qi->nxt - buf));
338 len = qi->nxt - buf;
339 }
340 }
328341 if (conn->l->fd >= 0 && sendto(conn->l->fd, (void *)buf, len, 0,
329342 (struct sockaddr *)&conn->remote_in, conn->addrlen) == -1) {
330343 /* TODO: handle _getdns_socketerror_wants_retry() */
544557 return;
545558
546559 (void) memset(conn, 0, sizeof(tcp_connection));
560 conn->super.max_udp_size = 65536;
547561 conn->super.l = l;
548562 conn->super.addrlen = sizeof(conn->super.remote_in);
549563 if ((conn->fd = accept(l->fd, (struct sockaddr *)
628642
629643 conn->l = l;
630644 conn->addrlen = sizeof(conn->remote_in);
645 conn->max_udp_size = 512;
631646 if ((len = recvfrom(l->fd, (void *)buf, sizeof(buf), 0,
632647 (struct sockaddr *)&conn->remote_in, &conn->addrlen)) == -1) {
633648 if ( _getdns_socketerror_wants_retry() &&
712727 ; /* FROMERR on input, ignore */
713728
714729 else {
730 uint32_t max_udp_size = 512;
731
715732 /* Insert connection */
716733 conn->super.key = conn;
717734 if (!_getdns_rbtree_insert(
722739 }
723740 DEBUG_SERVER("[connection add] count: %d\n",
724741 (int)l->set->connections_set.count);
742
743 if (!getdns_dict_get_int(request_dict,
744 "/additional/0/udp_payload_size", &max_udp_size))
745 conn->max_udp_size = max_udp_size;
746
747 else if (!getdns_dict_get_int(request_dict,
748 "/additional/1/udp_payload_size", &max_udp_size))
749 conn->max_udp_size = max_udp_size;
750
725751 if ((conn->next = l->connections))
726752 conn->next->prev_next = &conn->next;
727753 conn->prev_next = &l->connections;
9771003
9781004 (void) memset(&hints, 0, sizeof(struct addrinfo));
9791005 hints.ai_family = AF_UNSPEC;
1006 hints.ai_socktype = SOCK_DGRAM;
9801007 hints.ai_flags = AI_NUMERICHOST;
9811008
9821009 for (i = 0; !r && i < new_set_count; i++) {
55 #include <string.h>
66 #include <stdint.h>
77
8 #ifdef _MSC_VER
9 # define strcasecmp _stricmp
10 #endif
11
12 #include <openssl/ssl.h>
813 #include <openssl/opensslv.h>
914 #include <openssl/err.h>
1015 #include <openssl/crypto.h>
6767 #define STUB_TCP_ERROR -2
6868
6969 /* Don't currently have access to the context whilst doing handshake */
70 #define TIMEOUT_TLS 2500
70 #define MIN_TLS_HS_TIMEOUT 2500
71 #define MAX_TLS_HS_TIMEOUT 7500
7172 /* Arbritray number of message for EDNS keepalive resend*/
7273 #define EDNS_KEEPALIVE_RESEND 5
7374
240241 uint8_t *data = (uint8_t *)rr_iter->pos;
241242 size_t data_len = rr_iter->nxt - rr_iter->pos;
242243 (void) gldns_wire2str_rr_scan(
243 &data, &data_len, &str, &str_len, (uint8_t *)rr_iter->pkt, rr_iter->pkt_end - rr_iter->pkt);
244 &data, &data_len, &str, &str_len, (uint8_t *)rr_iter->pkt, rr_iter->pkt_end - rr_iter->pkt, NULL);
244245 DEBUG_STUB("%s %-35s: OPT RR: %s",
245246 STUB_DEBUG_READ, __FUNC__, str_spc);
246247 #endif
454455 GETDNS_LOG_UPSTREAM_STATS, GETDNS_LOG_WARNING,
455456 "%-40s : Upstream : Could not setup TCP TFO\n",
456457 upstream->addr_str);
457
458 # else
459 (void)transport;
458460 # endif/* HAVE_DECL_TCP_FASTOPEN*/
459461 # endif /* HAVE_DECL_TCP_FASTOPEN_CONNECT */
460462 #endif /* USE_OSX_TCP_FASTOPEN */
979981 int r;
980982 while ((r = _getdns_tls_connection_do_handshake(upstream->tls_obj)) != GETDNS_RETURN_GOOD)
981983 {
984 uint64_t timeout_tls = _getdns_ms_until_expiry(upstream->expires);
985
986 if (timeout_tls < MIN_TLS_HS_TIMEOUT)
987 timeout_tls = MIN_TLS_HS_TIMEOUT;
988 else if (timeout_tls > MAX_TLS_HS_TIMEOUT)
989 timeout_tls = MAX_TLS_HS_TIMEOUT;
990
991 DEBUG_STUB("%s %-35s: FD: %d, do_handshake -> %d (timeout: %d)\n",
992 STUB_DEBUG_SETUP_TLS, __FUNC__, upstream->fd, r, (int)timeout_tls);
993
982994 switch (r) {
983995 case GETDNS_RETURN_TLS_WANT_READ:
984996 GETDNS_CLEAR_EVENT(upstream->loop, &upstream->event);
985997 upstream->event.read_cb = upstream_read_cb;
986998 upstream->event.write_cb = NULL;
987999 GETDNS_SCHEDULE_EVENT(upstream->loop,
988 upstream->fd, TIMEOUT_TLS, &upstream->event);
1000 upstream->fd, timeout_tls, &upstream->event);
9891001 upstream->tls_hs_state = GETDNS_HS_READ;
9901002 return STUB_TCP_RETRY;
9911003 case GETDNS_RETURN_TLS_WANT_WRITE:
9931005 upstream->event.read_cb = NULL;
9941006 upstream->event.write_cb = upstream_write_cb;
9951007 GETDNS_SCHEDULE_EVENT(upstream->loop,
996 upstream->fd, TIMEOUT_TLS, &upstream->event);
1008 upstream->fd, timeout_tls, &upstream->event);
9971009 upstream->tls_hs_state = GETDNS_HS_WRITE;
9981010 return STUB_TCP_RETRY;
9991011 default:
11971209 _getdns_tls_connection* tls_obj = upstream->tls_obj;
11981210 uint16_t padding_sz;
11991211
1200 int q = tls_connected(upstream);
1212 int q;
1213
1214 if (netreq->owner->expires > upstream->expires)
1215 upstream->expires = netreq->owner->expires;
1216
1217 q = tls_connected(upstream);
12011218 if (q != 0)
12021219 return q;
12031220 /* This is the case where the upstream is connected but it isn't an authenticated
22242241 /* Set a timeout on the upstream so we can catch failed setup*/
22252242 upstream->event.timeout_cb = upstream_setup_timeout_cb;
22262243 GETDNS_SCHEDULE_EVENT(upstream->loop, upstream->fd,
2227 _getdns_ms_until_expiry(netreq->owner->expires)/2,
2244 _getdns_ms_until_expiry(netreq->owner->expires)/5*4,
22282245 &upstream->event);
2246 #if defined(HAVE_DECL_TCP_FASTOPEN) && HAVE_DECL_TCP_FASTOPEN \
2247 && !(defined(HAVE_DECL_TCP_FASTOPEN_CONNECT) && HAVE_DECL_TCP_FASTOPEN_CONNECT) \
2248 && !(defined(HAVE_DECL_MSG_FASTOPEN) && HAVE_DECL_MSG_FASTOPEN)
2249 if (upstream->transport == GETDNS_TRANSPORT_TCP) {
2250 /* Write immediately! */
2251 upstream_write_cb(upstream);
2252 }
2253 #endif
22292254 } else {
22302255 GETDNS_SCHEDULE_EVENT(upstream->loop,
22312256 upstream->fd, TIMEOUT_FOREVER, &upstream->event);
22912316
22922317 case GETDNS_TRANSPORT_TLS:
22932318 case GETDNS_TRANSPORT_TCP:
2294 upstream_schedule_netreq(netreq->upstream, netreq);
2295 /* For TLS, set a short timeout to catch setup problems. This is reset
2296 when the connection is successful.*/
22972319 GETDNS_CLEAR_EVENT(dnsreq->loop, &netreq->event);
2298 /*************************************************************
2299 ****** *****
2300 ****** Scheduling differences of *****
2301 ****** synchronous and asynchronous requests *****
2302 ****** *****
2303 *************************************************************
2304 *
2305 * Besides the asynchronous event loop, which is typically
2306 * shared with the application, every getdns context also
2307 * has another event loop (not registered by the user) which
2308 * is used specifically and only for synchronous requests:
2309 * context->sync_eventloop.
2310 *
2311 * We do not use the asynchronous loop for the duration of the
2312 * synchronous query, because:
2313 * - Callbacks for outstanding (and thus asynchronous) queries
2314 * might fire as a side effect.
2315 * - But worse, since the asynchronous loop is created and
2316 * managed by the user, which may well have her own non-dns
2317 * related events scheduled against it, they will fire as
2318 * well as a side effect of doing the synchronous request!
2319 *
2320 *
2321 * Transports that keep connections open, have their own event
2322 * structure to keep their connection state. The event is
2323 * associated with the upstream struct. Note that there is a
2324 * separate upstream struct for each state full transport, so
2325 * each upstream has multiple transport structs!
2326 *
2327 * side note: The upstream structs have their own reference
2328 * to the "context's" event loop so they can,
2329 * in theory, be detached (to finish running
2330 * queries for example).
2331 *
2332 * If a synchronous request is scheduled for such a transport,
2333 * then the sync-loop temporarily has to "run" that
2334 * upstream/transport's event! Outstanding requests for that
2335 * upstream/transport might come in while processing the
2336 * synchronous call. When this happens, they are queued up
2337 * (at upstream->finished_queue) and an timeout event of 1
2338 * will be scheduled against the asynchronous loop to start
2339 * processing those received request as soon as the
2340 * asynchronous loop will be run.
2341 *
2342 *
2343 * When getdns is linked with libunbound 1.5.8 or older, then
2344 * when a RECURSING synchronous request is made then
2345 * outstanding asynchronously scheduled RECURSING requests
2346 * may fire as a side effect, as we reuse the same code path
2347 * For both synchronous and asynchronous calls,
2348 * ub_resolve_async() is used under the hood.
2349 *
2350 * With libunbound versions newer than 1.5.8, libunbound will
2351 * share the event loops used with getdns which will prevent
2352 * these side effects from happening.
2353 *
2354 *
2355 * The event loop used for a specific request is in
2356 * dnsreq->loop. The asynchronous is always also available
2357 * at the upstream as upstream->loop.
2358 */
23592320 GETDNS_SCHEDULE_EVENT(
23602321 dnsreq->loop, -1,
23612322 _getdns_ms_until_expiry2(dnsreq->expires, now_ms),
23622323 getdns_eventloop_event_init(
23632324 &netreq->event, netreq, NULL, NULL,
23642325 stub_timeout_cb));
2365
2326 upstream_schedule_netreq(netreq->upstream, netreq);
23662327 return GETDNS_RETURN_GOOD;
23672328 default:
23682329 return GETDNS_RETURN_GENERIC_ERROR;
+0
-314
src/test/Makefile.in less more
0 #
1 # @configure_input@
2 #
3 # Copyright (c) 2013, Verisign, Inc., NLNet Labs
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are met:
8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
13 # * Neither the names of the copyright holders nor the
14 # names of its contributors may be used to endorse or promote products
15 # derived from this software without specific prior written permission.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 # DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
21 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28 package = @PACKAGE_NAME@
29 version = @PACKAGE_VERSION@
30 tarname = @PACKAGE_TARNAME@
31 distdir = $(tarname)-$(version)
32
33 prefix = @prefix@
34 exec_prefix = @exec_prefix@
35 bindir = @bindir@
36 INSTALL = @INSTALL@
37 LIBTOOL = ../../libtool
38
39 srcdir = @srcdir@
40
41 have_libevent = @have_libevent@
42 have_libuv = @have_libuv@
43 have_libev = @have_libev@
44 NOLIBCHECK = @NOLIBCHECK@
45
46 EXTENSION_LIBEVENT_EXT_LIBS=@EXTENSION_LIBEVENT_EXT_LIBS@
47 EXTENSION_LIBEVENT_LDFLAGS=@EXTENSION_LIBEVENT_LDFLAGS@
48 EXTENSION_LIBUV_EXT_LIBS=@EXTENSION_LIBUV_EXT_LIBS@
49 EXTENSION_LIBUV_LDFLAGS=@EXTENSION_LIBUV_LDFLAGS@
50 EXTENSION_LIBEV_EXT_LIBS=@EXTENSION_LIBEV_EXT_LIBS@
51 EXTENSION_LIBEV_LDFLAGS=@EXTENSION_LIBEV_LDFLAGS@
52
53 CHECK_GETDNS=@CHECK_GETDNS@
54 CHECK_UV_PROG=@CHECK_UV_PROG@
55 CHECK_EVENT_PROG=@CHECK_EVENT_PROG@
56 CHECK_EV_PROG=@CHECK_EV_PROG@
57
58 CC=@CC@
59 CFLAGS=-I$(srcdir)/.. -I$(srcdir) -I.. $(cflags) @CFLAGS@ @CPPFLAGS@ $(XTRA_CFLAGS)
60 WPEDANTICFLAG=@WPEDANTICFLAG@
61 LDFLAGS=-L.. @LDFLAGS@
62 LDLIBS=../libgetdns.la @LIBS@
63 CHECK_LIBS=@CHECK_LIBS@
64 CHECK_CFLAGS=@CHECK_CFLAGS@
65
66 CHECK_OBJS=check_getdns_common.lo check_getdns_context_set_timeout.lo \
67 check_getdns.lo check_getdns_transport.lo
68
69 ALL_OBJS=$(CHECK_OBJS) check_getdns_libevent.lo check_getdns_libev.lo \
70 check_getdns_selectloop.lo scratchpad.lo \
71 testmessages.lo tests_dict.lo tests_list.lo tests_namespaces.lo \
72 tests_stub_async.lo tests_stub_sync.lo
73
74 NON_C99_OBJS=check_getdns_libuv.lo
75
76 PROGRAMS=tests_dict tests_list tests_namespaces tests_stub_async tests_stub_sync $(CHECK_GETDNS) $(CHECK_EV_PROG) $(CHECK_EVENT_PROG) $(CHECK_UV_PROG)
77
78
79 .SUFFIXES: .c .o .a .lo .h
80
81 .c.o:
82 $(CC) $(CFLAGS) $(WPEDANTICFLAG) -c $< -o $@
83
84 .c.lo:
85 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(WPEDANTICFLAG) -c $< -o $@
86
87 default: all
88
89 all: $(PROGRAMS)
90
91 $(ALL_OBJS):
92 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(WPEDANTICFLAG) -c $(srcdir)/$(@:.lo=.c) -o $@
93
94 $(NON_C99_OBJS):
95 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(WPEDANTICFLAG) -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c $(srcdir)/$(@:.lo=.c) -o $@
96
97 tests_dict: tests_dict.lo testmessages.lo
98 $(LIBTOOL) --tag=CC --mode=link $(CC) $(LDFLAGS) $(LDLIBS) -o $@ tests_dict.lo testmessages.lo
99
100 tests_list: tests_list.lo testmessages.lo
101 $(LIBTOOL) --tag=CC --mode=link $(CC) $(LDFLAGS) $(LDLIBS) -o $@ tests_list.lo testmessages.lo
102
103 tests_namespaces: tests_namespaces.lo
104 $(LIBTOOL) --tag=CC --mode=link $(CC) $(LDFLAGS) $(LDLIBS) -o $@ tests_namespaces.lo
105
106 tests_stub_async: tests_stub_async.lo testmessages.lo
107 $(LIBTOOL) --tag=CC --mode=link $(CC) $(LDFLAGS) $(LDLIBS) -o $@ tests_stub_async.lo testmessages.lo
108
109 tests_stub_sync: tests_stub_sync.lo
110 $(LIBTOOL) --tag=CC --mode=link $(CC) $(LDFLAGS) $(LDLIBS) -o $@ tests_stub_sync.lo
111
112 check_getdns_common: check_getdns_common.lo
113 $(LIBTOOL) --tag=CC --mode=link $(CC) $(LDFLAGS) $(LDLIBS) -o $@ check_getdns_common.lo
114
115 check_getdns: check_getdns.lo check_getdns_common.lo check_getdns_context_set_timeout.lo check_getdns_transport.lo check_getdns_selectloop.lo
116 $(LIBTOOL) --tag=CC --mode=link $(CC) $(LDFLAGS) $(LDLIBS) $(CHECK_LIBS) -o $@ check_getdns.lo check_getdns_common.lo check_getdns_context_set_timeout.lo check_getdns_transport.lo check_getdns_selectloop.lo
117
118 check_getdns_event: check_getdns.lo check_getdns_common.lo check_getdns_context_set_timeout.lo check_getdns_transport.lo check_getdns_libevent.lo ../libgetdns_ext_event.la
119 $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ check_getdns.lo check_getdns_common.lo check_getdns_context_set_timeout.lo check_getdns_transport.lo check_getdns_libevent.lo $(LDFLAGS) $(LDLIBS) $(CHECK_LIBS) ../libgetdns_ext_event.la $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS)
120
121 check_getdns_uv: check_getdns.lo check_getdns_common.lo check_getdns_context_set_timeout.lo check_getdns_transport.lo check_getdns_libuv.lo ../libgetdns_ext_uv.la
122 $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ check_getdns.lo check_getdns_common.lo check_getdns_context_set_timeout.lo check_getdns_transport.lo check_getdns_libuv.lo $(LDFLAGS) $(LDLIBS) $(CHECK_LIBS) ../libgetdns_ext_uv.la $(EXTENSION_LIBUV_LDFLAGS) $(EXTENSION_LIBUV_EXT_LIBS)
123
124 check_getdns_ev: check_getdns.lo check_getdns_common.lo check_getdns_context_set_timeout.lo check_getdns_transport.lo check_getdns_libev.lo ../libgetdns_ext_ev.la
125 $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ check_getdns.lo check_getdns_common.lo check_getdns_context_set_timeout.lo check_getdns_transport.lo check_getdns_libev.lo $(LDFLAGS) $(LDLIBS) $(CHECK_LIBS) ../libgetdns_ext_ev.la $(EXTENSION_LIBEV_LDFLAGS) $(EXTENSION_LIBEV_EXT_LIBS)
126
127 scratchpad: scratchpad.lo
128 $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ scratchpad.lo $(LDFLAGS) $(LDLIBS)
129
130 scratchpad.lo: scratchpad.c
131
132 $(srcdir)/scratchpad.c: scratchpad.template.c
133 [ ! -f $(srcdir)/scratchpad.c ] && cp -p $(srcdir)/scratchpad.template.c $(srcdir)/scratchpad.c || true
134
135 install:
136 echo nothing to install
137
138 uninstall:
139 echo nothing to uninstall
140
141 nolibcheck:
142 @echo "***"
143 @echo "*** Cannot run unit tests, because they could not be compiled,"
144 @echo "*** because libcheck was not found or usable at configure time."
145 @echo "*** To compile and run unit tests make sure libcheck is available"
146 @echo "*** and usable during configuration"
147 @echo "***"
148 @false
149
150 test_noeventloop: $(NOLIBCHECK) all
151 rm -f $(CHECK_GETDNS).failed
152 GETDNS_TEST_PORT=43210 CK_TIMEOUT_MULTIPLIER=2 CK_LOG_FILE_NAME="$(CHECK_GETDNS).log" ./$(CHECK_GETDNS) || echo "$(CHECK_GETDNS) failed" >> $(CHECK_GETDNS).failed
153
154 test_libevent: $(NOLIBCHECK) all
155 rm -f $(CHECK_EVENT_PROG).failed
156 if test $(have_libevent) = 1 ; then GETDNS_TEST_PORT=44321 CK_TIMEOUT_MULTIPLIER=2 CK_LOG_FILE_NAME="$(CHECK_EVENT_PROG).log" ./$(CHECK_EVENT_PROG) || echo "$(CHECK_EVENT_PROG) failed" >> $(CHECK_EVENT_PROG).failed; fi
157
158 test_libev: $(NOLIBCHECK) all
159 rm -f $(CHECK_EV_PROG).failed
160 if test $(have_libev) = 1 ; then GETDNS_TEST_PORT=45432 CK_TIMEOUT_MULTIPLIER=2 CK_LOG_FILE_NAME="$(CHECK_EV_PROG).log" ./$(CHECK_EV_PROG) || echo "$(CHECK_EV_PROG) failed" >> $(CHECK_EV_PROG).failed; fi
161
162 test_libuv: $(NOLIBCHECK) all
163 rm -f $(CHECK_UV_PROG).failed
164 if test $(have_libev) = 1 ; then GETDNS_TEST_PORT=46543 CK_TIMEOUT_MULTIPLIER=2 CK_LOG_FILE_NAME="$(CHECK_UV_PROG).log" ./$(CHECK_UV_PROG) || echo "$(CHECK_UV_PROG) failed" >> $(CHECK_UV_PROG).failed; fi
165
166 test: test_noeventloop test_libevent test_libev test_libuv
167 rm -f fails
168 if test -f $(CHECK_GETDNS).failed ; then cat $(CHECK_GETDNS).failed >> fails ; fi
169 if test -f $(CHECK_EVENT_PROG).failed ; then cat $(CHECK_EVENT_PROG).failed >> fails ; fi
170 if test -f $(CHECK_EV_PROG).failed ; then cat $(CHECK_EV_PROG).failed >> fails ; fi
171 if test -f $(CHECK_UV_PROG).failed ; then cat $(CHECK_UV_PROG).failed >> fails ; fi
172 test ! -e fails
173 @echo "All tests OK"
174
175 clean:
176 rm -f *.o *.lo $(PROGRAMS) scratchpad
177 rm -rf .libs
178 rm -f check_getdns.log check_getdns_event.log check_getdns_ev.log check_getdns_uv.log
179
180 distclean : clean
181 rm -f scratchpad.c
182 rm -f Makefile config.status config.log
183 rm -f check_getdns_uv.core check_getdns.core check_getdns_event.core
184 rm -Rf autom4te.cache
185
186 $(distdir): FORCE
187 mkdir -p $(distdir)/src
188 cp configure.ac $(distdir)
189 cp configure $(distdir)
190 cp Makefile.in $(distdir)
191 cp src/Makefile.in $(distdir)/src
192
193 distcheck: $(distdir).tar.gz
194 gzip -cd $(distdir).tar.gz | tar xvf -
195 cd $(distdir) && ./configure
196 cd $(distdir) && $(MAKE) all
197 cd $(distdir) && $(MAKE) check
198 cd $(distdir) && $(MAKE) DESTDIR=$${PWD}/_inst install
199 cd $(distdir) && $(MAKE) DESTDIR=$${PWD}/_inst uninstall
200 @remaining="`find $${PWD}/$(distdir)/_inst -type f | wc -l`"; \
201 if test "$${remaining}" -ne 0; then
202 echo "@@@ $${remaining} file(s) remaining in stage directory!"; \
203 exit 1; \
204 fi
205 cd $(distdir) && $(MAKE) clean
206 rm -rf $(distdir)
207 @echo "*** Package $(distdir).tar.gz is ready for distribution"
208
209 Makefile: $(srcdir)/Makefile.in ../../config.status
210 cd ../.. && ./config.status src/test/Makefile
211
212 configure.status: configure
213 cd ../.. && ./config.status --recheck
214
215 depend:
216 (cd $(srcdir) ; awk 'BEGIN{P=1}{if(P)print}/^# Dependencies/{P=0}' Makefile.in > Makefile.in.new )
217 (blddir=`pwd`; cd $(srcdir) ; gcc -MM -I. -I.. -I"$$blddir"/.. *.c | \
218 sed -e "s? $$blddir/? ?g" \
219 -e 's? \([a-z0-9_-]*\)\.\([ch]\)? $$(srcdir)/\1.\2?g' \
220 -e 's? \.\./\([a-z0-9_-]*\)\.h? $$(srcdir)/../\1.h?g' \
221 -e 's? \.\./\([a-z0-9_-]*\)/\([a-z0-9_-]*\)\.h? $$(srcdir)/../\1/\2.h?g' \
222 -e 's? \$$(srcdir)/config\.h? ../config.h?g' \
223 -e 's? \$$(srcdir)/\.\./config\.h? ../config.h?g' \
224 -e 's? \$$(srcdir)/\.\./getdns/getdns\.h? ../getdns/getdns.h?g' \
225 -e 's? \$$(srcdir)/\.\./getdns/getdns_extra\.h? ../getdns/getdns_extra.h?g' \
226 -e 's!\(.*\)\.o[ :]*!\1.lo \1.o: !g' >> Makefile.in.new )
227 (cd $(srcdir) ; diff Makefile.in.new Makefile.in && rm Makefile.in.new \
228 || mv Makefile.in.new Makefile.in )
229
230 .PHONY: clean test
231
232 # Dependencies for the unit tests
233 check_getdns.lo check_getdns.o: $(srcdir)/check_getdns.c \
234 ../getdns/getdns.h \
235 $(srcdir)/check_getdns_common.h \
236 ../getdns/getdns_extra.h \
237 $(srcdir)/check_getdns_address.h $(srcdir)/check_getdns_address_sync.h \
238 $(srcdir)/check_getdns_cancel_callback.h $(srcdir)/check_getdns_context_create.h \
239 $(srcdir)/check_getdns_context_destroy.h \
240 $(srcdir)/check_getdns_context_set_context_update_callback.h \
241 $(srcdir)/check_getdns_context_set_dns_transport.h \
242 $(srcdir)/check_getdns_context_set_timeout.h \
243 $(srcdir)/check_getdns_context_set_upstream_recursive_servers.h \
244 $(srcdir)/check_getdns_convert_alabel_to_ulabel.h \
245 $(srcdir)/check_getdns_convert_ulabel_to_alabel.h $(srcdir)/check_getdns_dict_destroy.h \
246 $(srcdir)/check_getdns_dict_get_bindata.h $(srcdir)/check_getdns_dict_get_data_type.h \
247 $(srcdir)/check_getdns_dict_get_dict.h $(srcdir)/check_getdns_dict_get_int.h \
248 $(srcdir)/check_getdns_dict_get_list.h $(srcdir)/check_getdns_dict_get_names.h \
249 $(srcdir)/check_getdns_dict_set_bindata.h $(srcdir)/check_getdns_dict_set_dict.h \
250 $(srcdir)/check_getdns_dict_set_int.h $(srcdir)/check_getdns_dict_set_list.h \
251 $(srcdir)/check_getdns_display_ip_address.h $(srcdir)/check_getdns_general.h \
252 $(srcdir)/check_getdns_general_sync.h $(srcdir)/check_getdns_hostname.h \
253 $(srcdir)/check_getdns_hostname_sync.h $(srcdir)/check_getdns_list_get_bindata.h \
254 $(srcdir)/check_getdns_list_get_data_type.h $(srcdir)/check_getdns_list_get_dict.h \
255 $(srcdir)/check_getdns_list_get_int.h $(srcdir)/check_getdns_list_get_length.h \
256 $(srcdir)/check_getdns_list_get_list.h $(srcdir)/check_getdns_pretty_print_dict.h \
257 $(srcdir)/check_getdns_service.h $(srcdir)/check_getdns_service_sync.h \
258 $(srcdir)/check_getdns_transport.h
259 check_getdns_common.lo check_getdns_common.o: $(srcdir)/check_getdns_common.c \
260 ../getdns/getdns.h \
261 ../config.h \
262 $(srcdir)/check_getdns_common.h \
263 ../getdns/getdns_extra.h \
264 $(srcdir)/check_getdns_eventloop.h
265 check_getdns_context_set_timeout.lo check_getdns_context_set_timeout.o: $(srcdir)/check_getdns_context_set_timeout.c \
266 $(srcdir)/check_getdns_context_set_timeout.h $(srcdir)/check_getdns_common.h \
267 ../getdns/getdns.h \
268 ../getdns/getdns_extra.h
269 check_getdns_libev.lo check_getdns_libev.o: $(srcdir)/check_getdns_libev.c $(srcdir)/check_getdns_eventloop.h \
270 ../config.h \
271 ../getdns/getdns.h \
272 $(srcdir)/../getdns/getdns_ext_libev.h \
273 ../getdns/getdns_extra.h \
274 $(srcdir)/check_getdns_common.h
275 check_getdns_libevent.lo check_getdns_libevent.o: $(srcdir)/check_getdns_libevent.c $(srcdir)/check_getdns_eventloop.h \
276 ../config.h \
277 ../getdns/getdns.h \
278 $(srcdir)/../getdns/getdns_ext_libevent.h \
279 ../getdns/getdns_extra.h \
280 $(srcdir)/check_getdns_libevent.h $(srcdir)/check_getdns_common.h
281 check_getdns_libuv.lo check_getdns_libuv.o: $(srcdir)/check_getdns_libuv.c $(srcdir)/check_getdns_eventloop.h \
282 ../config.h \
283 ../getdns/getdns.h \
284 $(srcdir)/../getdns/getdns_ext_libuv.h \
285 ../getdns/getdns_extra.h \
286 $(srcdir)/check_getdns_common.h
287 check_getdns_selectloop.lo check_getdns_selectloop.o: $(srcdir)/check_getdns_selectloop.c \
288 $(srcdir)/check_getdns_eventloop.h \
289 ../config.h \
290 ../getdns/getdns.h \
291 ../getdns/getdns_extra.h
292 check_getdns_transport.lo check_getdns_transport.o: $(srcdir)/check_getdns_transport.c \
293 $(srcdir)/check_getdns_transport.h $(srcdir)/check_getdns_common.h \
294 ../getdns/getdns.h \
295 ../getdns/getdns_extra.h
296 scratchpad.template.lo scratchpad.template.o: scratchpad.template.c \
297 ../getdns/getdns.h \
298 ../getdns/getdns_extra.h
299 testmessages.lo testmessages.o: $(srcdir)/testmessages.c $(srcdir)/testmessages.h
300 tests_dict.lo tests_dict.o: $(srcdir)/tests_dict.c $(srcdir)/testmessages.h \
301 ../getdns/getdns.h
302 tests_list.lo tests_list.o: $(srcdir)/tests_list.c $(srcdir)/testmessages.h \
303 ../getdns/getdns.h
304 tests_namespaces.lo tests_namespaces.o: $(srcdir)/tests_namespaces.c $(srcdir)/testmessages.h \
305 ../getdns/getdns.h
306 tests_stub_async.lo tests_stub_async.o: $(srcdir)/tests_stub_async.c \
307 ../config.h \
308 $(srcdir)/testmessages.h \
309 ../getdns/getdns.h \
310 ../getdns/getdns_extra.h
311 tests_stub_sync.lo tests_stub_sync.o: $(srcdir)/tests_stub_sync.c $(srcdir)/testmessages.h \
312 ../getdns/getdns.h \
313 ../getdns/getdns_extra.h
223223
224224 EVENT_BASE_CREATE;
225225
226 ASSERT_RC(getdns_address(context, "hostnamedoesntexist.", NULL,
226 // Ubuntu 18.04 system resolver - does not foward single labels, returns
227 // SERVFAIL so this must be a multilabel name
228 ASSERT_RC(getdns_address(context, "hostname.doesntexist.", NULL,
227229 &fn_ref, &transaction_id, callbackfn),
228230 GETDNS_RETURN_GOOD, "Return code from getdns_address()");
229231
236238 {
237239 assert_nxdomain(ex_response);
238240 assert_nodata(ex_response);
239 assert_soa_in_authority(ex_response);
241 // Ubuntu 18.04 system resolver does not return an SOA
242 //assert_soa_in_authority(ex_response);
240243 }
241244
242245
144144 START_TEST (getdns_address_sync_6)
145145 {
146146 /*
147 * name = "willem.getdnsapi.net" need to replace this with domain from unbound zone
147 * name = "d2a8n3.rootcanary.net" need to replace this with domain from unbound zone
148148 * expect: NOERROR/NODATA response:
149149 * status = GETDNS_RESPSTATUS_NO_DATA
150150 * rcode = 0
155155
156156 CONTEXT_CREATE(TRUE);
157157
158 ASSERT_RC(getdns_address_sync(context, "willem.getdnsapi.net", NULL, &response),
158 ASSERT_RC(getdns_address_sync(context, "d2a8n3.rootcanary.net", NULL, &response),
159159 GETDNS_RETURN_GOOD, "Return code from getdns_address_sync()");
160160
161161 EXTRACT_RESPONSE;
473473 TCase *tc_pos = tcase_create("Positive");
474474 /* TODO: Test which specific lists are supported */
475475 tcase_add_test(tc_pos, getdns_context_set_dns_transport_stub_5);
476 tcase_set_timeout(tc_pos, 6.0); /* test 6 times out after 5 secs */
476477 tcase_add_test(tc_pos, getdns_context_set_dns_transport_recursing_6);
477478 tcase_add_test(tc_pos, getdns_context_set_dns_transport_recursing_7);
478479 tcase_add_test(tc_pos, getdns_context_set_dns_transport_recursing_8);
426426
427427
428428 EXTRACT_RESPONSE;
429 printf("the resp is %s\n", getdns_pretty_print_dict(response));
429 //printf("the resp is %s\n", getdns_pretty_print_dict(response));
430430
431431
432432 assert_noerror(&ex_response);
139139 }
140140 END_TEST
141141
142 #if 0
142143 START_TEST (getdns_general_6)
143144 {
144145 /*
154155 struct getdns_context *context = NULL; \
155156 void* eventloop = NULL; \
156157 getdns_transaction_t transaction_id = 0;
157
158 CONTEXT_CREATE(TRUE);
159 EVENT_BASE_CREATE;
160
158
159 CONTEXT_CREATE(TRUE);
160 EVENT_BASE_CREATE;
161
161162 ASSERT_RC(getdns_general(context, "google.com", 0, NULL,
162163 &fn_ref, &transaction_id, callbackfn),
163164 GETDNS_RETURN_GOOD, "Return code from getdns_general()");
164
165 RUN_EVENT_LOOP;
166 CONTEXT_DESTROY;
167 }
168 END_TEST
169
165
166 RUN_EVENT_LOOP;
167 CONTEXT_DESTROY;
168 }
169 END_TEST
170
170171 void verify_getdns_general_6(struct extracted_response *ex_response)
171172 {
172173 assert_noerror(ex_response);
173174 assert_nodata(ex_response);
174175 }
176 #endif
175177
176178 START_TEST (getdns_general_7)
177179 {
178180 /*
179 * name = "google.com"
181 * name = "nlnetlabs.nl"
180182 * request_type = 65279 (maximum unassigned RRTYPE)
181183 * expect: NOERROR/NODATA response:
182184 * status = GETDNS_RESPSTATUS_NO_NAME
192194 CONTEXT_CREATE(TRUE);
193195 EVENT_BASE_CREATE;
194196
195 ASSERT_RC(getdns_general(context, "google.com", 65279, NULL,
197 ASSERT_RC(getdns_general(context, "nlnetlabs.nl", 65279, NULL,
196198 &fn_ref, &transaction_id, callbackfn),
197199 GETDNS_RETURN_GOOD, "Return code from getdns_general()");
198200
312314 {
313315 assert_nxdomain(ex_response);
314316 assert_nodata(ex_response);
315 assert_soa_in_authority(ex_response);
317 // Ubuntu 18.04 system resolver does not return an SOA
318 //assert_soa_in_authority(ex_response);
316319 }
317320
318321 START_TEST (getdns_general_11)
319322 {
320323 /*
321 * name = "willem.getdnsapi.net" and unbound zone
324 * name = "d2a8n3.rootcanary.net" and unbound zone
322325 * request_type = GETDNS_RRTYPE_MX
323326 * expect: NOERROR/NODATA response:
324327 * status = GETDNS_RESPSTATUS_NO_NAME
334337 CONTEXT_CREATE(TRUE);
335338 EVENT_BASE_CREATE;
336339
337 ASSERT_RC(getdns_general(context, "willem.getdnsapi.net", GETDNS_RRTYPE_MX, NULL,
340 ASSERT_RC(getdns_general(context, "d2a8n3.rootcanary.net", GETDNS_RRTYPE_MX, NULL,
338341 &fn_ref, &transaction_id, callbackfn),
339342 GETDNS_RETURN_GOOD, "Return code from getdns_general()");
340343
400403
401404 /* Positive test cases */
402405 TCase *tc_pos = tcase_create("Positive");
403 tcase_add_test(tc_pos, getdns_general_6);
406 // Ubuntu 18.04 system resolver returns FORMERR for this query
407 //tcase_add_test(tc_pos, getdns_general_6);
404408 tcase_add_test(tc_pos, getdns_general_7);
405409 tcase_add_test(tc_pos, getdns_general_8);
406410 tcase_add_test(tc_pos, getdns_general_9);
121121 }
122122 END_TEST
123123
124 START_TEST (getdns_general_sync_6)
125 {
126 /*
127 * name = "google.com"
128 * request_type = 0 (minimum valid RRTYPE)
129 * expect: NOERROR/NODATA response:
130 * status = GETDNS_RESPSTATUS_NO_NAME
131 * rcode = 0
132 * ancount = 0 (number of records in ANSWER section)
133 */
134 struct getdns_context *context = NULL;
135 struct getdns_dict *response = NULL;
136
137 CONTEXT_CREATE(TRUE);
138
139 ASSERT_RC(getdns_general_sync(context, "google.com", 0, NULL, &response),
140 GETDNS_RETURN_GOOD, "Return code from getdns_general_sync()");
141
142 EXTRACT_RESPONSE;
143
144 assert_noerror(&ex_response);
145 assert_nodata(&ex_response);
146
147 CONTEXT_DESTROY;
148 }
149 END_TEST
124 // START_TEST (getdns_general_sync_6)
125 // {
126 // /*
127 // * name = "google.com"
128 // * request_type = 0 (minimum valid RRTYPE)
129 // * expect: NOERROR/NODATA response:
130 // * status = GETDNS_RESPSTATUS_NO_NAME
131 // * rcode = 0
132 // * ancount = 0 (number of records in ANSWER section)
133 // */
134 // struct getdns_context *context = NULL;
135 // struct getdns_dict *response = NULL;
136 //
137 // CONTEXT_CREATE(TRUE);
138 //
139 // ASSERT_RC(getdns_general_sync(context, "google.com", 0, NULL, &response),
140 // GETDNS_RETURN_GOOD, "Return code from getdns_general_sync()");
141 //
142 // EXTRACT_RESPONSE;
143 //
144 // assert_noerror(&ex_response);
145 // assert_nodata(&ex_response);
146 //
147 // CONTEXT_DESTROY;
148 // }
149 // END_TEST
150150
151151 START_TEST (getdns_general_sync_7)
152152 {
153153 /*
154 * name = "google.com"
154 * name = "nlnetlabs.nl"
155155 * request_type = 65279 (maximum unassigned RRTYPE)
156156 * expect: NOERROR/NODATA response:
157157 * status = GETDNS_RESPSTATUS_NO_NAME
163163
164164 CONTEXT_CREATE(TRUE);
165165
166 ASSERT_RC(getdns_general_sync(context, "google.com", 65279, NULL, &response),
166 ASSERT_RC(getdns_general_sync(context, "nlnetlabs.nl", 65279, NULL, &response),
167167 GETDNS_RETURN_GOOD, "Return code from getdns_general_sync()");
168168
169169 EXTRACT_RESPONSE;
256256
257257 assert_nxdomain(&ex_response);
258258 assert_nodata(&ex_response);
259 assert_soa_in_authority(&ex_response);
259 // Ubuntu 18.04 system resolver does not return an SOA
260 //assert_soa_in_authority(&ex_response);
260261
261262 CONTEXT_DESTROY;
262263 }
265266 START_TEST (getdns_general_sync_11)
266267 {
267268 /*
268 * name = "willem.getdnsapi.net" an unbound zone (as in no MX)
269 * name = "d2a8n3.rootcanary.net" an unbound zone (as in no MX)
269270 * request_type = GETDNS_RRTYPE_MX
270271 * expect: NOERROR/NODATA response:
271272 * status = GETDNS_RESPSTATUS_NO_NAME
277278
278279 CONTEXT_CREATE(TRUE);
279280
280 ASSERT_RC(getdns_general_sync(context, "willem.getdnsapi.net", GETDNS_RRTYPE_MX, NULL, &response),
281 ASSERT_RC(getdns_general_sync(context, "d2a8n3.rootcanary.net", GETDNS_RRTYPE_MX, NULL, &response),
281282 GETDNS_RETURN_GOOD, "Return code from getdns_general_sync()");
282283
283284 EXTRACT_RESPONSE;
333334 /* Positive test cases */
334335
335336 TCase *tc_pos = tcase_create("Positive");
336 tcase_add_test(tc_pos, getdns_general_sync_6);
337 // Ubuntu 18.04 system resolver returns FORMERR for this query
338 //tcase_add_test(tc_pos, getdns_general_sync_6);
337339 tcase_add_test(tc_pos, getdns_general_sync_7);
338340 tcase_add_test(tc_pos, getdns_general_sync_8);
339341 tcase_add_test(tc_pos, getdns_general_sync_9);
360360 struct getdns_context *context = NULL;
361361 struct getdns_dict *address = NULL;
362362 struct getdns_bindata address_type = { 5, (void *)"IPv4" };
363 struct getdns_bindata address_data = { 4, (void *)"\xb9\x31\x8c\x00" };
363 struct getdns_bindata address_data = { 4, (void *)"\x08\x08\x08\x00" };
364364 void* eventloop = NULL;
365365 getdns_transaction_t transaction_id = 0;
366366
389389 {
390390 assert_nxdomain(ex_response);
391391 assert_nodata(ex_response);
392 assert_soa_in_authority(ex_response);
392 // Ubuntu 18.04 system resolver does not return an SOA
393 //assert_soa_in_authority(ex_response);
393394 }
394395
395396 START_TEST (getdns_hostname_12)
477478 {
478479 assert_nxdomain(ex_response);
479480 assert_nodata(ex_response);
480 assert_soa_in_authority(ex_response);
481 // Ubuntu 18.04 system resolver does not return an SOA
482 //assert_soa_in_authority(ex_response);
481483 }
482484
483485 Suite *
303303 struct getdns_context *context = NULL;
304304 struct getdns_dict *address = NULL;
305305 struct getdns_bindata address_type = { 5, (void *)"IPv4" };
306 struct getdns_bindata address_data = { 4, (void *)"\xb9\x31\x8c\x00" };
306 struct getdns_bindata address_data = { 4, (void *)"\x08\x08\x08\x00" };
307307 struct getdns_dict *response = NULL;
308308
309309 CONTEXT_CREATE(TRUE);
321321
322322 assert_nxdomain(&ex_response);
323323 assert_nodata(&ex_response);
324 assert_soa_in_authority(&ex_response);
324 // Ubuntu 18.04 system resolver does not return an SOA
325 //assert_soa_in_authority(&ex_response);
325326
326327 DICT_DESTROY(address);
327328 CONTEXT_DESTROY;
391392
392393 assert_nxdomain(&ex_response);
393394 assert_nodata(&ex_response);
394 assert_soa_in_authority(&ex_response);
395 // Ubuntu 18.04 system resolver does not return an SOA
396 //assert_soa_in_authority(&ex_response);
395397
396398 DICT_DESTROY(address);
397399 CONTEXT_DESTROY;
169169 {
170170 assert_nxdomain(ex_response);
171171 assert_nodata(ex_response);
172 assert_soa_in_authority(ex_response);
172 // Ubuntu 18.04 system resolver does not return an SOA
173 //assert_soa_in_authority(ex_response);
173174 }
174175
175176
134134
135135 assert_nxdomain(&ex_response);
136136 assert_nodata(&ex_response);
137 assert_soa_in_authority(&ex_response);
137 // Ubuntu 18.04 system resolver does not return an SOA
138 //assert_soa_in_authority(&ex_response);
138139 }
139140 END_TEST
140141
3636 #include <openssl/x509v3.h>
3737 #include <openssl/pem.h>
3838 #include <openssl/err.h>
39 #include <strings.h>
4039 #include <time.h>
4140 #include "types-internal.h"
4241 #include "context.h"
17251725 {
17261726 uint8_t digest[SHA256_DIGEST_SIZE];
17271727 mpz_t x, y;
1728 #ifdef HAVE_NETTLE_GET_SECP_256R1
1729 nettle_ecc_point_init(&pubkey, nettle_get_secp_256r1());
1730 #else
17281731 nettle_ecc_point_init(&pubkey, &nettle_secp_256r1);
1732 #endif
17291733 nettle_mpz_init_set_str_256_u(x, SHA256_DIGEST_SIZE, key);
17301734 nettle_mpz_init_set_str_256_u(y, SHA256_DIGEST_SIZE, key+SHA256_DIGEST_SIZE);
17311735 nettle_mpz_set_str_256_u(signature.r, SHA256_DIGEST_SIZE, sigblock);
17421746 {
17431747 uint8_t digest[SHA384_DIGEST_SIZE];
17441748 mpz_t x, y;
1749 #ifdef HAVE_NETTLE_GET_SECP_384R1
1750 nettle_ecc_point_init(&pubkey, nettle_get_secp_384r1());
1751 #else
17451752 nettle_ecc_point_init(&pubkey, &nettle_secp_384r1);
1753 #endif
17461754 nettle_mpz_init_set_str_256_u(x, SHA384_DIGEST_SIZE, key);
17471755 nettle_mpz_init_set_str_256_u(y, SHA384_DIGEST_SIZE, key+SHA384_DIGEST_SIZE);
17481756 nettle_mpz_set_str_256_u(signature.r, SHA384_DIGEST_SIZE, sigblock);
4141
4242 /* Forward declare type. */
4343 struct sha256_pin;
44 typedef struct sha256_pin sha256_pin_t;
44 struct getdns_log_config;
4545
4646 /* Additional return codes required by TLS abstraction. Internal use only. */
4747 #define GETDNS_RETURN_TLS_WANT_READ ((getdns_return_t) 420)
6060 * @paam log pointer to context log config.
6161 * @return pointer to new context or NULL on error.
6262 */
63 _getdns_tls_context* _getdns_tls_context_new(struct mem_funcs* mfs, const getdns_log_config* log);
63 _getdns_tls_context* _getdns_tls_context_new(struct mem_funcs* mfs, const struct getdns_log_config* log);
6464
6565 /**
6666 * Free a TLS context.
165165 * @paam log pointer to connection log config.
166166 * @return pointer to new connection or NULL on error.
167167 */
168 _getdns_tls_connection* _getdns_tls_connection_new(struct mem_funcs* mfs, _getdns_tls_context* ctx, int fd, const getdns_log_config* log);
168 _getdns_tls_connection* _getdns_tls_connection_new(struct mem_funcs* mfs, _getdns_tls_context* ctx, int fd, const struct getdns_log_config* log);
169169
170170 /**
171171 * Free a TLS connection.
313313 * @return GETDNS_RETURN_GOOD if all OK.
314314 * @return GETDNS_RETURN_INVALID_PARAMETER if conn is null or has no SSL.
315315 */
316 getdns_return_t _getdns_tls_connection_set_host_pinset(_getdns_tls_connection* conn, const char* auth_name, const sha256_pin_t* pinset);
316 getdns_return_t _getdns_tls_connection_set_host_pinset(_getdns_tls_connection* conn, const char* auth_name, const struct sha256_pin* pinset);
317317
318318 /**
319319 * Get result of certificate verification.
+0
-133
src/tools/Makefile.in less more
0 #
1 # @configure_input@
2 #
3 # Copyright (c) 2013, Verisign, Inc., NLNet Labs
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are met:
8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
13 # * Neither the names of the copyright holders nor the
14 # names of its contributors may be used to endorse or promote products
15 # derived from this software without specific prior written permission.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 # DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
21 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28 package = @PACKAGE_NAME@
29 version = @PACKAGE_VERSION@
30 tarname = @PACKAGE_TARNAME@
31 distdir = $(tarname)-$(version)
32
33 prefix = @prefix@
34 exec_prefix = @exec_prefix@
35 bindir = @bindir@
36 INSTALL = @INSTALL@
37 LIBTOOL = ../../libtool
38
39 srcdir = @srcdir@
40
41 CC=@CC@
42 WPEDANTICFLAG=@WPEDANTICFLAG@
43 CFLAGS=-I$(srcdir)/.. -I$(srcdir) -I.. $(cflags) @CFLAGS@ @CPPFLAGS@ $(WPEDANTICFLAG) $(XTRA_CFLAGS)
44 LDFLAGS=-L.. @LDFLAGS@
45 LDLIBS=../libgetdns.la @LIBS@
46
47 ALL_OBJS=getdns_query.lo getdns_server_mon.lo
48
49 PROGRAMS=getdns_query getdns_server_mon
50
51
52 .SUFFIXES: .c .o .a .lo .h
53
54 .c.o:
55 $(CC) $(CFLAGS) -c $< -o $@
56
57 .c.lo:
58 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $< -o $@
59
60 default: all
61
62 all: $(PROGRAMS)
63
64 $(ALL_OBJS):
65 $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/$(@:.lo=.c) -o $@
66
67 getdns_query: getdns_query.lo
68 $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ getdns_query.lo $(LDFLAGS) $(LDLIBS)
69
70 getdns_server_mon: getdns_server_mon.lo
71 $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ getdns_server_mon.lo $(LDFLAGS) $(LDLIBS)
72
73 stubby:
74 cd .. && $(MAKE) $@
75
76 install-getdns_query: getdns_query
77 $(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
78 $(LIBTOOL) --mode=install cp getdns_query $(DESTDIR)$(bindir)
79
80 uninstall-getdns_query:
81 $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/getdns_query
82
83 install-getdns_server_mon: getdns_server_mon
84 $(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
85 $(LIBTOOL) --mode=install cp getdns_server_mon $(DESTDIR)$(bindir)
86
87 uninstall-getdns_server_mon:
88 $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/getdns_server_mon
89
90 install-stubby:
91 cd .. && $(MAKE) $@
92
93 uninstall-stubby:
94 cd .. && $(MAKE) $@
95
96 clean:
97 rm -f *.o *.lo $(PROGRAMS)
98 rm -rf .libs
99
100 distclean : clean
101 rm -f Makefile
102
103 Makefile: $(srcdir)/Makefile.in ../../config.status
104 cd ../.. && ./config.status src/test/Makefile
105
106 depend:
107 (cd $(srcdir) ; awk 'BEGIN{P=1}{if(P)print}/^# Dependencies/{P=0}' Makefile.in > Makefile.in.new )
108 (blddir=`pwd`; cd $(srcdir) ; gcc -MM -I. -I.. -I"$$blddir"/.. *.c | \
109 sed -e "s? $$blddir/? ?g" \
110 -e 's? \([a-z0-9_-]*\)\.\([ch]\)? $$(srcdir)/\1.\2?g' \
111 -e 's? \.\./\([a-z0-9_-]*\)\.h? $$(srcdir)/../\1.h?g' \
112 -e 's? \.\./\([a-z0-9_-]*\)/\([a-z0-9_-]*\)\.h? $$(srcdir)/../\1/\2.h?g' \
113 -e 's? \$$(srcdir)/config\.h? ../config.h?g' \
114 -e 's? \$$(srcdir)/\.\./config\.h? ../config.h?g' \
115 -e 's? \$$(srcdir)/\.\./getdns/getdns\.h? ../getdns/getdns.h?g' \
116 -e 's? \$$(srcdir)/\.\./getdns/getdns_extra\.h? ../getdns/getdns_extra.h?g' \
117 -e 's!\(.*\)\.o[ :]*!\1.lo \1.o: !g' >> Makefile.in.new )
118 (cd $(srcdir) ; diff Makefile.in.new Makefile.in && rm Makefile.in.new \
119 || mv Makefile.in.new Makefile.in )
120
121 .PHONY: clean test
122
123 # Dependencies for getdns_query
124 getdns_query.lo getdns_query.o: $(srcdir)/getdns_query.c \
125 ../config.h \
126 $(srcdir)/../debug.h \
127 ../getdns/getdns.h \
128 ../getdns/getdns_extra.h
129 getdns_server_mon.lo getdns_server_mon.o: $(srcdir)/getdns_server_mon.c \
130 ../config.h \
131 ../getdns/getdns.h \
132 ../getdns/getdns_extra.h
13561356 typedef struct dns_msg {
13571357 getdns_transaction_t request_id;
13581358 getdns_dict *request;
1359 uint32_t rt;
1359 getdns_resolution_t rt;
13601360 uint32_t ad_bit;
13611361 uint32_t do_bit;
13621362 uint32_t cd_bit;
3333 #ifndef UTIL_LOG_H
3434 #define UTIL_LOG_H
3535
36 #include <stdlib.h>
37
3638 #include "config.h"
3739 #include "debug.h"
3840
4141 #include "config.h"
4242 #include "util/locks.h"
4343 #include <signal.h>
44 #include <string.h>
4445 #ifdef HAVE_SYS_WAIT_H
4546 #include <sys/wait.h>
4647 #endif
4848 #include "util/storage/lookup3.h"
4949 #include <stdio.h> /* defines printf for tests */
5050 #include <time.h> /* defines time_t for timings in the test */
51 /*#include <stdint.h> defines uint32_t etc (from config.h) */
52 #include <sys/param.h> /* attempt to define endianness */
51
52 #if defined(HAVE_TARGET_ENDIANNESS)
53 # if defined(TARGET_IS_BIG_ENDIAN)
54 # define HASH_LITTLE_ENDIAN 0
55 # define HASH_BIG_ENDIAN 1
56 # else
57 # define HASH_LITTLE_ENDIAN 1
58 # define HASH_BIG_ENDIAN 0
59 # endif
60 #else
5361 #ifdef HAVE_SYS_TYPES_H
5462 # include <sys/types.h> /* attempt to define endianness (solaris) */
5563 #endif
6371 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
6472 #include <sys/endian.h> /* attempt to define endianness */
6573 #endif
66
67 /* random initial value */
68 static uint32_t raninit = (uint32_t)0xdeadbeef;
69
70 void
71 hash_set_raninit(uint32_t v)
72 {
73 raninit = v;
74 }
7574
7675 /*
7776 * My best guess at if you are big-endian or little-endian. This may
102101 # define HASH_LITTLE_ENDIAN 0
103102 # define HASH_BIG_ENDIAN 0
104103 #endif
104 #endif /* defined(TARGET_IS_BIG_ENDIAN) */
105
106 /* random initial value */
107 static uint32_t raninit = (uint32_t)0xdeadbeef;
108
109 void
110 hash_set_raninit(uint32_t v)
111 {
112 raninit = v;
113 }
105114
106115 #define hashsize(n) ((uint32_t)1<<(n))
107116 #define hashmask(n) (hashsize(n)-1)
3939 *
4040 */
4141
42 #include <stdlib.h>
43
4244 #include "config.h"
4345 #include "util/storage/lruhash.h"
4446 #include "util/fptr_wlist.h"
457459 void
458460 lruhash_status(struct lruhash* table, const char* id, int extended)
459461 {
462 (void)id;
460463 lock_quick_lock(&table->lock);
461464 log_info("%s: %u entries, memory %u / %u",
462465 id, (unsigned)table->num, (unsigned)table->space_used,
3434
3535 #ifndef UTIL_LOCKS_H
3636 #define UTIL_LOCKS_H
37
38 #include <string.h>
3739
3840 /**
3941 * \file
218220 #else /* we do not HAVE_SOLARIS_THREADS and no PTHREADS */
219221 /******************* WINDOWS THREADS ************************/
220222 #ifdef HAVE_WINDOWS_THREADS
223 #include <winsock2.h>
221224 #include <windows.h>
222225
223226 /* Use a mutex */
3838 * Implementation of a redblack tree.
3939 */
4040
41 #include <stdlib.h>
42
4143 #include "config.h"
4244 #include "log.h"
4345 #include "fptr_wlist.h"
5050 #include "gldns/gbuffer.h"
5151 #include "gldns/pkthdr.h"
5252 #include "dnssec.h"
53 #include "convert.h"
5354
5455
5556 getdns_return_t
724725 , answer_spc.rrset.name))
725726 goto error;
726727
728 if (!req->upstream)
729 ;
730 else if (req->upstream->addr.ss_family == AF_INET) {
731 struct sockaddr_in *addr = (struct sockaddr_in *) &req->upstream->addr;
732 if (_getdns_dict_set_const_bindata(result,
733 "answer_ipv4_address", sizeof(addr->sin_addr)
734 , (uint8_t *) & (addr->sin_addr)))
735 goto error;
736 }
737 else if (req->upstream->addr.ss_family == AF_INET6) {
738 struct sockaddr_in6 *addr = (struct sockaddr_in6 *) &req->upstream->addr;
739 if (_getdns_dict_set_const_bindata(result,
740 "answer_ipv6_address", sizeof(addr->sin6_addr)
741 , (uint8_t *) & (addr->sin6_addr)))
742 goto error;
743 }
744
727745 if (!req->owner->add_warning_for_bad_dns)
728746 goto success;
729747
802820 getdns_bindata qname;
803821 getdns_dict *netreq_debug;
804822 getdns_dict *address_debug = NULL;
823 getdns_dict *query_dict = NULL;
824 const uint8_t *wire;
825 size_t wire_len;
805826
806827 assert(netreq);
807828
838859 return NULL;
839860 }
840861 /* Stub resolver debug data */
862 wire = netreq->query;
863 wire_len = netreq->response - netreq->query;
864 if (!wire)
865 ; /* pass */
866
867 else if(_getdns_wire2msg_dict_scan(
868 &netreq_debug->mf, &wire, &wire_len, &query_dict)) {
869
870 getdns_dict_destroy(netreq_debug);
871 return NULL;
872
873 } else if (_getdns_dict_set_this_dict(
874 netreq_debug, "query", query_dict)) {
875
876 getdns_dict_destroy(netreq_debug);
877 return NULL;
878 }
841879 _getdns_sockaddr_to_dict(
842880 context, &netreq->upstream->addr, &address_debug);
843881
11241162 getdns_dict *netreq_debug;
11251163 _srvs srvs = { 0, 0, NULL };
11261164 _getdns_rrset_spc answer_spc;
1165 getdns_bindata *answer_ipv4_address = NULL;
1166 getdns_bindata *answer_ipv6_address = NULL;
11271167
11281168 /* info (bools) about dns_req */
11291169 int dnssec_return_status;
11591199 goto error_free_result;
11601200 }
11611201 }
1162 if (getdns_dict_set_int(result, GETDNS_STR_KEY_ANSWER_TYPE,
1163 GETDNS_NAMETYPE_DNS))
1202 if (getdns_dict_set_int(result, "answer_type", GETDNS_NAMETYPE_DNS))
11641203 goto error_free_result;
11651204
11661205 if (!(replies_full = getdns_list_create_with_context(context)))
11751214
11761215 for ( netreq_p = completed_request->netreqs
11771216 ; (netreq = *netreq_p) ; netreq_p++) {
1217 getdns_bindata *tmp_ipv4_address;
1218 getdns_bindata *tmp_ipv6_address;
11781219
11791220 if (call_reporting && ( netreq->response_len
11801221 || netreq->state == NET_REQ_TIMED_OUT)) {
12321273 result, "canonical_name", canonical_name))
12331274 goto error;
12341275 }
1276
1277 if (!getdns_dict_get_bindata(
1278 reply, "answer_ipv4_address", &tmp_ipv4_address)) {
1279 if (!answer_ipv4_address)
1280 answer_ipv4_address = tmp_ipv4_address;
1281 else if (tmp_ipv4_address->size != answer_ipv4_address->size
1282 || memcmp( tmp_ipv4_address->data
1283 , answer_ipv4_address->data
1284 , answer_ipv4_address->size))
1285 answer_ipv4_address = NULL;
1286 }
1287 if (!getdns_dict_get_bindata(
1288 reply, "answer_ipv6_address", &tmp_ipv6_address)) {
1289 if (!answer_ipv6_address)
1290 answer_ipv6_address = tmp_ipv6_address;
1291 else if (tmp_ipv6_address->size != answer_ipv6_address->size
1292 || memcmp( tmp_ipv6_address->data
1293 , answer_ipv6_address->data
1294 , answer_ipv6_address->size))
1295 answer_ipv6_address = NULL;
1296 }
12351297 /* TODO: Check instead if canonical_name for request_type
12361298 * is in the answer section.
12371299 */
12661328 if (!canonical_name &&
12671329 _getdns_dict_set_const_bindata(result, "canonical_name",
12681330 completed_request->name_len, completed_request->name))
1331 goto error;
1332
1333 if (answer_ipv4_address &&
1334 getdns_dict_set_bindata(result, "answer_ipv4_address", answer_ipv4_address))
1335 goto error;
1336
1337 if (answer_ipv6_address &&
1338 getdns_dict_set_bindata(result, "answer_ipv6_address", answer_ipv6_address))
12691339 goto error;
12701340
12711341 if (call_reporting) {
0 /bench export-ignore
1 /test export-ignore
2 /.gitignore export-ignore
3 /Makefile export-ignore
4 /yxml-gen.pl export-ignore
5 /yxml-states export-ignore
6 /yxml.c.in export-ignore
224224
225225 static inline yxml_ret_t yxml_elemstart (yxml_t *x, unsigned ch) { return yxml_pushstack(x, &x->elem, ch); }
226226 static inline yxml_ret_t yxml_elemname (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
227 static inline yxml_ret_t yxml_elemnameend(yxml_t *x, unsigned ch) { return YXML_ELEMSTART; }
227 static inline yxml_ret_t yxml_elemnameend(yxml_t *x, unsigned ch) { (void)x; (void)ch; return YXML_ELEMSTART; }
228228
229229
230230 /* Also used in yxml_elemcloseend(), since this function just removes the last
231231 * element from the stack and returns ELEMEND. */
232232 static yxml_ret_t yxml_selfclose(yxml_t *x, unsigned ch) {
233 (void)ch;
233234 yxml_popstack(x);
234235 if(x->stacklen) {
235236 x->elem = (char *)x->stack+x->stacklen-1;
260261
261262 static inline yxml_ret_t yxml_attrstart (yxml_t *x, unsigned ch) { return yxml_pushstack(x, &x->attr, ch); }
262263 static inline yxml_ret_t yxml_attrname (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
263 static inline yxml_ret_t yxml_attrnameend(yxml_t *x, unsigned ch) { return YXML_ATTRSTART; }
264 static inline yxml_ret_t yxml_attrvalend (yxml_t *x, unsigned ch) { yxml_popstack(x); return YXML_ATTREND; }
264 static inline yxml_ret_t yxml_attrnameend(yxml_t *x, unsigned ch) { (void)x; (void)ch; return YXML_ATTRSTART; }
265 static inline yxml_ret_t yxml_attrvalend (yxml_t *x, unsigned ch) { (void)ch; yxml_popstack(x); return YXML_ATTREND; }
265266
266267
267268 static inline yxml_ret_t yxml_pistart (yxml_t *x, unsigned ch) { return yxml_pushstack(x, &x->pi, ch); }
268269 static inline yxml_ret_t yxml_piname (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
269 static inline yxml_ret_t yxml_piabort (yxml_t *x, unsigned ch) { yxml_popstack(x); return YXML_OK; }
270 static inline yxml_ret_t yxml_piabort (yxml_t *x, unsigned ch) { (void)ch; yxml_popstack(x); return YXML_OK; }
270271 static inline yxml_ret_t yxml_pinameend(yxml_t *x, unsigned ch) {
271 return (x->pi[0]|32) == 'x' && (x->pi[1]|32) == 'm' && (x->pi[2]|32) == 'l' && !x->pi[3] ? YXML_ESYN : YXML_PISTART;
272 }
273 static inline yxml_ret_t yxml_pivalend (yxml_t *x, unsigned ch) { yxml_popstack(x); x->pi = (char *)x->stack; return YXML_PIEND; }
272 (void)ch; return (x->pi[0]|32) == 'x' && (x->pi[1]|32) == 'm' && (x->pi[2]|32) == 'l' && !x->pi[3] ? YXML_ESYN : YXML_PISTART;
273 }
274 static inline yxml_ret_t yxml_pivalend (yxml_t *x, unsigned ch) { (void)ch; yxml_popstack(x); x->pi = (char *)x->stack; return YXML_PIEND; }
274275
275276
276277 static inline yxml_ret_t yxml_refstart(yxml_t *x, unsigned ch) {
278 (void)ch;
277279 memset(x->data, 0, sizeof(x->data));
278280 x->reflen = 0;
279281 return YXML_OK;
319321 }
320322
321323
322 static inline yxml_ret_t yxml_refcontent(yxml_t *x, unsigned ch) { return yxml_refend(x, YXML_CONTENT); }
323 static inline yxml_ret_t yxml_refattrval(yxml_t *x, unsigned ch) { return yxml_refend(x, YXML_ATTRVAL); }
324 static inline yxml_ret_t yxml_refcontent(yxml_t *x, unsigned ch) { (void)ch; return yxml_refend(x, YXML_CONTENT); }
325 static inline yxml_ret_t yxml_refattrval(yxml_t *x, unsigned ch) { (void)ch; return yxml_refend(x, YXML_ATTRVAL); }
324326
325327
326328 void yxml_init(yxml_t *x, void *stack, size_t stacksize) {
327329 memset(x, 0, sizeof(*x));
328330 x->line = 1;
329 x->stack = stack;
331 x->stack = (unsigned char*)stack;
330332 x->stacksize = stacksize;
331333 *x->stack = 0;
332334 x->elem = x->pi = x->attr = (char *)x->stack;
0 % Yxml Manual
1
2 # Introduction
3
4 Yxml is a small non-validating and mostly conforming XML parser written in C.
5
6 The latest version of yxml and this document can be found on
7 [https://dev.yorhel.nl/yxml](https://dev.yorhel.nl/yxml).
8
9 # Compiling yxml
10
11 Due to the small size of yxml, the recommended way to use it is to copy the
12 [yxml.c](https://g.blicky.net/yxml.git/plain/yxml.c) and
13 [yxml.h](https://g.blicky.net/yxml.git/plain/yxml.h) from the git repository
14 into your project directory, and compile and link yxml.c as part of your
15 program or library.
16
17 The git repository also includes a Makefile. Running `make` without specifying
18 a target will compile a `.a` file for easy static linking. A test suite is
19 available under `make test`.
20
21 # API documentation
22
23 ## Overview
24
25 Yxml is designed to be very flexible and efficient, and thus offers a
26 relatively low-level stream-based API. The entire API consists of two typedefs
27 and three functions:
28
29 ```c
30 typedef enum { /* .. */ } yxml_ret_t;
31 typedef struct { /* .. */ } yxml_t;
32
33 void yxml_init(yxml_t *x, void *buf, size_t bufsize);
34 yxml_ret_t yxml_parse(yxml_t *x, int ch);
35 yxml_ret_t yxml_eof(yxml_t *x);
36 ```
37
38 The values of _yxml\_ret\_t_ and the public fields of _yxml\_t_ are explained
39 in detail below. Parsing a file using yxml involves three steps:
40
41 1. Initialization, using `yxml_init()`.
42 2. Parsing. This is performed in a loop where `yxml_parse()` is called on each
43 character of the input file.
44 3. Finalization, using `yxml_eof()`.
45
46 ## Initialization
47
48 ```c
49 #define BUFSIZE 4096
50 void *buf = malloc(BUFSIZE);
51 yxml_t x;
52 yxml_init(&x, buf, BUFSIZE);
53 ```
54
55 The parsing state for an input document is remembered in the `yxml_t`
56 structure. This structure needs to be allocated and initialized before parsing
57 a new XML document.
58
59 Allocating space for the `yxml_t` structure is the responsibility of the
60 application. Allocation can be done on the stack, but it is also possible to
61 embed the struct inside a larger object or to allocate space for the struct
62 separately.
63
64 `yxml_init()` takes a pointer to an (uninitialized) `yxml_t` struct as first
65 argument and performs the necessary initialization. The two additional
66 arguments specify a pointer to a buffer and the size of this buffer. The given
67 buffer must be writable, but does not have to be initialized by the
68 application.
69
70 The buffer is used internally by yxml to keep a stack of opened XML element
71 names, property names and PI targets. The size of the buffer determines both
72 the maximum depth in which XML elements can be nested and the maximum length of
73 element names, property names and PI targets. Each name consumes
74 `strlen(name)+1` bytes in the buffer, and the first byte of the buffer is
75 reserved for the `\0` byte. This means that in order to parse an XML document
76 with an element name of 100 bytes, a property name or PI target of 50 bytes and
77 a nesting depth of 10 levels, the buffer must be at least
78 `1+10*(100+1)+(50+1)=1062` bytes. Note that properties and PIs don't nest, so
79 the `max(PI_name, property_name)` only needs to be counted once.
80
81 It is not currently possibly to dynamically grow the buffer while parsing, so
82 it is important to choose a buffer size that is large enough to handle all the
83 XML documents that you want to parse. Since element names, property names and
84 PI targets are typically much shorter than in the previous example, a buffer
85 size of 4 or 8 KiB will give enough headroom even for documents with deep
86 nesting.
87
88 As a useful hack, it is possible to merge the memory for the `yxml_t` struct
89 and the stack buffer in a single allocation:
90
91 ```c
92 yxml_t *x = malloc(sizeof(yxml_t) + BUFSIZE);
93 yxml_init(x, x+1, BUFSIZE);
94 ```
95
96 This way, the complete parsing state can be passed around with a single
97 pointer, and both the struct and the buffer can be freed with a single call to
98 `free(x)`.
99
100 ## Parsing
101
102 ```c
103 yxml_t *x; /* An initialized state */
104 char *doc; /* The XML document as a zero-terminated string */
105 for(; *doc; doc++) {
106 yxml_ret_t r = yxml_parse(x, *doc);
107 if(r < 0)
108 exit(1); /* Handle error */
109 /* Handle any tokens we are interested in */
110 }
111 ```
112
113 The actual parsing of an XML document is facilitated by the `yxml_parse()`
114 function. It accepts a pointer to an initialized `yxml_t` struct as first
115 argument and a byte as second argument. The byte is passed as an `int`, and
116 values in the range of -128 to 255 (both inclusive) are accepted. This way you
117 can pass either `signed char` or `unsigned char` values, yxml will work fine
118 with both. To parse a complete document, `yxml_parse()` needs to be called for
119 each byte of the document in sequence, as done in the above example.
120
121 For each byte, `yxml_parse()` will return either _YXML\_OK_ (0), a token (>0)
122 or an error (<0). _YXML\_OK_ is returned if the given byte has been
123 parsed/consumed correctly but that otherwise nothing worthy of note has
124 happened. The application should then continue processing and pass the next
125 byte of the document.
126
127 ### Public State Variables
128
129 After each call to `yxml_parse()`, a number of interesting fields in the
130 `yxml_t` struct are updated. The fields documented here are part of the API,
131 and are considered as extra return values of `yxml_parse()`. All of these
132 fields should be considered read-only.
133
134 `char *elem;`
135 : Name of the currently opened XML element. Points into the buffer given to
136 `yxml_init()`. Described in ["Elements"](#elements).
137
138 `char *attr;`
139 : Name of the currently opened attribute. Points into the buffer given to
140 `yxml_init()`. Described in ["Attributes"](#attributes).
141
142 `char *pi;`
143 : Target of the currently opened PI. Points into the buffer given to
144 `yxml_init()`. Described in ["Processing Instructions"](#processing-instructions).
145
146 `char data[8];`
147 : Character data of element contents, attribute values or PI contents. Described
148 in ["Character Data"](#character-data).
149
150 `uint32_t line;`
151 : Number of the line in the XML document that is currently being parsed.
152
153 `uint64_t byte;`
154 : Byte offset into the current line the XML document.
155
156 `uint64_t total;`
157 : Byte offset into the XML document.
158
159 The values of the _elem_, _attr_, _pi_ and _data_ elements depend on the
160 parsing context, and only remain valid within that context. The exact contexts
161 in which these fields contain valid information is described in their
162 respective sections below.
163
164 The _line_, _byte_ and _total_ fields are mainly useful for error reporting.
165 When `yxml_parse()` reports an error, these fields can be used to generate a
166 useful error message. For example:
167
168 ```c
169 printf("Parsing error at %s:%"PRIu32":%"PRIu64" byte offset %"PRIu64",
170 filename, x->line, x->byte, x->total);
171 ```
172
173 ### Error Handling
174
175 Errors are not recoverable. No further calls to `yxml_parse()` or `yxml_eof()`
176 should be performed on the same `yxml_t` struct. Re-initializing the same
177 struct using `yxml_init()` to start parsing a new document is possible,
178 however. The following error values may be returned by `yxml_parse()`:
179
180 YXML\_EREF
181 : Invalid character or entity reference. E.g. `&whatever;` or `&#ABC;`.
182
183 YXML\_ECLOSE
184 : Close tag does not match open tag. E.g. `<Tag> .. </SomeOtherTag>`.
185
186 YXML\_ESTACK
187 : Stack overflow. This happens when the buffer given to `yxml_init()` was not
188 large enough to parse this document. E.g. when elements are too deeply nested
189 or an element name, attribute name or PI target is too long.
190
191 YXML\_ESYN
192 : Miscellaneous syntax error.
193
194 ## Handling Tokens
195
196 The `yxml_parse()` function will return tokens as they are found. When loading
197 an XML document, it is important to know which tokens are returned in which
198 situation and how to handle them.
199
200 The following graph shows the (simplified) state machine of the parser to
201 illustrate the order in which tokens are returned. The labels on the edge
202 indicate the tokens that are returned by `yxml_parse()`, with their `YXML_`
203 prefix removed. The special return value `YXML_OK` and error returns are not
204 displayed.
205
206 ![](https://dev.yorhel.nl/img/yxml-apistates.png)
207
208 Tokens that the application is not interested in can be ignored safely. For
209 example, if you are not interested in handling processing instructions, then
210 the `YXML_PISTART`, `YXML_PICONTENT` and `YXML_PIEND` tokens can be handled
211 exactly as if they were an alias for `YXML_OK`.
212
213 ### Elements
214
215 The `YXML_ELEMSTART` and `YXML_ELEMEND` tokens are returned when an XML
216 element is opened and closed, respectively. When `YXML_ELEMSTART` is returned,
217 the _elem_ struct field will hold the name of the element. This field will be
218 valid (i.e. keeps pointing to the name of the opened element) until the end of
219 the attribute list. That is, until any token other than those described in
220 ["Attributes"](#attributes) is returned. Although the _elem_ pointer itself may be reused
221 and modified while parsing the contents of the element, the buffer that _elem_
222 points to will remain valid up to and including the corresponding
223 `YXML_ELEMEND`.
224
225 Yxml will verify that elements properly nest and that the name of each closing
226 tag properly matches that of the corresponding opening tag. The application may
227 safely assume that each `YXML_ELEMSTART` is properly matched with a
228 `YXML_ELEMEND`, or that otherwise an error is returned. Furthermore, only a
229 single root element is allowed. When the root element is closed, no further
230 `YXML_ELEMSTART` tokens will be returned.
231
232 No distinction is made between self-closing tags and elements with empty
233 content. For example, both `<a/>` and `<a></a>` will result in the
234 `YXML_ELEMSTART` token (with `elem="a"`) followed by `YXML_ELEMEND`.
235
236 Element contents are returned in the form of the `YXML_CONTENT` token and the
237 _data_ field. This is described in more detail in ["Character
238 Data"](#character-data).
239
240 ### Attributes
241
242 Element attributes are passed using the `YXML_ATTRSTART`, `YXML_ATTRVAL` and
243 `YXML_ATTREND` tokens. The name of the attribute is available in the _attr_
244 field, which is available when `YXML_ATTRSTART` is returned and valid up to
245 and including the next `YXML_ATTREND`.
246
247 Yxml does not verify that attribute names are unique within a single element.
248 It is thus possible that the same attribute will appear twice, possibly with a
249 different value. The correct way to handle this situation is to stop parsing
250 the rest of the document and to report an error, but if the application is not
251 interested in all attributes, detecting duplicates in them may complicate the
252 code and possibly even introduce security vulnerabilities (e.g. algorithmic
253 complexity attacks in a hash table). As such, the best solution is to report an
254 error when you can easily detect a duplicate attribute, but ignore duplicates
255 that require more effort to be detected.
256
257 The attribute value is returned with the `YXML_ATTRVAL` token and the _data_
258 field. This is described in more detail in ["Character Data"](#character-data).
259
260 ### Processing Instructions
261
262 Processing instructions are passed in similar fashion to attributes, and are
263 passed using `YXML_PISTART`, `YXML_PICONTENT` and `YXML_PIEND`. The target of
264 the PI is available in the _pi_ field after `YXML_PISTART` and remains valid up
265 to (but excluding) the next `YXML_PIEND` token.
266
267 PI contents are returned as `YXML_PICONTENT` tokens and using the _data_ field,
268 described in more detail in ["Character Data"](#character-data).
269
270 ### Character Data
271
272 Element contents (`YXML_CONTENT`), attribute values (`YXML_ATTRVAL`) and PI
273 contents (`YXML_PICONTENT`) are all passed to the application in small chunks
274 through the _data_ field. Each time that `yxml_parse()` returns one of these
275 tokens, the _data_ field will contain one or more bytes of the element
276 contents, attribute value or PI content. The string is zero-terminated, and its
277 value is only valid until the next call to `yxml_parse()`.
278
279 Typically only a single byte is returned after each call, but multiple bytes
280 can be returned in the following special cases:
281
282 - Character references outside of the ASCII character range. When a character
283 reference is encountered in element contents or in an attribute value, it is
284 automatically replaced with the referenced character. For example, the XML
285 string `&#47;` is replaced with the single character "/". If the character
286 value is above 127, its value is encoded in UTF-8 and then returned as a
287 multi-byte string in the _data_ field. For example, the character reference
288 `&#xe7;` is returned as the C string "\\xc3\\xa9", which is the UTF-8
289 encoding for the character "é". Character references are not expanded in PI
290 contents.
291 - The special character "\]" in CDATA sections. When the "\]" character is
292 encountered inside a CDATA section, yxml can't immediately return it to the
293 application because it does not know whether the character is part of the
294 CDATA ending or whether it is still part of its contents. So it remembers the
295 character for the next call to `yxml_parse()`, and if it then turns out that
296 the character was part of the CDATA contents, it returns both the "\]"
297 character and the following byte in the same _data_ string. Similarly, if two
298 "\]" characters appear in sequence as part of the CDATA content, then the two
299 characters are returned in a single _data_ string together with the byte that
300 follows. CDATA sections only appear in element contents, so this does not
301 happen in attribute values or PI contents.
302 - The special character "?" in PI contents. This is similar to the issue with
303 "\]" characters in CDATA sections. Yxml remembers a "?" character while
304 parsing a PI, and then returns it together with the byte following it if it
305 turned out to be part of the PI contents.
306
307 Note that `yxml_parse()` operates on bytes rather than characters. If the
308 document is encoded in a multi-byte character encoding such as UTF-8, then each
309 Unicode character that occupies more than a single byte will be broken up and
310 its bytes processed individually. As a result, the bytes returned in the
311 _data_ field may not necessarily represent a single Unicode character. To
312 ensure that multi-byte characters are not broken up, the application can
313 concatenate multiple data tokens to a single buffer before attempting to do
314 further processing on the result.
315
316 To make processing easier, an application may want to combine all the tokens
317 into a single buffer. This can be easily implemented as follows:
318
319 ```c
320 SomeString attrval;
321 while(..) {
322 yxml_ret_t r = yxml_parse(x, ch);
323 switch(r) {
324 case YXML_ATTRSTART:
325 somestring_initialize(attrval);
326 break;
327 case YXML_ATTRVAL:
328 somestring_append(attrval, x->data);
329 break;
330 case YXML_ATTREND:
331 /* Now we have a full attribute. Its name is in x->attr, and its value is
332 * in the string 'attrval'. */
333 somestring_reset(attrval);
334 break;
335 }
336 }
337 ```
338
339 The `SomeString` type and `somestring_` functions are stubs for any string
340 handling library of your choosing. When using Glib, for example, one could use
341 the [GString](https://developer.gnome.org/glib/stable/glib-Strings.html)
342 type and the `g_string_new()`, `g_string_append()` and `g_string_free()`
343 functions. For a more lighter-weight string library there is also
344 [kstring.h in klib](https://github.com/attractivechaos/klib), but the
345 functionality required in the above example can easily be implemented in a few
346 lines of pure C, too.
347
348 When buffering data into an ever-growing string, as done in the previous
349 example, one should be careful to protect against memory exhaustion. This can
350 be done trivially by limiting the size of the total XML document or the maximum
351 length of the buffer. If you want to extract information from an XML document
352 that might not fit into memory, but you know that the information you care
353 about is limited in size and is only stored in specific attributes or elements,
354 you can choose to ignore data you don't care about. For example, if you only
355 want to extract the "Size" attribute and you know that its value is never
356 larger than 63 bytes, you can limit your code to read only that value and store
357 it into a small pre-allocated buffer:
358
359 ```c
360 char sizebuf[64], *sizecur = NULL, *tmp;
361 while(..) {
362 yxml_ret_t r = yxml_parse(x, ch);
363 switch(r) {
364 case YXML_ATTRSTART:
365 if(strcmp(x->attr, "Size") == 0)
366 sizecur = sizebuf;
367 break;
368 case YXML_ATTRVAL:
369 if(!sizecur) /* Are we in the "Size" attribute? */
370 break;
371 /* Append x->data to sizecur while there is space */
372 tmp = x->data;
373 while(*tmp && sizecur < sizebuf+sizeof(sizebuf))
374 *(sizecur++) = *(tmp++);
375 if(sizecur == sizebuf+sizeof(sizebuf))
376 exit(1); /* Too long attribute value, handle error */
377 *sizecur = 0;
378 break;
379 case YXML_ATTREND:
380 if(sizecur) {
381 /* Now we have the value of the "Size" attribute in sizebuf */
382 sizecur = NULL;
383 }
384 break;
385 }
386 }
387 ```
388
389 ## Finalization
390
391 ```c
392 yxml_t *x; /* An initialized state */
393 yxml_ret_t r = yxml_eof(x);
394 if(r < 0)
395 exit(1); /* Handle error */
396 else
397 /* No errors in the XML document */
398 ```
399
400 Because `yxml_parse()` does not know when the end of the XML document has been
401 reached, it is unable to detect certain errors in the document. This is why,
402 after successfully parsing a complete document with `yxml_parse()`, the
403 application should call `yxml_eof()` to perform some extra checks.
404
405 `yxml_eof()` will return `YXML_OK` if the parsed XML document is well-formed,
406 `YXML_EEOF` otherwise. The following errors are not detected by
407 `yxml_parse()` but will result in an error on `yxml_eof()`:
408
409 - The XML document did not contain a root element (e.g. an empty file).
410 - The XML root element has not been closed (e.g. "`<a> ..`").
411 - The XML document ended in the middle of a comment or PI (e.g.
412 "`<a/><!-- ..`").
413
414 ## Utility functions
415
416 ```c
417 size_t yxml_symlen(yxml_t *, const char *);
418 ```
419
420 `yxml_symlen()` returns the length of the element name (`x->elem`), attribute
421 name (`x->attr`), or PI name (`x->pi`). When used correctly, it gives the same
422 result as `strlen()`, except without having to scan through the string. This
423 function should **ONLY** be used directly after the `YXML_ELEMSTART`,
424 `YXML_ATTRSTART` or `YXML_PISTART` (respectively) tokens have been returned by
425 `yxml_parse()`, calling this function at any other time may not give the
426 correct results. This function should **NOT** be used on strings other than
427 `x->elem`, `x->attr` or `x->pi`.
+0
-450
src/yxml/yxml.pod less more
0 =head1 Introduction
1
2 Yxml is a small non-validating and mostly conforming XML parser written in C.
3
4 The latest version of yxml and this document can be found on
5 L<http://dev.yorhel.nl/yxml>.
6
7 =head1 Compiling yxml
8
9 Due to the small size of yxml, the recommended way to use it is to copy the
10 L<yxml.c|http://g.blicky.net/yxml.git/plain/yxml.c> and
11 L<yxml.h|http://g.blicky.net/yxml.git/plain/yxml.h> from the git repository
12 into your project directory, and compile and link yxml.c as part of your
13 program or library.
14
15 The git repository also includes a Makefile. Running C<make> without specifying
16 a target will compile a C<.a> file for easy static linking. A test suite is
17 available under C<make test>.
18
19 =head1 API documentation
20
21 =head2 Overview
22
23 Yxml is designed to be very flexible and efficient, and thus offers a
24 relatively low-level stream-based API. The entire API consists of two typedefs
25 and three functions:
26
27 typedef enum { /* .. */ } yxml_ret_t;
28 typedef struct { /* .. */ } yxml_t;
29
30 void yxml_init(yxml_t *x, void *buf, size_t bufsize);
31 yxml_ret_t yxml_parse(yxml_t *x, int ch);
32 yxml_ret_t yxml_eof(yxml_t *x);
33
34 The values of I<yxml_ret_t> and the public fields of I<yxml_t> are explained in
35 detail below. Parsing a file using yxml involves three steps:
36
37 =over
38
39 =item 1. Initialization, using C<yxml_init()>.
40
41 =item 2. Parsing. This is performed in a loop where C<yxml_parse()> is called
42 on each character of the input file.
43
44 =item 3. Finalization, using C<yxml_eof()>.
45
46 =back
47
48
49 =head2 Initialization
50
51 #define BUFSIZE 4096
52 void *buf = malloc(BUFSIZE);
53 yxml_t x;
54 yxml_init(&x, buf, BUFSIZE);
55
56 The parsing state for an input document is remembered in the C<yxml_t>
57 structure. This structure needs to be allocated and initialized before parsing
58 a new XML document.
59
60 Allocating space for the C<yxml_t> structure is the responsibility of the
61 application. Allocation can be done on the stack, but it is also possible to
62 embed the struct inside a larger object or to allocate space for the struct
63 separately.
64
65 C<yxml_init()> takes a pointer to an (uninitialized) C<yxml_t> struct as first
66 argument and performs the necessary initialization. The two additional
67 arguments specify a pointer to a buffer and the size of this buffer. The given
68 buffer must be writable, but does not have to be initialized by the
69 application.
70
71 The buffer is used internally by yxml to keep a stack of opened XML element
72 names, property names and PI targets. The size of the buffer determines both
73 the maximum depth in which XML elements can be nested and the maximum length of
74 element names, property names and PI targets. Each name consumes
75 C<strlen(name)+1> bytes in the buffer, and the first byte of the buffer is
76 reserved for the C<\0> byte. This means that in order to parse an XML document
77 with an element name of 100 bytes, a property name or PI target of 50 bytes and
78 a nesting depth of 10 levels, the buffer must be at least
79 C<1+10*(100+1)+(50+1)=1062> bytes. Note that properties and PIs don't nest, so
80 the C<max(PI_name, property_name)> only needs to be counted once.
81
82 It is not currently possibly to dynamically grow the buffer while parsing, so
83 it is important to choose a buffer size that is large enough to handle all the
84 XML documents that you want to parse. Since element names, property names and
85 PI targets are typically much shorter than in the previous example, a buffer
86 size of 4 or 8 KiB will give enough headroom even for documents with deep
87 nesting.
88
89 As a useful hack, it is possible to merge the memory for the C<yxml_t> struct
90 and the stack buffer in a single allocation:
91
92 yxml_t *x = malloc(sizeof(yxml_t) + BUFSIZE);
93 yxml_init(x, x+1, BUFSIZE);
94
95 This way, the complete parsing state can be passed around with a single
96 pointer, and both the struct and the buffer can be freed with a single call to
97 C<free(x)>.
98
99
100 =head2 Parsing
101
102 yxml_t *x; /* An initialized state */
103 char *doc; /* The XML document as a zero-terminated string */
104 for(; *doc; doc++) {
105 yxml_ret_t r = yxml_parse(x, *doc);
106 if(r < 0)
107 exit(1); /* Handle error */
108 /* Handle any tokens we are interested in */
109 }
110
111 The actual parsing of an XML document is facilitated by the C<yxml_parse()>
112 function. It accepts a pointer to an initialized C<yxml_t> struct as first
113 argument and a byte as second argument. The byte is passed as an C<int>, and
114 values in the range of -128 to 255 (both inclusive) are accepted. This way you
115 can pass either C<signed char> or C<unsigned char> values, yxml will work fine
116 with both. To parse a complete document, C<yxml_parse()> needs to be called
117 for each byte of the document in sequence, as done in the above example.
118
119 For each byte, C<yxml_parse()> will return either I<YXML_OK> (0), a token (>0)
120 or an error (<0). I<YXML_OK> is returned if the given byte has been
121 parsed/consumed correctly but that otherwise nothing worthy of note has
122 happened. The application should then continue processing and pass the next
123 byte of the document.
124
125 =head3 Public State Variables
126
127 After each call to C<yxml_parse()>, a number of interesting fields in the
128 C<yxml_t> struct are updated. The fields documented here are part of the API,
129 and are considered as extra return values of C<yxml_parse()>. All of these
130 fields should be considered read-only.
131
132 =over
133
134 =item C<char *elem;>
135
136 Name of the currently opened XML element. Points into the buffer given to
137 C<yxml_init()>. Described in L</Elements>.
138
139 =item C<char *attr;>
140
141 Name of the currently opened attribute. Points into the buffer given to
142 C<yxml_init()>. Described in L</Attributes>.
143
144 =item C<char *pi;>
145
146 Target of the currently opened PI. Points into the buffer given to
147 C<yxml_init()>. Described in L</Processing Instructions>.
148
149 =item C<char data[8];>
150
151 Character data of element contents, attribute values or PI contents. Described
152 in L</Character Data>.
153
154 =item C<uint32_t line;>
155
156 Number of the line in the XML document that is currently being parsed.
157
158 =item C<uint64_t byte;>
159
160 Byte offset into the current line the XML document.
161
162 =item C<uint64_t total;>
163
164 Byte offset into the XML document.
165
166 =back
167
168 The values of the I<elem>, I<attr>, I<pi> and I<data> elements depend on the
169 parsing context, and only remain valid within that context. The exact contexts
170 in which these fields contain valid information is described in their
171 respective sections below.
172
173 The I<line>, I<byte> and I<total> fields are mainly useful for error reporting.
174 When C<yxml_parse()> reports an error, these fields can be used to generate a
175 useful error message. For example:
176
177 printf("Parsing error at %s:%"PRIu32":%"PRIu64" byte offset %"PRIu64",
178 filename, x->line, x->byte, x->total);
179
180 =head3 Error Handling
181
182 Errors are not recoverable. No further calls to C<yxml_parse()> or
183 C<yxml_eof()> should be performed on the same C<yxml_t> struct. Re-initializing
184 the same struct using C<yxml_init()> to start parsing a new document is
185 possible, however. The following error values may be returned by
186 C<yxml_parse()>:
187
188 =over
189
190 =item YXML_EREF
191
192 Invalid character or entity reference. E.g. C<&whatever;> or C<&#ABC;>.
193
194 =item YXML_ECLOSE
195
196 Close tag does not match open tag. E.g. C<< <Tag> .. </SomeOtherTag> >>.
197
198 =item YXML_ESTACK
199
200 Stack overflow. This happens when the buffer given to C<yxml_init()> was not
201 large enough to parse this document. E.g. when elements are too deeply nested
202 or an element name, attribute name or PI target is too long.
203
204 =item YXML_ESYN
205
206 Miscellaneous syntax error.
207
208 =back
209
210
211 =head2 Handling Tokens
212
213 The C<yxml_parse()> function will return tokens as they are found. When loading
214 an XML document, it is important to know which tokens are returned in which
215 situation and how to handle them.
216
217 The following graph shows the (simplified) state machine of the parser to
218 illustrate the order in which tokens are returned. The labels on the edge
219 indicate the tokens that are returned by C<yxml_parse()>, with their C<YXML_>
220 prefix removed. The special return value C<YXML_OK> and error returns are not
221 displayed.
222
223 [html]<img src="/img/yxml-apistates.png" />É
224
225 Tokens that the application is not interested in can be ignored safely. For
226 example, if you are not interested in handling processing instructions, then
227 the C<YXML_PISTART>, C<YXML_PICONTENT> and C<YXML_PIEND> tokens can be handled
228 exactly as if they were an alias for C<YXML_OK>.
229
230 =head3 Elements
231
232 The C<YXML_ELEMSTART> and C<YXML_ELEMEND> tokens are returned when an XML
233 element is opened and closed, respectively. When C<YXML_ELEMSTART> is returned,
234 the I<elem> struct field will hold the name of the element. This field will be
235 valid (i.e. keeps pointing to the name of the opened element) until the end of
236 the attribute list. That is, until any token other than those described in
237 L</Attributes> is returned. Although the I<elem> pointer itself may be reused
238 and modified while parsing the contents of the element, the buffer that I<elem>
239 points to will remain valid up to and including the corresponding
240 C<YXML_ELEMEND>.
241
242 Yxml will verify that elements properly nest and that the name of each closing
243 tag properly matches that of the corresponding opening tag. The application may
244 safely assume that each C<YXML_ELEMSTART> is properly matched with a
245 C<YXML_ELEMEND>, or that otherwise an error is returned. Furthermore, only a
246 single root element is allowed. When the root element is closed, no further
247 C<YXML_ELEMSTART> tokens will be returned.
248
249 No distinction is made between self-closing tags and elements with empty
250 content. For example, both C<< <a/> >> and C<< <a></a> >> will result in the
251 C<YXML_ELEMSTART> token (with C<elem="a">) followed by C<YXML_ELEMEND>.
252
253 Element contents are returned in the form of the C<YXML_CONTENT> token and the
254 I<data> field. This is described in more detail in L</Character Data>.
255
256 =head3 Attributes
257
258 Element attributes are passed using the C<YXML_ATTRSTART>, C<YXML_ATTRVAL> and
259 C<YXML_ATTREND> tokens. The name of the attribute is available in the I<attr>
260 field, which is available when C<YXML_ATTRSTART> is returned and valid up to
261 and including the next C<YXML_ATTREND>.
262
263 Yxml does not verify that attribute names are unique within a single element.
264 It is thus possible that the same attribute will appear twice, possibly with a
265 different value. The correct way to handle this situation is to stop parsing
266 the rest of the document and to report an error, but if the application is not
267 interested in all attributes, detecting duplicates in them may complicate the
268 code and possibly even introduce security vulnerabilities (e.g. algorithmic
269 complexity attacks in a hash table). As such, the best solution is to report an
270 error when you can easily detect a duplicate attribute, but ignore duplicates
271 that require more effort to be detected.
272
273 The attribute value is returned with the C<YXML_ATTRVAL> token and the I<data>
274 field. This is described in more detail in L</Character Data>.
275
276 =head3 Processing Instructions
277
278 Processing instructions are passed in similar fashion to attributes, and are
279 passed using C<YXML_PISTART>, C<YXML_PICONTENT> and C<YXML_PIEND>. The target
280 of the PI is available in the I<pi> field after C<YXML_PISTART> and remains
281 valid up to (but excluding) the next C<YXML_PIEND> token.
282
283 PI contents are returned as C<YXML_PICONTENT> tokens and using the I<data>
284 field, described in more detail in L</Character Data>.
285
286 =head3 Character Data
287
288 Element contents (C<YXML_CONTENT>), attribute values (C<YXML_ATTRVAL>) and PI
289 contents (C<YXML_PICONTENT>) are all passed to the application in small chunks
290 through the I<data> field. Each time that C<yxml_parse()> returns one of these
291 tokens, the I<data> field will contain one or more bytes of the element
292 contents, attribute value or PI content. The string is zero-terminated, and its
293 value is only valid until the next call to C<yxml_parse()>.
294
295 Typically only a single byte is returned after each call, but multiple bytes
296 can be returned in the following special cases:
297
298 =over
299
300 =item * Character references outside of the ASCII character range. When a
301 character reference is encountered in element contents or in an attribute
302 value, it is automatically replaced with the referenced character. For example,
303 the XML string C<&#47;> is replaced with the single character "/". If the
304 character value is above 127, its value is encoded in UTF-8 and then returned
305 as a multi-byte string in the I<data> field. For example, the character
306 reference C<&#xe7;> is returned as the C string "\xc3\xa9", which is the UTF-8
307 encoding for the character "é". Character references are not expanded in PI
308 contents.
309
310 =item * The special character "]" in CDATA sections. When the "]" character is
311 encountered inside a CDATA section, yxml can't immediately return it to the
312 application because it does not know whether the character is part of the CDATA
313 ending or whether it is still part of its contents. So it remembers the
314 character for the next call to C<yxml_parse()>, and if it then turns out that
315 the character was part of the CDATA contents, it returns both the "]" character
316 and the following byte in the same I<data> string. Similarly, if two "]"
317 characters appear in sequence as part of the CDATA content, then the two
318 characters are returned in a single I<data> string together with the byte that
319 follows. CDATA sections only appear in element contents, so this does not
320 happen in attribute values or PI contents.
321
322 =item * The special character "?" in PI contents. This is similar to the issue
323 with "]" characters in CDATA sections. Yxml remembers a "?" character while
324 parsing a PI, and then returns it together with the byte following it if it
325 turned out to be part of the PI contents.
326
327 =back
328
329 Note that C<yxml_parse()> operates on bytes rather than characters. If the
330 document is encoded in a multi-byte character encoding such as UTF-8, then each
331 Unicode character that occupies more than a single byte will be broken up and
332 its bytes processed individually. As a result, the bytes returned in the
333 I<data> field may not necessarily represent a single Unicode character. To
334 ensure that multi-byte characters are not broken up, the application can
335 concatenate multiple data tokens to a single buffer before attempting to do
336 further processing on the result.
337
338 To make processing easier, an application may want to combine all the tokens
339 into a single buffer. This can be easily implemented as follows:
340
341 SomeString attrval;
342 while(..) {
343 yxml_ret_t r = yxml_parse(x, ch);
344 switch(r) {
345 case YXML_ATTRSTART:
346 somestring_initialize(attrval);
347 break;
348 case YXML_ATTRVAL:
349 somestring_append(attrval, x->data);
350 break;
351 case YXML_ATTREND:
352 /* Now we have a full attribute. Its name is in x->attr, and its value is
353 * in the string 'attrval'. */
354 somestring_reset(attrval);
355 break;
356 }
357 }
358
359 The C<SomeString> type and C<somestring_> functions are stubs for any string
360 handling library of your choosing. When using Glib, for example, one could use
361 the L<GString|https://developer.gnome.org/glib/stable/glib-Strings.html>
362 type and the C<g_string_new()>, C<g_string_append()> and C<g_string_free()>
363 functions. For a more lighter-weight string library there is also
364 L<kstring.h in klib|https://github.com/attractivechaos/klib>, but the
365 functionality required in the above example can easily be implemented in a few
366 lines of pure C, too.
367
368 When buffering data into an ever-growing string, as done in the previous
369 example, one should be careful to protect against memory exhaustion. This can
370 be done trivially by limiting the size of the total XML document or the maximum
371 length of the buffer. If you want to extract information from an XML document
372 that might not fit into memory, but you know that the information you care
373 about is limited in size and is only stored in specific attributes or elements,
374 you can choose to ignore data you don't care about. For example, if you only
375 want to extract the "Size" attribute and you know that its value is never
376 larger than 63 bytes, you can limit your code to read only that value and store
377 it into a small pre-allocated buffer:
378
379 char sizebuf[64], *sizecur = NULL, *tmp;
380 while(..) {
381 yxml_ret_t r = yxml_parse(x, ch);
382 switch(r) {
383 case YXML_ATTRSTART:
384 if(strcmp(x->attr, "Size") == 0)
385 sizecur = sizebuf;
386 break;
387 case YXML_ATTRVAL:
388 if(!sizecur) /* Are we in the "Size" attribute? */
389 break;
390 /* Append x->data to sizecur while there is space */
391 tmp = x->data;
392 while(*tmp && sizecur < sizebuf+sizeof(sizebuf))
393 *(sizecur++) = *(tmp++);
394 if(sizecur == sizebuf+sizeof(sizebuf))
395 exit(1); /* Too long attribute value, handle error */
396 *sizecur = 0;
397 break;
398 case YXML_ATTREND:
399 if(sizecur) {
400 /* Now we have the value of the "Size" attribute in sizebuf */
401 sizecur = NULL;
402 }
403 break;
404 }
405 }
406
407
408 =head2 Finalization
409
410 yxml_t *x; /* An initialized state */
411 yxml_ret_t r = yxml_eof(x);
412 if(r < 0)
413 exit(1); /* Handle error */
414 else
415 /* No errors in the XML document */
416
417 Because C<yxml_parse()> does not know when the end of the XML document has been
418 reached, it is unable to detect certain errors in the document. This is why,
419 after successfully parsing a complete document with C<yxml_parse()>, the
420 application should call C<yxml_eof()> to perform some extra checks.
421
422 C<yxml_eof()> will return C<YXML_OK> if the parsed XML document is well-formed,
423 C<YXML_EEOF> otherwise. The following errors are not detected by
424 C<yxml_parse()> but will result in an error on C<yxml_eof()>:
425
426 =over
427
428 =item * The XML document did not contain a root element (e.g. an empty
429 file).
430
431 =item * The XML root element has not been closed (e.g. "C<< <a> .. >>").
432
433 =item * The XML document ended in the middle of a comment or PI (e.g.
434 "C<< <a/><!-- .. >>").
435
436 =back
437
438 =head2 Utility functions
439
440 size_t yxml_symlen(yxml_t *, const char *);
441
442 C<yxml_symlen()> returns the length of the element name (C<< x->elem >>),
443 attribute name (C<< x->attr >>), or PI name (C<< x->pi >>). When used
444 correctly, it gives the same result as C<strlen()>, except without having to
445 scan through the string. This function should B<ONLY> be used directly after
446 the C<YXML_ELEMSTART>, C<YXML_ATTRSTART> or C<YXML_PISTART> (respectively)
447 tokens have been returned by C<yxml_parse()>, calling this function at any
448 other time may not give the correct results. This function should B<NOT> be
449 used on strings other than C<< x->elem >>, C<< x->attr >> or C<< x->pi >>.
0 Contributors the the Stubby project include:
1
2 Willem Toorop <willem@NLnetLabs.nl>
3 Sara Dickinson <sara@sinodun.com>
4 Jim Hague <jim@sinodun.com>
5 Allison Mankin <amankin@verisign.com>
6 Melinda Shore <melinda.shore@nomountain.net>
7 John Dickinson <jad@sinodun.com>
8 Tom Pusateri <pusateri@bangj.com>
9
10 Also, many thanks to the NLnet Foundation for a grant to support this work.
0 cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
1
2 if (POLICY CMP0075)
3 cmake_policy(SET CMP0075 NEW)
4 endif ()
5
6 # The following must be set BEFORE doing project() or enable_language().
7 if (NOT CMAKE_BUILD_TYPE)
8 message(STATUS "No build type defined; defaulting to 'Debug'")
9 set(CMAKE_BUILD_TYPE "Debug" CACHE STRING
10 "The type of build. Possible values are: Debug, Release, RelWithDebInfo and MinSizeRel.")
11 endif ()
12
13 set(PACKAGE "stubby")
14 set(PACKAGE_NAME "Stubby")
15 set(PACKAGE_VERSION "0.3.0")
16 set(PACKAGE_BUGREPORT "team@getdnsapi.net")
17 set(RELEASE_CANDIDATE "")
18
19 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}${RELEASE_CANDIDATE}")
20 set(PACKAGE_TARNAME "${PACKAGE}-${PACKAGE_VERSION}${RELEASE_CANDIDATE}")
21
22 set(STUBBY_PACKAGE "${PACKAGE}")
23 set(STUBBY_PACKAGE_STRING "${PACKAGE_STRING}")
24
25 project (stubby VERSION ${PACKAGE_VERSION} LANGUAGES C)
26
27 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
28
29 include(CheckIncludeFile)
30 include(CheckSymbolExists)
31 include(GNUInstallDirs)
32 include(CMakeDependentOption)
33
34 # Options.
35 find_package(Libsystemd)
36 if (Libsystemd_FOUND)
37 option(ENABLE_SYSTEMD "Enable systemd support." ON)
38 endif()
39
40 # Directories
41 if (DEFINED CMAKE_INSTALL_FULL_RUNSTATEDIR)
42 set(RUNSTATEDIR "${CMAKE_INSTALL_FULL_RUNSTATEDIR}")
43 else ()
44 set(RUNSTATEDIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/run")
45 endif ()
46 install(DIRECTORY
47 DESTINATION ${RUNSTATEDIR}
48 DIRECTORY_PERMISSIONS
49 OWNER_READ OWNER_WRITE OWNER_EXECUTE
50 GROUP_READ GROUP_EXECUTE
51 WORLD_READ WORLD_EXECUTE
52 )
53 set(STUBBYCONFDIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/stubby")
54
55 find_package(Libyaml REQUIRED)
56
57 if (WIN32)
58 set(STUBBY_ON_WINDOWS 1)
59 endif ()
60
61 check_include_file(os/log.h HAVE_OS_LOG_H)
62 check_include_file(inttypes.h HAVE_INTTYPES_H)
63 check_include_file(sys/types.h HAVE_SYS_TYPES_H)
64
65 option(ENABLE_DEBUG_ALL "Enable all debugging messages.")
66 cmake_dependent_option(ENABLE_DEBUG_SERVER "Enable server debugging messages." OFF "NOT ENABLE_DEBUG_ALL" ON)
67 set(SERVER_DEBUG ${ENABLE_DEBUG_SERVER})
68
69
70 check_symbol_exists(getopt "unistd.h" HAVE_GETOPT)
71
72 # Does the compiler accept the "format" attribute?
73 try_compile(HAVE_ATTR_FORMAT
74 ${CMAKE_CURRENT_BINARY_DIR}
75 ${CMAKE_CURRENT_SOURCE_DIR}/cmake/tests/test_format_attr.c
76 )
77 # Does the compiler accept the "unused" attribute?
78 try_compile(HAVE_ATTR_UNUSED
79 ${CMAKE_CURRENT_BINARY_DIR}
80 ${CMAKE_CURRENT_SOURCE_DIR}/cmake/tests/test_unused_attr.c
81 )
82
83 configure_file(cmake/include/cmakeconfig.h.in config.h)
84 set(ETCDIR "${STUBBYCONFDIR}")
85 configure_file(doc/stubby.1.in stubby.1 @ONLY)
86
87 add_executable(stubby
88 src/stubby.c
89 src/yaml/convert_yaml_to_json.c
90 src/sldns/sbuffer.c
91 )
92 if (NOT HAVE_GETOPT)
93 target_sources(stubby PRIVATE src/compat/getopt.c)
94 target_include_directories(stubby PRIVATE src/compat)
95 endif ()
96
97 target_include_directories(stubby PRIVATE src ${CMAKE_CURRENT_BINARY_DIR})
98 target_link_libraries(stubby PRIVATE Libyaml::Libyaml)
99 if (ENABLE_SYSTEMD)
100 target_link_libraries(stubby PRIVATE Libsystemd::Libsystemd)
101 endif()
102 # Are we being built from getdns? If so, use the build tree getdns.
103 if (TARGET getdns)
104 target_link_libraries(stubby PRIVATE getdns)
105 else ()
106 find_package(Getdns "1.5.0" REQUIRED)
107 target_link_libraries(stubby PRIVATE Getdns::Getdns)
108 endif ()
109 set_property(TARGET stubby PROPERTY C_STANDARD 11)
110
111 install(TARGETS stubby DESTINATION bin)
112 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/stubby.1 DESTINATION share/man/man1)
113 install(FILES AUTHORS COPYING ChangeLog NEWS README.md DESTINATION share/doc/stubby)
114
115 # Ensure the file gets CRLF line endings on Windows.
116 file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/stubby.yml INPUT ${CMAKE_CURRENT_SOURCE_DIR}/stubby.yml.example)
117 # Copy to destination iff no destination file exists.
118 install(CODE "\
119 set(targetdir ${STUBBYCONFDIR})\n\
120 if (\$ENV{DESTDIR})\n\
121 set(targetdir \$ENV{DESTDIR}/\${targetdir})\n\
122 endif ()\n\
123 if (NOT EXISTS \${targetdir}/stubby.yml)\n\
124 file(COPY ${CMAKE_CURRENT_BINARY_DIR}/stubby.yml DESTINATION \${targetdir})\n\
125 endif ()")
126
127 if (APPLE)
128 find_library(security Security REQUIRED)
129 add_executable(stubby-ui-helper macos/stubby-ui-helper.c)
130 target_include_directories(stubby-ui-helper PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
131 target_link_libraries(stubby-ui-helper ${security})
132
133 install(FILES macos/stubby-setdns-macos.sh DESTINATION sbin)
134 endif ()
0 * 2020-02-28: Version 0.3.0
1 * Correct the applied-privacy.net details and remove ibksturm server in stubby.yml.example.
2 * Include AppArmor profile (thanks CameronNemo)
3 * Add `contrib` contributors to the README
4 * Let scheduled task run idefinately on Windows (thanks triatic)
5 * Add `Restart=on-failure` to the systemd.service file (thanks appliedprivacy)
6
7 * 2019-12-20: Version 0.3.0-beta.1
8 * Migration of build system to cmake.
9
10 * 2019-04-03: Version 0.2.6
11 * Windows: use appropriate system and user configuration directories.
12 * Windows: replace references to C:\Program Files with %PROGRAMFILES%.
13 * Windows: use location of stubby.bat to find stubby.exe and stubby.yml.
14
15 * 2019-01-11: Version 0.2.5
16 * Fix builds on Windows.
17 * RFE getdnsapi/getdns#408: Document trust_anchors_backoff_time
18 in stubby.yml.example. Thanks Jonathan Underwood
19 * RFE #148: Document tls_ciphersuites, tls_cipher_list, tls_min_version
20 and tls_max_version in stubby.yml.example. Thanks Jonathan Underwood
21 * RFE #149: Added Google Public DNS to stubby.yml.example.
22 Thanks Bruno Pagani
23
24 * 2018-12-21: Version 0.2.4
25 * DNSSEC required with dnssec extension in example config
26 * Removed the yeti servers from stubby.yml.example
27 * Added the Foundation RESTENA servers in stubby.yml.example
28 * Bugfix: only start Stubby when network is up
29 Thanks Bruno Pagani
30
31 * 2018-05-11: Version 0.2.3
32 * Bugfix #62 and #106: With systemd setups, make /run/stubby directory
33 writeable for stubby user and include a "appdata_dir" directory
34 in stubby.yml.example.
35 Thanks Paul Wouters, eccgecko and Han Vinke
36 * Update securedns.eu entries in stubby.yml.example
37 * Added Cloudflare servers in stubby.yml.example
38 * Added basic upstart script in contrib/upstart dir. Thanks vapniks
39 * Bugfix #98: EDNS options that are handled internally should not
40 be passed on through downstream. Thanks Twisteroid Ambassador
41
42 * 2018-02-21: Version 0.2.2
43 * Fixes and updates to the stubby.yml.config file. Add separate entries for
44 servers that listen on port 443.
45 * Additional logging of basic config on startup
46 * -V option to show version
47 * Added a man page
48
49 * 2017-12-18: Version 0.2.1
50 * Fix use of logging on macos 10.11
51
52 * 2017-12-18: Version 0.2.0
53 * Add Powershell scripts for Windows 7 that will update the IPv4 DNS resolvers.
54 * Add Windows scripts to enable a Scheduled task for stubby
55 * Add files to support a separate macOS GUI application to manage stubby
56 https://dnsprivacy.org/wiki/x/CIBn
57 * Add Quad9 details to the configuration file
58 * Bugfix #48: Do not do native DNSSEC validation when cd bit was
59 received (for example from an unbound forwarder), but DNSSEC
60 validation was not enabled in the first place.
61 * Bugfix getdnsapi/getdns#358: Parse config files given with the
62 -C option that have an .yaml extension as YAML not JSON.
63 Thanks Ollivier Robert
64
65 * 2017-11-03: Version 0.1.5
66 * Add Windows installer package. Installer available at dnsprivacy.org
67 * Fix to systemd file names (thanks ArchangeGabriel)
68 * Add SPKI for Uncensored DNS (thanks woopstar)
69 * Fix installation of stubby.yml file (thanks ArchangeGabriel)
70 * Fix detection of platform for standalone build
71 * Fix location of pid file installation
72 * Update the stubby.yml file to contain details of all available servers. Only
73 a small subset are enabled by default.
74
75 * 2017-10-20: Version 0.1.4
76 * '-i' option of stubby no longer tries to bind to the listen addresses so
77 it can be run without requiring root privileges. Makes it easier to validate
78 the configuration file syntax.
79 * Fix incorrect IP addresses for some servers in the config file. Add note that
80 IPv6 addresses ending in :: are not supported (must use ::0). Also add
81 example of using a specific port in a listen address.
82 * Fixes for Windows support
83
84
85 * 2017-09-29: Version 0.1.3
86 * Change the default configuration file format to be YAML. A default file
87 'stubby.yml' will be installed. The JSON dict format is still supported when
88 specifying a custom configuration file on the command line.
89 * Add a -v flag to let users specify the logging level they want to see
90
91 * 2017-08-24: Version 0.1.2
92 * revert logging to stderr until we have good separation of logging and error
93 within the code
94
95 * 2017-08-23: Version 0.1.1
96 * systemd folder has moved here from the getdns repo
97 * logging can now be controlled at runtime using the '-l' flag
98 * minor fixes from a static analysis
99
100 * 2017-07-12: Version 0.1.0
101 * Initial release of stubby after break-out from getdns repository
(New empty file)
0 autoreconf -vfi
1 ./configure CFLAGS="-g -I$HOME/local2/include" LDFLAGS="-L$HOME/local2/lib" --prefix="$HOME/local2"
2 make
1818
1919 # Dependencies
2020
21 Stubby uses [getdns](https://getdnsapi.net/) and requires the 1.2 release of getdns or later.
21 Stubby uses [getdns](https://getdnsapi.net/) and requires the 1.5.0 release of getdns or later.
2222
2323 It also requires [yaml](http://pyyaml.org/wiki/LibYAML).
2424
4242 git clone https://github.com/getdnsapi/stubby.git
4343 ```
4444
45 Build and install (the paths below assume that getdns and libyaml are installed in a standard location e.g. by Homebrew in /usr/local/)
45 Build and install (NOTE: from release 0.3.0 stubby uses cmake)
4646 ```
4747 cd stubby
48 autoreconf -vfi
49 ./configure CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"
48 cmake .
5049 make
51 sudo make install
5250 ````
5351
5452 # Configure Stubby
194192
195193 Powershell scripts are provided in the the windows directory of the source code that can be used to update the system resolvers.
196194 Instructions for how to update the resolvers manually are provided are also provided - see https://dnsprivacy.org/wiki/display/DP/Windows+installer+for+Stubby
197
195 Stubby has been reported to work on Windows 7, but we don't officially support it.
198196
199197 ## Notes:
200198
201199 * If Stubby works for a while but you then see failures from Stubby such as "None of the configured upstreams could be used to send queries on the specified transports" try restarting Stubby.
202200 * If you are using a DNS Privacy server that does not support concurrent processing of TLS queries, you may experience some issues due to timeouts causing subsequent queries on the same connection to fail.
203201
204 # Building getdns from Source
202 # Building getdns from source
205203
206204 Note that from getdns 1.1.3 stubby is included in the getdns code as a git submodule. Therefore stubby and getdns can be built together by following the
207 instructions below but adding the ``--with-stubby`` flag to the `configure` step.
208
209 ## Dependencies
210
211 The most limited install of getdns that will work with Stubby requires only OpenSSL as a dependency (version 1.0.2 or later is required for hostname authentication to be supported). If OpenSSL is installed in a non-standard location on your system use the `--with-ssl` option to `configure` below to specify where it is installed.
212
213 ### Linux
214
215 It may be necessary to install [1.0.2 from source](https://openssl.org/source/openssl-1.0.2h.tar.gz) for most Linux distros.
216
217 ### OS X
218
219 It is recommended to [install OpenSSL using homebrew](http://brewformulas.org/Openssl), in which case use the following in the `configure` line in the build step below:
220
221 ```sh
222 --with-ssl=/usr/local/opt/openssl/
223 ```
224
225 ## Download the getdns source
226
227 Either clone the code:
228
229 ```sh
230 > git clone https://github.com/getdnsapi/getdns.git
231 > cd getdns
232 > git checkout master
233 ```
234 for the very latest version of getdns or grab a release tarball from this page: [Latest getdns releases](https://getdnsapi.net/releases/)
235
236 ## Build the code
237
238 Note that on Mac OS X you will need the developer tools from Xcode to compile the code. And you may need to use brew to install libtool, autoconf, and automake.
239
240 ```sh
241 > git submodule update --init
242 > libtoolize -ci
243 > autoreconf -fi
244 > mkdir build
245 > cd build
246 > ../configure --prefix=<install_location> --without-libidn --without-libidn2
247 > make
248 > sudo make install
249 ```
250
251 Use the ```--enable-stub-only``` flag with configure IF you want remove the dependency on libunbound for getdns for some reason (Stubby works fine when getdns is built like this but beware this limits the functions of the getdns library as a generic system component and should be used with care).
252
253 Logging/debugging
205 instructions in the getdns [README](https://github.com/getdnsapi/getdns/blob/develop/README.md) and setting the ``BUILD_STUBBY`` option.
206
207 ## Logging/debugging when building from source
254208
255209 > **`--enable-debug-stub`** If you do want to see _very_ detailed debug information as messages are processed then add the `--enable-debug-stub` option to the `configure` line above (not recommended for use with Stubby)
210
211
212 # Contributions
213
214 The contrib directory contains code kindly contributed by various people:
215
216 vapniks
217 Tom Matthews
218 CameronNemo
0 #ifndef CONFIG_H
1 #define CONFIG_H
2
3 #cmakedefine STUBBY_PACKAGE "@STUBBY_PACKAGE@"
4 #cmakedefine STUBBY_PACKAGE_STRING "@STUBBY_PACKAGE_STRING@"
5
6 #cmakedefine STUBBY_ON_WINDOWS 1
7
8 #cmakedefine HAVE_ATTR_FORMAT 1
9 #cmakedefine HAVE_ATTR_UNUSED 1
10
11 #cmakedefine HAVE_GETOPT 1
12
13 #cmakedefine HAVE_INTTYPES_H 1
14 #ifdef HAVE_INTTYPES_H
15 # include <inttypes.h>
16 #endif
17
18 #cmakedefine HAVE_SYS_TYPES_H 1
19 #ifdef HAVE_SYS_TYPES_H
20 # include <sys/types.h>
21 #endif
22
23 #cmakedefine SERVER_DEBUG 1
24
25 #cmakedefine ENABLE_SYSTEMD 1
26
27 #cmakedefine STUBBYCONFDIR "@STUBBYCONFDIR@"
28 #cmakedefine RUNSTATEDIR "@RUNSTATEDIR@"
29
30 #ifdef STUBBY_ON_WINDOWS
31 # ifndef _CUSTOM_VSNPRINTF
32 # define _CUSTOM_VSNPRINTF
33 // Ensure we have definition of va_list, and that vsnprint is defined
34 // before we redefine it.
35 # include <stdarg.h>
36 # include <stdio.h>
37 static inline int _gldns_custom_vsnprintf(
38 char *str, size_t size, const char *format, va_list ap)
39 { int r = vsnprintf(str, size, format, ap)
40 ; return r == -1 ? _vscprintf(format, ap) : r; }
41 # define vsnprintf _gldns_custom_vsnprintf
42 # endif
43
44 # ifdef _MSC_VER
45 # if _MSC_VER >= 1800
46 # define PRIsz "zu"
47 # else
48 # define PRIsz "Iu"
49 # endif
50 # include <BaseTsd.h>
51 typedef SSIZE_T ssize_t;
52 # else
53 # define PRIsz "Iu"
54 # endif
55 #else
56 # define PRIsz "zu"
57 #endif
58
59 #ifdef HAVE_ATTR_FORMAT
60 # define ATTR_FORMAT(archetype, string_index, first_to_check) \
61 __attribute__ ((format (archetype, string_index, first_to_check)))
62 #else /* !HAVE_ATTR_FORMAT */
63 # define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
64 #endif /* !HAVE_ATTR_FORMAT */
65
66 #if defined(__cplusplus)
67 # define ATTR_UNUSED(x)
68 #elif defined(HAVE_ATTR_UNUSED)
69 # define ATTR_UNUSED(x) x __attribute__((unused))
70 #else /* !HAVE_ATTR_UNUSED */
71 # define ATTR_UNUSED(x) x
72 #endif /* !HAVE_ATTR_UNUSED */
73
74 #define USE_YAML_CONFIG 1
75
76 #define yaml_string_to_json_string stubby_yaml_string_to_json_string
77
78 #define sldns_read_uint16 stubby_ldns_read_uint16
79 #define sldns_read_uint32 stubby_ldns_read_uint32
80 #define sldns_write_uint16 stubby_ldns_write_uint16
81 #define sldns_write_uint32 stubby_ldns_write_uint32
82 #define sldns_write_uint48 stubby_ldns_write_uint48
83 #define sldns_buffer stubby_ldns_buffer
84 #define sldns_buffer_invariant stubby_ldns_buffer_invariant
85 #define sldns_buffer_invariant stubby_ldns_buffer_invariant
86 #define sldns_buffer_new stubby_ldns_buffer_new
87 #define sldns_buffer_new_frm_data stubby_ldns_new_frm_data
88 #define sldns_buffer_init_frm_data stubby_ldns_buffer_init_frm_data
89 #define sldns_buffer_init_vfixed_frm_data stubby_ldns_buffer_init_vfixed_frm_data
90 #define sldns_buffer_clear stubby_ldns_buffer_clear
91 #define sldns_buffer_flip stubby_ldns_buffer_flip
92 #define sldns_buffer_rewind stubby_ldns_buffer_rewind
93 #define sldns_buffer_position stubby_ldns_buffer_position
94 #define sldns_buffer_set_position stubby_ldns_buffer_set_position
95 #define sldns_buffer_skip stubby_ldns_buffer_skip
96 #define sldns_buffer_limit stubby_ldns_buffer_limit
97 #define sldns_buffer_set_limit stubby_ldns_buffer_set_limit
98 #define sldns_buffer_capacity stubby_ldns_buffer_capacity
99 #define sldns_buffer_set_capacity stubby_ldns_buffer_set_capacity
100 #define sldns_buffer_reserve stubby_ldns_buffer_reserve
101 #define sldns_buffer_at stubby_ldns_buffer_at
102 #define sldns_buffer_begin stubby_ldns_buffer_begin
103 #define sldns_buffer_end stubby_ldns_buffer_end
104 #define sldns_buffer_current stubby_ldns_buffer_current
105 #define sldns_buffer_remaining_at stubby_ldns_buffer_remaining_at
106 #define sldns_buffer_remaining stubby_ldns_buffer_remaining
107 #define sldns_buffer_available_at stubby_ldns_buffer_available_at
108 #define sldns_buffer_available stubby_ldns_buffer_available
109 #define sldns_buffer_write_at stubby_ldns_buffer_write_at
110 #define sldns_buffer_set_at stubby_ldns_buffer_set_at
111 #define sldns_buffer_write stubby_ldns_buffer_write
112 #define sldns_buffer_write_string_at stubby_ldns_buffer_write_string_at
113 #define sldns_buffer_write_string stubby_ldns_buffer_write_string
114 #define sldns_buffer_write_u8_at stubby_ldns_buffer_write_u8_at
115 #define sldns_buffer_write_u8 stubby_ldns_buffer_write_u8
116 #define sldns_buffer_write_u16_at stubby_ldns_buffer_write_u16_at
117 #define sldns_buffer_write_u16 stubby_ldns_buffer_write_u16
118 #define sldns_buffer_write_u32_at stubby_ldns_buffer_write_u32_at
119 #define sldns_buffer_write_u48_at stubby_ldns_buffer_write_u48_at
120 #define sldns_buffer_write_u32 stubby_ldns_buffer_write_u32
121 #define sldns_buffer_write_u48 stubby_ldns_buffer_write_u48
122 #define sldns_buffer_read_at stubby_ldns_buffer_read_at
123 #define sldns_buffer_read stubby_ldns_buffer_read
124 #define sldns_buffer_read_u8_at stubby_ldns_buffer_read_u8_at
125 #define sldns_buffer_read_u8 stubby_ldns_buffer_read_u8
126 #define sldns_buffer_read_u16_at stubby_ldns_buffer_read_u16_at
127 #define sldns_buffer_read_u16 stubby_ldns_buffer_read_u16
128 #define sldns_buffer_read_u32_at stubby_ldns_buffer_read_u32_at
129 #define sldns_buffer_read_u32 stubby_ldns_buffer_read_u32
130 #define sldns_buffer_status stubby_ldns_buffer_status
131 #define sldns_buffer_status_ok stubby_ldns_buffer_status_ok
132 #define sldns_buffer_printf stubby_ldns_buffer_printf
133 #define sldns_buffer_free stubby_ldns_buffer_free
134 #define sldns_buffer_export stubby_ldns_buffer_export
135 #define sldns_buffer_copy stubby_ldns_buffer_copy
136
137 #define gldns_read_uint16 stubby_ldns_read_uint16
138 #define gldns_read_uint32 stubby_ldns_read_uint32
139 #define gldns_write_uint16 stubby_ldns_write_uint16
140 #define gldns_write_uint32 stubby_ldns_write_uint32
141 #define gldns_write_uint48 stubby_ldns_write_uint48
142 #define gldns_buffer stubby_ldns_buffer
143 #define gldns_buffer_invariant stubby_ldns_buffer_invariant
144 #define gldns_buffer_invariant stubby_ldns_buffer_invariant
145 #define gldns_buffer_new stubby_ldns_buffer_new
146 #define gldns_buffer_new_frm_data stubby_ldns_new_frm_data
147 #define gldns_buffer_init_frm_data stubby_ldns_buffer_init_frm_data
148 #define gldns_buffer_init_vfixed_frm_data stubby_ldns_buffer_init_vfixed_frm_data
149 #define gldns_buffer_clear stubby_ldns_buffer_clear
150 #define gldns_buffer_flip stubby_ldns_buffer_flip
151 #define gldns_buffer_rewind stubby_ldns_buffer_rewind
152 #define gldns_buffer_position stubby_ldns_buffer_position
153 #define gldns_buffer_set_position stubby_ldns_buffer_set_position
154 #define gldns_buffer_skip stubby_ldns_buffer_skip
155 #define gldns_buffer_limit stubby_ldns_buffer_limit
156 #define gldns_buffer_set_limit stubby_ldns_buffer_set_limit
157 #define gldns_buffer_capacity stubby_ldns_buffer_capacity
158 #define gldns_buffer_set_capacity stubby_ldns_buffer_set_capacity
159 #define gldns_buffer_reserve stubby_ldns_buffer_reserve
160 #define gldns_buffer_at stubby_ldns_buffer_at
161 #define gldns_buffer_begin stubby_ldns_buffer_begin
162 #define gldns_buffer_end stubby_ldns_buffer_end
163 #define gldns_buffer_current stubby_ldns_buffer_current
164 #define gldns_buffer_remaining_at stubby_ldns_buffer_remaining_at
165 #define gldns_buffer_remaining stubby_ldns_buffer_remaining
166 #define gldns_buffer_available_at stubby_ldns_buffer_available_at
167 #define gldns_buffer_available stubby_ldns_buffer_available
168 #define gldns_buffer_write_at stubby_ldns_buffer_write_at
169 #define gldns_buffer_set_at stubby_ldns_buffer_set_at
170 #define gldns_buffer_write stubby_ldns_buffer_write
171 #define gldns_buffer_write_string_at stubby_ldns_buffer_write_string_at
172 #define gldns_buffer_write_string stubby_ldns_buffer_write_string
173 #define gldns_buffer_write_u8_at stubby_ldns_buffer_write_u8_at
174 #define gldns_buffer_write_u8 stubby_ldns_buffer_write_u8
175 #define gldns_buffer_write_u16_at stubby_ldns_buffer_write_u16_at
176 #define gldns_buffer_write_u16 stubby_ldns_buffer_write_u16
177 #define gldns_buffer_write_u32_at stubby_ldns_buffer_write_u32_at
178 #define gldns_buffer_write_u48_at stubby_ldns_buffer_write_u48_at
179 #define gldns_buffer_write_u32 stubby_ldns_buffer_write_u32
180 #define gldns_buffer_write_u48 stubby_ldns_buffer_write_u48
181 #define gldns_buffer_read_at stubby_ldns_buffer_read_at
182 #define gldns_buffer_read stubby_ldns_buffer_read
183 #define gldns_buffer_read_u8_at stubby_ldns_buffer_read_u8_at
184 #define gldns_buffer_read_u8 stubby_ldns_buffer_read_u8
185 #define gldns_buffer_read_u16_at stubby_ldns_buffer_read_u16_at
186 #define gldns_buffer_read_u16 stubby_ldns_buffer_read_u16
187 #define gldns_buffer_read_u32_at stubby_ldns_buffer_read_u32_at
188 #define gldns_buffer_read_u32 stubby_ldns_buffer_read_u32
189 #define gldns_buffer_status stubby_ldns_buffer_status
190 #define gldns_buffer_status_ok stubby_ldns_buffer_status_ok
191 #define gldns_buffer_printf stubby_ldns_buffer_printf
192 #define gldns_buffer_free stubby_ldns_buffer_free
193 #define gldns_buffer_export stubby_ldns_buffer_export
194 #define gldns_buffer_copy stubby_ldns_buffer_copy
195
196 #endif /* CONFIG_H */
0 #[=======================================================================[.rst:
1 FindGetdns
2 ----------
3
4 Find the Getdns library
5
6 Imported targets
7 ^^^^^^^^^^^^^^^^
8
9 This module defines the following :prop_tgt:`IMPORTED` targets:
10
11 ``Getdns::Getdns``
12 The Getdns library, if found.
13
14 Result variables
15 ^^^^^^^^^^^^^^^^
16
17 This module will set the following variables in your project:
18
19 ``Getdns_FOUND``
20 If false, do not try to use Getdns.
21 ``GETDNS_INCLUDE_DIR``
22 where to find getdns/getdns.h, etc.
23 ``GETDNS_LIBRARIES``
24 the libraries needed to use Getdns.
25 ``GETDNS_VERSION``
26 the version of the Getdns library found
27
28 #]=======================================================================]
29
30 find_path(GETDNS_INCLUDE_DIR getdns/getdns.h
31 HINTS
32 "${GETDNS_DIR}"
33 "${GETDNS_DIR}/include"
34 )
35
36 find_library(GETDNS_LIBRARY NAMES getdns libgetdns
37 HINTS
38 "${GETDNS_DIR}"
39 "${GETDNS_DIR}/lib"
40 )
41
42 set(GETDNS_LIBRARIES "")
43
44 if (GETDNS_INCLUDE_DIR AND GETDNS_LIBRARY)
45 if (NOT TARGET Getdns::Getdns)
46 add_library(Getdns::Getdns UNKNOWN IMPORTED)
47 set_target_properties(Getdns::Getdns PROPERTIES
48 INTERFACE_INCLUDE_DIRECTORIES "${GETDNS_INCLUDE_DIR}"
49 INTERFACE_LINK_LIBRARIES "${GETDNS_LIBRARIES}"
50 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
51 IMPORTED_LOCATION "${GETDNS_LIBRARY}"
52 )
53 endif ()
54
55 if (NOT GETDNS_VERSION AND GETDNS_INCLUDE_DIR AND EXISTS "${GETDNS_INCLUDE_DIR}/getdns/getdns.h")
56 file(STRINGS "${GETDNS_INCLUDE_DIR}/getdns/getdns_extra.h" GETDNS_H REGEX "^#define GETDNS_VERSION")
57 string(REGEX REPLACE "^.*GETDNS_VERSION \"([0-9.]+)[A-Za-z0-9.+-]*\".*$" "\\1" GETDNS_VERSION "${GETDNS_H}")
58 endif ()
59 endif()
60
61 list(APPEND GETDNS_LIBRARIES "${GETDNS_LIBRARY}")
62
63 include(FindPackageHandleStandardArgs)
64 find_package_handle_standard_args(Getdns
65 REQUIRED_VARS GETDNS_LIBRARIES GETDNS_INCLUDE_DIR
66 VERSION_VAR GETDNS_VERSION
67 )
68
69 mark_as_advanced(GETDNS_INCLUDE_DIR GETDNS_LIBRARIES GETDNS_LIBRARY)
0 #[=======================================================================[.rst:
1 FindLibsystemd
2 ----------
3
4 Find the Libsystemd library
5
6 Imported targets
7 ^^^^^^^^^^^^^^^^
8
9 This module defines the following :prop_tgt:`IMPORTED` targets:
10
11 ``Libsystemd::Libsystemd``
12 The Libsystemd library, if found.
13
14 Result variables
15 ^^^^^^^^^^^^^^^^
16
17 This module will set the following variables in your project:
18
19 ``Libsystemd_FOUND``
20 If false, do not try to use Libsystemd.
21 ``LIBSYSTEMD_INCLUDE_DIR``
22 where to find systemd/sd-daemon.h, etc.
23 ``LIBSYSTEMD_LIBRARIES``
24 the libraries needed to use Libsystemd.
25
26 #]=======================================================================]
27
28 find_path(LIBSYSTEMD_INCLUDE_DIR systemd/sd-daemon.h
29 HINTS
30 "${LIBSYSTEMD_DIR}"
31 "${LIBSYSTEMD_DIR}/include"
32 )
33
34 find_library(LIBSYSTEMD_LIBRARY NAMES systemd libsystemd
35 HINTS
36 "${LIBSYSTEMD_DIR}"
37 "${LIBSYSTEMD_DIR}/lib"
38 )
39
40 set(LIBSYSTEMD_LIBRARIES "")
41
42 if (LIBSYSTEMD_INCLUDE_DIR AND LIBSYSTEMD_LIBRARY)
43 if (NOT TARGET Libsystemd::Libsystemd)
44 add_library(Libsystemd::Libsystemd UNKNOWN IMPORTED)
45 set_target_properties(Libsystemd::Libsystemd PROPERTIES
46 INTERFACE_INCLUDE_DIRECTORIES "${LIBSYSTEMD_INCLUDE_DIR}"
47 INTERFACE_LINK_LIBRARIES "${LIBSYSTEMD_LIBRARIES}"
48 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
49 IMPORTED_LOCATION "${LIBSYSTEMD_LIBRARY}"
50 )
51 endif ()
52 endif ()
53
54 list(APPEND LIBSYSTEMD_LIBRARIES "${LIBSYSTEMD_LIBRARY}")
55
56 include(FindPackageHandleStandardArgs)
57 find_package_handle_standard_args(Libsystemd
58 REQUIRED_VARS LIBSYSTEMD_LIBRARIES LIBSYSTEMD_INCLUDE_DIR
59 )
60
61 mark_as_advanced(LIBSYSTEMD_INCLUDE_DIR LIBSYSTEMD_LIBRARIES LIBSYSTEMD_LIBRARY)
0 #[=======================================================================[.rst:
1 FindLibyaml
2 ----------
3
4 Find the Libyaml library
5
6 Imported targets
7 ^^^^^^^^^^^^^^^^
8
9 This module defines the following :prop_tgt:`IMPORTED` targets:
10
11 ``Libyaml::Libyaml``
12 The Libyaml library, if found.
13
14 Result variables
15 ^^^^^^^^^^^^^^^^
16
17 This module will set the following variables in your project:
18
19 ``Libyaml_FOUND``
20 If false, do not try to use Libyaml.
21 ``LIBYAML_INCLUDE_DIR``
22 where to find getdns/getdns.h, etc.
23 ``LIBYAML_LIBRARIES``
24 the libraries needed to use Libyaml.
25
26 #]=======================================================================]
27
28 find_path(LIBYAML_INCLUDE_DIR yaml.h
29 HINTS
30 "${LIBYAML_DIR}"
31 "${LIBYAML_DIR}/include"
32 )
33
34 find_library(LIBYAML_LIBRARY NAMES yaml libyaml
35 HINTS
36 "${LIBYAML_DIR}"
37 "${LIBYAML_DIR}/lib"
38 )
39
40 set(LIBYAML_LIBRARIES "")
41
42 if (LIBYAML_INCLUDE_DIR AND LIBYAML_LIBRARY)
43 if (NOT TARGET Libyaml::Libyaml)
44 add_library(Libyaml::Libyaml UNKNOWN IMPORTED)
45 set_target_properties(Libyaml::Libyaml PROPERTIES
46 INTERFACE_INCLUDE_DIRECTORIES "${LIBYAML_INCLUDE_DIR}"
47 INTERFACE_LINK_LIBRARIES "${LIBYAML_LIBRARIES}"
48 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
49 IMPORTED_LOCATION "${LIBYAML_LIBRARY}"
50 )
51 endif ()
52 endif ()
53
54 list(APPEND LIBYAML_LIBRARIES "${LIBYAML_LIBRARY}")
55
56 include(FindPackageHandleStandardArgs)
57 find_package_handle_standard_args(Libyaml
58 REQUIRED_VARS LIBYAML_LIBRARIES LIBYAML_INCLUDE_DIR
59 )
60
61 mark_as_advanced(LIBYAML_INCLUDE_DIR LIBYAML_LIBRARIES LIBYAML_LIBRARY)
0 #include <stdio.h>
1
2 void f(char *format, ...) __attribute__ ((format (printf, 1, 2)));
3
4 void f(char *format, ...)
5 {
6 }
7
8 int main (int ac, char *av[])
9 {
10 f("%s", "str");
11 return 0;
12 }
0 #include <stdio.h>
1
2 void f (char *u __attribute__((unused)));
3
4 void f(char *u)
5 {
6 }
7
8 int main (int ac, char *av[])
9 {
10 f("str");
11 return 0;
12 }
0 #include <tunables/global>
1
2 profile net.getdnsapi.stubby /usr/bin/stubby {
3 #include <abstractions/base>
4 #include <abstractions/nameservice>
5 capability net_bind_service,
6 # config
7 /etc/stubby/stubby.yml r,
8 owner @{HOME}/.stubby.yml r,
9 # static DNSSEC anchors
10 /etc/unbound/getdns-root.key r,
11 # auto-downloaded DNSSEC anchors
12 /var/cache/stubby/{,**} rw,
13 owner @{HOME}/.getdns/{,**} rw,
14 }
0 #!/bin/sh
1
2 ### BEGIN INIT INFO
3 # Provides: stubby
4 # Required-Start: $remote_fs
5 # Required-Stop: $remote_fs
6 # Default-Start: 2 3 4 5
7 # Default-Stop:
8 # Short-Description: Start DNS Privacy stub resolver
9 ### END INIT INFO
10
11 PATH=/sbin:/bin:/usr/sbin:/usr/bin
12
13 . /lib/lsb/init-functions
14
15 DAEMON=/usr/bin/stubby
16 OPTS='-g'
17
18 test -x $DAEMON || exit 0
19
20 if [ -r /etc/default/stubby ]; then
21 . /etc/default/stubby
22 fi
23
24 RUNASUSER=root
25 UGID=$(getent passwd $RUNASUSER | cut -f 3,4 -d:) || true
26
27 case $1 in
28 start)
29 log_daemon_msg "Starting DNS Privacy stub resolver" "stubby"
30 if [ -z "$UGID" ]; then
31 log_failure_msg "user \"$RUNASUSER\" does not exist"
32 exit 1
33 fi
34 start-stop-daemon --start --quiet --oknodo --exec $DAEMON --startas $DAEMON -- $OPTS
35 log_end_msg $?
36 ;;
37 stop)
38 log_daemon_msg "Stopping DNS Privacy stub resolver" "stubby"
39 start-stop-daemon --stop --quiet --oknodo --retry=TERM/30/KILL/5 --exec $DAEMON
40 log_end_msg $?
41 ;;
42 restart|force-reload)
43 $0 stop && sleep 2 && $0 start
44 ;;
45 try-restart)
46 if $0 status >/dev/null; then
47 $0 restart
48 else
49 exit 0
50 fi
51 ;;
52 reload)
53 exit 3
54 ;;
55 status)
56 status_of_proc $DAEMON "DNS Privacy stub resolver"
57 ;;
58 *)
59 echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
60 exit 2
61 ;;
62 esac
0 The files in this directory are mainly provided to support implementation of a
1 separate macOS GUI application to manage Stubby.
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!DOCTYPE plist PUBLIC "-/Apple/DTD PLIST 1.0/EN" "http:/www.apple.com/DTDs/PropertyList-1.0.dtd">
2 <plist version="1.0">
3 <dict>
4 <key>Label</key>
5 <string>org.getdns.stubby</string>
6 <key>KeepAlive</key>
7 <true/>
8 <key>RunAtLoad</key>
9 <true/>
10 <key>ProgramArguments</key>
11 <array>
12 <string>/Applications/StubbyManager.app/Contents/MacOS/stubby</string>
13 <string>-l</string>
14 <string>-C</string>
15 <string>/Applications/StubbyManager.app/Contents/MacOS/stubby.yml</string>
16 </array>
17 <key>UserName</key>
18 <string>root</string>
19 <key>StandardErrorPath</key>
20 <string>/var/log/stubby.log</string>
21 <key>StandardOutPath</key>
22 <string>/var/log/stubby.log</string>
23 </dict>
24 </plist>
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!DOCTYPE plist PUBLIC "-/Apple/DTD PLIST 1.0/EN" "http:/www.apple.com/DTDs/PropertyList-1.0.dtd">
2 <plist version="1.0">
3 <dict>
4 <key>Label</key>
5 <string>org.getdns.stubby</string>
6 <key>KeepAlive</key>
7 <true/>
8 <key>RunAtLoad</key>
9 <true/>
10 <key>ProgramArguments</key>
11 <array>
12 <string>/usr/local/bin/stubby</string>
13 <string>-l</string>
14 </array>
15 <key>UserName</key>
16 <string>root</string>
17 <key>StandardErrorPath</key>
18 <string>/var/log/stubby.log</string>
19 <key>StandardOutPath</key>
20 <string>/var/log/stubby.log</string>
21 </dict>
22 </plist>
0 #!/bin/sh
1
2 security authorizationdb write net.getdnsapi.stubby.daemon.run < /Applications/StubbyManager.app/Contents/MacOS/rights.daemon.run.plist
3 security authorizationdb write net.getdnsapi.stubby.dns.local < /Applications/StubbyManager.app/Contents/MacOS/rights.dns.local.plist
4 sudo chmod 6755 /Applications/StubbyManager.app/Contents/MacOS/stubby-ui-helper
5 sudo touch /var/log/stubby.log
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
2 <plist version="1.0">
3 <dict>
4 <key>allow-root</key>
5 <false/>
6 <key>authenticate-user</key>
7 <true/>
8 <key>class</key>
9 <string>user</string>
10 <key>comment</key>
11 <string>Start/stop Stubby daemon. Authenticate as an administrator.</string>
12 <key>group</key>
13 <string>admin</string>
14 <key>session-owner</key>
15 <false/>
16 <key>shared</key>
17 <true/>
18 <key>timeout</key>
19 <integer>600</integer>
20 <key>default-prompt</key>
21 <dict>
22 <key></key>
23 <string>You must authenticate to start or stop Stubby</string>
24 </dict>
25 <key>version</key>
26 <integer>2</integer>
27 </dict>
28 </plist>
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
2 <plist version="1.0">
3 <dict>
4 <key>allow-root</key>
5 <false/>
6 <key>authenticate-user</key>
7 <true/>
8 <key>class</key>
9 <string>user</string>
10 <key>comment</key>
11 <string>Set DNS resolution to/from Stubby. Authenticate as an administrator.</string>
12 <key>group</key>
13 <string>admin</string>
14 <key>session-owner</key>
15 <false/>
16 <key>shared</key>
17 <true/>
18 <key>timeout</key>
19 <integer>600</integer>
20 <key>default-prompt</key>
21 <dict>
22 <key></key>
23 <string>You must authenticate to change DNS lookups to or from Stubby</string>
24 </dict>
25 <key>version</key>
26 <integer>1</integer>
27 </dict>
28 </plist>
0 #!/bin/bash
1 #
2 # Copyright (c) 2017, Sinodun Internet Technologies Ltd, NLnet Labs
3 # All rights reserved.
4 #
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are met:
7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above copyright
10 # notice, this list of conditions and the following disclaimer in the
11 # documentation and/or other materials provided with the distribution.
12 # * Neither the names of the copyright holders nor the
13 # names of its contributors may be used to endorse or promote products
14 # derived from this software without specific prior written permission.
15 #
16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 # DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
20 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27
28 # Stubby helper file to set DNS servers on macOS.
29 # Note - this script doesn't detect or handle network events, simply changes the
30 # current resolvers
31 # Must run as root.
32
33 usage () {
34 echo
35 echo "Update the system DNS resolvers so that Stubby is used for all DNS"
36 echo "queries on macOS. (Stubby must already be running)"
37 echo "This must be run as root."
38 echo
39 echo "Usage: $0 options"
40 echo
41 echo "Supported options:"
42 echo " -r Reset DNS resolvers to the default ones (e.g. from DHCP)"
43 echo " -l List the current DNS settings for all interfaces"
44 echo " -h Show this help."
45 }
46
47 RESET=0
48 LIST=0
49 SERVERS="127.0.0.1 ::1"
50 OS_X=$(uname -a | grep -c 'Darwin')
51
52 while getopts ":rlh" opt; do
53 case $opt in
54 r ) RESET=1 ;;
55 l ) LIST=1 ;;
56 h ) usage
57 exit 1 ;;
58 \? ) usage
59 exit 1 ;;
60 esac
61 done
62
63
64 if [[ $OS_X -eq 0 ]]; then
65 echo "Sorry - This script only works on macOS and you are on a different OS."
66 exit 1
67 fi
68
69 if [[ $LIST -eq 1 ]]; then
70 echo "** Current DNS settings **"
71 networksetup -listallnetworkservices 2>/dev/null | grep -v '\*' | while read -r x ; do
72 RESULT=$(networksetup -getdnsservers "$x")
73 RESULT=$(echo $RESULT)
74 printf '%-30s %s\n' "$x:" "$RESULT"
75 done
76 exit 1
77 fi
78
79 if [ $EUID -ne 0 ]; then
80 echo "Must be root to update system resolvers. Retry using 'sudo stubby-setdns'"
81 exit 1
82 fi
83
84 if [[ $RESET -eq 1 ]]; then
85 SERVERS="empty"
86 echo "Setting DNS servers to $SERVERS - the system will use default DNS service."
87 else
88 echo "Setting DNS servers to $SERVERS - the system will use Stubby if it is running."
89 fi
90
91 ### Set the DNS settings via networksetup ###
92 networksetup -listallnetworkservices 2>/dev/null | grep -v '\*' | while read -r x ; do
93 networksetup -setdnsservers "$x" $SERVERS
94 done
0 /**
1 * stubby_ui_helper [-auth auth_key] [-config <config file path>] (start|stop|list|dns_stubby|dns_default|dns_list|check_config)
2 *
3 * A setuid application to accompany Stubby UI and do all the work that
4 * requires privileges.
5 */
6
7 #include "config.h"
8 #include <ctype.h>
9 #include <errno.h>
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <string.h>
13 #include <unistd.h>
14
15 #include <Security/Authorization.h>
16 #ifdef HAVE_OS_LOG_H
17 #include <os/log.h>
18 #endif
19
20 static const char CP[] = "/bin/cp";
21 static const char LAUNCHCTL[] = "/bin/launchctl";
22 static const char STUBBY_SETDNS[] = "/usr/local/sbin/stubby-setdns-macos.sh";
23 static const char STUBBY[] = "/usr/local/bin/stubby";
24 static const char DEFAULT_CONFIG_FILE[] = "/usr/local/etc/stubby/stubby.yml";
25
26 static const char RIGHT_DAEMON_RUN[] = "net.getdnsapi.stubby.daemon.run";
27 static const char RIGHT_DNS_LOCAL[] = "net.getdnsapi.stubby.dns.local";
28
29 static void log_failure(const char *log_message)
30 {
31 fprintf(stderr, "failed: %s\n", log_message);
32 #ifdef HAVE_OS_LOG_H
33 os_log(OS_LOG_DEFAULT, "failed: %s", log_message);
34 #endif
35 }
36
37 #ifdef HAVE_OS_LOG_H
38 static void log_action(const char *log_message)
39 {
40 os_log(OS_LOG_DEFAULT, "%s", log_message);
41 }
42 #endif
43
44 void check_auth(const char *auth, const char *right)
45 {
46 if (!auth) {
47 log_failure("Authorization required.");
48 exit(1);
49 }
50
51 AuthorizationExternalForm auth_ext_form;
52 for (size_t i = 0; i < kAuthorizationExternalFormLength; ++i) {
53 char c = 0;
54
55 if (isxdigit(*auth)) {
56 char n = (*auth >= 'a') ? *auth + 10 - 'a' : *auth - '0';
57 c |= (n << 4);
58 ++auth;
59 if (isxdigit(*auth)) {
60 n = (*auth >= 'a') ? *auth + 10 - 'a' : *auth - '0';
61 c |= n;
62 ++auth;
63 auth_ext_form.bytes[i] = c;
64 continue;
65 }
66 }
67 log_failure("Invalid authorization key text.");
68 exit(1);
69 }
70
71 AuthorizationRef auth_ref;
72 OSStatus oss;
73
74 oss = AuthorizationCreateFromExternalForm(&auth_ext_form, &auth_ref);
75 if (oss != errAuthorizationSuccess) {
76 log_failure("Bad authorization key form.");
77 exit(1);
78 }
79
80 AuthorizationItem one_right = { right, 0, NULL, 0 };
81 AuthorizationRights rights = { 1, &one_right };
82
83 oss = AuthorizationCopyRights(
84 auth_ref,
85 &rights,
86 kAuthorizationEmptyEnvironment,
87 kAuthorizationFlagExtendRights | kAuthorizationFlagInteractionAllowed,
88 NULL);
89 if (oss != errAuthorizationSuccess) {
90 log_failure("Authorization declined.");
91 exit(1);
92 }
93
94 AuthorizationFree(auth_ref, kAuthorizationFlagDefaults);
95 }
96
97 void usage()
98 {
99 fprintf(stderr, "Usage: stubby_ui_helper [-auth <auth_key>] [-config <config file>] (start|stop|list|dns_stubby|dns_default|dns_list|check_config|write_config)\n");
100 exit(1);
101 }
102
103 void fail_with_errno(const char *op)
104 {
105 (void)op;
106 log_failure(strerror(errno));
107 exit(1);
108 }
109
110 void start()
111 {
112 #ifdef HAVE_OS_LOG_H
113 log_action("Starting Stubby.");
114 #endif
115 int err = execl(LAUNCHCTL, LAUNCHCTL, "load", "/Library/LaunchDaemons/org.getdns.stubby.plist", NULL);
116 if (err == -1)
117 fail_with_errno("start");
118 }
119
120 void stop()
121 {
122 #ifdef HAVE_OS_LOG_H
123 log_action("Stopping Stubby.");
124 #endif
125 int err = execl(LAUNCHCTL, LAUNCHCTL, "unload", "/Library/LaunchDaemons/org.getdns.stubby.plist", NULL);
126 if (err == -1)
127 fail_with_errno("stop");
128 }
129
130 void list()
131 {
132 #ifdef HAVE_OS_LOG_H
133 log_action("Checking Stubby.");
134 #endif
135 int err = execl(LAUNCHCTL, LAUNCHCTL, "list", "org.getdns.stubby", NULL);
136 if (err == -1)
137 fail_with_errno("stop");
138 }
139
140 void dns_stubby()
141 {
142 #ifdef HAVE_OS_LOG_H
143 log_action("DNS resolving via Stubby.");
144 #endif
145 int err = execl(STUBBY_SETDNS, STUBBY_SETDNS, NULL);
146 if (err == -1)
147 fail_with_errno("dns_stubby");
148 }
149
150 void dns_default()
151 {
152 #ifdef HAVE_OS_LOG_H
153 log_action("DNS resolving via defaults.");
154 #endif
155 int err = execl(STUBBY_SETDNS, STUBBY_SETDNS, "-r", NULL);
156 if (err == -1)
157 fail_with_errno("dns_default");
158 }
159
160 void dns_list()
161 {
162 #ifdef HAVE_OS_LOG_H
163 log_action("List DNS resolver.");
164 #endif
165 int err = execl(STUBBY_SETDNS, STUBBY_SETDNS, "-l", NULL);
166 if (err == -1)
167 fail_with_errno("dns_list");
168 }
169
170 void check_config(const char *config_file)
171 {
172 #ifdef HAVE_OS_LOG_H
173 log_action("Check configuration.");
174 #endif
175 int err = execl(STUBBY, STUBBY, "-C", config_file, "-i", NULL);
176 if (err == -1)
177 fail_with_errno("check_config");
178 }
179
180 void write_config(const char *config_file)
181 {
182 #ifdef HAVE_OS_LOG_H
183 log_action("Write configuration.");
184 #endif
185 int err = execl(CP, CP, config_file, DEFAULT_CONFIG_FILE, NULL);
186 if (err == -1)
187 fail_with_errno("write_config");
188 }
189
190
191 int main(int ac, char *av[])
192 {
193 const char *auth = NULL;
194 const char *cmd = NULL;
195 const char *config_file = DEFAULT_CONFIG_FILE;
196 char authbuf[80];
197
198 ac--;
199 av++;
200
201 while (ac > 0) {
202 if (strcmp(av[0], "-h") == 0 || strcmp(av[0], "--help") == 0)
203 usage();
204
205 if (ac < 2)
206 break;
207
208 if (strcmp(av[0], "-auth") == 0) {
209 if (strcmp(av[1], "-") == 0) {
210 int n = fread(authbuf, 1, sizeof(authbuf) - 1, stdin);
211 authbuf[n] = '\0';
212 auth = authbuf;
213 }
214 else
215 auth = av[1];
216 }
217 else if (strcmp(av[0], "-config") == 0)
218 config_file = av[1];
219 else
220 usage();
221 av += 2;
222 ac -= 2;
223 }
224
225 if (ac != 1)
226 usage();
227 cmd = av[0];
228
229 if (setuid(0) == -1)
230 fail_with_errno("setuid");
231
232 if (strcmp(cmd, "start") == 0) {
233 check_auth(auth, RIGHT_DAEMON_RUN);
234 start();
235 }
236 else if (strcmp(cmd, "stop") == 0) {
237 check_auth(auth, RIGHT_DAEMON_RUN);
238 stop();
239 }
240 else if (strcmp(cmd, "list") == 0)
241 list();
242 else if (strcmp(cmd, "dns_stubby") == 0) {
243 check_auth(auth, RIGHT_DNS_LOCAL);
244 dns_stubby();
245 }
246 else if (strcmp(cmd, "dns_default") == 0) {
247 check_auth(auth, RIGHT_DNS_LOCAL);
248 dns_default();
249 }
250 else if (strcmp(cmd, "dns_list") == 0)
251 dns_list();
252 else if (strcmp(cmd, "check_config") == 0)
253 check_config(config_file);
254 else if (strcmp(cmd, "write_config") == 0)
255 write_config(config_file);
256
257 /* If we get here, there's a problem... */
258 usage();
259 }
0 /*
1 * Copyright (c) 1987, 1993, 1994
2 * The Regents of the University of California. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * 3. All advertising materials mentioning features or use of this software
13 * must display the following acknowledgement:
14 * This product includes software developed by the University of
15 * California, Berkeley and its contributors.
16 * 4. Neither the name of the University nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33 #include <string.h>
34 #include <stdio.h>
35
36 #include "getopt.h"
37
38 int opterr = 1, /* if error message should be printed */
39 optind = 1, /* index into parent argv vector */
40 optopt, /* character checked for validity */
41 optreset; /* reset getopt */
42 char *optarg; /* argument associated with option */
43
44 #define BADCH (int)'?'
45 #define BADARG (int)':'
46 #define EMSG ""
47
48 /*
49 * getopt --
50 * Parse argc/argv argument vector.
51 */
52 int getopt(int nargc, char * const nargv[], const char *ostr)
53 {
54 static char *place = EMSG; /* option letter processing */
55 const char *oli; /* option letter list index */
56
57 if (optreset || !*place) { /* update scanning pointer */
58 optreset = 0;
59 if (optind >= nargc || *(place = nargv[optind]) != '-') {
60 place = EMSG;
61 return (-1);
62 }
63 if (place[1] && *++place == '-') { /* found "--" */
64 ++optind;
65 place = EMSG;
66 return (-1);
67 }
68 } /* option letter okay? */
69 if ((optopt = (int)*place++) == (int)':' ||
70 !(oli = strchr(ostr, optopt))) {
71 /*
72 * if the user didn't specify '-' as an option,
73 * assume it means -1.
74 */
75 if (optopt == (int)'-')
76 return (-1);
77 if (!*place)
78 ++optind;
79 if (opterr && *ostr != ':')
80 (void)printf("illegal option -- %c\n", optopt);
81 return (BADCH);
82 }
83 if (*++oli != ':') { /* don't need argument */
84 optarg = NULL;
85 if (!*place)
86 ++optind;
87 }
88 else { /* need an argument */
89 if (*place) /* no white space */
90 optarg = place;
91 else if (nargc <= ++optind) { /* no arg */
92 place = EMSG;
93 if (*ostr == ':')
94 return (BADARG);
95 if (opterr)
96 (void)printf("option requires an argument -- %c\n", optopt);
97 return (BADCH);
98 }
99 else /* white space */
100 optarg = nargv[optind];
101 place = EMSG;
102 ++optind;
103 }
104 return (optopt); /* dump back option letter */
105 }
0 #ifndef GETOPT_H
1 #define GETOPT_H
2
3 extern int opterr; /* if error message should be printed */
4 extern int optind; /* index into parent argv vector */
5 extern int optopt; /* character checked for validity */
6 extern int optreset; /* reset getopt */
7 extern char *optarg; /* argument associated with option */
8
9 int getopt(int nargc, char * const nargv[], const char *ostr);
10
11 #endif
0 /*
1 * buffer.c -- generic memory buffer .
2 *
3 * Copyright (c) 2001-2008, NLnet Labs. All rights reserved.
4 *
5 * See LICENSE for the license.
6 *
7 */
8 /**
9 * \file
10 *
11 * This file contains the definition of sldns_buffer, and functions to manipulate those.
12 */
13 #include "config.h"
14 #include "sldns/sbuffer.h"
15 #include <stdarg.h>
16 #include <stdio.h>
17
18 sldns_buffer *
19 sldns_buffer_new(size_t capacity)
20 {
21 sldns_buffer *buffer = (sldns_buffer*)malloc(sizeof(sldns_buffer));
22
23 if (!buffer) {
24 return NULL;
25 }
26
27 buffer->_data = (uint8_t *) malloc(capacity);
28 if (!buffer->_data) {
29 free(buffer);
30 return NULL;
31 }
32
33 buffer->_position = 0;
34 buffer->_limit = buffer->_capacity = capacity;
35 buffer->_fixed = 0;
36 buffer->_vfixed = 0;
37 buffer->_status_err = 0;
38
39 sldns_buffer_invariant(buffer);
40
41 return buffer;
42 }
43
44 void
45 sldns_buffer_new_frm_data(sldns_buffer *buffer, void *data, size_t size)
46 {
47 assert(data != NULL);
48
49 buffer->_position = 0;
50 buffer->_limit = buffer->_capacity = size;
51 buffer->_fixed = 0;
52 buffer->_vfixed = 0;
53 if (!buffer->_fixed && buffer->_data)
54 free(buffer->_data);
55 buffer->_data = malloc(size);
56 if(!buffer->_data) {
57 buffer->_status_err = 1;
58 return;
59 }
60 memcpy(buffer->_data, data, size);
61 buffer->_status_err = 0;
62
63 sldns_buffer_invariant(buffer);
64 }
65
66 void
67 sldns_buffer_init_frm_data(sldns_buffer *buffer, void *data, size_t size)
68 {
69 memset(buffer, 0, sizeof(*buffer));
70 buffer->_data = data;
71 buffer->_capacity = buffer->_limit = size;
72 buffer->_fixed = 1;
73 buffer->_vfixed = 0;
74 }
75
76 void
77 sldns_buffer_init_vfixed_frm_data(sldns_buffer *buffer, void *data, size_t size)
78 {
79 memset(buffer, 0, sizeof(*buffer));
80 buffer->_data = data;
81 buffer->_capacity = buffer->_limit = size;
82 buffer->_fixed = 1;
83 buffer->_vfixed = 1;
84 }
85
86 int
87 sldns_buffer_set_capacity(sldns_buffer *buffer, size_t capacity)
88 {
89 void *data;
90
91 sldns_buffer_invariant(buffer);
92 assert(buffer->_position <= capacity && !buffer->_fixed);
93
94 data = (uint8_t *) realloc(buffer->_data, capacity);
95 if (!data) {
96 buffer->_status_err = 1;
97 return 0;
98 } else {
99 buffer->_data = data;
100 buffer->_limit = buffer->_capacity = capacity;
101 return 1;
102 }
103 }
104
105 int
106 sldns_buffer_reserve(sldns_buffer *buffer, size_t amount)
107 {
108 sldns_buffer_invariant(buffer);
109 assert(!buffer->_fixed);
110 if (buffer->_capacity < buffer->_position + amount) {
111 size_t new_capacity = buffer->_capacity * 3 / 2;
112
113 if (new_capacity < buffer->_position + amount) {
114 new_capacity = buffer->_position + amount;
115 }
116 if (!sldns_buffer_set_capacity(buffer, new_capacity)) {
117 buffer->_status_err = 1;
118 return 0;
119 }
120 }
121 buffer->_limit = buffer->_capacity;
122 return 1;
123 }
124
125 int
126 sldns_buffer_printf(sldns_buffer *buffer, const char *format, ...)
127 {
128 va_list args;
129 int written = 0;
130 size_t remaining;
131
132 if (sldns_buffer_status_ok(buffer)) {
133 sldns_buffer_invariant(buffer);
134 assert(buffer->_limit == buffer->_capacity);
135
136 remaining = sldns_buffer_remaining(buffer);
137 va_start(args, format);
138 written = vsnprintf((char *) sldns_buffer_current(buffer), remaining,
139 format, args);
140 va_end(args);
141 if (written == -1) {
142 buffer->_status_err = 1;
143 return -1;
144 } else if (!buffer->_vfixed && (size_t) written >= remaining) {
145 if (!sldns_buffer_reserve(buffer, (size_t) written + 1)) {
146 buffer->_status_err = 1;
147 return -1;
148 }
149 va_start(args, format);
150 written = vsnprintf((char *) sldns_buffer_current(buffer),
151 sldns_buffer_remaining(buffer), format, args);
152 va_end(args);
153 if (written == -1) {
154 buffer->_status_err = 1;
155 return -1;
156 }
157 }
158 buffer->_position += written;
159 }
160 return written;
161 }
162
163 void
164 sldns_buffer_free(sldns_buffer *buffer)
165 {
166 if (!buffer) {
167 return;
168 }
169
170 if (!buffer->_fixed)
171 free(buffer->_data);
172
173 free(buffer);
174 }
175
176 void *
177 sldns_buffer_export(sldns_buffer *buffer)
178 {
179 buffer->_fixed = 1;
180 return buffer->_data;
181 }
182
183 void
184 sldns_buffer_copy(sldns_buffer* result, sldns_buffer* from)
185 {
186 size_t tocopy = sldns_buffer_limit(from);
187
188 if(tocopy > sldns_buffer_capacity(result))
189 tocopy = sldns_buffer_capacity(result);
190 sldns_buffer_clear(result);
191 sldns_buffer_write(result, sldns_buffer_begin(from), tocopy);
192 sldns_buffer_flip(result);
193 }
0 /*
1 * buffer.h -- generic memory buffer.
2 *
3 * Copyright (c) 2005-2008, NLnet Labs. All rights reserved.
4 *
5 * See LICENSE for the license.
6 *
7 *
8 * The buffer module implements a generic buffer. The API is based on
9 * the java.nio.Buffer interface.
10 */
11
12 #ifndef LDNS_SBUFFER_H
13 #define LDNS_SBUFFER_H
14
15 #include <assert.h>
16 #include <stdint.h>
17 #if defined(_MSC_VER)
18 #include <BaseTsd.h>
19 typedef SSIZE_T ssize_t;
20 #endif
21 #include <stdlib.h>
22 #include <string.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #ifdef S_SPLINT_S
29 # define INLINE
30 #else
31 # ifdef SWIG
32 # define INLINE static
33 # else
34 # define INLINE static inline
35 # endif
36 #endif
37
38 /*
39 * Copy data allowing for unaligned accesses in network byte order
40 * (big endian).
41 */
42 INLINE uint16_t
43 sldns_read_uint16(const void *src)
44 {
45 #ifdef ALLOW_UNALIGNED_ACCESSES
46 return ntohs(*(const uint16_t *) src);
47 #else
48 const uint8_t *p = (const uint8_t *) src;
49 return ((uint16_t) p[0] << 8) | (uint16_t) p[1];
50 #endif
51 }
52
53 INLINE uint32_t
54 sldns_read_uint32(const void *src)
55 {
56 #ifdef ALLOW_UNALIGNED_ACCESSES
57 return ntohl(*(const uint32_t *) src);
58 #else
59 const uint8_t *p = (const uint8_t *) src;
60 return ( ((uint32_t) p[0] << 24)
61 | ((uint32_t) p[1] << 16)
62 | ((uint32_t) p[2] << 8)
63 | (uint32_t) p[3]);
64 #endif
65 }
66
67 /*
68 * Copy data allowing for unaligned accesses in network byte order
69 * (big endian).
70 */
71 INLINE void
72 sldns_write_uint16(void *dst, uint16_t data)
73 {
74 #ifdef ALLOW_UNALIGNED_ACCESSES
75 * (uint16_t *) dst = htons(data);
76 #else
77 uint8_t *p = (uint8_t *) dst;
78 p[0] = (uint8_t) ((data >> 8) & 0xff);
79 p[1] = (uint8_t) (data & 0xff);
80 #endif
81 }
82
83 INLINE void
84 sldns_write_uint32(void *dst, uint32_t data)
85 {
86 #ifdef ALLOW_UNALIGNED_ACCESSES
87 * (uint32_t *) dst = htonl(data);
88 #else
89 uint8_t *p = (uint8_t *) dst;
90 p[0] = (uint8_t) ((data >> 24) & 0xff);
91 p[1] = (uint8_t) ((data >> 16) & 0xff);
92 p[2] = (uint8_t) ((data >> 8) & 0xff);
93 p[3] = (uint8_t) (data & 0xff);
94 #endif
95 }
96
97
98 INLINE void
99 sldns_write_uint48(void *dst, uint64_t data)
100 {
101 uint8_t *p = (uint8_t *) dst;
102 p[0] = (uint8_t) ((data >> 40) & 0xff);
103 p[1] = (uint8_t) ((data >> 32) & 0xff);
104 p[2] = (uint8_t) ((data >> 24) & 0xff);
105 p[3] = (uint8_t) ((data >> 16) & 0xff);
106 p[4] = (uint8_t) ((data >> 8) & 0xff);
107 p[5] = (uint8_t) (data & 0xff);
108 }
109
110
111 /**
112 * \file sbuffer.h
113 *
114 * This file contains the definition of sldns_buffer, and functions to manipulate those.
115 */
116
117 /**
118 * implementation of buffers to ease operations
119 *
120 * sldns_buffers can contain arbitrary information, per octet. You can write
121 * to the current end of a buffer, read from the current position, and
122 * access any data within it.
123 */
124 struct sldns_buffer
125 {
126 /** The current position used for reading/writing */
127 size_t _position;
128
129 /** The read/write limit */
130 size_t _limit;
131
132 /** The amount of data the buffer can contain */
133 size_t _capacity;
134
135 /** The data contained in the buffer */
136 uint8_t *_data;
137
138 /** If the buffer is fixed it cannot be resized */
139 unsigned _fixed : 1;
140
141 /** If the buffer is vfixed, no more than capacity bytes will be
142 * written to _data, however the _position counter will be updated
143 * with the amount that would have been written in consecutive
144 * writes. This allows for a modus operandi in which a sequence is
145 * written on a fixed capacity buffer (perhaps with _data on stack).
146 * When everything could be written, then the _data is immediately
147 * usable, if not, then a buffer could be allocated sized precisely
148 * to fit the data for a second attempt.
149 */
150 unsigned _vfixed : 1;
151
152 /** The current state of the buffer. If writing to the buffer fails
153 * for any reason, this value is changed. This way, you can perform
154 * multiple writes in sequence and check for success afterwards. */
155 unsigned _status_err : 1;
156 };
157 typedef struct sldns_buffer sldns_buffer;
158
159 #ifdef NDEBUG
160 INLINE void
161 sldns_buffer_invariant(sldns_buffer *ATTR_UNUSED(buffer))
162 {
163 }
164 #else
165 INLINE void
166 sldns_buffer_invariant(sldns_buffer *buffer)
167 {
168 assert(buffer != NULL);
169 assert(buffer->_position <= buffer->_limit || buffer->_vfixed);
170 assert(buffer->_limit <= buffer->_capacity);
171 assert(buffer->_data != NULL || (buffer->_vfixed && buffer->_capacity == 0));
172 }
173 #endif
174
175 /**
176 * creates a new buffer with the specified capacity.
177 *
178 * \param[in] capacity the size (in bytes) to allocate for the buffer
179 * \return the created buffer
180 */
181 sldns_buffer *sldns_buffer_new(size_t capacity);
182
183 /**
184 * creates a buffer with the specified data. The data IS copied
185 * and MEMORY allocations are done. The buffer is not fixed and can
186 * be resized using buffer_reserve().
187 *
188 * \param[in] buffer pointer to the buffer to put the data in
189 * \param[in] data the data to encapsulate in the buffer
190 * \param[in] size the size of the data
191 */
192 void sldns_buffer_new_frm_data(sldns_buffer *buffer, void *data, size_t size);
193
194 /**
195 * Setup a buffer with the data pointed to. No data copied, no memory allocs.
196 * The buffer is fixed.
197 * \param[in] buffer pointer to the buffer to put the data in
198 * \param[in] data the data to encapsulate in the buffer
199 * \param[in] size the size of the data
200 */
201 void sldns_buffer_init_frm_data(sldns_buffer *buffer, void *data, size_t size);
202
203 /**
204 * Setup a buffer with the data pointed to. No data copied, no memory allocs.
205 * The buffer is "virtually" fixed. Writes beyond size (the capacity) will
206 * only update position, but no data will be written beyond capacity. This
207 * allows to determine how big the buffer should have been to contain all the
208 * written data, by looking at the position with sldns_buffer_position(),
209 * similarly to the return value of POSIX's snprintf.
210 * \param[in] buffer pointer to the buffer to put the data in
211 * \param[in] data the data to encapsulate in the buffer
212 * \param[in] size the size of the data
213 */
214 void sldns_buffer_init_vfixed_frm_data(sldns_buffer *buffer, void *data, size_t size);
215
216 /**
217 * clears the buffer and make it ready for writing. The buffer's limit
218 * is set to the capacity and the position is set to 0.
219 * \param[in] buffer the buffer to clear
220 */
221 INLINE void sldns_buffer_clear(sldns_buffer *buffer)
222 {
223 sldns_buffer_invariant(buffer);
224
225 /* reset status here? */
226
227 buffer->_position = 0;
228 buffer->_limit = buffer->_capacity;
229 }
230
231 /**
232 * makes the buffer ready for reading the data that has been written to
233 * the buffer. The buffer's limit is set to the current position and
234 * the position is set to 0.
235 *
236 * \param[in] buffer the buffer to flip
237 * \return void
238 */
239 INLINE void sldns_buffer_flip(sldns_buffer *buffer)
240 {
241 sldns_buffer_invariant(buffer);
242
243 buffer->_limit = buffer->_position;
244 buffer->_position = 0;
245 }
246
247 /**
248 * make the buffer ready for re-reading the data. The buffer's
249 * position is reset to 0.
250 * \param[in] buffer the buffer to rewind
251 */
252 INLINE void sldns_buffer_rewind(sldns_buffer *buffer)
253 {
254 sldns_buffer_invariant(buffer);
255
256 buffer->_position = 0;
257 }
258
259 /**
260 * returns the current position in the buffer (as a number of bytes)
261 * \param[in] buffer the buffer
262 * \return the current position
263 */
264 INLINE size_t
265 sldns_buffer_position(sldns_buffer *buffer)
266 {
267 return buffer->_position;
268 }
269
270 /**
271 * sets the buffer's position to MARK. The position must be less than
272 * or equal to the buffer's limit.
273 * \param[in] buffer the buffer
274 * \param[in] mark the mark to use
275 */
276 INLINE void
277 sldns_buffer_set_position(sldns_buffer *buffer, size_t mark)
278 {
279 assert(mark <= buffer->_limit || buffer->_vfixed);
280 buffer->_position = mark;
281 }
282
283 /**
284 * changes the buffer's position by COUNT bytes. The position must not
285 * be moved behind the buffer's limit or before the beginning of the
286 * buffer.
287 * \param[in] buffer the buffer
288 * \param[in] count the count to use
289 */
290 INLINE void
291 sldns_buffer_skip(sldns_buffer *buffer, ssize_t count)
292 {
293 assert(buffer->_position + count <= buffer->_limit || buffer->_vfixed);
294 buffer->_position += count;
295 }
296
297 /**
298 * returns the maximum size of the buffer
299 * \param[in] buffer
300 * \return the size
301 */
302 INLINE size_t
303 sldns_buffer_limit(sldns_buffer *buffer)
304 {
305 return buffer->_limit;
306 }
307
308 /**
309 * changes the buffer's limit. If the buffer's position is greater
310 * than the new limit the position is set to the limit.
311 * \param[in] buffer the buffer
312 * \param[in] limit the new limit
313 */
314 INLINE void
315 sldns_buffer_set_limit(sldns_buffer *buffer, size_t limit)
316 {
317 assert(limit <= buffer->_capacity);
318 buffer->_limit = limit;
319 if (buffer->_position > buffer->_limit)
320 buffer->_position = buffer->_limit;
321 }
322
323 /**
324 * returns the number of bytes the buffer can hold.
325 * \param[in] buffer the buffer
326 * \return the number of bytes
327 */
328 INLINE size_t
329 sldns_buffer_capacity(sldns_buffer *buffer)
330 {
331 return buffer->_capacity;
332 }
333
334 /**
335 * changes the buffer's capacity. The data is reallocated so any
336 * pointers to the data may become invalid. The buffer's limit is set
337 * to the buffer's new capacity.
338 * \param[in] buffer the buffer
339 * \param[in] capacity the capacity to use
340 * \return whether this failed or succeeded
341 */
342 int sldns_buffer_set_capacity(sldns_buffer *buffer, size_t capacity);
343
344 /**
345 * ensures BUFFER can contain at least AMOUNT more bytes. The buffer's
346 * capacity is increased if necessary using buffer_set_capacity().
347 *
348 * The buffer's limit is always set to the (possibly increased)
349 * capacity.
350 * \param[in] buffer the buffer
351 * \param[in] amount amount to use
352 * \return whether this failed or succeeded
353 */
354 int sldns_buffer_reserve(sldns_buffer *buffer, size_t amount);
355
356 /**
357 * returns a pointer to the data at the indicated position.
358 * \param[in] buffer the buffer
359 * \param[in] at position
360 * \return the pointer to the data
361 */
362 INLINE uint8_t *
363 sldns_buffer_at(const sldns_buffer *buffer, size_t at)
364 {
365 assert(at <= buffer->_limit || buffer->_vfixed);
366 return buffer->_data + at;
367 }
368
369 /**
370 * returns a pointer to the beginning of the buffer (the data at
371 * position 0).
372 * \param[in] buffer the buffer
373 * \return the pointer
374 */
375 INLINE uint8_t *
376 sldns_buffer_begin(const sldns_buffer *buffer)
377 {
378 return sldns_buffer_at(buffer, 0);
379 }
380
381 /**
382 * returns a pointer to the end of the buffer (the data at the buffer's
383 * limit).
384 * \param[in] buffer the buffer
385 * \return the pointer
386 */
387 INLINE uint8_t *
388 sldns_buffer_end(sldns_buffer *buffer)
389 {
390 return sldns_buffer_at(buffer, buffer->_limit);
391 }
392
393 /**
394 * returns a pointer to the data at the buffer's current position.
395 * \param[in] buffer the buffer
396 * \return the pointer
397 */
398 INLINE uint8_t *
399 sldns_buffer_current(sldns_buffer *buffer)
400 {
401 return sldns_buffer_at(buffer, buffer->_position);
402 }
403
404 /**
405 * returns the number of bytes remaining between the indicated position and
406 * the limit.
407 * \param[in] buffer the buffer
408 * \param[in] at indicated position
409 * \return number of bytes
410 */
411 INLINE size_t
412 sldns_buffer_remaining_at(sldns_buffer *buffer, size_t at)
413 {
414 sldns_buffer_invariant(buffer);
415 assert(at <= buffer->_limit || buffer->_vfixed);
416 return at < buffer->_limit ? buffer->_limit - at : 0;
417 }
418
419 /**
420 * returns the number of bytes remaining between the buffer's position and
421 * limit.
422 * \param[in] buffer the buffer
423 * \return the number of bytes
424 */
425 INLINE size_t
426 sldns_buffer_remaining(sldns_buffer *buffer)
427 {
428 return sldns_buffer_remaining_at(buffer, buffer->_position);
429 }
430
431 /**
432 * checks if the buffer has at least COUNT more bytes available.
433 * Before reading or writing the caller needs to ensure enough space
434 * is available!
435 * \param[in] buffer the buffer
436 * \param[in] at indicated position
437 * \param[in] count how much is available
438 * \return true or false (as int?)
439 */
440 INLINE int
441 sldns_buffer_available_at(sldns_buffer *buffer, size_t at, size_t count)
442 {
443 return count <= sldns_buffer_remaining_at(buffer, at);
444 }
445
446 /**
447 * checks if the buffer has count bytes available at the current position
448 * \param[in] buffer the buffer
449 * \param[in] count how much is available
450 * \return true or false (as int?)
451 */
452 INLINE int
453 sldns_buffer_available(sldns_buffer *buffer, size_t count)
454 {
455 return sldns_buffer_available_at(buffer, buffer->_position, count);
456 }
457
458 /**
459 * writes the given data to the buffer at the specified position
460 * \param[in] buffer the buffer
461 * \param[in] at the position (in number of bytes) to write the data at
462 * \param[in] data pointer to the data to write to the buffer
463 * \param[in] count the number of bytes of data to write
464 */
465 INLINE void
466 sldns_buffer_write_at(sldns_buffer *buffer, size_t at, const void *data, size_t count)
467 {
468 if (!buffer->_vfixed)
469 assert(sldns_buffer_available_at(buffer, at, count));
470 else if (sldns_buffer_remaining_at(buffer, at) == 0)
471 return;
472 else if (count > sldns_buffer_remaining_at(buffer, at)) {
473 memcpy(buffer->_data + at, data,
474 sldns_buffer_remaining_at(buffer, at));
475 return;
476 }
477 memcpy(buffer->_data + at, data, count);
478 }
479
480 /**
481 * set the given byte to the buffer at the specified position
482 * \param[in] buffer the buffer
483 * \param[in] at the position (in number of bytes) to write the data at
484 * \param[in] c the byte to set to the buffer
485 * \param[in] count the number of bytes of bytes to write
486 */
487
488 INLINE void
489 sldns_buffer_set_at(sldns_buffer *buffer, size_t at, int c, size_t count)
490 {
491 if (!buffer->_vfixed)
492 assert(sldns_buffer_available_at(buffer, at, count));
493 else if (sldns_buffer_remaining_at(buffer, at) == 0)
494 return;
495 else if (count > sldns_buffer_remaining_at(buffer, at)) {
496 memset(buffer->_data + at, c,
497 sldns_buffer_remaining_at(buffer, at));
498 return;
499 }
500 memset(buffer->_data + at, c, count);
501 }
502
503
504 /**
505 * writes count bytes of data to the current position of the buffer
506 * \param[in] buffer the buffer
507 * \param[in] data the data to write
508 * \param[in] count the length of the data to write
509 */
510 INLINE void
511 sldns_buffer_write(sldns_buffer *buffer, const void *data, size_t count)
512 {
513 sldns_buffer_write_at(buffer, buffer->_position, data, count);
514 buffer->_position += count;
515 }
516
517 /**
518 * copies the given (null-delimited) string to the specified position at the buffer
519 * \param[in] buffer the buffer
520 * \param[in] at the position in the buffer
521 * \param[in] str the string to write
522 */
523 INLINE void
524 sldns_buffer_write_string_at(sldns_buffer *buffer, size_t at, const char *str)
525 {
526 sldns_buffer_write_at(buffer, at, str, strlen(str));
527 }
528
529 /**
530 * copies the given (null-delimited) string to the current position at the buffer
531 * \param[in] buffer the buffer
532 * \param[in] str the string to write
533 */
534 INLINE void
535 sldns_buffer_write_string(sldns_buffer *buffer, const char *str)
536 {
537 sldns_buffer_write(buffer, str, strlen(str));
538 }
539
540 /**
541 * writes the given byte of data at the given position in the buffer
542 * \param[in] buffer the buffer
543 * \param[in] at the position in the buffer
544 * \param[in] data the 8 bits to write
545 */
546 INLINE void
547 sldns_buffer_write_u8_at(sldns_buffer *buffer, size_t at, uint8_t data)
548 {
549 if (buffer->_vfixed && at + sizeof(data) > buffer->_limit) return;
550 assert(sldns_buffer_available_at(buffer, at, sizeof(data)));
551 buffer->_data[at] = data;
552 }
553
554 /**
555 * writes the given byte of data at the current position in the buffer
556 * \param[in] buffer the buffer
557 * \param[in] data the 8 bits to write
558 */
559 INLINE void
560 sldns_buffer_write_u8(sldns_buffer *buffer, uint8_t data)
561 {
562 sldns_buffer_write_u8_at(buffer, buffer->_position, data);
563 buffer->_position += sizeof(data);
564 }
565
566 /**
567 * writes the given 2 byte integer at the given position in the buffer
568 * \param[in] buffer the buffer
569 * \param[in] at the position in the buffer
570 * \param[in] data the 16 bits to write
571 */
572 INLINE void
573 sldns_buffer_write_u16_at(sldns_buffer *buffer, size_t at, uint16_t data)
574 {
575 if (buffer->_vfixed && at + sizeof(data) > buffer->_limit) return;
576 assert(sldns_buffer_available_at(buffer, at, sizeof(data)));
577 sldns_write_uint16(buffer->_data + at, data);
578 }
579
580 /**
581 * writes the given 2 byte integer at the current position in the buffer
582 * \param[in] buffer the buffer
583 * \param[in] data the 16 bits to write
584 */
585 INLINE void
586 sldns_buffer_write_u16(sldns_buffer *buffer, uint16_t data)
587 {
588 sldns_buffer_write_u16_at(buffer, buffer->_position, data);
589 buffer->_position += sizeof(data);
590 }
591
592 /**
593 * writes the given 4 byte integer at the given position in the buffer
594 * \param[in] buffer the buffer
595 * \param[in] at the position in the buffer
596 * \param[in] data the 32 bits to write
597 */
598 INLINE void
599 sldns_buffer_write_u32_at(sldns_buffer *buffer, size_t at, uint32_t data)
600 {
601 if (buffer->_vfixed && at + sizeof(data) > buffer->_limit) return;
602 assert(sldns_buffer_available_at(buffer, at, sizeof(data)));
603 sldns_write_uint32(buffer->_data + at, data);
604 }
605
606 /**
607 * writes the given 6 byte integer at the given position in the buffer
608 * \param[in] buffer the buffer
609 * \param[in] at the position in the buffer
610 * \param[in] data the (lower) 48 bits to write
611 */
612 INLINE void
613 sldns_buffer_write_u48_at(sldns_buffer *buffer, size_t at, uint64_t data)
614 {
615 if (buffer->_vfixed && at + 6 > buffer->_limit) return;
616 assert(sldns_buffer_available_at(buffer, at, 6));
617 sldns_write_uint48(buffer->_data + at, data);
618 }
619
620 /**
621 * writes the given 4 byte integer at the current position in the buffer
622 * \param[in] buffer the buffer
623 * \param[in] data the 32 bits to write
624 */
625 INLINE void
626 sldns_buffer_write_u32(sldns_buffer *buffer, uint32_t data)
627 {
628 sldns_buffer_write_u32_at(buffer, buffer->_position, data);
629 buffer->_position += sizeof(data);
630 }
631
632 /**
633 * writes the given 6 byte integer at the current position in the buffer
634 * \param[in] buffer the buffer
635 * \param[in] data the 48 bits to write
636 */
637 INLINE void
638 sldns_buffer_write_u48(sldns_buffer *buffer, uint64_t data)
639 {
640 sldns_buffer_write_u48_at(buffer, buffer->_position, data);
641 buffer->_position += 6;
642 }
643
644 /**
645 * copies count bytes of data at the given position to the given data-array
646 * \param[in] buffer the buffer
647 * \param[in] at the position in the buffer to start
648 * \param[out] data buffer to copy to
649 * \param[in] count the length of the data to copy
650 */
651 INLINE void
652 sldns_buffer_read_at(sldns_buffer *buffer, size_t at, void *data, size_t count)
653 {
654 assert(sldns_buffer_available_at(buffer, at, count));
655 memcpy(data, buffer->_data + at, count);
656 }
657
658 /**
659 * copies count bytes of data at the current position to the given data-array
660 * \param[in] buffer the buffer
661 * \param[out] data buffer to copy to
662 * \param[in] count the length of the data to copy
663 */
664 INLINE void
665 sldns_buffer_read(sldns_buffer *buffer, void *data, size_t count)
666 {
667 sldns_buffer_read_at(buffer, buffer->_position, data, count);
668 buffer->_position += count;
669 }
670
671 /**
672 * returns the byte value at the given position in the buffer
673 * \param[in] buffer the buffer
674 * \param[in] at the position in the buffer
675 * \return 1 byte integer
676 */
677 INLINE uint8_t
678 sldns_buffer_read_u8_at(sldns_buffer *buffer, size_t at)
679 {
680 assert(sldns_buffer_available_at(buffer, at, sizeof(uint8_t)));
681 return buffer->_data[at];
682 }
683
684 /**
685 * returns the byte value at the current position in the buffer
686 * \param[in] buffer the buffer
687 * \return 1 byte integer
688 */
689 INLINE uint8_t
690 sldns_buffer_read_u8(sldns_buffer *buffer)
691 {
692 uint8_t result = sldns_buffer_read_u8_at(buffer, buffer->_position);
693 buffer->_position += sizeof(uint8_t);
694 return result;
695 }
696
697 /**
698 * returns the 2-byte integer value at the given position in the buffer
699 * \param[in] buffer the buffer
700 * \param[in] at position in the buffer
701 * \return 2 byte integer
702 */
703 INLINE uint16_t
704 sldns_buffer_read_u16_at(sldns_buffer *buffer, size_t at)
705 {
706 assert(sldns_buffer_available_at(buffer, at, sizeof(uint16_t)));
707 return sldns_read_uint16(buffer->_data + at);
708 }
709
710 /**
711 * returns the 2-byte integer value at the current position in the buffer
712 * \param[in] buffer the buffer
713 * \return 2 byte integer
714 */
715 INLINE uint16_t
716 sldns_buffer_read_u16(sldns_buffer *buffer)
717 {
718 uint16_t result = sldns_buffer_read_u16_at(buffer, buffer->_position);
719 buffer->_position += sizeof(uint16_t);
720 return result;
721 }
722
723 /**
724 * returns the 4-byte integer value at the given position in the buffer
725 * \param[in] buffer the buffer
726 * \param[in] at position in the buffer
727 * \return 4 byte integer
728 */
729 INLINE uint32_t
730 sldns_buffer_read_u32_at(sldns_buffer *buffer, size_t at)
731 {
732 assert(sldns_buffer_available_at(buffer, at, sizeof(uint32_t)));
733 return sldns_read_uint32(buffer->_data + at);
734 }
735
736 /**
737 * returns the 4-byte integer value at the current position in the buffer
738 * \param[in] buffer the buffer
739 * \return 4 byte integer
740 */
741 INLINE uint32_t
742 sldns_buffer_read_u32(sldns_buffer *buffer)
743 {
744 uint32_t result = sldns_buffer_read_u32_at(buffer, buffer->_position);
745 buffer->_position += sizeof(uint32_t);
746 return result;
747 }
748
749 /**
750 * returns the status of the buffer
751 * \param[in] buffer
752 * \return the status
753 */
754 INLINE int
755 sldns_buffer_status(sldns_buffer *buffer)
756 {
757 return (int)buffer->_status_err;
758 }
759
760 /**
761 * returns true if the status of the buffer is LDNS_STATUS_OK, false otherwise
762 * \param[in] buffer the buffer
763 * \return true or false
764 */
765 INLINE int
766 sldns_buffer_status_ok(sldns_buffer *buffer)
767 {
768 if (buffer) {
769 return sldns_buffer_status(buffer) == 0;
770 } else {
771 return 0;
772 }
773 }
774
775 /**
776 * prints to the buffer, increasing the capacity if required using
777 * buffer_reserve(). The buffer's position is set to the terminating '\\0'
778 * Returns the number of characters written (not including the
779 * terminating '\\0') or -1 on failure.
780 */
781 int sldns_buffer_printf(sldns_buffer *buffer, const char *format, ...)
782 ATTR_FORMAT(printf, 2, 3);
783
784 /**
785 * frees the buffer.
786 * \param[in] *buffer the buffer to be freed
787 * \return void
788 */
789 void sldns_buffer_free(sldns_buffer *buffer);
790
791 /**
792 * Makes the buffer fixed and returns a pointer to the data. The
793 * caller is responsible for free'ing the result.
794 * \param[in] *buffer the buffer to be exported
795 * \return void
796 */
797 void *sldns_buffer_export(sldns_buffer *buffer);
798
799 /**
800 * Copy contents of the from buffer to the result buffer and then flips
801 * the result buffer. Data will be silently truncated if the result buffer is
802 * too small.
803 * \param[out] *result resulting buffer which is copied to.
804 * \param[in] *from what to copy to result.
805 */
806 void sldns_buffer_copy(sldns_buffer* result, sldns_buffer* from);
807
808 #ifdef __cplusplus
809 }
810 #endif
811
812 #endif /* LDNS_SBUFFER_H */
2727 #include "config.h"
2828 #include <getdns/getdns.h>
2929 #include <getdns/getdns_extra.h>
30 #include <stdint.h>
3031 #include <string.h>
3132 #include <errno.h>
3233 #include <limits.h>
3536 #include <shlobj.h>
3637 #else
3738 #include <pwd.h>
38 #include <unistd.h>
3939 #endif
4040 #include <signal.h>
4141 #include <limits.h>
42 #ifndef HAVE_GETOPT
43 #include "getopt.h"
44 #else
45 #include <unistd.h>
46 #endif
47 #if defined(ENABLE_SYSTEMD)
48 #include <systemd/sd-daemon.h>
49 #endif
4250
4351 #ifdef HAVE_GETDNS_YAML2DICT
4452 getdns_return_t getdns_yaml2dict(const char *str, getdns_dict **dict);
343351 typedef struct dns_msg {
344352 getdns_transaction_t request_id;
345353 getdns_dict *request;
346 uint32_t rt;
354 getdns_resolution_t rt;
347355 uint32_t ad_bit;
348356 uint32_t do_bit;
349357 uint32_t cd_bit;
806814 }
807815 }
808816
817 stubby_local_log(NULL,GETDNS_LOG_UPSTREAM_STATS, GETDNS_LOG_INFO,
818 "Stubby version: %s\n", STUBBY_PACKAGE_STRING);
819
809820 if ((r = getdns_context_create(&context, 1))) {
810821 fprintf(stderr, "Create context failed: %s\n",
811822 _getdns_strerror(r));
969980 } else {
970981 #ifdef SIGPIPE
971982 (void)signal(SIGPIPE, SIG_IGN);
983 #endif
984 #ifdef ENABLE_SYSTEMD
985 sd_notifyf(0, "READY=1\nMAINPID=%u", getpid());
972986 #endif
973987 getdns_context_run(context);
974988 }
10171031 #ifdef SIGPIPE
10181032 (void)signal(SIGPIPE, SIG_IGN);
10191033 #endif
1034 #ifdef ENABLE_SYSTEMD
1035 sd_notify(0, "READY=1");
1036 #endif
10201037 getdns_context_run(context);
10211038 }
10221039
00 /*
1 * Copyright (c) 2017, Sinodun Internet Technologies Ltd.
1 * Copyright (c) 2017, 2019, Sinodun Internet Technologies Ltd.
22 * All rights reserved.
33 *
44 * Redistribution and use in source and binary forms, with or without
2424 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525 */
2626
27 #include <stdint.h>
2728 #include <stdlib.h>
2829 #include <stdio.h>
2930 #include <assert.h>
+0
-95
stubby/stubby-setdns-macos.sh less more
0 #!/bin/bash
1 #
2 # Copyright (c) 2017, Sinodun Internet Technologies Ltd, NLnet Labs
3 # All rights reserved.
4 #
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are met:
7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above copyright
10 # notice, this list of conditions and the following disclaimer in the
11 # documentation and/or other materials provided with the distribution.
12 # * Neither the names of the copyright holders nor the
13 # names of its contributors may be used to endorse or promote products
14 # derived from this software without specific prior written permission.
15 #
16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 # DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
20 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27
28 # Stubby helper file to set DNS servers on macOS.
29 # Note - this script doesn't detect or handle network events, simply changes the
30 # current resolvers
31 # Must run as root.
32
33 usage () {
34 echo
35 echo "Update the system DNS resolvers so that Stubby is used for all DNS"
36 echo "queries on macOS. (Stubby must already be running)"
37 echo "This must be run as root."
38 echo
39 echo "Usage: $0 options"
40 echo
41 echo "Supported options:"
42 echo " -r Reset DNS resolvers to the default ones (e.g. from DHCP)"
43 echo " -l List the current DNS settings for all interfaces"
44 echo " -h Show this help."
45 }
46
47 RESET=0
48 LIST=0
49 SERVERS="127.0.0.1 ::1"
50 OS_X=$(uname -a | grep -c 'Darwin')
51
52 while getopts ":rlh" opt; do
53 case $opt in
54 r ) RESET=1 ;;
55 l ) LIST=1 ;;
56 h ) usage
57 exit 1 ;;
58 \? ) usage
59 exit 1 ;;
60 esac
61 done
62
63
64 if [[ $OS_X -eq 0 ]]; then
65 echo "Sorry - This script only works on macOS and you are on a different OS."
66 exit 1
67 fi
68
69 if [[ $LIST -eq 1 ]]; then
70 echo "** Current DNS settings **"
71 networksetup -listallnetworkservices 2>/dev/null | grep -v '\*' | while read -r x ; do
72 RESULT=$(networksetup -getdnsservers "$x")
73 RESULT=$(echo $RESULT)
74 printf '%-30s %s\n' "$x:" "$RESULT"
75 done
76 exit 1
77 fi
78
79 if [ $EUID -ne 0 ]; then
80 echo "Must be root to update system resolvers. Retry using 'sudo stubby-setdns'"
81 exit 1
82 fi
83
84 if [[ $RESET -eq 1 ]]; then
85 SERVERS="empty"
86 echo "Setting DNS servers to $SERVERS - the system will use default DNS service."
87 else
88 echo "Setting DNS servers to $SERVERS - the system will use Stubby if it is running."
89 fi
90
91 ### Set the DNS settings via networksetup ###
92 networksetup -listallnetworkservices 2>/dev/null | grep -v '\*' | while read -r x ; do
93 networksetup -setdnsservers "$x" $SERVERS
94 done
7272 # EDNS0 option for keepalive idle timeout in milliseconds as specified in
7373 # https://tools.ietf.org/html/rfc7828
7474 # This keeps idle TLS connections open to avoid the overhead of opening a new
75 # connection for every query.
75 # connection for every query. Note that if a given server doesn't implement
76 # EDNS0 keepalive and uses an idle timeout shorter than this stubby will backoff
77 # from using that server because the server is always closing the connection.
78 # This can degrade performance for certain configurations so reducing the
79 # idle_timeout to below that of that lowest server value is recommended.
7680 idle_timeout: 10000
7781
7882 # Control the maximum number of connection failures that will be permitted
149153 # in milliseconds (which defaults to two and a half seconds).
150154 # trust_anchors_backoff_time: 2500
151155
152 # Specify the location of the installed trust anchor file (leave commented out
153 # for zero configuration DNSSEC)
156 # Specify the location of the installed trust anchor file to override the
157 # default location (see above)
154158 # dnssec_trust_anchors: "/etc/unbound/getdns-root.key"
155159
156160
175179 # value: Base64 encoded value of the sha256 fingerprint of the public
176180 # key
177181 # tls_port: Port for TLS (default is 853)
182
183 # To always use the DHCP resolvers provided by the local network in Opportunistic
184 # mode then
185 # 1) In the dns_transport_list after TLS add UDP then TCP
186 # 2) Change to tls_authentication: GETDNS_AUTHENTICATION_NONE
187 # 3) Remove all the upstream_recursive_servers listed below
188
178189 upstream_recursive_servers:
179190 ############################ DEFAULT UPSTREAMS ################################
180191 ####### IPv4 addresses ######
227238 # - address_data: 9.9.9.10
228239 # tls_auth_name: "dns.quad9.net"
229240 ## Cloudflare 1.1.1.1 and 1.0.0.1
241 ## (NOTE: recommend reducing idle_timeout to 9000 if using Coudflare)
230242 # - address_data: 1.1.1.1
231243 # tls_auth_name: "cloudflare-dns.com"
232244 # - address_data: 1.0.0.1
333345 # tls_pubkey_pinset:
334346 # - digest: "sha256"
335347 # value: sG6kj+XJToXwt1M6+9BeCz1SOj/1/mdZn56OZvCyZZc=
348 ## Foundation for Applied Privacy
349 # - address_data: 93.177.65.183
350 # tls_auth_name: "dot1.applied-privacy.net"
336351 ## # OARC. Note: this server currently doesn't support strict mode!
337352 ## - address_data: 184.105.193.78
338353 ## tls_auth_name: "tls-dns-u.odvr.dns-oarc.net"
350365 # - address_data: 2620:fe::10
351366 # tls_auth_name: "dns.quad9.net"
352367 ## Cloudflare servers
368 ## (NOTE: recommend reducing idle_timeout to 9000 if using Coudflare)
353369 # - address_data: 2606:4700:4700::1111
354370 # tls_auth_name: "cloudflare-dns.com"
355371 # - address_data: 2606:4700:4700::1001
450466 # tls_pubkey_pinset:
451467 # - digest: "sha256"
452468 # value: sG6kj+XJToXwt1M6+9BeCz1SOj/1/mdZn56OZvCyZZc=
469 ## Foundation for Applied Privacy
470 # - address_data: 2a03:4000:38:53c::2
471 # tls_auth_name: "dot1.applied-privacy.net"
453472 ## # OARC. Note: this server currently doesn't support strict mode!
454473 ## - address_data: 2620:ff:c000:0:1::64:25
455474 ## tls_auth_name: "tls-dns-u.odvr.dns-oarc.net"
529548 # tls_pubkey_pinset:
530549 # - digest: "sha256"
531550 # value: wTeXHM8aczvhRSi0cv2qOXkXInoDU+2C+M8MpRyT3OI=
551 ## Foundation for Applied Privacy
552 # - address_data: 93.177.65.183
553 # tls_port: 443
554 # tls_auth_name: "dot1.applied-privacy.net"
555 # - address_data: 2a03:4000:38:53c::2
556 # tls_port: 443
557 # tls_auth_name: "dot1.applied-privacy.net"
1010 ExecStart=/usr/bin/stubby
1111 AmbientCapabilities=CAP_NET_BIND_SERVICE
1212 CapabilityBoundingSet=CAP_NET_BIND_SERVICE
13 Restart=on-failure
14 RestartSec=1
1315
1416 [Install]
1517 WantedBy=multi-user.target
0 Stubby for Windows
1 --------------------
2 We consider Windows support for Stubby to be Beta at this time. It has been
3 tested on Windows 10 and Windows 8. There is limited support for Windows 7
4 (see below). User testing reports, bug reports and patches/pull requests are all
5 welcomed via github!
6 https://github.com/getdnsapi/stubby
7
8 Installation
9 --------------------
10 Download and run the installer.
11
12 This installs the following files in C:\Program Files\Stubby:
13 * README.txt containing these instructions
14 * stubby.exe binary
15 * stubby.yml configuration file
16 * getdns_query.exe tool for testing stubby
17 * Powershell scripts for modifying system resolvers:
18 * stubby_setdns_windows.ps1
19 * stubby_resetdns_windows.ps1
20 * Windows 7 versions of Powershell scripts
21 * stubby_setdns_windows7.ps1
22 * stubby_resetdns_windows7.ps1
23 * Scripts to enable Stubby to be configured as a Scheduled Task
24 * stubby.bat
25 * stubby.xml
26
27 NOTE: The 32bit build of Stubby is installed in C:\Program Files (x86)\Stubby on
28 64 bit systems so use that path below as required.
29
30
31 Version
32 --------
33 This version of the installer is version %INSTALLER_VERSION%. It is built from:
34 getdns version: %GETDNS_VERSION%
35 stubby version: %STUBBY_VERSION%
36 openssl version: %OPENSSL_VERSION%
37
38 Configuration
39 --------------------
40 It is recommended to use the default configuration file provided which will use
41 'Strict' privacy mode and spread the DNS queries among several of the current
42 DNS Privacy test servers. Note that this file contains both IPv4 and IPv6
43 addresses. It installed in "C:\Program Files\Stubby\stubby.yml"
44
45 More information on how to customise the configuration can be found here.
46 https://dnsprivacy.org/wiki/display/DP/Configuring+Stubby
47
48 Run Stubby
49 --------------------
50 Simply invoke Stubby on the command line from a command prompt window (To get a
51 command prompt go to the Windows search box and type 'cmd' and then choose the
52 'Command prompt' option)
53
54 > "C:\Program Files\Stubby\stubby.exe" -l
55
56 The -l flag enables full logging. Alternatively a specific logging level can be
57 controlled by using the -v flag (run '"C:\Program Files\Stubby\stubby.exe" - h'
58 for details of available levels).
59
60 A different location for the configuration file can be specified by adding:
61 -C "<full path to stubby.yml>"
62
63 We are working on support for running stubby as a service on Windows 10
64
65 Test Stubby
66 --------------------
67 A quick test can be done by using getdns_query (or your favourite DNS tool) on
68 the loopback address:
69
70 > "C:\Program Files\Stubby\getdns_query" -s @127.0.0.1 www.example.com
71
72 You should see a status of GETDNS_RESPSTATUS_GOOD and and rcode of
73 GETDNS_RCODE_NOERROR in the getdns_query output. You should also see a
74 connection being made in the stubby logs.
75
76 Modify your upstream resolvers (Windows 8 and 10)
77 ----------------------------------------
78 *Once this change is made all your DNS queries will be re-directed to Stubby and
79 sent over TLS!*
80 (You may need to restart some applications to have them pick up the network
81 settings).
82
83
84 For Stubby to re-send outgoing DNS queries over TLS the recursive resolvers
85 configured on your machine must be changed to send all the local queries to the
86 loopback interface on which Stubby is listening. It might be useful to note your
87 existing default nameservers before making this change!
88
89 To change nameservers:
90 * From Windows search box type 'cmd' and on the 'Command prompt' option that
91 appears right click and select 'run as Administrator'
92 * In the command prompt window that appears type
93
94 >PowerShell -ExecutionPolicy bypass -file "C:\Program Files\Stubby\stubby_setdns_windows.ps1"
95
96 to switch the system DNS resolvers to use Stubby.
97
98 * Use the same command but with
99 "C:\Program Files\Stubby\stubby_resetdns_windows.ps1" instead to switch back to
100 the default DNS nameservers.
101
102 You can monitor the DNS traffic using Wireshark watching on port 853.
103 If you encounter problems reverse this change to restore your default settings
104 (no DNS Privacy).
105
106 Modify your upstream resolvers (Windows 7)
107 ----------------------------------------
108 Follow the procedure above, but use the scripts:
109
110 * C:\Program Files\Stubby\stubby_setdns_windows7.ps1 and
111 * C:\Program Files\Stubby\stubby_resetdns_windows7.ps1
112
113 WARNING: These scripts can only update DNS servers on the IPv4 service. IPv6
114 will still use the default DNS servers, sending queries in clear text so one
115 option is to disable IPv6.
116
117 Create a Scheduled Task
118 ----------------------
119 If you want Stubby to always start when you boot your system, you can create
120 a Scheduled task for this. A template for the task is provided: to create the
121 task just run
122
123 schtasks /create /tn Stubby /XML "C:\Program Files\Stubby\stubby.xml" /RU <you_user_name>
124
125
126 Known Issues
127 --------------------
128 * We are aware of occasional issues when Windows sleeps and resumes when Stubby
129 must be restarted to work correctly.
130 * The help command of stubby.exe shows the wrong path for the installed
131 configuration file. An issue has been opened for this.
132 * The installer currently overwrites the stubby.yml file so if changes have been
133 made a backup should be created before upgrading
134
135
136 Building the Windows Installer
137 --------------------------------
138
139 The Visual Studio solution provided in the stubby source code to build the
140 installer requires the Wix Toolset designer plugin (wixtoolset.org).
141
142 It assumes stubby was built using MinGW64 in the following way:
143
144 $ git clone https://github.com/getdnsapi/getdns.git
145 $ cd getdns/
146 $ git submodule update --init
147 $ libtoolize -ci
148 $ autoreconf -fi
149 $ mkdir build
150 $ cd build
151 $ CFLAGS="-O2" LDFLAGS="-Wl,-static -lpthread" ../configure --host=x86_64-w64-mingw32 --without-libidn --with-ssl=/mingw64 --with-libyaml=/mingw64 --enable-stub-only --with-stubby --disable-shared
152 $ make
153 $ make install
154
0 "%~dp0stubby.exe" -C "%~dp0stubby.yml" -l
0 <?xml version="1.0" encoding="UTF-16"?>
1 <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
2 <Triggers>
3 <BootTrigger>
4 <Enabled>true</Enabled>
5 </BootTrigger>
6 </Triggers>
7 <Principals>
8 <Principal id="Author">
9 <LogonType>Password</LogonType>
10 <RunLevel>LeastPrivilege</RunLevel>
11 </Principal>
12 </Principals>
13 <Settings>
14 <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
15 <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
16 <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
17 <AllowHardTerminate>true</AllowHardTerminate>
18 <StartWhenAvailable>false</StartWhenAvailable>
19 <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
20 <IdleSettings>
21 <StopOnIdleEnd>true</StopOnIdleEnd>
22 <RestartOnIdle>false</RestartOnIdle>
23 </IdleSettings>
24 <AllowStartOnDemand>true</AllowStartOnDemand>
25 <Enabled>true</Enabled>
26 <Hidden>true</Hidden>
27 <RunOnlyIfIdle>false</RunOnlyIfIdle>
28 <WakeToRun>false</WakeToRun>
29 <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
30 <Priority>7</Priority>
31 </Settings>
32 <Actions Context="Author">
33 <Exec>
34 <Command>"%PROGRAMFILES%\Stubby\stubby.bat"</Command>
35 </Exec>
36 </Actions>
37 </Task>
0 Get-NetAdapter -Physical | ForEach-Object {
1 $ifname = $_.Name
2 Write-Host "Resetting DNS servers on interface $ifname - the system will use default DNS service."
3 set-dnsclientserveraddress $ifname -ResetServerAddresses
4 $new_value = get-dnsclientserveraddress $ifname
5 Write-Output -InputObjext $new_value
6 }
0 #Requires -RunAsAdministrator
1 #Requires -Version 2
2
3 #Get enabled/connected adapters (same as 'Get-NetAdapter -Physical')
4 $NetworkAdapters = Get-WmiObject -Class 'Win32_NetworkAdapterConfiguration' -Filter {IPEnabled = 1}
5
6 #Verbose output so the user gets to know the current configuration
7 Write-Output -InputObject 'Found Adapters:'
8 Write-Output -InputObject $NetworkAdapters | Format-Table -Property IPAddress,DefaultIPGateway,DNSServerSearchOrder,Description
9
10 Write-Output -InputObject 'Resetting DNS servers - the system will use default DNS service..'
11
12 #Change the DNS entry for each found network adapter
13 foreach ($NetworkAdapter in $NetworkAdapters) {
14 $result = $NetworkAdapter.SetDNSServerSearchOrder()
15 }
16
17 #Get enabled/connected adapters (same as 'Get-NetAdapter -Physical')
18 $NetworkAdapters = Get-WmiObject -Class 'Win32_NetworkAdapterConfiguration' -Filter {IPEnabled = 1}
19 Write-Output -InputObject 'Updated Adapters:'
20 Write-Output -InputObject $NetworkAdapters | Format-Table -Property IPAddress,DefaultIPGateway,DNSServerSearchOrder,Description
21
22 Write-Output -InputObject ''
23 Write-Output -InputObject '############################## WARNING ##############################'
24 Write-Output -InputObject 'Warning: this script can only update IPv4 addresses for DNS servers.'
25 Write-Output -InputObject 'Queries sent over IPv6 will still use the default DNS servers and'
26 Write-Output -InputObject 'send DNS queries in clear text. You may want to disable IPv6!!!'
27 Write-Output -InputObject '############################## WARNING ##############################'
0 Get-NetAdapter -Physical | ForEach-Object {
1 $ifname = $_.Name
2 Write-Host "Setting DNS servers on interface $ifname to use local resolver - the system will use Stubby if it is running"
3 set-dnsclientserveraddress $ifname -ServerAddresses ("127.0.0.1","0::1")
4 $new_value = get-dnsclientserveraddress $ifname
5 Write-Output -InputObjext $new_value
6 }
0 #Requires -RunAsAdministrator
1 #Requires -Version 2
2 #Set Stubby Address
3 $StubbyDNS = '127.0.0.1'
4
5 #Get enabled/connected adapters (same as 'Get-NetAdapter -Physical')
6 $NetworkAdapters = Get-WmiObject -Class 'Win32_NetworkAdapterConfiguration' -Filter {IPEnabled = 1}
7
8 #Verbose output so the user gets to know the current configuration
9 Write-Output -InputObject 'Found Adapters:'
10 Write-Output -InputObject $NetworkAdapters | Format-Table -Property IPAddress,DefaultIPGateway,DNSServerSearchOrder,Description
11
12 Write-Output -InputObject 'Setting DNS entries to use Stubby for the found Network Adapters...'
13
14 #Change the DNS entry for each found network adapter
15 foreach ($NetworkAdapter in $NetworkAdapters) {
16 $result = $NetworkAdapter.SetDNSServerSearchOrder($StubbyDNS)
17 }
18
19 #Get enabled/connected adapters (same as 'Get-NetAdapter -Physical')
20 $NetworkAdapters = Get-WmiObject -Class 'Win32_NetworkAdapterConfiguration' -Filter {IPEnabled = 1}
21 Write-Output -InputObject 'Updated Adapters:'
22 Write-Output -InputObject $NetworkAdapters | Format-Table -Property IPAddress,DefaultIPGateway,DNSServerSearchOrder,Description
23
24 Write-Output -InputObject ''
25 Write-Output -InputObject '############################## WARNING ##############################'
26 Write-Output -InputObject 'Warning: this script can only update IPv4 addresses for DNS servers.'
27 Write-Output -InputObject 'Queries sent over IPv6 will still use the default DNS servers and'
28 Write-Output -InputObject 'send DNS queries in clear text. You may want to disable IPv6!!!'
29 Write-Output -InputObject '############################## WARNING ##############################'
0 <?xml version="1.0" encoding="UTF-8"?>
1 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
2 <Product Id="*" Name="Stubby" Language="1033" Version="0.0.2" Manufacturer="Sinodun Internet Technologies Ltd." UpgradeCode="af30ca25-b1c5-404b-b1f1-d988dc7ca1a7">
3 <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64" />
4
5 <MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
6 <MediaTemplate EmbedCab="yes" />
7
8 <Feature Id="ProductFeature" Title="Stubby" Level="1">
9 <ComponentGroupRef Id="ProductComponents" />
10 </Feature>
11 </Product>
12
13 <Fragment>
14 <Directory Id="TARGETDIR" Name="SourceDir">
15 <Directory Id="ProgramFiles64Folder">
16 <Directory Id="INSTALLFOLDER" Name="Stubby" />
17 </Directory>
18 </Directory>
19 </Fragment>
20
21 <Fragment>
22 <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
23 <Component Id="stubby.exe" Win64="yes">
24 <File Id="stubbby.exe" Source="c:/msys64/mingw64/bin/stubby.exe" KeyPath="yes" Checksum="yes"/>
25 </Component>
26 <Component Id="getdns_query.exe" Win64="yes">
27 <File Id="getdns_query.exe" Source="c:/msys64/mingw64/bin/getdns_query.exe" KeyPath="yes" Checksum="yes"/>
28 </Component>
29 <Component Id="stubby.yml" Win64="yes">
30 <File Id="stubbby.yml" Source="c:/msys64/mingw64/etc/stubby/stubby.yml" KeyPath="yes" Checksum="yes" />
31 </Component>
32 <Component Id="README.txt" Win64="yes">
33 <File Id="README.txt" Source="../../../README.txt" KeyPath="yes" Checksum="yes"/>
34 </Component>
35 <Component Id="stubby_setdns_windows.ps1" Win64="yes">
36 <File Id="stubby_setdns_windows.ps1" Source="../../../stubby_setdns_windows.ps1" KeyPath="yes" Checksum="yes"/>
37 </Component>
38 <Component Id="stubby_resetdns_windows.ps1" Win64="yes">
39 <File Id="stubby_resetdns_windows.ps1" Source="../../../stubby_resetdns_windows.ps1" KeyPath="yes" Checksum="yes"/>
40 </Component>
41 <Component Id="stubby_setdns_windows7.ps1" Win64="yes">
42 <File Id="stubby_setdns_windows7.ps1" Source="../../../stubby_setdns_windows7.ps1" KeyPath="yes" Checksum="yes"/>
43 </Component>
44 <Component Id="stubby_resetdns_windows7.ps1" Win64="yes">
45 <File Id="stubby_resetdns_windows7.ps1" Source="../../../stubby_resetdns_windows7.ps1" KeyPath="yes" Checksum="yes"/>
46 </Component>
47 <Component Id="stubby.bat" Win64="yes">
48 <File Id="stubby.bat" Source="../../../stubby.bat" KeyPath="yes" Checksum="yes"/>
49 </Component>
50 <Component Id="stubby.xml" Win64="yes">
51 <File Id="stubby.xml" Source="../../../stubby.xml" KeyPath="yes" Checksum="yes"/>
52 </Component>
53 </ComponentGroup>
54 </Fragment>
55 </Wix>
0 <?xml version="1.0" encoding="utf-8"?>
1 <Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
5 <ProductVersion>3.10</ProductVersion>
6 <ProjectGuid>9e7edd0f-8fae-4a89-9b7a-78c8694bf740</ProjectGuid>
7 <SchemaVersion>2.0</SchemaVersion>
8 <OutputName>Stubby</OutputName>
9 <OutputType>Package</OutputType>
10 </PropertyGroup>
11 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
12 <OutputPath>bin\$(Configuration)\</OutputPath>
13 <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
14 <DefineConstants>Debug</DefineConstants>
15 </PropertyGroup>
16 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
17 <OutputPath>bin\$(Configuration)\</OutputPath>
18 <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
19 </PropertyGroup>
20 <ItemGroup>
21 <Compile Include="Product.wxs" />
22 </ItemGroup>
23 <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
24 <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
25 <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
26 <Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
27 </Target>
28 <!--
29 To modify your build process, add your task inside one of the targets below and uncomment it.
30 Other similar extension points exist, see Wix.targets.
31 <Target Name="BeforeBuild">
32 </Target>
33 <Target Name="AfterBuild">
34 </Target>
35 -->
36 </Project>
0 
1 Microsoft Visual Studio Solution File, Format Version 12.00
2 # Visual Studio 15
3 VisualStudioVersion = 15.0.26730.15
4 MinimumVisualStudioVersion = 10.0.40219.1
5 Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "StubbyPkg", "StubbyPkg\StubbyPkg.wixproj", "{9E7EDD0F-8FAE-4A89-9B7A-78C8694BF740}"
6 EndProject
7 Global
8 GlobalSection(SolutionConfigurationPlatforms) = preSolution
9 Debug|x64 = Debug|x64
10 Debug|x86 = Debug|x86
11 Release|x64 = Release|x64
12 Release|x86 = Release|x86
13 EndGlobalSection
14 GlobalSection(ProjectConfigurationPlatforms) = postSolution
15 {9E7EDD0F-8FAE-4A89-9B7A-78C8694BF740}.Debug|x64.ActiveCfg = Debug|x86
16 {9E7EDD0F-8FAE-4A89-9B7A-78C8694BF740}.Debug|x86.ActiveCfg = Debug|x86
17 {9E7EDD0F-8FAE-4A89-9B7A-78C8694BF740}.Debug|x86.Build.0 = Debug|x86
18 {9E7EDD0F-8FAE-4A89-9B7A-78C8694BF740}.Release|x64.ActiveCfg = Release|x86
19 {9E7EDD0F-8FAE-4A89-9B7A-78C8694BF740}.Release|x64.Build.0 = Release|x86
20 {9E7EDD0F-8FAE-4A89-9B7A-78C8694BF740}.Release|x86.ActiveCfg = Release|x86
21 {9E7EDD0F-8FAE-4A89-9B7A-78C8694BF740}.Release|x86.Build.0 = Release|x86
22 EndGlobalSection
23 GlobalSection(SolutionProperties) = preSolution
24 HideSolutionNode = FALSE
25 EndGlobalSection
26 GlobalSection(ExtensibilityGlobals) = postSolution
27 SolutionGuid = {D4F2172C-3206-4F3C-AEA6-5C84D68D99BF}
28 EndGlobalSection
29 EndGlobal