diff options
Diffstat (limited to '')
69 files changed, 6022 insertions, 2828 deletions
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index e624171..6943534 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -5,7 +5,7 @@ on: branches: [ "*" ] tags: [ "*" ] pull_request: - branches: [ "trunk" ] + branches: [ "trunk", "1.7.x" ] env: MARGS: "-j2" @@ -17,10 +17,18 @@ jobs: matrix: include: - name: Default + # Check default shm decision logic for Linux: + config-output: APR_USE_SHMEM_MMAP_SHM APR_USE_SHMEM_MMAP_ANON - name: Static config: --enable-static - name: Maintainer-mode config: --enable-maintainer-mode + - name: Named SHM - SysV, Maintainer-mode + config: --enable-maintainer-mode --enable-sysv-shm + config-output: APR_USE_SHMEM_SHMGET + - name: Named SHM - Classic mmap, Maintainer-mode + config: --enable-maintainer-mode ac_cv_func_shm_open=no ac_cv_func_shmget=no + config-output: APR_USE_SHMEM_MMAP_TMP - name: Pool-debug config: --enable-pool-debug - name: Pool-debug, maintainer-mode @@ -49,12 +57,20 @@ jobs: steps: - name: Install prerequisites run: sudo apt-get install libtool libtool-bin - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + # https://github.com/actions/runner-images/issues/9491#issuecomment-1989718917 + - name: Workaround ASAN issue in Ubuntu 22.04 runners + run: sudo sysctl vm.mmap_rnd_bits=28 - name: buildconf run: ./buildconf - name: configure - run: ./configure ${{ matrix.config }} + run: ./configure --prefix=/tmp/apr ${{ matrix.config }} + - if: ${{ matrix.config-output != '' }} + name: check for expected configure output ${{ matrix.config-output }} + run: for var in ${{ matrix.config-output }}; do grep "^#define *${var} *1" include/apr.h; done - name: make run: make $MARGS - - name: make check + - name: install + run: make install + - name: check run: make check diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 8647702..1d70a89 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -18,11 +18,14 @@ jobs: os: [ "macos-latest" ] runs-on: ${{ matrix.os }} + timeout-minutes: 15 env: NOTEST_CFLAGS: ${{ matrix.notest-cflags }} name: ${{ matrix.name }} steps: - - uses: actions/checkout@v3 + - name: Install prerequisites + run: brew install libtool autoconf make bash + - uses: actions/checkout@v4 - name: buildconf run: ./buildconf - name: configure diff --git a/.github/workflows/windows-vcpkg.yml b/.github/workflows/windows-vcpkg.yml new file mode 100644 index 0000000..80062e2 --- /dev/null +++ b/.github/workflows/windows-vcpkg.yml @@ -0,0 +1,44 @@ +name: Vcpkg (Windows)
+
+on:
+ push:
+ branches: [ "1.7.x*" ]
+
+jobs:
+ build:
+ strategy:
+ matrix:
+ os: [windows-latest]
+ triplet:
+ - x64-windows
+ - x64-windows-static
+ - x64-windows-static-md
+ - x86-windows
+ - x86-windows-static
+ port:
+ - apr
+ - apr[core]
+ - apr[private-headers]
+ fail-fast: false
+
+ name: "${{ matrix.port }}:${{ matrix.triplet }} on ${{ matrix.os }}"
+ # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
+ # You can convert this to a matrix build if you need cross-platform coverage.
+ # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
+ runs-on: ${{ matrix.os }}
+
+ env:
+ VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
+
+ steps:
+ - name: Export GitHub Actions cache environment variables
+ uses: actions/github-script@v7
+ with:
+ script: |
+ core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
+
+ - uses: actions/checkout@v4
+
+ - name: Vcpkg Install
+ run: C:\vcpkg\vcpkg.exe install ${{ matrix.port }} --head --overlay-ports ${{ github.workspace }}\build\vcpkg --triplet ${{ matrix.triplet }} --enforce-port-checks
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 96b303f..97d369e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -15,22 +15,23 @@ jobs: build-type: [Debug, Release] generator: [ "Visual Studio 17 2022" ] arch: [ "Win32", "x64" ] - toolset: [ "v143", "v142", "v141" ] + toolset: [ "v143", "v142" ] + test-static: [ "ON", "OFF" ] fail-fast: false - name: "MSVC ${{ matrix.toolset }} ${{ matrix.arch }} [${{ matrix.build-type }}] on ${{ matrix.os }}" + name: "MSVC ${{ matrix.toolset }} ${{ matrix.arch }} [${{ matrix.build-type }}] test-static=${{ matrix.test-static }} on ${{ matrix.os }}" # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. # You can convert this to a matrix build if you need cross-platform coverage. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DAPR_BUILD_TESTAPR=ON -G "${{ matrix.generator }}" -A ${{ matrix.arch }} -T ${{ matrix.toolset }} + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DAPR_BUILD_TESTAPR=ON -DTEST_STATIC_LIBS=${{ matrix.test-static }} -G "${{ matrix.generator }}" -A ${{ matrix.arch }} -T ${{ matrix.toolset }} - name: Build # Build your program with the given configuration @@ -1,4 +1,67 @@ -*- coding: utf-8 -*- +Changes for APR 1.7.5 + + *) Unix: Implement apr_shm_perms_set() for the "POSIX shm_open()" + and "classic mmap" shared memory implementations. [Joe Orton, + Ruediger Pluem] + + *) Fix missing ';' for XML/HTML hex entities from apr_escape_entity(). + [Yann Ylavic] + + *) Fix crash in apr_pool_create() with --enable-pool-debug=all|owner. + [Yann Ylavic] + + *) Improve platform detection by updating config.guess and config.sub. + [Rainer Jung] + + *) CMake: Add support for CMAKE_WARNING_AS_ERROR. [Ivan Zhakov] + + *) CMake: Enable support for MSVC runtime library selection by abstraction. + [Ivan Zhakov] + + *) CMake: Export installed targets (libapr-1, apr-1, libaprapp-1, aprapp-1) + to apr:: namespace. [Ivan Zhakov] + +Changes for APR 1.7.4 + + *) Fix a regression where writing to a file opened with both APR_FOPEN_APPEND + and APR_FOPEN_BUFFERED did not properly append the data on Windows. + (This regression was introduced in APR 1.7.3) [Evgeny Kotkov] + +Changes for APR 1.7.3 + + *) apr-1-config: Fix crosscompiling detection in apr-1-config. PR 66510 + [Ruediger Pluem] + + *) configure: Add --enable-sysv-shm to use SysV shared memory (shmget) if + available. [Ruediger Pluem] + + *) apr_socket_sendfile: Use WSAIoctl() to get TransmitFile function + pointer on Windows. [Ivan Zhakov] + + *) apr_dir_read: Do not request short file names on Windows 7 + and later. [Ivan Zhakov] + + *) apr_file_gets: Optimize for buffered files on Windows. + [Evgeny Kotkov] + + *) Fix a deadlock when writing to locked files opened with APR_FOPEN_APPEND + on Windows. PR 50058. [Evgeny Kotkov] + + *) Don't seek to the end when opening files with APR_FOPEN_APPEND on Windows. + [Evgeny Kotkov] + + *) apr_file_write: Optimize large writes to buffered files on Windows. + [Evgeny Kotkov] + + *) apr_file_read: Optimize large reads from buffered files on Windows. + [Evgeny Kotkov] + +Changes for APR 1.7.2 + + *) Correct a packaging issue in 1.7.1. The contents of the release were + correct, but the top level directory was misnamed. + Changes for APR 1.7.1 *) SECURITY: CVE-2022-24963 (cve.mitre.org) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b9c5d8..d16eec6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,14 +21,45 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(APR C) +# Enable support for MSVC runtime library selection by abstraction +# if supported by CMake. +IF(POLICY CMP0091) + CMAKE_POLICY(SET CMP0091 NEW) +ENDIF() + +# Add simple support CMAKE_WARNING_AS_ERROR if CMake doesn't +# support it. +IF (CMAKE_VERSION VERSION_LESS 3.24) + IF(CMAKE_WARNING_AS_ERROR AND MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") + ENDIF() +ENDIF() + +SET(apr_name apr-1) +SET(apr_libname libapr-1) + OPTION(APR_INSTALL_PRIVATE_H "Install selected private .h files (for httpd)" OFF) OPTION(APR_HAVE_IPV6 "IPv6 support" ON) OPTION(INSTALL_PDB "Install .pdb files (if generated)" ON) OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) +OPTION(APR_BUILD_SHARED "Build shared libraries" ON) +OPTION(APR_BUILD_STATIC "Build static libraries" ON) OPTION(TEST_STATIC_LIBS "Test programs use APR static libraries instead of shared libraries?" OFF) SET(MIN_WINDOWS_VER "Vista" CACHE STRING "Minimum Windows version") +SET(APR_INSTALL_BIN_DIR "bin" CACHE STRING "Install subdirectory for binary files") +SET(APR_INSTALL_LIB_DIR "lib" CACHE STRING "Install subdirectory for library files") +SET(APR_INSTALL_INCLUDE_DIR "include" CACHE STRING "Install subdirectory for include files") + +IF(NOT APR_BUILD_SHARED AND NOT APR_BUILD_STATIC) + MESSAGE(FATAL_ERROR "Both APR_BUILD_SHARED and APR_BUILD_STATIC have been disabled") +ENDIF() + +IF(NOT APR_BUILD_STATIC AND TEST_STATIC_LIBS) + MESSAGE(FATAL_ERROR "APR_BUILD_STATIC has been disabled, but TEST_STATIC_LIBS is enabled") +ENDIF() + # create 1-or-0 representation of feature tests for apr.h SET(apr_have_ipv6_10 0) @@ -47,6 +78,13 @@ ELSE() SET(win32_winnt_str ${MIN_WINDOWS_VER}) ENDIF() +# Read current version. +FILE(STRINGS include/apr_version.h VERSION_STRINGS REGEX "#define (APR_MAJOR_VERSION|APR_MINOR_VERSION|APR_PATCH_VERSION)") + +STRING(REGEX REPLACE ".*#define APR_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" APR_MAJOR_VERSION ${VERSION_STRINGS}) +STRING(REGEX REPLACE ".*#define APR_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" APR_MINOR_VERSION ${VERSION_STRINGS}) +STRING(REGEX REPLACE ".*#define APR_PATCH_VERSION[ \t]+([0-9]+).*" "\\1" APR_PATCH_VERSION ${VERSION_STRINGS}) + CONFIGURE_FILE(include/apr.hwc ${PROJECT_BINARY_DIR}/apr.h) @@ -71,16 +109,15 @@ ADD_CUSTOM_TARGET( # you've generated apr.h before using a different build SET(APR_INCLUDE_DIRECTORIES - ${PROJECT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/arch/win32 - ${CMAKE_CURRENT_SOURCE_DIR}/include/arch/unix - ${CMAKE_CURRENT_SOURCE_DIR}/include/private + $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}> + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/arch/win32> + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/arch/unix> + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/private> ) SET(APR_SYSTEM_LIBS ws2_32 - mswsock rpcrt4 ) @@ -261,28 +298,62 @@ SET(APR_TEST_SUITES SET(install_targets) SET(install_bin_pdb) +IF (MSVC) + # Ignore Microsoft's interpretation of secure development + # and the POSIX string handling API + ADD_COMPILE_DEFINITIONS(_CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_WARNINGS) +ENDIF() + # libapr-1 is shared, apr-1 is static -ADD_LIBRARY(libapr-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libapr.rc) -SET(install_targets ${install_targets} libapr-1) -SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libapr-1.pdb) -TARGET_LINK_LIBRARIES(libapr-1 ${APR_SYSTEM_LIBS}) -SET_TARGET_PROPERTIES(libapr-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_EXPORT;WINNT") -ADD_DEPENDENCIES(libapr-1 test_char_header) - -ADD_LIBRARY(apr-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED}) -SET(install_targets ${install_targets} apr-1) -TARGET_LINK_LIBRARIES(apr-1 ${APR_SYSTEM_LIBS}) -SET_TARGET_PROPERTIES(apr-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;WINNT") -ADD_DEPENDENCIES(apr-1 test_char_header) +IF (APR_BUILD_SHARED) + ADD_LIBRARY(${apr_libname} SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libapr.rc) + LIST(APPEND install_targets ${apr_libname}) + LIST(APPEND install_bin_pdb ${PROJECT_BINARY_DIR}/${apr_libname}.pdb) + TARGET_LINK_LIBRARIES(${apr_libname} + PRIVATE ${APR_SYSTEM_LIBS}) + TARGET_COMPILE_DEFINITIONS(${apr_libname} + PRIVATE "APR_DECLARE_EXPORT;WINNT" + INTERFACE "APR_DECLARE_IMPORT;WINNT") + TARGET_INCLUDE_DIRECTORIES(${apr_libname} + PRIVATE ${APR_INCLUDE_DIRECTORIES} + INTERFACE $<INSTALL_INTERFACE:${APR_INSTALL_INCLUDE_DIR}> ${APR_INCLUDE_DIRECTORIES} + ) + ADD_DEPENDENCIES(${apr_libname} test_char_header) +ENDIF() + +IF (APR_BUILD_STATIC) + ADD_LIBRARY(${apr_name} STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED}) + LIST(APPEND install_targets ${apr_name}) + TARGET_LINK_LIBRARIES(${apr_name} + PRIVATE ${APR_SYSTEM_LIBS}) + TARGET_COMPILE_DEFINITIONS(${apr_name} + PRIVATE "APR_DECLARE_STATIC;WINNT" + INTERFACE "APR_DECLARE_STATIC;WINNT") + TARGET_INCLUDE_DIRECTORIES(${apr_name} + PRIVATE ${APR_INCLUDE_DIRECTORIES} + INTERFACE $<INSTALL_INTERFACE:${APR_INSTALL_INCLUDE_DIR}> ${APR_INCLUDE_DIRECTORIES} + ) + ADD_DEPENDENCIES(${apr_name} test_char_header) +ENDIF() # libaprapp-1 and aprapp-1 are static -ADD_LIBRARY(libaprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED}) -SET(install_targets ${install_targets} libaprapp-1) -SET_TARGET_PROPERTIES(libaprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_APP;WINNT") +IF (APR_BUILD_SHARED) + ADD_LIBRARY(libaprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED}) + LIST(APPEND install_targets libaprapp-1) + SET_TARGET_PROPERTIES(libaprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_APP;WINNT") + TARGET_INCLUDE_DIRECTORIES(libaprapp-1 + PRIVATE ${APR_INCLUDE_DIRECTORIES} + ) +ENDIF() -ADD_LIBRARY(aprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED}) -SET(install_targets ${install_targets} aprapp-1) -SET_TARGET_PROPERTIES(aprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_APP;WINNT") +IF (APR_BUILD_STATIC) + ADD_LIBRARY(aprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED}) + LIST(APPEND install_targets aprapp-1) + SET_TARGET_PROPERTIES(aprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_APP;WINNT") + TARGET_INCLUDE_DIRECTORIES(aprapp-1 + PRIVATE ${APR_INCLUDE_DIRECTORIES} + ) +ENDIF() IF(APR_BUILD_TESTAPR) ENABLE_TESTING() @@ -300,21 +371,16 @@ IF(APR_BUILD_TESTAPR) ${PROJECT_BINARY_DIR}/data/mmap_datafile.txt) IF(TEST_STATIC_LIBS) - SET(whichapr apr-1) + SET(whichapr ${apr_name}) SET(whichaprapp aprapp-1) - SET(apiflag -DAPR_DECLARE_STATIC) ELSE() - SET(whichapr libapr-1) + SET(whichapr ${apr_libname}) SET(whichaprapp libaprapp-1) - SET(apiflag) ENDIF() ADD_EXECUTABLE(testapp test/testapp.c) - TARGET_LINK_LIBRARIES(testapp ${whichapr} ${whichaprapp} ${APR_SYSTEM_LIBS}) + TARGET_LINK_LIBRARIES(testapp ${whichapr} ${whichaprapp}) SET_TARGET_PROPERTIES(testapp PROPERTIES LINK_FLAGS /entry:wmainCRTStartup) - IF(apiflag) - SET_TARGET_PROPERTIES(testapp PROPERTIES COMPILE_FLAGS ${apiflag}) - ENDIF() ADD_TEST(NAME testapp COMMAND testapp) SET (APR_TEST_SOURCES @@ -327,27 +393,21 @@ IF(APR_BUILD_TESTAPR) ENDFOREACH() ADD_EXECUTABLE(testall ${APR_TEST_SOURCES}) - TARGET_LINK_LIBRARIES(testall ${whichapr} ${APR_SYSTEM_LIBS}) + TARGET_LINK_LIBRARIES(testall ${whichapr} ws2_32.lib) SET_TARGET_PROPERTIES(testall PROPERTIES COMPILE_DEFINITIONS "BINPATH=$<TARGET_FILE_DIR:testall>") - IF(apiflag) - SET_TARGET_PROPERTIES(testall PROPERTIES COMPILE_FLAGS ${apiflag}) - ENDIF() FOREACH(test ${APR_TEST_SUITES}) ADD_TEST(NAME ${test} COMMAND testall -v ${test}) ENDFOREACH() ADD_LIBRARY(mod_test MODULE test/mod_test.c) - TARGET_LINK_LIBRARIES(mod_test ${whichapr} ${APR_SYSTEM_LIBS}) + TARGET_LINK_LIBRARIES(mod_test ${whichapr}) SET_PROPERTY(TARGET mod_test APPEND PROPERTY LINK_FLAGS /export:print_hello) # nasty work-around for difficulties adding more than one additional flag # (they get joined in a bad way behind the scenes) GET_PROPERTY(link_flags TARGET mod_test PROPERTY LINK_FLAGS) SET(link_flags "${link_flags} /export:count_reps") SET_TARGET_PROPERTIES(mod_test PROPERTIES LINK_FLAGS ${link_flags}) - IF(apiflag) - SET_TARGET_PROPERTIES(mod_test PROPERTIES COMPILE_FLAGS ${apiflag}) - ENDIF() # Build all the single-source executable files with no special build # requirements. @@ -371,11 +431,10 @@ IF(APR_BUILD_TESTAPR) FOREACH(sourcefile ${single_source_programs}) STRING(REGEX REPLACE ".*/([^\\]+)\\.c" "\\1" proggie ${sourcefile}) ADD_EXECUTABLE(${proggie} ${sourcefile}) - TARGET_LINK_LIBRARIES(${proggie} ${whichapr} ${APR_SYSTEM_LIBS}) + TARGET_LINK_LIBRARIES(${proggie} ${whichapr}) SET_TARGET_PROPERTIES(${proggie} PROPERTIES COMPILE_DEFINITIONS "BINPATH=$<TARGET_FILE_DIR:${proggie}>") - IF(apiflag) - SET_TARGET_PROPERTIES(${proggie} PROPERTIES COMPILE_FLAGS ${apiflag}) - ENDIF() + + ADD_DEPENDENCIES(testall ${proggie}) ENDFOREACH() # Add tests for programs that run by themselves with no arguments. @@ -401,20 +460,38 @@ IF(APR_BUILD_TESTAPR) ENDIF (APR_BUILD_TESTAPR) # Installation +INCLUDE(CMakePackageConfigHelpers) + +string(TOLOWER "${PROJECT_NAME}" project_name_lower) -INSTALL(TARGETS ${install_targets} - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - ) +write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${project_name_lower}-config-version.cmake" + VERSION ${APR_MAJOR_VERSION}.${APR_MINOR_VERSION}.${APR_PATCH_VERSION} + COMPATIBILITY SameMajorVersion +) + +INSTALL(TARGETS ${install_targets} EXPORT apr-config + RUNTIME DESTINATION ${APR_INSTALL_BIN_DIR} + LIBRARY DESTINATION ${APR_INSTALL_LIB_DIR} + ARCHIVE DESTINATION ${APR_INSTALL_LIB_DIR} +) + +INSTALL(EXPORT apr-config + NAMESPACE apr:: + DESTINATION "lib/cmake/${project_name_lower}" + FILE "${project_name_lower}-config.cmake" +) + +INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${project_name_lower}-config-version.cmake" + DESTINATION "lib/cmake/${project_name_lower}" +) IF(INSTALL_PDB) INSTALL(FILES ${install_bin_pdb} - DESTINATION bin + DESTINATION ${APR_INSTALL_BIN_DIR} CONFIGURATIONS RelWithDebInfo Debug) ENDIF() -INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include) +INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION ${APR_INSTALL_INCLUDE_DIR}) IF(APR_INSTALL_PRIVATE_H) # Kludges for unexpected dependencies of httpd 2.x, not installed by default SET(APR_PRIVATE_H_FOR_HTTPD @@ -423,8 +500,8 @@ IF(APR_INSTALL_PRIVATE_H) include/arch/win32/apr_arch_utf8.h include/arch/win32/apr_private.h ) - INSTALL(FILES ${APR_PRIVATE_H_FOR_HTTPD} DESTINATION include/arch/win32) - INSTALL(FILES include/arch/apr_private_common.h DESTINATION include/arch) + INSTALL(FILES ${APR_PRIVATE_H_FOR_HTTPD} DESTINATION ${APR_INSTALL_INCLUDE_DIR}/arch/win32) + INSTALL(FILES include/arch/apr_private_common.h DESTINATION ${APR_INSTALL_INCLUDE_DIR}/arch) ENDIF() STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype) @@ -436,9 +513,14 @@ MESSAGE(STATUS "") MESSAGE(STATUS " Build type ...................... : ${CMAKE_BUILD_TYPE}") MESSAGE(STATUS " Install .pdb (if available)...... : ${INSTALL_PDB}") MESSAGE(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}") +MESSAGE(STATUS " Directory for binary files .... : PREFIX/${APR_INSTALL_BIN_DIR}") +MESSAGE(STATUS " Directory for library files ... : PREFIX/${APR_INSTALL_LIB_DIR}") +MESSAGE(STATUS " Directory for include files ... : PREFIX/${APR_INSTALL_INCLUDE_DIR}") MESSAGE(STATUS " C compiler ...................... : ${CMAKE_C_COMPILER}") MESSAGE(STATUS " IPv6 ............................ : ${APR_HAVE_IPV6}") MESSAGE(STATUS " Minimum Windows version ......... : ${MIN_WINDOWS_VER}") +MESSAGE(STATUS " Build shared libs ............... : ${APR_BUILD_SHARED}") +MESSAGE(STATUS " Build static libs ............... : ${APR_BUILD_STATIC}") MESSAGE(STATUS " Build test suite ................ : ${APR_BUILD_TESTAPR}") IF(TEST_STATIC_LIBS) MESSAGE(STATUS " (testing static libraries)") diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..aef2c3c --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,65 @@ +{
+ "version": 3,
+ "configurePresets": [
+ {
+ "name": "windows-base",
+ "description": "Target Windows with the Visual Studio development environment.",
+ "hidden": true,
+ "generator": "Ninja",
+ "binaryDir": "${sourceDir}/out/build/${presetName}",
+ "installDir": "${sourceDir}/out/install/${presetName}",
+ "cacheVariables": {
+ "CMAKE_C_COMPILER": "cl.exe",
+ },
+ "condition": {
+ "type": "equals",
+ "lhs": "${hostSystemName}",
+ "rhs": "Windows"
+ }
+ },
+ {
+ "name": "x64-debug",
+ "displayName": "x64 Debug",
+ "description": "Target Windows (64-bit) with the Visual Studio development environment. (Debug)",
+ "inherits": "windows-base",
+ "architecture": {
+ "value": "x64",
+ "strategy": "external"
+ },
+ "cacheVariables": {
+ "CMAKE_BUILD_TYPE": "Debug"
+ }
+ },
+ {
+ "name": "x64-release",
+ "displayName": "x64 Release",
+ "description": "Target Windows (64-bit) with the Visual Studio development environment. (RelWithDebInfo)",
+ "inherits": "x64-debug",
+ "cacheVariables": {
+ "CMAKE_BUILD_TYPE": "Release"
+ }
+ },
+ {
+ "name": "x86-debug",
+ "displayName": "x86 Debug",
+ "description": "Target Windows (32-bit) with the Visual Studio development environment. (Debug)",
+ "inherits": "windows-base",
+ "architecture": {
+ "value": "x86",
+ "strategy": "external"
+ },
+ "cacheVariables": {
+ "CMAKE_BUILD_TYPE": "Debug"
+ }
+ },
+ {
+ "name": "x86-release",
+ "displayName": "x86 Release",
+ "description": "Target Windows (32-bit) with the Visual Studio development environment. (RelWithDebInfo)",
+ "inherits": "x86-debug",
+ "cacheVariables": {
+ "CMAKE_BUILD_TYPE": "Release"
+ }
+ }
+ ]
+}
@@ -1,5 +1,5 @@ Apache Portable Runtime -Copyright (c) 2000-2023 The Apache Software Foundation. +Copyright 2024 The Apache Software Foundation. This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff --git a/apr-config.in b/apr-config.in index bed47ca..626d3b0 100644 --- a/apr-config.in +++ b/apr-config.in @@ -48,13 +48,28 @@ APR_LIBNAME="@APR_LIBNAME@" # NOTE: the following line is modified during 'make install': alter with care! location=@APR_CONFIG_LOCATION@ -# absolute path, but not installed path - we're cross compiling -case "$0" in - "${bindir}/"*) ;; - "/"*) location=crosscompile; - APR_TARGET_DIR=${0%${bindir}/apr-${APR_MAJOR_VERSION}-config} ;; - *) ;; -esac +cross_compiling=@APR_CROSS_COMPILING@ + +if test "$cross_compiling" != "no"; then + + # Normalize $0 and bindir by removing consecutive '/' as the comparison + # and the suffix removal below might fail for semantic equal pathes. + # XXX: This is not perfect. On Linux we could use realpath for this purpose + # but realpath is not portable. + normalized_command=`echo $0 | tr -s /` + normalized_bindir=`echo ${bindir} | tr -s /` + # Remove trailing '/' + normalized_bindir=${normalized_bindir%/} + + # absolute path, but not installed path - we're cross compiling + case "$normalized_command" in + "${normalized_bindir}/"*) ;; + "/"*) location=crosscompile; + APR_TARGET_DIR=${normalized_command%${normalized_bindir}/apr-${APR_MAJOR_VERSION}-config}; + ;; + *) ;; + esac +fi show_usage() { @@ -3,7 +3,7 @@ Summary: Apache Portable Runtime library Name: apr -Version: 1.7.2 +Version: 1.7.5 Release: 1 License: Apache Software License Group: System Environment/Libraries diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index 9c3df80..daee00d 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -20,7 +20,7 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *pool) { -#if defined (NEED_ATOMICS_GENERIC64) +#if defined(USE_ATOMICS_GENERIC64) return apr__atomic_generic64_init(p); #else return APR_SUCCESS; diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c index e6a1693..f526e34 100644 --- a/atomic/os390/atomic.c +++ b/atomic/os390/atomic.c @@ -20,7 +20,7 @@ apr_status_t apr_atomic_init(apr_pool_t *p) { -#if defined (NEED_ATOMICS_GENERIC64) +#if defined(USE_ATOMICS_GENERIC64) return apr__atomic_generic64_init(p); #else return APR_SUCCESS; diff --git a/atomic/unix/builtins.c b/atomic/unix/builtins.c index 22b828c..5165e72 100644 --- a/atomic/unix/builtins.c +++ b/atomic/unix/builtins.c @@ -18,15 +18,20 @@ #ifdef USE_ATOMICS_BUILTINS -#if defined(__arm__) || defined(__powerpc__) || defined(__powerpc64__) -#define WEAK_MEMORY_ORDERING 1 -#else +#if defined(__i386__) || defined(__x86_64__) \ + || defined(__s390__) || defined(__s390x__) #define WEAK_MEMORY_ORDERING 0 +#else +#define WEAK_MEMORY_ORDERING 1 #endif APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) { +#if defined (USE_ATOMICS_GENERIC64) + return apr__atomic_generic64_init(p); +#else return APR_SUCCESS; +#endif } APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) @@ -114,7 +119,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *ptr, const void *cmp) { #if HAVE__ATOMIC_BUILTINS - __atomic_compare_exchange_n(mem, (void **)&cmp, ptr, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); + __atomic_compare_exchange_n(mem, (void *)&cmp, ptr, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); return (void *)cmp; #else return (void *)__sync_val_compare_and_swap(mem, (void *)cmp, ptr); diff --git a/atomic/unix/builtins64.c b/atomic/unix/builtins64.c index 7d84225..f0cdb30 100644 --- a/atomic/unix/builtins64.c +++ b/atomic/unix/builtins64.c @@ -18,17 +18,18 @@ #ifdef USE_ATOMICS_BUILTINS64 -#if defined(__arm__) || defined(__powerpc__) || defined(__powerpc64__) -#define WEAK_MEMORY_ORDERING 1 -#else +#if defined(__i386__) || defined(__x86_64__) \ + || defined(__s390__) || defined(__s390x__) #define WEAK_MEMORY_ORDERING 0 +#else +#define WEAK_MEMORY_ORDERING 1 #endif APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem) { #if HAVE__ATOMIC_BUILTINS return __atomic_load_n(mem, __ATOMIC_SEQ_CST); -#elif WEAK_MEMORY_ORDERING +#elif WEAK_MEMORY_ORDERING || APR_SIZEOF_VOIDP < 8 /* No __sync_load() available => apr_atomic_add64(mem, 0) */ return __sync_fetch_and_add(mem, 0); #else @@ -40,7 +41,7 @@ APR_DECLARE(void) apr_atomic_set64(volatile apr_uint64_t *mem, apr_uint64_t val) { #if HAVE__ATOMIC_BUILTINS __atomic_store_n(mem, val, __ATOMIC_SEQ_CST); -#elif WEAK_MEMORY_ORDERING +#elif WEAK_MEMORY_ORDERING || APR_SIZEOF_VOIDP < 8 /* No __sync_store() available => apr_atomic_xchg64(mem, val) */ __sync_synchronize(); __sync_lock_test_and_set(mem, val); diff --git a/atomic/unix/ia32.c b/atomic/unix/ia32.c index cdb7a52..ce92c22 100644 --- a/atomic/unix/ia32.c +++ b/atomic/unix/ia32.c @@ -20,7 +20,7 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) { -#if defined (NEED_ATOMICS_GENERIC64) +#if defined(USE_ATOMICS_GENERIC64) return apr__atomic_generic64_init(p); #else return APR_SUCCESS; diff --git a/atomic/unix/mutex64.c b/atomic/unix/mutex64.c index 9fc44af..4ea4d8f 100644 --- a/atomic/unix/mutex64.c +++ b/atomic/unix/mutex64.c @@ -17,7 +17,7 @@ #include "apr_arch_atomic.h" #include "apr_thread_mutex.h" -#if defined(USE_ATOMICS_GENERIC) || defined (NEED_ATOMICS_GENERIC64) +#if defined(USE_ATOMICS_GENERIC64) #include <stdlib.h> @@ -96,7 +96,14 @@ apr_status_t apr__atomic_generic64_init(apr_pool_t *p) APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem) { - return *mem; + apr_uint64_t cur_value; + DECLARE_MUTEX_LOCKED(mutex, mem); + + cur_value = *mem; + + MUTEX_UNLOCK(mutex); + + return cur_value; } APR_DECLARE(void) apr_atomic_set64(volatile apr_uint64_t *mem, apr_uint64_t val) diff --git a/atomic/unix/ppc.c b/atomic/unix/ppc.c index 46554af..1ae727f 100644 --- a/atomic/unix/ppc.c +++ b/atomic/unix/ppc.c @@ -26,7 +26,7 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) { -#if defined (NEED_ATOMICS_GENERIC64) +#if defined(USE_ATOMICS_GENERIC64) return apr__atomic_generic64_init(p); #else return APR_SUCCESS; diff --git a/atomic/unix/s390.c b/atomic/unix/s390.c index ae5d040..c036128 100644 --- a/atomic/unix/s390.c +++ b/atomic/unix/s390.c @@ -20,7 +20,7 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) { -#if defined (NEED_ATOMICS_GENERIC64) +#if defined(USE_ATOMICS_GENERIC64) return apr__atomic_generic64_init(p); #else return APR_SUCCESS; diff --git a/atomic/unix/solaris.c b/atomic/unix/solaris.c index 9bc2de2..994354e 100644 --- a/atomic/unix/solaris.c +++ b/atomic/unix/solaris.c @@ -22,7 +22,7 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) { -#if defined (NEED_ATOMICS_GENERIC64) +#if defined(USE_ATOMICS_GENERIC64) return apr__atomic_generic64_init(p); #else return APR_SUCCESS; diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index b29ea59..5c2a870 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -18,11 +18,7 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) { -#if defined (NEED_ATOMICS_GENERIC64) - return apr__atomic_generic64_init(p); -#else return APR_SUCCESS; -#endif } APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index ac2312c..99d7ce1 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -920,7 +920,7 @@ else dnl <sys/types.h> should be available everywhere! cat > conftest.c <<EOF #include <sys/types.h> - int main() { return 0; } + int main(int argc, const char *argv[]) { return 0; } EOF MKDEP="true" for i in "$CC -MM" "$CC -M" "$CPP -MM" "$CPP -M" "cpp -M"; do diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index 6895c3a..dbe7f4e 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -100,7 +100,7 @@ void *thread_routine(void *data) { return data; } -int main() { +int main(int argc, const char *argv[]) { pthread_t thd; pthread_mutexattr_t mattr; pthread_once_t once_init = PTHREAD_ONCE_INIT; @@ -228,7 +228,7 @@ AC_DEFUN([APR_CHECK_PTHREAD_RECURSIVE_MUTEX], [ #include <pthread.h> #include <stdlib.h> -int main() { +int main(int argc, const char *argv[]) { pthread_mutexattr_t attr; pthread_mutex_t m; diff --git a/build/config.guess b/build/config.guess index e81d3ae..f6d217a 100755 --- a/build/config.guess +++ b/build/config.guess @@ -1,14 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2021 Free Software Foundation, Inc. +# Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2021-06-03' +timestamp='2024-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -47,7 +47,7 @@ me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] -Output the configuration name of the system \`$me' is run on. +Output the configuration name of the system '$me' is run on. Options: -h, --help print this help, then exit @@ -60,13 +60,13 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2021 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -102,8 +102,8 @@ GUESS= # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. +# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still +# use 'HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. @@ -155,6 +155,9 @@ Linux|GNU|GNU/*) set_cc_for_build cat <<-EOF > "$dummy.c" + #if defined(__ANDROID__) + LIBC=android + #else #include <features.h> #if defined(__UCLIBC__) LIBC=uclibc @@ -162,6 +165,8 @@ Linux|GNU|GNU/*) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu + #elif defined(__LLVM_LIBC__) + LIBC=llvm #else #include <stdarg.h> /* First heuristic to detect musl libc. */ @@ -169,6 +174,7 @@ Linux|GNU|GNU/*) LIBC=musl #endif #endif + #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" @@ -437,7 +443,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 @@ -459,7 +465,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in UNAME_RELEASE=`uname -v` ;; esac - # Japanese Language versions have a version number like `4.1.3-JL'. + # Japanese Language versions have a version number like '4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; @@ -904,7 +910,7 @@ EOF fi ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` + UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; @@ -929,6 +935,9 @@ EOF i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; *:Interix*:*) case $UNAME_MACHINE in x86) @@ -963,11 +972,37 @@ EOF GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; + x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-pc-managarm-mlibc" + ;; + *:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" + ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __ARM_EABI__ + #ifdef __ARM_PCS_VFP + ABI=eabihf + #else + ABI=eabi + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; + esac + fi + GUESS=$CPU-unknown-linux-$LIBCABI ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be @@ -1033,7 +1068,16 @@ EOF k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; - loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + kvx:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:cos:*:*) + GUESS=$UNAME_MACHINE-unknown-cos + ;; + kvx:mbr:*:*) + GUESS=$UNAME_MACHINE-unknown-mbr + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) @@ -1148,16 +1192,27 @@ EOF ;; x86_64:Linux:*:*) set_cc_for_build + CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then - if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_X32 >/dev/null - then - LIBCABI=${LIBC}x32 - fi + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __i386__ + ABI=x86 + #else + #ifdef __ILP32__ + ABI=x32 + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + x86) CPU=i686 ;; + x32) LIBCABI=${LIBC}x32 ;; + esac fi - GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI + GUESS=$CPU-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC @@ -1177,7 +1232,7 @@ EOF GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility + # If we were able to find 'uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; @@ -1318,7 +1373,7 @@ EOF GUESS=ns32k-sni-sysv fi ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort # says <Richard.M.Bartel@ccMail.Census.GOV> GUESS=i586-unisys-sysv4 ;; @@ -1364,8 +1419,11 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; - x86_64:Haiku:*:*) - GUESS=x86_64-unknown-haiku + ppc:Haiku:*:*) # Haiku running on Apple PowerPC + GUESS=powerpc-apple-haiku + ;; + *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) + GUESS=$UNAME_MACHINE-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE @@ -1522,6 +1580,9 @@ EOF i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; @@ -1534,6 +1595,9 @@ EOF *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; + *:Ironclad:*:*) + GUESS=$UNAME_MACHINE-unknown-ironclad + ;; esac # Do we have a guess based on uname results? diff --git a/build/config.sub b/build/config.sub index d74fb6d..2c6a07a 100755 --- a/build/config.sub +++ b/build/config.sub @@ -1,14 +1,14 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2021 Free Software Foundation, Inc. +# Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2021-08-14' +timestamp='2024-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -76,13 +76,13 @@ Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.sub ($timestamp) -Copyright 1992-2021 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -130,7 +130,7 @@ IFS=$saved_IFS # Separate into logical components for further validation case $1 in *-*-*-*-*) - echo Invalid configuration \`"$1"\': more than four components >&2 + echo "Invalid configuration '$1': more than four components" >&2 exit 1 ;; *-*-*-*) @@ -145,7 +145,8 @@ case $1 in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) + | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \ + | windows-* ) basic_machine=$field1 basic_os=$maybe_os ;; @@ -943,7 +944,7 @@ $basic_machine EOF IFS=$saved_IFS ;; - # We use `pc' rather than `unknown' + # We use 'pc' rather than 'unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) @@ -1020,6 +1021,11 @@ case $cpu-$vendor in ;; # Here we normalize CPU types with a missing or matching vendor + armh-unknown | armh-alt) + cpu=armv7l + vendor=alt + basic_os=${basic_os:-linux-gnueabihf} + ;; dpx20-unknown | dpx20-bull) cpu=rs6000 vendor=bull @@ -1070,7 +1076,7 @@ case $cpu-$vendor in pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) cpu=i586 ;; - pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*) + pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*) cpu=i686 ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) @@ -1121,7 +1127,7 @@ case $cpu-$vendor in xscale-* | xscalee[bl]-*) cpu=`echo "$cpu" | sed 's/^xscale/arm/'` ;; - arm64-*) + arm64-* | aarch64le-*) cpu=aarch64 ;; @@ -1175,7 +1181,7 @@ case $cpu-$vendor in case $cpu in 1750a | 580 \ | a29k \ - | aarch64 | aarch64_be \ + | aarch64 | aarch64_be | aarch64c | arm64ec \ | abacus \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ @@ -1194,50 +1200,29 @@ case $cpu-$vendor in | d10v | d30v | dlx | dsp16xx \ | e2k | elxsi | epiphany \ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | javascript \ | h8300 | h8500 \ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i*86 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ + | kvx \ | le32 | le64 \ | lm32 \ - | loongarch32 | loongarch64 | loongarchx32 \ + | loongarch32 | loongarch64 \ | m32c | m32r | m32rle \ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ | m88110 | m88k | maxq | mb | mcore | mep | metag \ | microblaze | microblazeel \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64eb | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r3 | mipsisa32r3el \ - | mipsisa32r5 | mipsisa32r5el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r3 | mipsisa64r3el \ - | mipsisa64r5 | mipsisa64r5el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ + | mips* \ | mmix \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ + | nanomips* \ | nds32 | nds32le | nds32be \ | nfp \ | nios | nios2 | nios2eb | nios2el \ @@ -1269,6 +1254,7 @@ case $cpu-$vendor in | ubicom32 \ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ | vax \ + | vc4 \ | visium \ | w65 \ | wasm32 | wasm64 \ @@ -1280,7 +1266,7 @@ case $cpu-$vendor in ;; *) - echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2 exit 1 ;; esac @@ -1301,11 +1287,12 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if test x$basic_os != x +if test x"$basic_os" != x then -# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. +obj= case $basic_os in gnu/linux*) kernel=linux @@ -1336,6 +1323,10 @@ EOF kernel=linux os=`echo "$basic_os" | sed -e 's|linux|gnu|'` ;; + managarm*) + kernel=managarm + os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'` + ;; *) kernel= os=$basic_os @@ -1501,10 +1492,16 @@ case $os in os=eabi ;; *) - os=elf + os= + obj=elf ;; esac ;; + aout* | coff* | elf* | pe*) + # These are machine code file formats, not OSes + obj=$os + os= + ;; *) # No normalization, but not necessarily accepted, that comes below. ;; @@ -1523,12 +1520,15 @@ else # system, and we'll never get to this point. kernel= +obj= case $cpu-$vendor in score-*) - os=elf + os= + obj=elf ;; spu-*) - os=elf + os= + obj=elf ;; *-acorn) os=riscix1.2 @@ -1538,28 +1538,35 @@ case $cpu-$vendor in os=gnu ;; arm*-semi) - os=aout + os= + obj=aout ;; c4x-* | tic4x-*) - os=coff + os= + obj=coff ;; c8051-*) - os=elf + os= + obj=elf ;; clipper-intergraph) os=clix ;; hexagon-*) - os=elf + os= + obj=elf ;; tic54x-*) - os=coff + os= + obj=coff ;; tic55x-*) - os=coff + os= + obj=coff ;; tic6x-*) - os=coff + os= + obj=coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1581,19 +1588,24 @@ case $cpu-$vendor in os=sunos3 ;; m68*-cisco) - os=aout + os= + obj=aout ;; mep-*) - os=elf + os= + obj=elf ;; mips*-cisco) - os=elf + os= + obj=elf ;; - mips*-*) - os=elf + mips*-*|nanomips*-*) + os= + obj=elf ;; or32-*) - os=coff + os= + obj=coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=sysv3 @@ -1602,7 +1614,8 @@ case $cpu-$vendor in os=sunos4.1.1 ;; pru-*) - os=elf + os= + obj=elf ;; *-be) os=beos @@ -1683,10 +1696,12 @@ case $cpu-$vendor in os=uxpv ;; *-rom68k) - os=coff + os= + obj=coff ;; *-*bug) - os=coff + os= + obj=coff ;; *-apple) os=macos @@ -1704,10 +1719,11 @@ esac fi -# Now, validate our (potentially fixed-up) OS. +# Now, validate our (potentially fixed-up) individual pieces (OS, OBJ). + case $os in # Sometimes we do "kernel-libc", so those need to count as OSes. - musl* | newlib* | relibc* | uclibc*) + llvm* | musl* | newlib* | relibc* | uclibc*) ;; # Likewise for "kernel-abi" eabi* | gnueabi*) @@ -1715,6 +1731,9 @@ case $os in # VxWorks passes extra cpu info in the 4th filed. simlinux | simwindows | spe) ;; + # See `case $cpu-$os` validation below + ghcjs) + ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. @@ -1723,7 +1742,7 @@ case $os in | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ | hiux* | abug | nacl* | netware* | windows* \ - | os9* | macos* | osx* | ios* \ + | os9* | macos* | osx* | ios* | tvos* | watchos* \ | mpw* | magic* | mmixware* | mon960* | lnews* \ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ | aos* | aros* | cloudabi* | sortix* | twizzler* \ @@ -1732,11 +1751,11 @@ case $os in | mirbsd* | netbsd* | dicos* | openedition* | ose* \ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ - | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ - | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | bosx* | nextstep* | cxux* | oabi* \ + | ptx* | ecoff* | winnt* | domain* | vsta* \ | udi* | lites* | ieee* | go32* | aux* | hcos* \ | chorusrdb* | cegcc* | glidix* | serenity* \ - | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | cygwin* | msys* | moss* | proelf* | rtems* \ | midipix* | mingw32* | mingw64* | mint* \ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ | interix* | uwin* | mks* | rhapsody* | darwin* \ @@ -1748,49 +1767,117 @@ case $os in | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ - | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr*) + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ + | fiwix* | mlibc* | cos* | mbr* | ironclad* ) ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v[4-9]* | sco5v6*) # Don't forget version if it is 3.2v4 or newer. ;; + # This refers to builds using the UEFI calling convention + # (which depends on the architecture) and PE file format. + # Note that this is both a different calling convention and + # different file format than that of GNU-EFI + # (x86_64-w64-mingw32). + uefi) + ;; none) ;; + kernel* | msvc* ) + # Restricted further below + ;; + '') + if test x"$obj" = x + then + echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2 + fi + ;; *) - echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 + exit 1 + ;; +esac + +case $obj in + aout* | coff* | elf* | pe*) + ;; + '') + # empty is fine + ;; + *) + echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 + exit 1 + ;; +esac + +# Here we handle the constraint that a (synthetic) cpu and os are +# valid only in combination with each other and nowhere else. +case $cpu-$os in + # The "javascript-unknown-ghcjs" triple is used by GHC; we + # accept it here in order to tolerate that, but reject any + # variations. + javascript-ghcjs) + ;; + javascript-* | *-ghcjs) + echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. -case $kernel-$os in - linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ - | linux-musl* | linux-relibc* | linux-uclibc* ) +case $kernel-$os-$obj in + linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ + | linux-mlibc*- | linux-musl*- | linux-newlib*- \ + | linux-relibc*- | linux-uclibc*- ) + ;; + uclinux-uclibc*- ) + ;; + managarm-mlibc*- | managarm-kernel*- ) ;; - uclinux-uclibc* ) + windows*-msvc*-) ;; - -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ + | -uclibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. - echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; - kfreebsd*-gnu* | kopensolaris*-gnu*) + -kernel*- ) + echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 + exit 1 ;; - vxworks-simlinux | vxworks-simwindows | vxworks-spe) + *-kernel*- ) + echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 + exit 1 ;; - nto-qnx*) + *-msvc*- ) + echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 + exit 1 ;; - os2-emx) + kfreebsd*-gnu*- | kopensolaris*-gnu*-) + ;; + vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) + ;; + nto-qnx*-) + ;; + os2-emx-) ;; - *-eabi* | *-gnueabi*) + *-eabi*- | *-gnueabi*-) ;; - -*) + none--*) + # None (no kernel, i.e. freestanding / bare metal), + # can be paired with an machine code file format + ;; + -*-) # Blank kernel with real OS is always fine. ;; - *-*) - echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + --*) + # Blank kernel and OS with real machine code file format is always fine. + ;; + *-*-*) + echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; esac @@ -1873,7 +1960,7 @@ case $vendor in ;; esac -echo "$cpu-$vendor-${kernel:+$kernel-}$os" +echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: diff --git a/build/vcpkg/apr/portfile.cmake b/build/vcpkg/apr/portfile.cmake new file mode 100644 index 0000000..4d79b3b --- /dev/null +++ b/build/vcpkg/apr/portfile.cmake @@ -0,0 +1,48 @@ +set(VERSION 1.7.5) +# +# Modify REF to latest commit id from https://github.com/apache/apr +# Update SHA512 with actual SHA512 +# +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO apache/apr + REF 6445e8804008922f8018aa238aa4d6bba608c49a + SHA512 0 + HEAD_REF 1.7.x +) + +if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + private-headers INSTALL_PRIVATE_H + ) + + string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" APR_BUILD_STATIC) + string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" APR_BUILD_SHARED) + + vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DAPR_BUILD_STATIC=${APR_BUILD_STATIC} + -DAPR_BUILD_SHARED=${APR_BUILD_SHARED} + -DAPR_BUILD_TESTAPR=OFF + -DINSTALL_PDB=OFF + -DAPR_INSTALL_PRIVATE_H=${INSTALL_PRIVATE_H} + -DAPR_INSTALL_INCLUDE_DIR=include/apr-1 + ) + + vcpkg_cmake_install() + vcpkg_copy_pdbs() + vcpkg_cmake_config_fixup(PACKAGE_NAME "apr" + CONFIG_PATH "lib/cmake/apr") + + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +else() + # In development +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +# Handle copyright +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) + diff --git a/build/vcpkg/apr/vcpkg.json b/build/vcpkg/apr/vcpkg.json new file mode 100644 index 0000000..6fc20dd --- /dev/null +++ b/build/vcpkg/apr/vcpkg.json @@ -0,0 +1,27 @@ +{ + "name": "apr", + "version": "1.7.5", + "port-version": 5, + "description": "The Apache Portable Runtime (APR) is a C library that forms a system portability layer that covers many operating systems.", + "homepage": "https://apr.apache.org/", + "license": "Apache-2.0", + "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true, + "platform": "windows" + }, + { + "name": "vcpkg-cmake-config", + "host": true, + "platform": "windows" + } + ], + "features": { + "private-headers": { + "description": "Install non-standard files required for building Apache httpd" + } + }, + "default-features": [] +} @@ -1,9 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71. +# Generated by GNU Autoconf 2.72. # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # @@ -15,7 +15,6 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -24,12 +23,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -101,7 +101,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -131,15 +131,14 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -147,12 +146,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -170,8 +170,9 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else \$as_nop - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -193,14 +194,15 @@ test \$(( 1 + 1 )) = 2 || exit 1 if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else $as_nop - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -233,12 +235,13 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi +fi ;; +esac fi @@ -260,7 +263,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -279,7 +282,8 @@ $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -318,14 +322,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -394,11 +390,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -412,21 +409,14 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -500,6 +490,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -548,7 +540,6 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -560,9 +551,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -587,10 +578,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated SHELL=${CONFIG_SHELL-/bin/sh} @@ -766,6 +759,7 @@ stringsh stringh stdlibh stdioh +stddefh stdargh netinet_tcph netinet_sctp_uioh @@ -887,6 +881,7 @@ APR_MAJOR_VERSION APR_DOTTED_VERSION apr_builders top_builddir +APR_CROSS_COMPILING APR_CONFIG_LOCATION apr_builddir apr_srcdir @@ -967,6 +962,7 @@ enable_threads with_efence with_valgrind enable_posix_shm +enable_sysv_shm with_sendfile enable_allocator_uses_mmap enable_allocator_guard_pages @@ -1097,7 +1093,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1123,7 +1119,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1336,7 +1332,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1352,7 +1348,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1382,8 +1378,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1391,7 +1387,7 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1441,7 +1437,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1509,7 +1505,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1537,7 +1533,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. +'configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1551,11 +1547,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' + -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] + --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1563,10 +1559,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. For better control, use the options below. @@ -1626,6 +1622,7 @@ Optional Features: --enable-nonportable-atomics Use optimized atomic code which may produce nonportable binaries --enable-threads Enable threading support in APR. --enable-posix-shm Use POSIX shared memory (shm_open) if available + --enable-sysv-shm Use SysV shared memory (shmget) if available --enable-allocator-uses-mmap Use mmap in apr_allocator instead of malloc --enable-allocator-guard-pages Use guard pages in apr_allocator (implies --enable-allocator-uses-mmap) @@ -1668,7 +1665,7 @@ Some influential environment variables: LT_SYS_LIBRARY_PATH User-defined run-time library search path. -Use these variables to override the choices made by `configure' or to help +Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. @@ -1736,9 +1733,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.71 +generated by GNU Autoconf 2.72 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1777,11 +1774,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1815,11 +1813,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1838,8 +1837,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -1847,10 +1846,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1890,11 +1891,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -1936,12 +1938,13 @@ printf "%s\n" "$ac_try_echo"; } >&5 test $ac_status = 0; }; } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status + ac_retval=$ac_status ;; +esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -1960,15 +1963,15 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case <limits.h> declares $2. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. */ + which can conflict with char $2 (void); below. */ #include <limits.h> #undef $2 @@ -1979,7 +1982,7 @@ else $as_nop #ifdef __cplusplus extern "C" #endif -char $2 (); +char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -1998,11 +2001,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2011,63 +2016,6 @@ printf "%s\n" "$ac_res" >&6; } } # ac_fn_c_check_func -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main (void) -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main (void) -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_type - # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes @@ -2113,18 +2061,19 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid; break -else $as_nop - as_fn_arith $ac_mid + 1 && ac_lo=$as_val +else case e in #( + e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int @@ -2159,20 +2108,23 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_lo=$ac_mid; break -else $as_nop - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val +else case e in #( + e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else $as_nop - ac_lo= ac_hi= +else case e in #( + e) ac_lo= ac_hi= ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. @@ -2195,8 +2147,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid -else $as_nop - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +else case e in #( + e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done @@ -2244,8 +2197,9 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : echo >>conftest.val; read $3 <conftest.val; ac_retval=0 -else $as_nop - ac_retval=1 +else case e in #( + e) ac_retval=1 ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -2257,6 +2211,65 @@ rm -f conftest.val } # ac_fn_c_compute_int +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in #( + e) eval "$3=yes" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + # ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR # ------------------------------------------------------------------ # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR @@ -2270,8 +2283,8 @@ printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` +else case e in #( + e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2295,12 +2308,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS - + ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2321,8 +2336,8 @@ printf %s "checking for $2.$3... " >&6; } if eval test \${$4+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int @@ -2338,8 +2353,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int @@ -2355,12 +2370,15 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" -else $as_nop - eval "$4=no" +else case e in #( + e) eval "$4=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$4 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2393,7 +2411,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -2639,10 +2657,10 @@ esac printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi done @@ -2678,9 +2696,7 @@ struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; +static char *e (char **p, int i) { return p[i]; } @@ -2694,6 +2710,21 @@ static char *f (char * (*g) (char **, int), char **p, ...) return s; } +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated @@ -2721,16 +2752,19 @@ ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? +/* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif +// See if C++-style comments work. + #include <stdbool.h> extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); +extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare @@ -2780,7 +2814,6 @@ typedef const char *ccp; static inline int test_restrict (ccp restrict text) { - // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) @@ -2846,6 +2879,8 @@ ac_c_conftest_c99_main=' ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); // Check named initializers. struct named_init ni = { @@ -2867,7 +2902,7 @@ ac_c_conftest_c99_main=' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? +/* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif @@ -3061,8 +3096,9 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac fi @@ -3090,12 +3126,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -3104,18 +3140,18 @@ printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. @@ -3131,11 +3167,11 @@ printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## @@ -5168,15 +5204,16 @@ printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_build_alias=$build_alias +else case e in #( + e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } @@ -5203,14 +5240,15 @@ printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$host_alias" = x; then +else case e in #( + e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } @@ -5237,14 +5275,15 @@ printf %s "checking target system type... " >&6; } if test ${ac_cv_target+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$target_alias" = x; then +else case e in #( + e) if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 printf "%s\n" "$ac_cv_target" >&6; } @@ -5293,6 +5332,18 @@ fi +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + APR_CROSS_COMPILING=maybe + elif test "x$build_alias" != "x$host_alias"; then + APR_CROSS_COMPILING=yes + fi +else + APR_CROSS_COMPILING=no +fi + + + # Libtool might need this symbol -- it must point to the location of # the generated libtool script (not necessarily the "top" build dir). # @@ -5314,8 +5365,8 @@ printf %s "checking for working mkdir -p... " >&6; } if test ${ac_cv_mkdir_p+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) test -d conftestdir && rm -rf conftestdir mkdir -p conftestdir/somedir >/dev/null 2>&1 if test -d conftestdir/somedir; then @@ -5324,7 +5375,8 @@ else $as_nop ac_cv_mkdir_p=no fi rm -rf conftestdir - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mkdir_p" >&5 printf "%s\n" "$ac_cv_mkdir_p" >&6; } @@ -5661,8 +5713,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5684,7 +5736,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -5706,8 +5759,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5729,7 +5782,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -5764,8 +5818,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5787,7 +5841,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -5809,8 +5864,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -5849,7 +5904,8 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -5873,8 +5929,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5896,7 +5952,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -5922,8 +5979,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5945,7 +6002,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -5983,8 +6041,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6006,7 +6064,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -6028,8 +6087,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6051,7 +6110,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -6080,10 +6140,10 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -6155,8 +6215,8 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. @@ -6176,7 +6236,7 @@ do ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' + # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. @@ -6187,8 +6247,9 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else $as_nop - ac_file='' +else case e in #( + e) ac_file='' ;; +esac fi if test -z "$ac_file" then : @@ -6197,13 +6258,14 @@ printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } @@ -6227,10 +6289,10 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -6240,11 +6302,12 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -6260,6 +6323,8 @@ int main (void) { FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; return ferror (f) || fclose (f) != 0; ; @@ -6299,26 +6364,27 @@ printf "%s\n" "$ac_try_echo"; } >&5 if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6350,16 +6416,18 @@ then : break;; esac done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } @@ -6370,8 +6438,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6388,12 +6456,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -6411,8 +6481,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -6430,8 +6500,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6446,8 +6516,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6464,12 +6534,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -6496,8 +6569,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6514,25 +6587,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" + CC="$CC $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -6542,8 +6618,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6560,25 +6636,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -6588,8 +6667,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6606,25 +6685,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -6650,8 +6732,8 @@ if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded +else case e in #( + e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false @@ -6669,9 +6751,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -6685,15 +6768,16 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : @@ -6702,7 +6786,8 @@ fi done ac_cv_prog_CPP=$CPP - + ;; +esac fi CPP=$ac_cv_prog_CPP else @@ -6725,9 +6810,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -6741,24 +6827,26 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi ac_ext=c @@ -6788,8 +6876,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC_FOR_BUILD"; then +else case e in #( + e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6811,7 +6899,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then @@ -6833,8 +6922,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC_FOR_BUILD"; then +else case e in #( + e) if test -n "$ac_ct_CC_FOR_BUILD"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6856,7 +6945,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD if test -n "$ac_ct_CC_FOR_BUILD"; then @@ -6891,8 +6981,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC_FOR_BUILD"; then +else case e in #( + e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6914,7 +7004,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then @@ -6936,8 +7027,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC_FOR_BUILD"; then +else case e in #( + e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else ac_prog_rejected=no @@ -6976,7 +7067,8 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC_FOR_BUILD="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then @@ -7000,8 +7092,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC_FOR_BUILD"; then +else case e in #( + e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7023,7 +7115,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then @@ -7049,8 +7142,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC_FOR_BUILD"; then +else case e in #( + e) if test -n "$ac_ct_CC_FOR_BUILD"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7072,7 +7165,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD if test -n "$ac_ct_CC_FOR_BUILD"; then @@ -7110,8 +7204,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC_FOR_BUILD"; then +else case e in #( + e) if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7133,7 +7227,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then @@ -7155,8 +7250,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC_FOR_BUILD"; then +else case e in #( + e) if test -n "$ac_ct_CC_FOR_BUILD"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7178,7 +7273,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD if test -n "$ac_ct_CC_FOR_BUILD"; then @@ -7207,10 +7303,10 @@ fi fi -test -z "$CC_FOR_BUILD" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC_FOR_BUILD" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -7242,8 +7338,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -7260,12 +7356,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -7283,8 +7381,8 @@ printf %s "checking whether $CC_FOR_BUILD accepts -g... " >&6; } if test ${ac_cv_build_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_build_prog_cc_g=no CFLAGS_FOR_BUILD="-g" @@ -7302,8 +7400,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_build_prog_cc_g=yes -else $as_nop - CFLAGS_FOR_BUILD="" +else case e in #( + e) CFLAGS_FOR_BUILD="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7318,8 +7416,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS_FOR_BUILD="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7336,12 +7434,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_build_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_g" >&5 printf "%s\n" "$ac_cv_build_prog_cc_g" >&6; } @@ -7368,8 +7469,8 @@ printf %s "checking for $CC_FOR_BUILD option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC_FOR_BUILD cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7386,25 +7487,28 @@ rm -f core conftest.err conftest.$ac_build_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC_FOR_BUILD=$ac_save_CC +CC_FOR_BUILD=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_prog_cc_c11" + CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -7414,8 +7518,8 @@ printf %s "checking for $CC_FOR_BUILD option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC_FOR_BUILD cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7432,25 +7536,28 @@ rm -f core conftest.err conftest.$ac_build_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC_FOR_BUILD=$ac_save_CC +CC_FOR_BUILD=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_prog_cc_c99" + CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -7460,8 +7567,8 @@ printf %s "checking for $CC_FOR_BUILD option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC_FOR_BUILD cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7478,25 +7585,28 @@ rm -f core conftest.err conftest.$ac_build_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC_FOR_BUILD=$ac_save_CC +CC_FOR_BUILD=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_prog_cc_c89" + CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -7521,8 +7631,8 @@ if test -z "$CPP_FOR_BUILD"; then if test ${ac_cv_build_prog_CPP+y} then : printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded +else case e in #( + e) # Double quotes because $CC needs to be expanded for CPP_FOR_BUILD in "$CC_FOR_BUILD -E" "$CC_FOR_BUILD -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false @@ -7540,9 +7650,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -7556,15 +7667,16 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : @@ -7573,7 +7685,8 @@ fi done ac_cv_build_prog_CPP=$CPP_FOR_BUILD - + ;; +esac fi CPP_FOR_BUILD=$ac_cv_build_prog_CPP else @@ -7596,9 +7709,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -7612,24 +7726,26 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP_FOR_BUILD\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi ac_ext=c @@ -7653,8 +7769,8 @@ printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ +else case e in #( + e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done @@ -7679,9 +7795,10 @@ do as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in +case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -7716,7 +7833,8 @@ IFS=$as_save_IFS else ac_cv_path_SED=$SED fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } @@ -11088,8 +11206,8 @@ ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 -else $as_nop - cat >conftest.make <<\_ACEOF +else case e in #( + e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' @@ -11101,7 +11219,8 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in *) eval ac_cv_prog_make_${ac_make}_set=no;; esac -rm -f conftest.make +rm -f conftest.make ;; +esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -11128,8 +11247,8 @@ if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded +else case e in #( + e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false @@ -11147,9 +11266,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -11163,15 +11283,16 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : @@ -11180,7 +11301,8 @@ fi done ac_cv_prog_CPP=$CPP - + ;; +esac fi CPP=$ac_cv_prog_CPP else @@ -11203,9 +11325,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -11219,24 +11342,26 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi ac_ext=c @@ -11254,8 +11379,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AWK"; then +else case e in #( + e) if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11277,7 +11402,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then @@ -11311,8 +11437,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$RANLIB"; then +else case e in #( + e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11334,7 +11460,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then @@ -11356,8 +11483,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_RANLIB"; then +else case e in #( + e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11379,7 +11506,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then @@ -11426,8 +11554,8 @@ if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -11481,7 +11609,8 @@ esac IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir - + ;; +esac fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install @@ -11511,8 +11640,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RM+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$RM"; then +else case e in #( + e) if test -n "$RM"; then ac_cv_prog_RM="$RM" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11534,7 +11663,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi RM=$ac_cv_prog_RM if test -n "$RM"; then @@ -11553,8 +11683,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AS+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AS"; then +else case e in #( + e) if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11576,7 +11706,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AS=$ac_cv_prog_AS if test -n "$AS"; then @@ -11595,8 +11726,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ASCPP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ASCPP"; then +else case e in #( + e) if test -n "$ASCPP"; then ac_cv_prog_ASCPP="$ASCPP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11618,7 +11749,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ASCPP=$ac_cv_prog_ASCPP if test -n "$ASCPP"; then @@ -11638,8 +11770,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AR"; then +else case e in #( + e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11661,7 +11793,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then @@ -11683,8 +11816,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_AR"; then +else case e in #( + e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11706,7 +11839,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then @@ -11775,8 +11909,8 @@ printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test ${ac_cv_safe_to_define___extensions__+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 @@ -11792,10 +11926,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_safe_to_define___extensions__=yes -else $as_nop - ac_cv_safe_to_define___extensions__=no +else case e in #( + e) ac_cv_safe_to_define___extensions__=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } @@ -11805,8 +11941,8 @@ printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } if test ${ac_cv_should_define__xopen_source+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_should_define__xopen_source=no +else case e in #( + e) ac_cv_should_define__xopen_source=no if test $ac_cv_header_wchar_h = yes then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -11825,8 +11961,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE 500 @@ -11844,10 +11980,12 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_should_define__xopen_source=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } @@ -11872,6 +12010,8 @@ printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + printf "%s\n" "#define __STDC_WANT_IEC_60559_EXT__ 1" >>confdefs.h + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h @@ -11891,8 +12031,9 @@ then : printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h -else $as_nop - MINIX= +else case e in #( + e) MINIX= ;; +esac fi if test $ac_cv_safe_to_define___extensions__ = yes then : @@ -11912,15 +12053,21 @@ printf %s "checking for library containing strerror... " >&6; } if test ${ac_cv_search_strerror+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char strerror (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char strerror (void); int main (void) { @@ -11951,11 +12098,13 @@ done if test ${ac_cv_search_strerror+y} then : -else $as_nop - ac_cv_search_strerror=no +else case e in #( + e) ac_cv_search_strerror=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 printf "%s\n" "$ac_cv_search_strerror" >&6; } @@ -11972,15 +12121,15 @@ printf %s "checking whether system uses EBCDIC... " >&6; } if test ${ac_cv_ebcdic+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_ebcdic="no" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(void) { @@ -11993,15 +12142,18 @@ then : ac_cv_ebcdic="yes" -else $as_nop - +else case e in #( + e) ac_cv_ebcdic="no" - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ebcdic" >&5 printf "%s\n" "$ac_cv_ebcdic" >&6; } @@ -12022,8 +12174,9 @@ echo "performing libtool configuration..." if test ${enable_experimental_libtool+y} then : enableval=$enable_experimental_libtool; experimental_libtool=$enableval -else $as_nop - experimental_libtool=no +else case e in #( + e) experimental_libtool=no ;; +esac fi @@ -12065,8 +12218,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AS+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AS"; then +else case e in #( + e) if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12088,7 +12241,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AS=$ac_cv_prog_AS if test -n "$AS"; then @@ -12110,8 +12264,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AS+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_AS"; then +else case e in #( + e) if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12133,7 +12287,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then @@ -12167,8 +12322,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DLLTOOL"; then +else case e in #( + e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12190,7 +12345,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then @@ -12212,8 +12368,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DLLTOOL"; then +else case e in #( + e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12235,7 +12391,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then @@ -12269,8 +12426,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$OBJDUMP"; then +else case e in #( + e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12292,7 +12449,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then @@ -12314,8 +12472,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OBJDUMP"; then +else case e in #( + e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12337,7 +12495,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then @@ -12487,8 +12646,8 @@ printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ +else case e in #( + e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done @@ -12513,9 +12672,10 @@ do as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in +case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -12550,7 +12710,8 @@ IFS=$as_save_IFS else ac_cv_path_SED=$SED fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } @@ -12575,8 +12736,8 @@ printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$GREP"; then +else case e in #( + e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12595,9 +12756,10 @@ do as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in +case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -12632,7 +12794,8 @@ IFS=$as_save_IFS else ac_cv_path_GREP=$GREP fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } @@ -12644,8 +12807,8 @@ printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 +else case e in #( + e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then @@ -12667,9 +12830,10 @@ do as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in +case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -12705,20 +12869,23 @@ else ac_cv_path_EGREP=$EGREP fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" + EGREP_TRADITIONAL=$EGREP + ac_cv_path_EGREP_TRADITIONAL=$EGREP { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 +else case e in #( + e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then @@ -12740,9 +12907,10 @@ do as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in +case `"$ac_path_FGREP" --version 2>&1` in #( *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -12778,7 +12946,8 @@ else ac_cv_path_FGREP=$FGREP fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } @@ -12809,8 +12978,9 @@ test -z "$GREP" && GREP=grep if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else $as_nop - with_gnu_ld=no +else case e in #( + e) with_gnu_ld=no ;; +esac fi ac_prog=ld @@ -12855,8 +13025,8 @@ fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$LD"; then +else case e in #( + e) if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs @@ -12879,7 +13049,8 @@ else $as_nop IFS=$lt_save_ifs else lt_cv_path_LD=$LD # Let the user override the test with a path. -fi +fi ;; +esac fi LD=$lt_cv_path_LD @@ -12896,8 +13067,8 @@ printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 -else $as_nop - # I'd rather use --version here, but apparently some GNU lds only accept -v. +else case e in #( + e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) lt_cv_prog_gnu_ld=yes @@ -12905,6 +13076,7 @@ case `$LD -v 2>&1 </dev/null` in *) lt_cv_prog_gnu_ld=no ;; +esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 @@ -12924,8 +13096,8 @@ printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$NM"; then +else case e in #( + e) if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else @@ -12972,7 +13144,8 @@ else IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } @@ -12993,8 +13166,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DUMPBIN+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DUMPBIN"; then +else case e in #( + e) if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13016,7 +13189,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then @@ -13042,8 +13216,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DUMPBIN+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DUMPBIN"; then +else case e in #( + e) if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13065,7 +13239,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then @@ -13119,8 +13294,8 @@ printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_nm_interface="BSD nm" +else case e in #( + e) lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) @@ -13133,7 +13308,8 @@ else $as_nop if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi - rm -f conftest* + rm -f conftest* ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } @@ -13144,8 +13320,8 @@ printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 -else $as_nop - i=0 +else case e in #( + e) i=0 teststring=ABCD case $build_os in @@ -13267,7 +13443,8 @@ else $as_nop fi ;; esac - + ;; +esac fi if test -n "$lt_cv_sys_max_cmd_len"; then @@ -13324,8 +13501,8 @@ printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 -else $as_nop - case $host in +else case e in #( + e) case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys @@ -13356,7 +13533,8 @@ else $as_nop lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac - + ;; +esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd @@ -13372,8 +13550,8 @@ printf %s "checking how to convert $build file names to toolchain format... " >& if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 -else $as_nop - #assume ordinary cross tools, or native build. +else case e in #( + e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) @@ -13384,7 +13562,8 @@ case $host in esac ;; esac - + ;; +esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd @@ -13400,8 +13579,9 @@ printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_reload_flag='-r' +else case e in #( + e) lt_cv_ld_reload_flag='-r' ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } @@ -13442,8 +13622,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_FILECMD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$FILECMD"; then +else case e in #( + e) if test -n "$FILECMD"; then ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13465,7 +13645,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi FILECMD=$ac_cv_prog_FILECMD if test -n "$FILECMD"; then @@ -13487,8 +13668,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_FILECMD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_FILECMD"; then +else case e in #( + e) if test -n "$ac_ct_FILECMD"; then ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13510,7 +13691,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD if test -n "$ac_ct_FILECMD"; then @@ -13550,8 +13732,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$OBJDUMP"; then +else case e in #( + e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13573,7 +13755,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then @@ -13595,8 +13778,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OBJDUMP"; then +else case e in #( + e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13618,7 +13801,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then @@ -13656,8 +13840,8 @@ printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_file_magic_cmd='$MAGIC_CMD' +else case e in #( + e) lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support @@ -13850,7 +14034,8 @@ os2*) lt_cv_deplibs_check_method=pass_all ;; esac - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } @@ -13902,8 +14087,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DLLTOOL"; then +else case e in #( + e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13925,7 +14110,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then @@ -13947,8 +14133,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DLLTOOL"; then +else case e in #( + e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13970,7 +14156,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then @@ -14009,8 +14196,8 @@ printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_sharedlib_from_linklib_cmd='unknown' +else case e in #( + e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) @@ -14030,7 +14217,8 @@ cygwin* | mingw* | pw32* | cegcc*) lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } @@ -14053,8 +14241,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AR"; then +else case e in #( + e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14076,7 +14264,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then @@ -14102,8 +14291,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_AR"; then +else case e in #( + e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14125,7 +14314,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then @@ -14187,8 +14377,8 @@ printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ar_at_file=no +else case e in #( + e) lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14225,7 +14415,8 @@ then : fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } @@ -14250,8 +14441,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$STRIP"; then +else case e in #( + e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14273,7 +14464,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then @@ -14295,8 +14487,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_STRIP"; then +else case e in #( + e) if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14318,7 +14510,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then @@ -14359,8 +14552,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$RANLIB"; then +else case e in #( + e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14382,7 +14575,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then @@ -14404,8 +14598,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_RANLIB"; then +else case e in #( + e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14427,7 +14621,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then @@ -14538,8 +14733,8 @@ printf %s "checking command to parse $NM output from $compiler object... " >&6; if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] @@ -14794,7 +14989,8 @@ _LT_EOF lt_cv_sys_global_symbol_pipe= fi done - + ;; +esac fi if test -z "$lt_cv_sys_global_symbol_pipe"; then @@ -14858,8 +15054,9 @@ printf %s "checking for sysroot... " >&6; } if test ${with_sysroot+y} then : withval=$with_sysroot; -else $as_nop - with_sysroot=no +else case e in #( + e) with_sysroot=no ;; +esac fi @@ -14894,8 +15091,8 @@ printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 -else $as_nop - printf 0123456789abcdef0123456789abcdef >conftest.i +else case e in #( + e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then @@ -14931,7 +15128,8 @@ else ac_cv_path_lt_DD=$lt_DD fi -rm -f conftest.i conftest2.i conftest.out +rm -f conftest.i conftest2.i conftest.out ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } @@ -14942,8 +15140,8 @@ printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 -else $as_nop - printf 0123456789abcdef0123456789abcdef >conftest.i +else case e in #( + e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then @@ -14951,7 +15149,8 @@ if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; the && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out -test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } @@ -15161,8 +15360,8 @@ printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_ext=c +else case e in #( + e) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -15182,8 +15381,9 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes -else $as_nop - lt_cv_cc_needs_belf=no +else case e in #( + e) lt_cv_cc_needs_belf=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15192,7 +15392,8 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } @@ -15250,8 +15451,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$MANIFEST_TOOL"; then +else case e in #( + e) if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15273,7 +15474,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then @@ -15295,8 +15497,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_MANIFEST_TOOL"; then +else case e in #( + e) if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15318,7 +15520,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then @@ -15350,15 +15553,16 @@ printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_mainfest_tool+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_path_mainfest_tool=no +else case e in #( + e) lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi - rm -f conftest* + rm -f conftest* ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } @@ -15381,8 +15585,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DSYMUTIL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DSYMUTIL"; then +else case e in #( + e) if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15404,7 +15608,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then @@ -15426,8 +15631,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DSYMUTIL"; then +else case e in #( + e) if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15449,7 +15654,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then @@ -15483,8 +15689,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_NMEDIT+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$NMEDIT"; then +else case e in #( + e) if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15506,7 +15712,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then @@ -15528,8 +15735,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_NMEDIT+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_NMEDIT"; then +else case e in #( + e) if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15551,7 +15758,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then @@ -15585,8 +15793,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LIPO+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$LIPO"; then +else case e in #( + e) if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15608,7 +15816,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then @@ -15630,8 +15839,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_LIPO+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_LIPO"; then +else case e in #( + e) if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15653,7 +15862,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then @@ -15687,8 +15897,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$OTOOL"; then +else case e in #( + e) if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15710,7 +15920,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then @@ -15732,8 +15943,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OTOOL"; then +else case e in #( + e) if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15755,7 +15966,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then @@ -15789,8 +16001,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL64+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$OTOOL64"; then +else case e in #( + e) if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15812,7 +16024,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then @@ -15834,8 +16047,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL64+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OTOOL64"; then +else case e in #( + e) if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15857,7 +16070,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then @@ -15914,8 +16128,8 @@ printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_apple_cc_single_mod=no +else case e in #( + e) lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE @@ -15941,7 +16155,8 @@ else $as_nop fi rm -rf libconftest.dylib* rm -f conftest.* - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } @@ -15951,8 +16166,8 @@ printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_exported_symbols_list=no +else case e in #( + e) lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" @@ -15970,13 +16185,15 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes -else $as_nop - lt_cv_ld_exported_symbols_list=no +else case e in #( + e) lt_cv_ld_exported_symbols_list=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } @@ -15986,8 +16203,8 @@ printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_force_load=no +else case e in #( + e) lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF @@ -16012,7 +16229,8 @@ _LT_EOF fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } @@ -16121,8 +16339,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - enable_shared=yes +else case e in #( + e) enable_shared=yes ;; +esac fi @@ -16153,8 +16372,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - enable_static=yes +else case e in #( + e) enable_static=yes ;; +esac fi @@ -16185,8 +16405,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - pic_mode=default +else case e in #( + e) pic_mode=default ;; +esac fi @@ -16216,8 +16437,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - enable_fast_install=yes +else case e in #( + e) enable_fast_install=yes ;; +esac fi @@ -16244,15 +16466,17 @@ then : ;; esac lt_cv_with_aix_soname=$with_aix_soname -else $as_nop - if test ${lt_cv_with_aix_soname+y} +else case e in #( + e) if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_with_aix_soname=aix +else case e in #( + e) lt_cv_with_aix_soname=aix ;; +esac fi - with_aix_soname=$lt_cv_with_aix_soname + with_aix_soname=$lt_cv_with_aix_soname ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 @@ -16343,8 +16567,8 @@ printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 -else $as_nop - rm -f .libs 2>/dev/null +else case e in #( + e) rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs @@ -16352,7 +16576,8 @@ else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi -rmdir .libs 2>/dev/null +rmdir .libs 2>/dev/null ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } @@ -16413,8 +16638,8 @@ printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MAGIC_CMD in +else case e in #( + e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; @@ -16457,6 +16682,7 @@ _LT_EOF IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; +esac ;; esac fi @@ -16480,8 +16706,8 @@ printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MAGIC_CMD in +else case e in #( + e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; @@ -16524,6 +16750,7 @@ _LT_EOF IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; +esac ;; esac fi @@ -16623,8 +16850,8 @@ printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_rtti_exceptions=no +else case e in #( + e) lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment @@ -16652,7 +16879,8 @@ else $as_nop fi fi $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } @@ -17017,8 +17245,9 @@ printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +else case e in #( + e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } @@ -17033,8 +17262,8 @@ printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic_works=no +else case e in #( + e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment @@ -17062,7 +17291,8 @@ else $as_nop fi fi $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } @@ -17098,8 +17328,8 @@ printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_static_works=no +else case e in #( + e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext @@ -17120,7 +17350,8 @@ else $as_nop fi $RM -r conftest* LDFLAGS=$save_LDFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } @@ -17142,8 +17373,8 @@ printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_c_o=no +else case e in #( + e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest @@ -17183,7 +17414,8 @@ else $as_nop cd .. $RM -r conftest $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -17198,8 +17430,8 @@ printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_c_o=no +else case e in #( + e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest @@ -17239,7 +17471,8 @@ else $as_nop cd .. $RM -r conftest $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -17834,8 +18067,8 @@ else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -17867,7 +18100,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi - + ;; +esac fi aix_libpath=$lt_cv_aix_libpath_ @@ -17889,8 +18123,8 @@ else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -17922,7 +18156,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi - + ;; +esac fi aix_libpath=$lt_cv_aix_libpath_ @@ -18173,8 +18408,8 @@ printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler__b=no +else case e in #( + e) lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext @@ -18195,7 +18430,8 @@ else $as_nop fi $RM -r conftest* LDFLAGS=$save_LDFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } @@ -18243,8 +18479,8 @@ printf %s "checking whether the $host_os linker accepts -exported_symbol... " >& if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 -else $as_nop - save_LDFLAGS=$LDFLAGS +else case e in #( + e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18253,12 +18489,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes -else $as_nop - lt_cv_irix_exported_symbol=no +else case e in #( + e) lt_cv_irix_exported_symbol=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS + LDFLAGS=$save_LDFLAGS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } @@ -18584,8 +18822,8 @@ printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 -else $as_nop - $RM conftest* +else case e in #( + e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -18621,7 +18859,8 @@ else $as_nop cat conftest.err 1>&5 fi $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } @@ -19348,8 +19587,8 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_shlibpath_overrides_runpath=no +else case e in #( + e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ @@ -19376,7 +19615,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir - + ;; +esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath @@ -19801,16 +20041,22 @@ printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -19822,24 +20068,27 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no +else case e in #( + e) ac_cv_lib_dl_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else $as_nop - +else case e in #( + e) lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes - + ;; +esac fi ;; @@ -19857,22 +20106,28 @@ fi if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char shl_load (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (void); int main (void) { @@ -19884,39 +20139,47 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes -else $as_nop - ac_cv_lib_dld_shl_load=no +else case e in #( + e) ac_cv_lib_dld_shl_load=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else $as_nop - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +else case e in #( + e) ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -19928,34 +20191,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no +else case e in #( + e) ac_cv_lib_dl_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -19967,34 +20238,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes -else $as_nop - ac_cv_lib_svld_dlopen=no +else case e in #( + e) ac_cv_lib_svld_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dld_link (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (void); int main (void) { @@ -20006,12 +20285,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes -else $as_nop - ac_cv_lib_dld_dld_link=no +else case e in #( + e) ac_cv_lib_dld_dld_link=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } @@ -20020,19 +20301,24 @@ then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi ;; @@ -20060,8 +20346,8 @@ printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 -else $as_nop - if test yes = "$cross_compiling"; then : +else case e in #( + e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -20155,7 +20441,8 @@ _LT_EOF fi rm -fr conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } @@ -20167,8 +20454,8 @@ printf %s "checking whether a statically linked program can dlopen itself... " > if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 -else $as_nop - if test yes = "$cross_compiling"; then : +else case e in #( + e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -20262,7 +20549,8 @@ _LT_EOF fi rm -fr conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } @@ -20455,8 +20743,9 @@ fi if test ${with_libtool+y} then : withval=$with_libtool; use_libtool=$withval -else $as_nop - use_libtool="yes" +else case e in #( + e) use_libtool="yes" ;; +esac fi @@ -21070,12 +21359,12 @@ printf %s "checking whether the compiler provides 32bit atomic builtins... " >&6 if test ${ap_cv_atomic_builtins+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ap_cv_atomic_builtins=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_STDINT_H @@ -21116,13 +21405,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ap_cv_atomic_builtins=yes -else $as_nop - ap_cv_atomic_builtins=no +else case e in #( + e) ap_cv_atomic_builtins=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ap_cv_atomic_builtins" >&5 printf "%s\n" "$ap_cv_atomic_builtins" >&6; } @@ -21132,12 +21424,12 @@ printf %s "checking whether the compiler provides 32bit __atomic builtins... " > if test ${ap_cv__atomic_builtins+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ap_cv__atomic_builtins=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_STDINT_H @@ -21180,13 +21472,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ap_cv__atomic_builtins=yes -else $as_nop - ap_cv__atomic_builtins=no +else case e in #( + e) ap_cv__atomic_builtins=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ap_cv__atomic_builtins" >&5 printf "%s\n" "$ap_cv__atomic_builtins" >&6; } @@ -21200,6 +21495,9 @@ printf "%s\n" "#define HAVE_ATOMIC_BUILTINS 1" >>confdefs.h printf "%s\n" "#define HAVE__ATOMIC_BUILTINS 1" >>confdefs.h fi + has_atomic_builtins=yes +else + has_atomic_builtins=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler provides 64bit atomic builtins" >&5 @@ -21207,41 +21505,45 @@ printf %s "checking whether the compiler provides 64bit atomic builtins... " >&6 if test ${ap_cv_atomic_builtins64+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ap_cv_atomic_builtins64=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_STDINT_H #include <stdint.h> +typedef uint64_t u64_t; +#else +typedef unsigned long long u64_t; #endif int main(int argc, const char *const *argv) { -#if HAVE_STDINT_H - uint64_t val = 1010, tmp, *mem = &val; -#else - unsigned long long val = 1010, tmp, *mem = &val; -#endif - - if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020) + struct { + char pad0; + u64_t val; + } s; + u64_t *mem = &s.val, tmp; + + s.val = 1010; + if (__sync_fetch_and_add(&s.val, 1010) != 1010 || s.val != 2020) return 1; - tmp = val; - if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010) + tmp = s.val; + if (__sync_fetch_and_sub(mem, 1010) != tmp || s.val != 1010) return 1; - if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0) + if (__sync_sub_and_fetch(&s.val, 1010) != 0 || s.val != 0) return 1; tmp = 3030; - if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp) + if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || s.val != tmp) return 1; __sync_synchronize(); - if (__sync_lock_test_and_set(&val, 4040) != 3030) + if (__sync_lock_test_and_set(&s.val, 4040) != 3030) return 1; return 0; @@ -21250,13 +21552,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ap_cv_atomic_builtins64=yes -else $as_nop - ap_cv_atomic_builtins64=no +else case e in #( + e) ap_cv_atomic_builtins64=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ap_cv_atomic_builtins64" >&5 printf "%s\n" "$ap_cv_atomic_builtins64" >&6; } @@ -21266,41 +21571,55 @@ printf %s "checking whether the compiler provides 64bit __atomic builtins... " > if test ${ap_cv__atomic_builtins64+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ap_cv__atomic_builtins64=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_STDINT_H #include <stdint.h> +typedef uint64_t u64_t; +#else +typedef unsigned long long u64_t; #endif +static int test_always_lock_free(volatile u64_t *val) +{ + return __atomic_always_lock_free(sizeof(*val), val); +} int main(int argc, const char *const *argv) { -#if HAVE_STDINT_H - uint64_t val = 1010, tmp, *mem = &val; -#else - unsigned long long val = 1010, tmp, *mem = &val; -#endif + struct { + char pad0; + u64_t val; + char pad1; + u64_t tmp; + } s; + u64_t *mem = &s.val; + + /* check if alignment matters (no fallback to libatomic) */ + if (!test_always_lock_free(&s.val)) + return 1; - if (__atomic_fetch_add(&val, 1010, __ATOMIC_SEQ_CST) != 1010 || val != 2020) + s.val = 1010; + if (__atomic_fetch_add(&s.val, 1010, __ATOMIC_SEQ_CST) != 1010 || s.val != 2020) return 1; - tmp = val; - if (__atomic_fetch_sub(mem, 1010, __ATOMIC_SEQ_CST) != tmp || val != 1010) + s.tmp = s.val; + if (__atomic_fetch_sub(mem, 1010, __ATOMIC_SEQ_CST) != s.tmp || s.val != 1010) return 1; - if (__atomic_sub_fetch(&val, 1010, __ATOMIC_SEQ_CST) != 0 || val != 0) + if (__atomic_sub_fetch(&s.val, 1010, __ATOMIC_SEQ_CST) != 0 || s.val != 0) return 1; - tmp = val; - if (!__atomic_compare_exchange_n(mem, &tmp, 3030, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) - || tmp != 0) + s.tmp = s.val; + if (!__atomic_compare_exchange_n(mem, &s.tmp, 3030, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) + || s.tmp != 0) return 1; - if (__atomic_exchange_n(&val, 4040, __ATOMIC_SEQ_CST) != 3030) + if (__atomic_exchange_n(&s.val, 4040, __ATOMIC_SEQ_CST) != 3030) return 1; return 0; @@ -21309,13 +21628,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ap_cv__atomic_builtins64=yes -else $as_nop - ap_cv__atomic_builtins64=no +else case e in #( + e) ap_cv__atomic_builtins64=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ap_cv__atomic_builtins64" >&5 printf "%s\n" "$ap_cv__atomic_builtins64" >&6; } @@ -21349,7 +21671,7 @@ else rm -f conftest.c cat > conftest.c <<EOF #include <sys/types.h> - int main() { return 0; } + int main(int argc, const char *argv) { return 0; } EOF MKDEP="true" for i in "$CC -MM" "$CC -M" "$CPP -MM" "$CPP -M" "cpp -M"; do @@ -21451,16 +21773,22 @@ printf %s "checking for random in -lbsd... " >&6; } if test ${ac_cv_lib_bsd_random+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char random (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char random (void); int main (void) { @@ -21472,12 +21800,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_bsd_random=yes -else $as_nop - ac_cv_lib_bsd_random=no +else case e in #( + e) ac_cv_lib_bsd_random=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_random" >&5 printf "%s\n" "$ac_cv_lib_bsd_random" >&6; } @@ -21522,14 +21852,148 @@ fi enable_threads="system_threads" native_mmap_emul="1" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 +printf %s "checking for egrep -e... " >&6; } +if test ${ac_cv_path_EGREP_TRADITIONAL+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + : + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + + if test "$ac_cv_path_EGREP_TRADITIONAL" +then : + ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 +printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } + EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BONE_VERSION in sys/socket.h" >&5 printf %s "checking for BONE_VERSION in sys/socket.h... " >&6; } if test ${ac_cv_define_BONE_VERSION+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -21540,15 +22004,17 @@ YES_IS_DEFINED _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "YES_IS_DEFINED" >/dev/null 2>&1 + $EGREP_TRADITIONAL "YES_IS_DEFINED" >/dev/null 2>&1 then : ac_cv_define_BONE_VERSION=yes -else $as_nop - ac_cv_define_BONE_VERSION=no +else case e in #( + e) ac_cv_define_BONE_VERSION=no ;; +esac fi rm -rf conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_BONE_VERSION" >&5 printf "%s\n" "$ac_cv_define_BONE_VERSION" >&6; } @@ -21621,8 +22087,9 @@ esac if test ${enable_lfs+y} then : enableval=$enable_lfs; apr_lfs_choice=$enableval -else $as_nop - apr_lfs_choice=yes +else case e in #( + e) apr_lfs_choice=yes ;; +esac fi @@ -21633,15 +22100,15 @@ printf %s "checking whether to enable -D_LARGEFILE64_SOURCE... " >&6; } if test ${apr_cv_use_lfs64+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" if test "$cross_compiling" = yes then : apr_cv_use_lfs64=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> @@ -21681,14 +22148,17 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_use_lfs64=yes -else $as_nop - apr_cv_use_lfs64=no +else case e in #( + e) apr_cv_use_lfs64=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - CPPFLAGS=$apr_save_CPPFLAGS + CPPFLAGS=$apr_save_CPPFLAGS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_use_lfs64" >&5 printf "%s\n" "$apr_cv_use_lfs64" >&6; } @@ -21717,20 +22187,66 @@ printf "%s\n" "$apr_cv_use_lfs64" >&6; } fi fi +force_generic_atomics=no +force_generic_atomics64=no +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5 +printf %s "checking size of void*... " >&6; } +if test ${ac_cv_sizeof_voidp+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void*))" "ac_cv_sizeof_voidp" "$ac_includes_default" +then : + +else case e in #( + e) if test "$ac_cv_type_voidp" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (void*) +See 'config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_voidp=0 + fi ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_voidp" >&5 +printf "%s\n" "$ac_cv_sizeof_voidp" >&6; } + + + +printf "%s\n" "#define SIZEOF_VOIDP $ac_cv_sizeof_voidp" >>confdefs.h + + +if test "x$ac_cv_sizeof_voidp" = "x"; then + force_generic_atomics64=yes +elif test $ac_cv_sizeof_voidp -lt 8; then + force_generic_atomics64=yes +fi # Check whether --enable-nonportable-atomics was given. if test ${enable_nonportable_atomics+y} then : - enableval=$enable_nonportable_atomics; if test $enableval = yes; then - force_generic_atomics=no - else + enableval=$enable_nonportable_atomics; if test "$enableval" = "upto32bit"; then + force_generic_atomics64=yes + elif test "$enableval" != "yes"; then force_generic_atomics=yes fi -else $as_nop - case $host_cpu in - i[456]86) force_generic_atomics=yes ;; - *) force_generic_atomics=no - case $host in +else case e in #( + e) case $host_cpu in + i[34]86) + force_generic_atomics=yes + ;; + i[56]86) + force_generic_atomics64=yes + ;; + *) case $host in *solaris2.10*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -21746,9 +22262,10 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - force_generic_atomics=yes - +else case e in #( + e) force_generic_atomics=yes + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $force_generic_atomics = yes; then @@ -21759,15 +22276,20 @@ printf "%s\n" "$as_me: nonportable atomic support disabled, system needs Patch-I esac ;; esac - + ;; +esac fi - if test $force_generic_atomics = yes; then printf "%s\n" "#define USE_ATOMICS_GENERIC 1" >>confdefs.h fi +if test $force_generic_atomics = yes -o $force_generic_atomics64 = yes; then + +printf "%s\n" "#define USE_ATOMICS_GENERIC64 1" >>confdefs.h + +fi @@ -21837,15 +22359,21 @@ printf %s "checking for library containing gethostbyname... " >&6; } if test ${ac_cv_search_gethostbyname+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gethostbyname (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (void); int main (void) { @@ -21876,11 +22404,13 @@ done if test ${ac_cv_search_gethostbyname+y} then : -else $as_nop - ac_cv_search_gethostbyname=no +else case e in #( + e) ac_cv_search_gethostbyname=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 printf "%s\n" "$ac_cv_search_gethostbyname" >&6; } @@ -21896,15 +22426,21 @@ printf %s "checking for library containing gethostname... " >&6; } if test ${ac_cv_search_gethostname+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gethostname (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gethostname (void); int main (void) { @@ -21935,11 +22471,13 @@ done if test ${ac_cv_search_gethostname+y} then : -else $as_nop - ac_cv_search_gethostname=no +else case e in #( + e) ac_cv_search_gethostname=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostname" >&5 printf "%s\n" "$ac_cv_search_gethostname" >&6; } @@ -21955,15 +22493,21 @@ printf %s "checking for library containing socket... " >&6; } if test ${ac_cv_search_socket+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char socket (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char socket (void); int main (void) { @@ -21994,11 +22538,13 @@ done if test ${ac_cv_search_socket+y} then : -else $as_nop - ac_cv_search_socket=no +else case e in #( + e) ac_cv_search_socket=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 printf "%s\n" "$ac_cv_search_socket" >&6; } @@ -22014,15 +22560,21 @@ printf %s "checking for library containing crypt... " >&6; } if test ${ac_cv_search_crypt+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char crypt (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char crypt (void); int main (void) { @@ -22053,11 +22605,13 @@ done if test ${ac_cv_search_crypt+y} then : -else $as_nop - ac_cv_search_crypt=no +else case e in #( + e) ac_cv_search_crypt=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5 printf "%s\n" "$ac_cv_search_crypt" >&6; } @@ -22073,8 +22627,8 @@ printf %s "checking for main in -ltruerand... " >&6; } if test ${ac_cv_lib_truerand_main+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ltruerand $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22091,12 +22645,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_truerand_main=yes -else $as_nop - ac_cv_lib_truerand_main=no +else case e in #( + e) ac_cv_lib_truerand_main=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_truerand_main" >&5 printf "%s\n" "$ac_cv_lib_truerand_main" >&6; } @@ -22113,15 +22669,21 @@ printf %s "checking for library containing modf... " >&6; } if test ${ac_cv_search_modf+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char modf (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char modf (void); int main (void) { @@ -22152,11 +22714,13 @@ done if test ${ac_cv_search_modf+y} then : -else $as_nop - ac_cv_search_modf=no +else case e in #( + e) ac_cv_search_modf=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_modf" >&5 printf "%s\n" "$ac_cv_search_modf" >&6; } @@ -22177,8 +22741,8 @@ if test -z "$enable_threads"; then if test ${enable_threads+y} then : enableval=$enable_threads; enable_threads=$enableval -else $as_nop - +else case e in #( + e) if test "$GCC" = "yes"; then SAVE_FL="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -w" @@ -22189,8 +22753,9 @@ if test "x$ac_cv_header_pthread_h" = xyes then : printf "%s\n" "#define HAVE_PTHREAD_H 1" >>confdefs.h enable_threads="pthread" -else $as_nop - enable_threads="no" +else case e in #( + e) enable_threads="no" ;; +esac fi done @@ -22203,13 +22768,15 @@ if test "x$ac_cv_header_pthread_h" = xyes then : printf "%s\n" "#define HAVE_PTHREAD_H 1" >>confdefs.h enable_threads="pthread" -else $as_nop - enable_threads="no" +else case e in #( + e) enable_threads="no" ;; +esac fi done fi - + ;; +esac fi fi @@ -22233,8 +22800,8 @@ printf %s "checking for CFLAGS needed for pthreads... " >&6; } if test ${apr_cv_pthreads_cflags+y} then : printf %s "(cached) " >&6 -else $as_nop - apr_ptc_cflags=$CFLAGS +else case e in #( + e) apr_ptc_cflags=$CFLAGS for flag in none -kthread -pthread -pthreads -mt -mthreads -Kthread -threads; do CFLAGS=$apr_ptc_cflags test "x$flag" != "xnone" && CFLAGS="$CFLAGS $flag" @@ -22242,8 +22809,8 @@ else $as_nop if test "$cross_compiling" = yes then : apr_p_t_r=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <pthread.h> @@ -22253,7 +22820,7 @@ void *thread_routine(void *data) { return data; } -int main() { +int main(int argc, const char *argv[]) { pthread_t thd; pthread_mutexattr_t mattr; pthread_once_t once_init = PTHREAD_ONCE_INIT; @@ -22265,11 +22832,13 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_p_t_r=yes -else $as_nop - apr_p_t_r=no +else case e in #( + e) apr_p_t_r=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi @@ -22283,7 +22852,8 @@ fi done CFLAGS=$apr_ptc_cflags - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_pthreads_cflags" >&5 printf "%s\n" "$apr_cv_pthreads_cflags" >&6; } @@ -22326,8 +22896,8 @@ printf %s "checking for LIBS needed for pthreads... " >&6; } if test ${apr_cv_pthreads_lib+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_ptc_libs=$LIBS for lib in -lpthread -lpthreads -lc_r; do LIBS="$apr_ptc_libs $lib" @@ -22335,8 +22905,8 @@ else $as_nop if test "$cross_compiling" = yes then : apr_p_t_r=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <pthread.h> @@ -22346,7 +22916,7 @@ void *thread_routine(void *data) { return data; } -int main() { +int main(int argc, const char *argv[]) { pthread_t thd; pthread_mutexattr_t mattr; pthread_once_t once_init = PTHREAD_ONCE_INIT; @@ -22358,11 +22928,13 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_p_t_r=yes -else $as_nop - apr_p_t_r=no +else case e in #( + e) apr_p_t_r=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi @@ -22376,7 +22948,8 @@ fi done LIBS=$apr_ptc_libs - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_pthreads_lib" >&5 printf "%s\n" "$apr_cv_pthreads_lib" >&6; } @@ -22426,15 +22999,16 @@ then : threads="1" pthreadh="1" pthreadser="1" -else $as_nop - +else case e in #( + e) threads="0" pthreadh="0" pthreadser="0" CFLAGS="$apr_pthsv_CFLAGS" LIBS="$apr_pthsv_LIBS" - + ;; +esac fi done @@ -22450,15 +23024,16 @@ then : threads="1" pthreadh="1" pthreadser="1" -else $as_nop - +else case e in #( + e) threads="0" pthreadh="0" pthreadser="0" CFLAGS="$apr_pthsv_CFLAGS" LIBS="$apr_pthsv_LIBS" - + ;; +esac fi done @@ -22483,8 +23058,8 @@ printf %s "checking for CFLAGS needed for pthreads... " >&6; } if test ${apr_cv_pthreads_cflags+y} then : printf %s "(cached) " >&6 -else $as_nop - apr_ptc_cflags=$CFLAGS +else case e in #( + e) apr_ptc_cflags=$CFLAGS for flag in none -kthread -pthread -pthreads -mt -mthreads -Kthread -threads; do CFLAGS=$apr_ptc_cflags test "x$flag" != "xnone" && CFLAGS="$CFLAGS $flag" @@ -22492,8 +23067,8 @@ else $as_nop if test "$cross_compiling" = yes then : apr_p_t_r=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <pthread.h> @@ -22503,7 +23078,7 @@ void *thread_routine(void *data) { return data; } -int main() { +int main(int argc, const char *argv[]) { pthread_t thd; pthread_mutexattr_t mattr; pthread_once_t once_init = PTHREAD_ONCE_INIT; @@ -22515,11 +23090,13 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_p_t_r=yes -else $as_nop - apr_p_t_r=no +else case e in #( + e) apr_p_t_r=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi @@ -22533,7 +23110,8 @@ fi done CFLAGS=$apr_ptc_cflags - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_pthreads_cflags" >&5 printf "%s\n" "$apr_cv_pthreads_cflags" >&6; } @@ -22576,8 +23154,8 @@ printf %s "checking for LIBS needed for pthreads... " >&6; } if test ${apr_cv_pthreads_lib+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_ptc_libs=$LIBS for lib in -lpthread -lpthreads -lc_r; do LIBS="$apr_ptc_libs $lib" @@ -22585,8 +23163,8 @@ else $as_nop if test "$cross_compiling" = yes then : apr_p_t_r=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <pthread.h> @@ -22596,7 +23174,7 @@ void *thread_routine(void *data) { return data; } -int main() { +int main(int argc, const char *argv[]) { pthread_t thd; pthread_mutexattr_t mattr; pthread_once_t once_init = PTHREAD_ONCE_INIT; @@ -22608,11 +23186,13 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_p_t_r=yes -else $as_nop - apr_p_t_r=no +else case e in #( + e) apr_p_t_r=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi @@ -22626,7 +23206,8 @@ fi done LIBS=$apr_ptc_libs - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_pthreads_lib" >&5 printf "%s\n" "$apr_cv_pthreads_lib" >&6; } @@ -22676,15 +23257,16 @@ then : threads="1" pthreadh="1" pthreadser="1" -else $as_nop - +else case e in #( + e) threads="0" pthreadser="0" pthreadh="0" CFLAGS="$apr_pthsv_CFLAGS" LIBS="$apr_pthsv_LIBS" - + ;; +esac fi done @@ -22700,15 +23282,16 @@ then : threads="1" pthreadh="1" pthreadser="1" -else $as_nop - +else case e in #( + e) threads="0" pthreadser="0" pthreadh="0" CFLAGS="$apr_pthsv_CFLAGS" LIBS="$apr_pthsv_LIBS" - + ;; +esac fi done @@ -22722,8 +23305,8 @@ printf %s "checking whether pthread_getspecific takes two arguments... " >&6; } if test ${ac_cv_pthread_getspecific_two_args+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22746,13 +23329,15 @@ then : ac_cv_pthread_getspecific_two_args=yes -else $as_nop - +else case e in #( + e) ac_cv_pthread_getspecific_two_args=no - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread_getspecific_two_args" >&5 printf "%s\n" "$ac_cv_pthread_getspecific_two_args" >&6; } @@ -22769,8 +23354,8 @@ printf %s "checking whether pthread_attr_getdetachstate takes one argument... " if test ${ac_cv_pthread_attr_getdetachstate_one_arg+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22792,13 +23377,15 @@ then : ac_cv_pthread_attr_getdetachstate_one_arg=yes -else $as_nop - +else case e in #( + e) ac_cv_pthread_attr_getdetachstate_one_arg=no - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread_attr_getdetachstate_one_arg" >&5 printf "%s\n" "$ac_cv_pthread_attr_getdetachstate_one_arg" >&6; } @@ -22815,18 +23402,18 @@ printf %s "checking for recursive mutex support... " >&6; } if test ${apr_cv_mutex_recursive+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : apr_cv_mutex_recursive=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <pthread.h> #include <stdlib.h> -int main() { +int main(int argc, const char *argv[]) { pthread_mutexattr_t attr; pthread_mutex_t m; @@ -22838,13 +23425,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_mutex_recursive=yes -else $as_nop - apr_cv_mutex_recursive=no +else case e in #( + e) apr_cv_mutex_recursive=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_mutex_recursive" >&5 printf "%s\n" "$apr_cv_mutex_recursive" >&6; } @@ -22887,8 +23477,8 @@ printf %s "checking for pthread_rwlock_t... " >&6; } if test ${apr_cv_type_rwlock_t+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <pthread.h> @@ -22903,10 +23493,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : apr_cv_type_rwlock_t=yes -else $as_nop - apr_cv_type_rwlock_t=no +else case e in #( + e) apr_cv_type_rwlock_t=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_type_rwlock_t" >&5 printf "%s\n" "$apr_cv_type_rwlock_t" >&6; } @@ -22951,16 +23543,22 @@ printf %s "checking for gethostbyname in -lc_r... " >&6; } if test ${ac_cv_lib_c_r_gethostbyname+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gethostbyname (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (void); int main (void) { @@ -22972,12 +23570,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_c_r_gethostbyname=yes -else $as_nop - ac_cv_lib_c_r_gethostbyname=no +else case e in #( + e) ac_cv_lib_c_r_gethostbyname=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_c_r_gethostbyname" >&6; } @@ -22998,16 +23598,22 @@ printf %s "checking for gethostbyaddr in -lc_r... " >&6; } if test ${ac_cv_lib_c_r_gethostbyaddr+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gethostbyaddr (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyaddr (void); int main (void) { @@ -23019,12 +23625,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_c_r_gethostbyaddr=yes -else $as_nop - ac_cv_lib_c_r_gethostbyaddr=no +else case e in #( + e) ac_cv_lib_c_r_gethostbyaddr=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_gethostbyaddr" >&5 printf "%s\n" "$ac_cv_lib_c_r_gethostbyaddr" >&6; } @@ -23045,16 +23653,22 @@ printf %s "checking for getservbyname in -lc_r... " >&6; } if test ${ac_cv_lib_c_r_getservbyname+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char getservbyname (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char getservbyname (void); int main (void) { @@ -23066,12 +23680,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_c_r_getservbyname=yes -else $as_nop - ac_cv_lib_c_r_getservbyname=no +else case e in #( + e) ac_cv_lib_c_r_getservbyname=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_getservbyname" >&5 printf "%s\n" "$ac_cv_lib_c_r_getservbyname" >&6; } @@ -23165,16 +23781,22 @@ printf %s "checking for malloc in -lefence... " >&6; } if test ${ac_cv_lib_efence_malloc+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lefence $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char malloc (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char malloc (void); int main (void) { @@ -23186,12 +23808,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_efence_malloc=yes -else $as_nop - ac_cv_lib_efence_malloc=no +else case e in #( + e) ac_cv_lib_efence_malloc=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_efence_malloc" >&5 printf "%s\n" "$ac_cv_lib_efence_malloc" >&6; } @@ -23218,8 +23842,9 @@ then : done fi -else $as_nop - as_fn_error $? "Electric Fence requested but not detected" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "Electric Fence requested but not detected" "$LINENO" 5 ;; +esac fi @@ -23316,8 +23941,9 @@ if test "x$ac_cv_func_sigsuspend" = xyes then : printf "%s\n" "#define HAVE_SIGSUSPEND 1" >>confdefs.h have_sigsuspend="1" -else $as_nop - have_sigsuspend="0" +else case e in #( + e) have_sigsuspend="0" ;; +esac fi done @@ -23329,8 +23955,9 @@ if test "x$ac_cv_func_sigwait" = xyes then : printf "%s\n" "#define HAVE_SIGWAIT 1" >>confdefs.h have_sigwait="1" -else $as_nop - have_sigwait="0" +else case e in #( + e) have_sigwait="0" ;; +esac fi done @@ -23371,18 +23998,18 @@ printf %s "checking for epoll support... " >&6; } if test ${apr_cv_epoll+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : apr_cv_epoll=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/epoll.h> #include <unistd.h> -int main() +int main(int argc, const char *argv[]) { return epoll_create(5) == -1; } @@ -23390,13 +24017,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_epoll=yes -else $as_nop - apr_cv_epoll=no +else case e in #( + e) apr_cv_epoll=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_epoll" >&5 printf "%s\n" "$apr_cv_epoll" >&6; } @@ -23413,18 +24043,18 @@ printf %s "checking for epoll_create1 support... " >&6; } if test ${apr_cv_epoll_create1+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : apr_cv_epoll_create1=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/epoll.h> #include <unistd.h> -int main() +int main(int argc, const char *argv[]) { return epoll_create1(0) == -1; } @@ -23432,13 +24062,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_epoll_create1=yes -else $as_nop - apr_cv_epoll_create1=no +else case e in #( + e) apr_cv_epoll_create1=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_epoll_create1" >&5 printf "%s\n" "$apr_cv_epoll_create1" >&6; } @@ -23449,23 +24082,90 @@ printf "%s\n" "#define HAVE_EPOLL_CREATE1 1" >>confdefs.h fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether epoll_wait has a reliable timeout (min)" >&5 +printf %s "checking whether epoll_wait has a reliable timeout (min)... " >&6; } +if test ${apr_cv_epoll_wait_has_reliable_timeout+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + apr_cv_epoll_wait_has_reliable_timeout=no +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <unistd.h> +#include <sys/epoll.h> +#include <sys/time.h> /* for gettimeofday */ + +#define TV2US(tv) ((tv).tv_sec * 1000000LL + (tv).tv_usec) + +int main(int argc, const char *argv[]) +{ + struct epoll_event events[1]; + int fd, i; +#ifdef HAVE_EPOLL_CREATE1 + fd = epoll_create1(0); +#else + fd = epoll_create(1); +#endif + if (fd < 0) { + return 1; + } + for (i = 0; i < 10; ++i) { + struct timeval t1 = {0,}, + t2 = {0,}; + (void)gettimeofday(&t1, NULL); + (void)epoll_wait(fd, events, 1, 100); /* ms */ + (void)gettimeofday(&t2, NULL); + if (TV2US(t2) - TV2US(t1) < 100000) { /* us */ + return 1; + } + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + apr_cv_epoll_wait_has_reliable_timeout=yes +else case e in #( + e) apr_cv_epoll_wait_has_reliable_timeout=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_epoll_wait_has_reliable_timeout" >&5 +printf "%s\n" "$apr_cv_epoll_wait_has_reliable_timeout" >&6; } + +if test "$apr_cv_epoll_wait_has_reliable_timeout" = "yes"; then + +printf "%s\n" "#define HAVE_EPOLL_WAIT_RELIABLE_TIMEOUT 1" >>confdefs.h + +fi + # test for dup3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dup3 support" >&5 printf %s "checking for dup3 support... " >&6; } if test ${apr_cv_dup3+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : apr_cv_dup3=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> -int main() +int main(int argc, const char *argv[]) { return dup3(STDOUT_FILENO, STDERR_FILENO, 0) == -1; } @@ -23473,13 +24173,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_dup3=yes -else $as_nop - apr_cv_dup3=no +else case e in #( + e) apr_cv_dup3=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_dup3" >&5 printf "%s\n" "$apr_cv_dup3" >&6; } @@ -23499,12 +24202,12 @@ printf %s "checking for accept4 support... " >&6; } if test ${apr_cv_accept4+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : apr_cv_accept4=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> @@ -23547,13 +24250,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_accept4=yes -else $as_nop - apr_cv_accept4=no +else case e in #( + e) apr_cv_accept4=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_accept4" >&5 printf "%s\n" "$apr_cv_accept4" >&6; } @@ -23569,18 +24275,18 @@ printf %s "checking for SOCK_CLOEXEC support... " >&6; } if test ${apr_cv_sock_cloexec+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : apr_cv_sock_cloexec=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/socket.h> -int main() +int main(int argc, const char *argv[]) { return socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, 0) == -1; } @@ -23588,13 +24294,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_sock_cloexec=yes -else $as_nop - apr_cv_sock_cloexec=no +else case e in #( + e) apr_cv_sock_cloexec=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_sock_cloexec" >&5 printf "%s\n" "$apr_cv_sock_cloexec" >&6; } @@ -23619,12 +24328,12 @@ printf %s "checking for epoll_create1 support... " >&6; } if test ${apr_cv_epoll_create1+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : apr_cv_epoll_create1=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/epoll.h> @@ -23638,13 +24347,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_epoll_create1=yes -else $as_nop - apr_cv_epoll_create1=no +else case e in #( + e) apr_cv_epoll_create1=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_epoll_create1" >&5 printf "%s\n" "$apr_cv_epoll_create1" >&6; } @@ -23661,12 +24373,12 @@ printf %s "checking for asio -> message queue support... " >&6; } if test ${apr_cv_aio_msgq+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : apr_cv_aio_msgq=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _AIO_OS390 @@ -23684,13 +24396,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_aio_msgq=yes -else $as_nop - apr_cv_aio_msgq=no +else case e in #( + e) apr_cv_aio_msgq=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_aio_msgq" >&5 printf "%s\n" "$apr_cv_aio_msgq" >&6; } @@ -23707,12 +24422,12 @@ printf %s "checking for dup3 support... " >&6; } if test ${apr_cv_dup3+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : apr_cv_dup3=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> @@ -23725,13 +24440,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_dup3=yes -else $as_nop - apr_cv_dup3=no +else case e in #( + e) apr_cv_dup3=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_dup3" >&5 printf "%s\n" "$apr_cv_dup3" >&6; } @@ -23748,12 +24466,12 @@ printf %s "checking for accept4 support... " >&6; } if test ${apr_cv_accept4+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : apr_cv_accept4=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> @@ -23830,13 +24548,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_accept4=yes -else $as_nop - apr_cv_accept4=no +else case e in #( + e) apr_cv_accept4=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_accept4" >&5 printf "%s\n" "$apr_cv_accept4" >&6; } @@ -23852,12 +24573,12 @@ printf %s "checking for SOCK_CLOEXEC support... " >&6; } if test ${apr_cv_sock_cloexec+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : apr_cv_sock_cloexec=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> @@ -23871,13 +24592,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_sock_cloexec=yes -else $as_nop - apr_cv_sock_cloexec=no +else case e in #( + e) apr_cv_sock_cloexec=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_sock_cloexec" >&5 printf "%s\n" "$apr_cv_sock_cloexec" >&6; } @@ -23923,15 +24647,21 @@ printf %s "checking for library containing shm_open... " >&6; } if test ${ac_cv_search_shm_open+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char shm_open (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char shm_open (void); int main (void) { @@ -23962,11 +24692,13 @@ done if test ${ac_cv_search_shm_open+y} then : -else $as_nop - ac_cv_search_shm_open=no +else case e in #( + e) ac_cv_search_shm_open=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_open" >&5 printf "%s\n" "$ac_cv_search_shm_open" >&6; } @@ -24128,8 +24860,8 @@ printf %s "checking for MAP_ANON in sys/mman.h... " >&6; } if test ${ac_cv_define_MAP_ANON+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24140,15 +24872,17 @@ YES_IS_DEFINED _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "YES_IS_DEFINED" >/dev/null 2>&1 + $EGREP_TRADITIONAL "YES_IS_DEFINED" >/dev/null 2>&1 then : ac_cv_define_MAP_ANON=yes -else $as_nop - ac_cv_define_MAP_ANON=no +else case e in #( + e) ac_cv_define_MAP_ANON=no ;; +esac fi rm -rf conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_MAP_ANON" >&5 printf "%s\n" "$ac_cv_define_MAP_ANON" >&6; } @@ -24163,14 +24897,15 @@ printf %s "checking for /dev/zero... " >&6; } if test ${ac_cv_file__dev_zero+y} then : printf %s "(cached) " >&6 -else $as_nop - test "$cross_compiling" = yes && +else case e in #( + e) test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/dev/zero"; then ac_cv_file__dev_zero=yes else ac_cv_file__dev_zero=no -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_zero" >&5 printf "%s\n" "$ac_cv_file__dev_zero" >&6; } @@ -24188,12 +24923,12 @@ printf %s "checking for mmap that can map /dev/zero... " >&6; } if test ${ac_cv_mmap__dev_zero+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_file__dev_zero=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/stat.h> @@ -24201,7 +24936,7 @@ else $as_nop #ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> #endif - int main() + int main(int argc, const char *argv[]) { int fd; void *m; @@ -24222,13 +24957,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : -else $as_nop - ac_cv_file__dev_zero=no +else case e in #( + e) ac_cv_file__dev_zero=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mmap__dev_zero" >&5 printf "%s\n" "$ac_cv_mmap__dev_zero" >&6; } @@ -24798,6 +25536,24 @@ fi fi +# Check whether --enable-sysv-shm was given. +if test ${enable_sysv_shm+y} +then : + enableval=$enable_sysv_shm; +if test "$haveshmget" = "1"; then + ac_decision='' + for ac_item in USE_SHMEM_SHMGET; do + eval "ac_decision_this=\$ac_decision_${ac_item}" + if test ".$ac_decision_this" = .yes; then + ac_decision=$ac_item + eval "ac_decision_msg=\$ac_decision_${ac_item}_msg" + fi + done + +fi + +fi + case $host in *linux* ) # Linux pre-2.4 had problems with MM_SHMT_MMANON even though @@ -24897,10 +25653,11 @@ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h - + ;; +esac fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works @@ -24910,8 +25667,8 @@ printf %s "checking for working alloca.h... " >&6; } if test ${ac_cv_working_alloca_h+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <alloca.h> int @@ -24926,11 +25683,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_working_alloca_h=yes -else $as_nop - ac_cv_working_alloca_h=no +else case e in #( + e) ac_cv_working_alloca_h=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 printf "%s\n" "$ac_cv_working_alloca_h" >&6; } @@ -24945,10 +25704,10 @@ printf %s "checking for alloca... " >&6; } if test ${ac_cv_func_alloca_works+y} then : printf %s "(cached) " >&6 -else $as_nop - if test $ac_cv_working_alloca_h = yes; then - ac_cv_func_alloca_works=yes -else +else case e in #( + e) ac_cv_func_alloca_works=$ac_cv_working_alloca_h +if test "$ac_cv_func_alloca_works" != yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> @@ -24979,15 +25738,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_func_alloca_works=yes -else $as_nop - ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 printf "%s\n" "$ac_cv_func_alloca_works" >&6; } -fi if test $ac_cv_func_alloca_works = yes; then @@ -25009,12 +25767,12 @@ printf %s "checking stack direction for C alloca... " >&6; } if test ${ac_cv_c_stack_direction+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_c_stack_direction=0 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -25037,13 +25795,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_c_stack_direction=1 -else $as_nop - ac_cv_c_stack_direction=-1 +else case e in #( + e) ac_cv_c_stack_direction=-1 ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 printf "%s\n" "$ac_cv_c_stack_direction" >&6; } @@ -25134,8 +25895,9 @@ if test "x$ac_cv_func_setrlimit" = xyes then : printf "%s\n" "#define HAVE_SETRLIMIT 1" >>confdefs.h have_setrlimit="1" -else $as_nop - have_setrlimit="0" +else case e in #( + e) have_setrlimit="0" ;; +esac fi done @@ -25147,8 +25909,9 @@ if test "x$ac_cv_func_getrlimit" = xyes then : printf "%s\n" "#define HAVE_GETRLIMIT 1" >>confdefs.h have_getrlimit="1" -else $as_nop - have_getrlimit="0" +else case e in #( + e) have_getrlimit="0" ;; +esac fi done @@ -25158,16 +25921,22 @@ printf %s "checking for sendfilev in -lsendfile... " >&6; } if test ${ac_cv_lib_sendfile_sendfilev+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsendfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char sendfilev (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char sendfilev (void); int main (void) { @@ -25179,12 +25948,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_sendfile_sendfilev=yes -else $as_nop - ac_cv_lib_sendfile_sendfilev=no +else case e in #( + e) ac_cv_lib_sendfile_sendfilev=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sendfile_sendfilev" >&5 printf "%s\n" "$ac_cv_lib_sendfile_sendfilev" >&6; } @@ -25199,12 +25970,12 @@ fi for ac_func in sendfile send_file sendfilev do : - as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh` + as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | sed "$as_sed_sh"` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_func" | sed "$as_sed_cpp"` 1 _ACEOF sendfile="1" fi @@ -25221,8 +25992,8 @@ then : else sendfile="0" fi -else $as_nop - +else case e in #( + e) orig_sendfile=$sendfile case $host in *freebsd*) @@ -25248,28 +26019,30 @@ printf "%s\n" "$as_me: WARNING: Disabled sendfile support for Linux 2.2 on S/390 # compiler-independent check for 64-bit build # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5 printf %s "checking size of void*... " >&6; } if test ${ac_cv_sizeof_voidp+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void*))" "ac_cv_sizeof_voidp" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void*))" "ac_cv_sizeof_voidp" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_voidp" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_voidp" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (void*) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_voidp=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_voidp" >&5 printf "%s\n" "$ac_cv_sizeof_voidp" >&6; } @@ -25287,7 +26060,8 @@ printf "%s\n" "#define SIZEOF_VOIDP $ac_cv_sizeof_voidp" >>confdefs.h esac if test "$orig_sendfile" != "$sendfile"; then echo "sendfile support disabled to avoid system problem" - fi + fi ;; +esac fi @@ -25300,8 +26074,9 @@ if test "x$ac_cv_func_sigaction" = xyes then : printf "%s\n" "#define HAVE_SIGACTION 1" >>confdefs.h have_sigaction="1" -else $as_nop - have_sigaction="0" +else case e in #( + e) have_sigaction="0" ;; +esac fi done @@ -25310,8 +26085,8 @@ printf %s "checking for $CC options needed to detect all undeclared functions... if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_CFLAGS=$CFLAGS +else case e in #( + e) ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" @@ -25330,8 +26105,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - # This test program should compile successfully. +else case e in #( + e) # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the @@ -25359,26 +26134,29 @@ then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' -else $as_nop - ac_cv_c_undeclared_builtin_options=$ac_arg +else case e in #( + e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; +esac fi break fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins -See \`config.log' for more details" "$LINENO" 5; } ;; #( +See 'config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : @@ -25395,8 +26173,9 @@ ac_fn_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include if test "x$ac_cv_have_decl_sys_siglist" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_SYS_SIGLIST $ac_have_decl" >>confdefs.h @@ -25410,8 +26189,9 @@ if test "x$ac_cv_func_fork" = xyes then : printf "%s\n" "#define HAVE_FORK 1" >>confdefs.h fork="1" -else $as_nop - fork="0" +else case e in #( + e) fork="0" ;; +esac fi done @@ -25430,8 +26210,9 @@ if test "x$ac_cv_func_strerror_r" = xyes then : printf "%s\n" "#define HAVE_STRERROR_R 1" >>confdefs.h strerror_r="1" -else $as_nop - strerror_r="0" +else case e in #( + e) strerror_r="0" ;; +esac fi done @@ -25442,13 +26223,13 @@ printf %s "checking whether return code from strerror_r has type int... " >&6; } if test ${ac_cv_strerror_r_rc_int+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_strerror_r_rc_int=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <errno.h> @@ -25470,14 +26251,17 @@ if ac_fn_c_try_run "$LINENO" then : ac_cv_strerror_r_rc_int=yes -else $as_nop - - ac_cv_strerror_r_rc_int=no +else case e in #( + e) + ac_cv_strerror_r_rc_int=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_strerror_r_rc_int" >&5 printf "%s\n" "$ac_cv_strerror_r_rc_int" >&6; } @@ -25496,8 +26280,9 @@ if test "x$ac_cv_func_mmap" = xyes then : printf "%s\n" "#define HAVE_MMAP 1" >>confdefs.h mmap="1" -else $as_nop - mmap="0" +else case e in #( + e) mmap="0" ;; +esac fi done @@ -25512,8 +26297,9 @@ if test "x$ac_cv_func_memmove" = xyes then : printf "%s\n" "#define HAVE_MEMMOVE 1" >>confdefs.h have_memmove="1" -else $as_nop - have_memmove="0" +else case e in #( + e) have_memmove="0" ;; +esac fi done @@ -25573,8 +26359,8 @@ printf %s "checking whether sigwait takes one argument... " >&6; } if test ${ac_cv_sigwait_one_arg+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -25605,12 +26391,14 @@ then : ac_cv_sigwait_one_arg=yes -else $as_nop - +else case e in #( + e) ac_cv_sigwait_one_arg=no - + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sigwait_one_arg" >&5 printf "%s\n" "$ac_cv_sigwait_one_arg" >&6; } @@ -25629,8 +26417,8 @@ printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 +else case e in #( + e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then @@ -25652,9 +26440,10 @@ do as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in +case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -25690,12 +26479,15 @@ else ac_cv_path_EGREP=$EGREP fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" + EGREP_TRADITIONAL=$EGREP + ac_cv_path_EGREP_TRADITIONAL=$EGREP @@ -26180,8 +26972,8 @@ printf %s "checking for inet_addr... " >&6; } if test ${ac_cv_func_inet_addr+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26213,13 +27005,15 @@ then : ac_cv_func_inet_addr=yes -else $as_nop - +else case e in #( + e) ac_cv_func_inet_addr=no - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_inet_addr" >&5 printf "%s\n" "$ac_cv_func_inet_addr" >&6; } @@ -26236,8 +27030,8 @@ printf %s "checking for inet_network... " >&6; } if test ${ac_cv_func_inet_network+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26267,13 +27061,15 @@ then : ac_cv_func_inet_network=yes -else $as_nop - +else case e in #( + e) ac_cv_func_inet_network=no - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_inet_network" >&5 printf "%s\n" "$ac_cv_func_inet_network" >&6; } @@ -26293,8 +27089,8 @@ printf %s "checking for netinet/tcp.h... " >&6; } if test ${apr_cv_hdr_netinet_tcp_h+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> @@ -26305,10 +27101,12 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : apr_cv_hdr_netinet_tcp_h=yes -else $as_nop - apr_cv_hdr_netinet_tcp_h=no +else case e in #( + e) apr_cv_hdr_netinet_tcp_h=no ;; +esac fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_hdr_netinet_tcp_h" >&5 printf "%s\n" "$apr_cv_hdr_netinet_tcp_h" >&6; } @@ -26361,6 +27159,7 @@ fi + # Checking for h_errno in <netdb.h> if test "$netdbh" = "1"; then @@ -26369,8 +27168,8 @@ printf %s "checking for h_errno in netdb.h... " >&6; } if test ${ac_cv_h_errno_cppflags+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test x != x; then CPPFLAGS="-D $CPPFLAGS" @@ -26404,10 +27203,11 @@ then : ac_cv_h_errno_cppflags=yes fi -else $as_nop - +else case e in #( + e) ac_cv_h_errno_cppflags=no - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "$ac_cv_h_errno_cppflags" = "no"; then @@ -26446,10 +27246,11 @@ then : ac_cv_h_errno_cppflags=yes fi -else $as_nop - +else case e in #( + e) ac_cv_h_errno_cppflags=no - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "$ac_cv_h_errno_cppflags" != "no"; then @@ -26458,7 +27259,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CPPFLAGS="$ac_save" fi - + ;; +esac fi if test "$ac_cv_h_errno_cppflags" != "no"; then @@ -26585,10 +27387,11 @@ ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define off_t long int" >>confdefs.h - + ;; +esac fi @@ -26597,8 +27400,8 @@ fi if test "x$ac_cv_type_pid_t" = xyes then : -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _WIN64 && !defined __CYGWIN__ @@ -26617,14 +27420,16 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_pid_type='int' -else $as_nop - ac_pid_type='__int64' +else case e in #( + e) ac_pid_type='__int64' ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h - + ;; +esac fi @@ -26632,52 +27437,44 @@ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h - + ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -printf %s "checking for uid_t in sys/types.h... " >&6; } -if test ${ac_cv_type_uid_t+y} +ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" +if test "x$ac_cv_type_uid_t" = xyes then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <sys/types.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1 -then : - ac_cv_type_uid_t=yes -else $as_nop - ac_cv_type_uid_t=no -fi -rm -rf conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -printf "%s\n" "$ac_cv_type_uid_t" >&6; } -if test $ac_cv_type_uid_t = no; then +else case e in #( + e) printf "%s\n" "#define uid_t int" >>confdefs.h + ;; +esac +fi +ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" +if test "x$ac_cv_type_gid_t" = xyes +then : +else case e in #( + e) printf "%s\n" "#define gid_t int" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define ssize_t int" >>confdefs.h - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 @@ -26685,8 +27482,8 @@ printf %s "checking for inline... " >&6; } if test ${ac_cv_c_inline+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_inline=no +else case e in #( + e) ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26704,7 +27501,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 printf "%s\n" "$ac_cv_c_inline" >&6; } @@ -26729,8 +27527,8 @@ printf %s "checking for an ANSI C-conforming const... " >&6; } if test ${ac_cv_c_const+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -26794,10 +27592,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_const=yes -else $as_nop - ac_cv_c_const=no +else case e in #( + e) ac_cv_c_const=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 printf "%s\n" "$ac_cv_c_const" >&6; } @@ -26812,8 +27612,8 @@ printf %s "checking whether setpgrp requires zero arguments... " >&6; } if test ${ac_cv_func_setpgrp_void+y} then : printf %s "(cached) " >&6 -else $as_nop - # Call it with two arguments. +else case e in #( + e) # Call it with two arguments. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -26828,11 +27628,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_func_setpgrp_void=no -else $as_nop - ac_cv_func_setpgrp_void=yes +else case e in #( + e) ac_cv_func_setpgrp_void=yes ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 printf "%s\n" "$ac_cv_func_setpgrp_void" >&6; } @@ -26849,8 +27651,8 @@ printf %s "checking for socklen_t... " >&6; } if test ${ac_cv_socklen_t+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26876,13 +27678,15 @@ then : ac_cv_socklen_t=yes -else $as_nop - +else case e in #( + e) ac_cv_socklen_t=no - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_socklen_t" >&5 printf "%s\n" "$ac_cv_socklen_t" >&6; } @@ -26896,28 +27700,30 @@ fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5 printf %s "checking size of void*... " >&6; } if test ${ac_cv_sizeof_voidp+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void*))" "ac_cv_sizeof_voidp" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void*))" "ac_cv_sizeof_voidp" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_voidp" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_voidp" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (void*) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_voidp=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_voidp" >&5 printf "%s\n" "$ac_cv_sizeof_voidp" >&6; } @@ -26936,28 +27742,30 @@ fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 printf %s "checking size of char... " >&6; } if test ${ac_cv_sizeof_char+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_char" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_char" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (char) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_char=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5 printf "%s\n" "$ac_cv_sizeof_char" >&6; } @@ -26969,28 +27777,30 @@ printf "%s\n" "#define SIZEOF_CHAR $ac_cv_sizeof_char" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 printf %s "checking size of short... " >&6; } if test ${ac_cv_sizeof_short+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_short" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_short" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 printf "%s\n" "$ac_cv_sizeof_short" >&6; } @@ -27002,28 +27812,30 @@ printf "%s\n" "#define SIZEOF_SHORT $ac_cv_sizeof_short" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 printf %s "checking size of int... " >&6; } if test ${ac_cv_sizeof_int+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_int" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_int" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 printf "%s\n" "$ac_cv_sizeof_int" >&6; } @@ -27035,28 +27847,30 @@ printf "%s\n" "#define SIZEOF_INT $ac_cv_sizeof_int" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 printf %s "checking size of long... " >&6; } if test ${ac_cv_sizeof_long+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_long" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_long" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 printf "%s\n" "$ac_cv_sizeof_long" >&6; } @@ -27068,28 +27882,30 @@ printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 printf %s "checking size of long long... " >&6; } if test ${ac_cv_sizeof_long_long+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_long_long" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_long_long" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 printf "%s\n" "$ac_cv_sizeof_long_long" >&6; } @@ -27156,8 +27972,8 @@ printf %s "checking whether int64_t and int use fmt %d... " >&6; } if test ${apr_cv_typematch_int64_t_int_d+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_c_compiler_gnu" = "yes"; then @@ -27191,12 +28007,14 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS apr_cv_typematch_int64_t_int_d=yes -else $as_nop - CFLAGS=$apr_save_CFLAGS -apr_cv_typematch_int64_t_int_d=no +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +apr_cv_typematch_int64_t_int_d=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_typematch_int64_t_int_d" >&5 printf "%s\n" "$apr_cv_typematch_int64_t_int_d" >&6; } @@ -27215,8 +28033,8 @@ printf %s "checking whether int64_t and long use fmt %ld... " >&6; } if test ${apr_cv_typematch_int64_t_long_ld+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_c_compiler_gnu" = "yes"; then @@ -27250,12 +28068,14 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS apr_cv_typematch_int64_t_long_ld=yes -else $as_nop - CFLAGS=$apr_save_CFLAGS -apr_cv_typematch_int64_t_long_ld=no +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +apr_cv_typematch_int64_t_long_ld=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_typematch_int64_t_long_ld" >&5 printf "%s\n" "$apr_cv_typematch_int64_t_long_ld" >&6; } @@ -27274,8 +28094,8 @@ printf %s "checking whether int64_t and long long use fmt %lld... " >&6; } if test ${apr_cv_typematch_int64_t_long_long_lld+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_c_compiler_gnu" = "yes"; then @@ -27309,12 +28129,14 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS apr_cv_typematch_int64_t_long_long_lld=yes -else $as_nop - CFLAGS=$apr_save_CFLAGS -apr_cv_typematch_int64_t_long_long_lld=no +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +apr_cv_typematch_int64_t_long_long_lld=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_typematch_int64_t_long_long_lld" >&5 printf "%s\n" "$apr_cv_typematch_int64_t_long_long_lld" >&6; } @@ -27389,8 +28211,8 @@ printf %s "checking for INT64_C... " >&6; } if test ${apr_cv_define_INT64_C+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef INT64_C @@ -27398,11 +28220,11 @@ YES_IS_DEFINED #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "YES_IS_DEFINED" >/dev/null 2>&1 + $EGREP_TRADITIONAL "YES_IS_DEFINED" >/dev/null 2>&1 then : apr_cv_define_INT64_C=yes -else $as_nop - +else case e in #( + e) # Now check for INT64_C in stdint.h cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -27412,17 +28234,20 @@ YES_IS_DEFINED #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "YES_IS_DEFINED" >/dev/null 2>&1 + $EGREP_TRADITIONAL "YES_IS_DEFINED" >/dev/null 2>&1 then : apr_cv_define_INT64_C=yes -else $as_nop - apr_cv_define_INT64_C=no +else case e in #( + e) apr_cv_define_INT64_C=no ;; +esac fi rm -rf conftest* - + ;; +esac fi rm -rf conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_define_INT64_C" >&5 printf "%s\n" "$apr_cv_define_INT64_C" >&6; } @@ -27465,28 +28290,30 @@ fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of pid_t" >&5 printf %s "checking size of pid_t... " >&6; } if test ${ac_cv_sizeof_pid_t+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pid_t))" "ac_cv_sizeof_pid_t" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pid_t))" "ac_cv_sizeof_pid_t" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_pid_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_pid_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (pid_t) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_pid_t=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pid_t" >&5 printf "%s\n" "$ac_cv_sizeof_pid_t" >&6; } @@ -27566,8 +28393,8 @@ printf %s "checking whether ssize_t and long use fmt %ld... " >&6; } if test ${apr_cv_typematch_ssize_t_long_ld+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_c_compiler_gnu" = "yes"; then @@ -27601,12 +28428,14 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS apr_cv_typematch_ssize_t_long_ld=yes -else $as_nop - CFLAGS=$apr_save_CFLAGS -apr_cv_typematch_ssize_t_long_ld=no +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +apr_cv_typematch_ssize_t_long_ld=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_typematch_ssize_t_long_ld" >&5 printf "%s\n" "$apr_cv_typematch_ssize_t_long_ld" >&6; } @@ -27623,8 +28452,8 @@ printf %s "checking whether ssize_t and int use fmt %d... " >&6; } if test ${apr_cv_typematch_ssize_t_int_d+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_c_compiler_gnu" = "yes"; then @@ -27658,12 +28487,14 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS apr_cv_typematch_ssize_t_int_d=yes -else $as_nop - CFLAGS=$apr_save_CFLAGS -apr_cv_typematch_ssize_t_int_d=no +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +apr_cv_typematch_ssize_t_int_d=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_typematch_ssize_t_int_d" >&5 printf "%s\n" "$apr_cv_typematch_ssize_t_int_d" >&6; } @@ -27685,8 +28516,8 @@ printf %s "checking whether size_t and unsigned long use fmt %lu... " >&6; } if test ${apr_cv_typematch_size_t_unsigned_long_lu+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_c_compiler_gnu" = "yes"; then @@ -27720,12 +28551,14 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS apr_cv_typematch_size_t_unsigned_long_lu=yes -else $as_nop - CFLAGS=$apr_save_CFLAGS -apr_cv_typematch_size_t_unsigned_long_lu=no +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +apr_cv_typematch_size_t_unsigned_long_lu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_typematch_size_t_unsigned_long_lu" >&5 printf "%s\n" "$apr_cv_typematch_size_t_unsigned_long_lu" >&6; } @@ -27742,8 +28575,8 @@ printf %s "checking whether size_t and unsigned int use fmt %u... " >&6; } if test ${apr_cv_typematch_size_t_unsigned_int_u+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_c_compiler_gnu" = "yes"; then @@ -27777,12 +28610,14 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS apr_cv_typematch_size_t_unsigned_int_u=yes -else $as_nop - CFLAGS=$apr_save_CFLAGS -apr_cv_typematch_size_t_unsigned_int_u=no +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +apr_cv_typematch_size_t_unsigned_int_u=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_typematch_size_t_unsigned_int_u" >&5 printf "%s\n" "$apr_cv_typematch_size_t_unsigned_int_u" >&6; } @@ -27800,28 +28635,30 @@ fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of ssize_t" >&5 printf %s "checking size of ssize_t... " >&6; } if test ${ac_cv_sizeof_ssize_t+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ssize_t))" "ac_cv_sizeof_ssize_t" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ssize_t))" "ac_cv_sizeof_ssize_t" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_ssize_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_ssize_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (ssize_t) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_ssize_t=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ssize_t" >&5 printf "%s\n" "$ac_cv_sizeof_ssize_t" >&6; } @@ -27853,28 +28690,30 @@ ssize_t_fmt="#define APR_SSIZE_T_FMT \"$ssize_t_fmt\"" # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 printf %s "checking size of size_t... " >&6; } if test ${ac_cv_sizeof_size_t+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_size_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_size_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (size_t) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_size_t=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 printf "%s\n" "$ac_cv_sizeof_size_t" >&6; } @@ -27907,28 +28746,30 @@ size_t_fmt="#define APR_SIZE_T_FMT \"$size_t_fmt\"" # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 printf %s "checking size of off_t... " >&6; } if test ${ac_cv_sizeof_off_t+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_off_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_off_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (off_t) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_off_t=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 printf "%s\n" "$ac_cv_sizeof_off_t" >&6; } @@ -28014,8 +28855,8 @@ printf %s "checking whether off_t and long use fmt %ld... " >&6; } if test ${apr_cv_typematch_off_t_long_ld+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_c_compiler_gnu" = "yes"; then @@ -28049,12 +28890,14 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS apr_cv_typematch_off_t_long_ld=yes -else $as_nop - CFLAGS=$apr_save_CFLAGS -apr_cv_typematch_off_t_long_ld=no +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +apr_cv_typematch_off_t_long_ld=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_typematch_off_t_long_ld" >&5 printf "%s\n" "$apr_cv_typematch_off_t_long_ld" >&6; } @@ -28074,8 +28917,8 @@ printf %s "checking whether off_t and int use fmt %d... " >&6; } if test ${apr_cv_typematch_off_t_int_d+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_c_compiler_gnu" = "yes"; then @@ -28109,12 +28952,14 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS apr_cv_typematch_off_t_int_d=yes -else $as_nop - CFLAGS=$apr_save_CFLAGS -apr_cv_typematch_off_t_int_d=no +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +apr_cv_typematch_off_t_int_d=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_typematch_off_t_int_d" >&5 printf "%s\n" "$apr_cv_typematch_off_t_int_d" >&6; } @@ -28134,8 +28979,8 @@ printf %s "checking whether off_t and long long use fmt %lld... " >&6; } if test ${apr_cv_typematch_off_t_long_long_lld+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_c_compiler_gnu" = "yes"; then @@ -28169,12 +29014,14 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS apr_cv_typematch_off_t_long_long_lld=yes -else $as_nop - CFLAGS=$apr_save_CFLAGS -apr_cv_typematch_off_t_long_long_lld=no +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +apr_cv_typematch_off_t_long_long_lld=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_typematch_off_t_long_long_lld" >&5 printf "%s\n" "$apr_cv_typematch_off_t_long_long_lld" >&6; } @@ -28194,8 +29041,8 @@ printf %s "checking whether off_t and $int64_value use fmt %I64d... " >&6; } if eval test \${apr_cv_typematch_off_t_$int64_value_I64d+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_c_compiler_gnu" = "yes"; then @@ -28229,12 +29076,14 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS apr_cv_typematch_off_t_$int64_value_I64d=yes -else $as_nop - CFLAGS=$apr_save_CFLAGS -apr_cv_typematch_off_t_$int64_value_I64d=no +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +apr_cv_typematch_off_t_$int64_value_I64d=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi eval ac_res=\$apr_cv_typematch_off_t_$int64_value_I64d { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -28297,28 +29146,30 @@ case $host in ino_t_value=ino_t # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of ino_t" >&5 printf %s "checking size of ino_t... " >&6; } if test ${ac_cv_sizeof_ino_t+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ino_t))" "ac_cv_sizeof_ino_t" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ino_t))" "ac_cv_sizeof_ino_t" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_ino_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_ino_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (ino_t) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_ino_t=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ino_t" >&5 printf "%s\n" "$ac_cv_sizeof_ino_t" >&6; } @@ -28346,8 +29197,8 @@ printf %s "checking whether byte ordering is bigendian... " >&6; } if test ${ac_cv_c_bigendian+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_bigendian=unknown +else case e in #( + e) ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -28393,8 +29244,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext int main (void) { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ && LITTLE_ENDIAN) bogus endian macros #endif @@ -28425,8 +29276,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes -else $as_nop - ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -28470,8 +29322,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes -else $as_nop - ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -28498,22 +29351,23 @@ unsigned short int ascii_mm[] = int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } - extern int foo; - -int -main (void) -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then ac_cv_c_bigendian=yes fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else @@ -28522,9 +29376,10 @@ then : fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -28547,14 +29402,17 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_c_bigendian=no -else $as_nop - ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=yes ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 printf "%s\n" "$ac_cv_c_bigendian" >&6; } @@ -28582,30 +29440,32 @@ fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of struct iovec" >&5 printf %s "checking size of struct iovec... " >&6; } if test ${ac_cv_sizeof_struct_iovec+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct iovec))" "ac_cv_sizeof_struct_iovec" "$ac_includes_default +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct iovec))" "ac_cv_sizeof_struct_iovec" "$ac_includes_default #include <sys/uio.h> " then : -else $as_nop - if test "$ac_cv_type_struct_iovec" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_struct_iovec" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (struct iovec) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_struct_iovec=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_iovec" >&5 printf "%s\n" "$ac_cv_sizeof_struct_iovec" >&6; } @@ -28653,8 +29513,9 @@ if test "x$ac_cv_func_strnicmp" = xyes then : printf "%s\n" "#define HAVE_STRNICMP 1" >>confdefs.h have_strnicmp="1" -else $as_nop - have_strnicmp="0" +else case e in #( + e) have_strnicmp="0" ;; +esac fi done @@ -28666,8 +29527,9 @@ if test "x$ac_cv_func_strncasecmp" = xyes then : printf "%s\n" "#define HAVE_STRNCASECMP 1" >>confdefs.h have_strncasecmp="1" -else $as_nop - have_strncasecmp="0" +else case e in #( + e) have_strncasecmp="0" ;; +esac fi done @@ -28679,8 +29541,9 @@ if test "x$ac_cv_func_stricmp" = xyes then : printf "%s\n" "#define HAVE_STRICMP 1" >>confdefs.h have_stricmp="1" -else $as_nop - have_stricmp="0" +else case e in #( + e) have_stricmp="0" ;; +esac fi done @@ -28692,8 +29555,9 @@ if test "x$ac_cv_func_strcasecmp" = xyes then : printf "%s\n" "#define HAVE_STRCASECMP 1" >>confdefs.h have_strcasecmp="1" -else $as_nop - have_strcasecmp="0" +else case e in #( + e) have_strcasecmp="0" ;; +esac fi done @@ -28705,8 +29569,9 @@ if test "x$ac_cv_func_strdup" = xyes then : printf "%s\n" "#define HAVE_STRDUP 1" >>confdefs.h have_strdup="1" -else $as_nop - have_strdup="0" +else case e in #( + e) have_strdup="0" ;; +esac fi done @@ -28718,8 +29583,9 @@ if test "x$ac_cv_func_strstr" = xyes then : printf "%s\n" "#define HAVE_STRSTR 1" >>confdefs.h have_strstr="1" -else $as_nop - have_strstr="0" +else case e in #( + e) have_strstr="0" ;; +esac fi done @@ -28731,18 +29597,20 @@ if test "x$ac_cv_func_memchr" = xyes then : printf "%s\n" "#define HAVE_MEMCHR 1" >>confdefs.h have_memchr="1" -else $as_nop - have_memchr="0" +else case e in #( + e) have_memchr="0" ;; +esac fi done -as_ac_var=`printf "%s\n" "ac_cv_func_$int64_strfn" | $as_tr_sh` +as_ac_var=`printf "%s\n" "ac_cv_func_$int64_strfn" | sed "$as_sed_sh"` ac_fn_c_check_func "$LINENO" "$int64_strfn" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes" then : have_int64_strfn="1" -else $as_nop - have_int64_strfn="0" +else case e in #( + e) have_int64_strfn="0" ;; +esac fi @@ -28752,8 +29620,9 @@ if test "$have_int64_strfn" = "0" && test "$int64_strfn" = "strtoll"; then if test "x$ac_cv_func_strtoq" = xyes then : have_int64_strfn=1 -else $as_nop - have_int64_strfn=0 +else case e in #( + e) have_int64_strfn=0 ;; +esac fi fi @@ -28789,8 +29658,9 @@ then : dsotype=$enableval fi -else $as_nop - dsotype=any +else case e in #( + e) dsotype=any ;; +esac fi @@ -28812,16 +29682,22 @@ printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char shl_load (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (void); int main (void) { @@ -28833,12 +29709,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes -else $as_nop - ac_cv_lib_dld_shl_load=no +else case e in #( + e) ac_cv_lib_dld_shl_load=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } @@ -28894,16 +29772,22 @@ printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -28915,12 +29799,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no +else case e in #( + e) ac_cv_lib_dl_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } @@ -28956,22 +29842,28 @@ fi if test "x$ac_cv_func_dlsym" = xyes then : -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5 printf %s "checking for dlsym in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlsym+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlsym (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlsym (void); int main (void) { @@ -28983,12 +29875,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlsym=yes -else $as_nop - ac_cv_lib_dl_dlsym=no +else case e in #( + e) ac_cv_lib_dl_dlsym=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5 printf "%s\n" "$ac_cv_lib_dl_dlsym" >&6; } @@ -29015,11 +29909,13 @@ then : done fi -else $as_nop - dsotype=any - echo "Weird: dlopen() was found but dlsym() was not found!" +else case e in #( + e) dsotype=any + echo "Weird: dlopen() was found but dlsym() was not found!" ;; +esac fi - + ;; +esac fi fi @@ -29030,16 +29926,22 @@ printf %s "checking for load_image in -lroot... " >&6; } if test ${ac_cv_lib_root_load_image+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lroot $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char load_image (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char load_image (void); int main (void) { @@ -29051,12 +29953,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_root_load_image=yes -else $as_nop - ac_cv_lib_root_load_image=no +else case e in #( + e) ac_cv_lib_root_load_image=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_root_load_image" >&5 printf "%s\n" "$ac_cv_lib_root_load_image" >&6; } @@ -29142,8 +30046,9 @@ then : else oc="0" fi -else $as_nop - oc=1 +else case e in #( + e) oc=1 ;; +esac fi @@ -29182,9 +30087,10 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS vla_msg=yes -else $as_nop - CFLAGS=$apr_save_CFLAGS -vla_msg=no +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +vla_msg=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -29201,14 +30107,14 @@ printf %s "checking struct rlimit... " >&6; } if test ${ac_cv_struct_rlimit+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_struct_rlimit=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> @@ -29227,14 +30133,17 @@ if ac_fn_c_try_run "$LINENO" then : ac_cv_struct_rlimit=yes -else $as_nop - - ac_cv_struct_rlimit=no +else case e in #( + e) + ac_cv_struct_rlimit=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_rlimit" >&5 printf "%s\n" "$ac_cv_struct_rlimit" >&6; } @@ -29320,15 +30229,21 @@ printf %s "checking for library containing sem_open... " >&6; } if test ${ac_cv_search_sem_open+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char sem_open (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char sem_open (void); int main (void) { @@ -29359,11 +30274,13 @@ done if test ${ac_cv_search_sem_open+y} then : -else $as_nop - ac_cv_search_sem_open=no +else case e in #( + e) ac_cv_search_sem_open=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_open" >&5 printf "%s\n" "$ac_cv_search_sem_open" >&6; } @@ -29503,13 +30420,13 @@ printf %s "checking for working sem_open... " >&6; } if test ${ac_cv_func_sem_open+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_func_sem_open=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <errno.h> @@ -29520,7 +30437,7 @@ else $as_nop #ifndef SEM_FAILED #define SEM_FAILED (-1) #endif -int main() +int main(int argc, const char *argv[]) { sem_t *psem; const char *sem_name = "/apr_autoconf"; @@ -29542,13 +30459,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_sem_open=yes -else $as_nop - ac_cv_func_sem_open=no +else case e in #( + e) ac_cv_func_sem_open=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_sem_open" >&5 printf "%s\n" "$ac_cv_func_sem_open" >&6; } @@ -29578,10 +30498,11 @@ if ac_fn_c_try_compile "$LINENO" then : have_union_semun="1" union_semun=yes msg=yes -else $as_nop - +else case e in #( + e) have_union_semun="0" -msg=no +msg=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $msg" >&5 @@ -29594,8 +30515,8 @@ printf %s "checking for LOCK_EX in sys/file.h... " >&6; } if test ${ac_cv_define_LOCK_EX+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -29606,15 +30527,17 @@ YES_IS_DEFINED _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "YES_IS_DEFINED" >/dev/null 2>&1 + $EGREP_TRADITIONAL "YES_IS_DEFINED" >/dev/null 2>&1 then : ac_cv_define_LOCK_EX=yes -else $as_nop - ac_cv_define_LOCK_EX=no +else case e in #( + e) ac_cv_define_LOCK_EX=no ;; +esac fi rm -rf conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_LOCK_EX" >&5 printf "%s\n" "$ac_cv_define_LOCK_EX" >&6; } @@ -29630,8 +30553,8 @@ printf %s "checking for F_SETLK in fcntl.h... " >&6; } if test ${ac_cv_define_F_SETLK+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -29642,15 +30565,17 @@ YES_IS_DEFINED _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "YES_IS_DEFINED" >/dev/null 2>&1 + $EGREP_TRADITIONAL "YES_IS_DEFINED" >/dev/null 2>&1 then : ac_cv_define_F_SETLK=yes -else $as_nop - ac_cv_define_F_SETLK=no +else case e in #( + e) ac_cv_define_F_SETLK=no ;; +esac fi rm -rf conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_F_SETLK" >&5 printf "%s\n" "$ac_cv_define_F_SETLK" >&6; } @@ -29666,8 +30591,8 @@ printf %s "checking for SEM_UNDO in sys/sem.h... " >&6; } if test ${ac_cv_define_SEM_UNDO+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -29678,15 +30603,17 @@ YES_IS_DEFINED _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "YES_IS_DEFINED" >/dev/null 2>&1 + $EGREP_TRADITIONAL "YES_IS_DEFINED" >/dev/null 2>&1 then : ac_cv_define_SEM_UNDO=yes -else $as_nop - ac_cv_define_SEM_UNDO=no +else case e in #( + e) ac_cv_define_SEM_UNDO=no ;; +esac fi rm -rf conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_SEM_UNDO" >&5 printf "%s\n" "$ac_cv_define_SEM_UNDO" >&6; } @@ -29705,8 +30632,8 @@ printf %s "checking for POLLIN in poll.h sys/poll.h... " >&6; } if test ${ac_cv_define_POLLIN+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ac_cv_define_POLLIN=no for curhdr in poll.h sys/poll.h do @@ -29720,14 +30647,15 @@ YES_IS_DEFINED _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "YES_IS_DEFINED" >/dev/null 2>&1 + $EGREP_TRADITIONAL "YES_IS_DEFINED" >/dev/null 2>&1 then : ac_cv_define_POLLIN=yes fi rm -rf conftest* done - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_POLLIN" >&5 printf "%s\n" "$ac_cv_define_POLLIN" >&6; } @@ -29745,8 +30673,8 @@ printf %s "checking for PTHREAD_PROCESS_SHARED in pthread.h... " >&6; } if test ${ac_cv_define_PTHREAD_PROCESS_SHARED+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -29757,15 +30685,17 @@ YES_IS_DEFINED _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "YES_IS_DEFINED" >/dev/null 2>&1 + $EGREP_TRADITIONAL "YES_IS_DEFINED" >/dev/null 2>&1 then : ac_cv_define_PTHREAD_PROCESS_SHARED=yes -else $as_nop - ac_cv_define_PTHREAD_PROCESS_SHARED=no +else case e in #( + e) ac_cv_define_PTHREAD_PROCESS_SHARED=no ;; +esac fi rm -rf conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_PTHREAD_PROCESS_SHARED" >&5 printf "%s\n" "$ac_cv_define_PTHREAD_PROCESS_SHARED" >&6; } @@ -29857,22 +30787,22 @@ printf %s "checking for working PROCESS_SHARED locks... " >&6; } if test ${apr_cv_process_shared_works+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <pthread.h> #include <stdlib.h> - int main() + int main(int argc, const char *argv[]) { pthread_mutex_t mutex; pthread_mutexattr_t attr; @@ -29892,13 +30822,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_process_shared_works=yes -else $as_nop - apr_cv_process_shared_works=no +else case e in #( + e) apr_cv_process_shared_works=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_process_shared_works" >&5 printf "%s\n" "$apr_cv_process_shared_works" >&6; } @@ -29917,15 +30850,15 @@ printf %s "checking for robust cross-process mutex support... " >&6; } if test ${apr_cv_mutex_robust_shared+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> @@ -29958,16 +30891,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_mutex_robust_shared=yes -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> @@ -30000,19 +30933,24 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_mutex_robust_shared=np -else $as_nop - apr_cv_mutex_robust_shared=no +else case e in #( + e) apr_cv_mutex_robust_shared=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_mutex_robust_shared" >&5 printf "%s\n" "$apr_cv_mutex_robust_shared" >&6; } @@ -30500,8 +31438,8 @@ printf %s "checking if fcntl returns EACCES when F_SETLK is already held... " >& if test "$cross_compiling" = yes then : apr_fcntl_tryacquire_eacces=0 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_STDLIB_H @@ -30530,7 +31468,7 @@ const char *fname = "conftest.fcntl"; int lockit(); -int main() +int main(int argc, const char *argv[]) { int rc, status;; proc_mutex_lock_it.l_whence = SEEK_SET; /* from current point */ @@ -30566,11 +31504,13 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_fcntl_tryacquire_eacces=1 -else $as_nop - apr_fcntl_tryacquire_eacces=0 +else case e in #( + e) apr_fcntl_tryacquire_eacces=0 ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi fi @@ -30699,8 +31639,9 @@ ac_fn_check_decl "$LINENO" "SYS_getrandom" "ac_cv_have_decl_SYS_getrandom" "#inc if test "x$ac_cv_have_decl_SYS_getrandom" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_SYS_GETRANDOM $ac_have_decl" >>confdefs.h @@ -30756,8 +31697,9 @@ if test "$rand" != "1"; then if test ${with_devrandom+y} then : withval=$with_devrandom; apr_devrandom="$withval" -else $as_nop - apr_devrandom="no" +else case e in #( + e) apr_devrandom="no" ;; +esac fi if test "$apr_devrandom" = "no"; then @@ -31031,8 +31973,8 @@ printf %s "checking for inode member of struct dirent... " >&6; } if test ${apr_cv_dirent_inode+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_cv_dirent_inode=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -31084,7 +32026,8 @@ then : fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_dirent_inode" >&5 printf "%s\n" "$apr_cv_dirent_inode" >&6; } @@ -31100,8 +32043,8 @@ printf %s "checking for file type member of struct dirent... " >&6; } if test ${apr_cv_dirent_type+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_cv_dirent_type=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -31124,7 +32067,8 @@ then : apr_cv_dirent_type=d_type fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_dirent_type" >&5 printf "%s\n" "$apr_cv_dirent_type" >&6; } @@ -31139,12 +32083,12 @@ echo "${nl}Checking for OS UUID Support..." for ac_header in uuid.h uuid/uuid.h sys/uuid.h do : - as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | sed "$as_sed_sh"` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_header" | sed "$as_sed_cpp"` 1 _ACEOF break fi @@ -31159,15 +32103,21 @@ printf %s "checking for library containing uuid_create... " >&6; } if test ${ac_cv_search_uuid_create+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char uuid_create (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char uuid_create (void); int main (void) { @@ -31198,11 +32148,13 @@ done if test ${ac_cv_search_uuid_create+y} then : -else $as_nop - ac_cv_search_uuid_create=no +else case e in #( + e) ac_cv_search_uuid_create=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uuid_create" >&5 printf "%s\n" "$ac_cv_search_uuid_create" >&6; } @@ -31218,15 +32170,21 @@ printf %s "checking for library containing uuid_generate... " >&6; } if test ${ac_cv_search_uuid_generate+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char uuid_generate (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char uuid_generate (void); int main (void) { @@ -31257,11 +32215,13 @@ done if test ${ac_cv_search_uuid_generate+y} then : -else $as_nop - ac_cv_search_uuid_generate=no +else case e in #( + e) ac_cv_search_uuid_generate=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uuid_generate" >&5 printf "%s\n" "$ac_cv_search_uuid_generate" >&6; } @@ -31296,8 +32256,8 @@ printf %s "checking for os uuid usability... " >&6; } if test ${apr_cv_osuuid+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) # Ensure this test closely mirrors misc/unix/rand.c! uuid_includes=" #if defined(HAVE_SYS_TYPES_H) @@ -31335,8 +32295,9 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : apr_cv_osuuid=yes -else $as_nop - apr_cv_func_uuid_create=no +else case e in #( + e) apr_cv_func_uuid_create=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -31359,13 +32320,15 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : apr_cv_osuuid=yes -else $as_nop - apr_cv_func_uuid_generate=no +else case e in #( + e) apr_cv_func_uuid_generate=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_osuuid" >&5 printf "%s\n" "$apr_cv_osuuid" >&6; } @@ -31412,8 +32375,8 @@ printf %s "checking for type in_addr... " >&6; } if test ${ac_cv_type_in_addr+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -31441,12 +32404,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_type_in_addr="yes" -else $as_nop - -ac_cv_type_in_addr="no" +else case e in #( + e) +ac_cv_type_in_addr="no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_in_addr" >&5 printf "%s\n" "$ac_cv_type_in_addr" >&6; } @@ -31484,8 +32449,8 @@ printf %s "checking style of gethostbyname_r routine... " >&6; } if test ${ac_cv_gethostbyname_r_style+y} then : printf %s "(cached) " >&6 -else $as_nop - apr_save_CFLAGS=$CFLAGS +else case e in #( + e) apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_c_compiler_gnu" = "yes"; then CFLAGS="$CFLAGS -Werror" @@ -31528,12 +32493,14 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS ac_cv_gethostbyname_r_style=glibc2 -else $as_nop - CFLAGS=$apr_save_CFLAGS -ac_cv_gethostbyname_r_style=none +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +ac_cv_gethostbyname_r_style=none ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gethostbyname_r_style" >&5 printf "%s\n" "$ac_cv_gethostbyname_r_style" >&6; } @@ -31549,8 +32516,8 @@ printf %s "checking 3rd argument to the gethostbyname_r routines... " >&6; } if test ${ac_cv_gethostbyname_r_arg+y} then : printf %s "(cached) " >&6 -else $as_nop - apr_save_CFLAGS=$CFLAGS +else case e in #( + e) apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_c_compiler_gnu" = "yes"; then CFLAGS="$CFLAGS -Werror" @@ -31593,12 +32560,14 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS ac_cv_gethostbyname_r_arg=hostent_data -else $as_nop - CFLAGS=$apr_save_CFLAGS -ac_cv_gethostbyname_r_arg=char +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +ac_cv_gethostbyname_r_arg=char ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gethostbyname_r_arg" >&5 printf "%s\n" "$ac_cv_gethostbyname_r_arg" >&6; } @@ -31620,8 +32589,8 @@ printf %s "checking style of getservbyname_r routine... " >&6; } if test ${ac_cv_getservbyname_r_style+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_c_compiler_gnu" = "yes"; then @@ -31666,9 +32635,10 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS ac_cv_getservbyname_r_style=glibc2 -else $as_nop - CFLAGS=$apr_save_CFLAGS -ac_cv_getservbyname_r_style=none +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +ac_cv_getservbyname_r_style=none ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -31717,9 +32687,10 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS ac_cv_getservbyname_r_style=solaris -else $as_nop - CFLAGS=$apr_save_CFLAGS -ac_cv_getservbyname_r_style=none +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +ac_cv_getservbyname_r_style=none ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -31769,14 +32740,16 @@ if ac_fn_c_try_compile "$LINENO" then : CFLAGS=$apr_save_CFLAGS ac_cv_getservbyname_r_style=osf1 -else $as_nop - CFLAGS=$apr_save_CFLAGS -ac_cv_getservbyname_r_style=none +else case e in #( + e) CFLAGS=$apr_save_CFLAGS +ac_cv_getservbyname_r_style=none ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_getservbyname_r_style" >&5 printf "%s\n" "$ac_cv_getservbyname_r_style" >&6; } @@ -31803,15 +32776,15 @@ printf %s "checking if TCP_NODELAY setting is inherited from listening sockets.. if test ${ac_cv_tcp_nodelay_inherited+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_tcp_nodelay_inherited="yes" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdio.h> @@ -31920,15 +32893,18 @@ then : ac_cv_tcp_nodelay_inherited="yes" -else $as_nop - +else case e in #( + e) ac_cv_tcp_nodelay_inherited="no" - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tcp_nodelay_inherited" >&5 printf "%s\n" "$ac_cv_tcp_nodelay_inherited" >&6; } @@ -31944,15 +32920,15 @@ printf %s "checking if O_NONBLOCK setting is inherited from listening sockets... if test ${ac_cv_o_nonblock_inherited+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_o_nonblock_inherited="yes" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_STDLIB_H @@ -32094,15 +33070,18 @@ then : ac_cv_o_nonblock_inherited="yes" -else $as_nop - +else case e in #( + e) ac_cv_o_nonblock_inherited="no" - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_o_nonblock_inherited" >&5 printf "%s\n" "$ac_cv_o_nonblock_inherited" >&6; } @@ -32118,15 +33097,15 @@ printf %s "checking whether TCP_NODELAY and TCP_CORK can both be enabled... " >& if test ${apr_cv_tcp_nodelay_with_cork+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H @@ -32178,13 +33157,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_tcp_nodelay_with_cork=yes -else $as_nop - apr_cv_tcp_nodelay_with_cork=no +else case e in #( + e) apr_cv_tcp_nodelay_with_cork=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_tcp_nodelay_with_cork" >&5 printf "%s\n" "$apr_cv_tcp_nodelay_with_cork" >&6; } @@ -32203,8 +33185,8 @@ printf %s "checking for TCP_CORK in netinet/tcp.h... " >&6; } if test ${ac_cv_define_TCP_CORK+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32215,15 +33197,17 @@ YES_IS_DEFINED _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "YES_IS_DEFINED" >/dev/null 2>&1 + $EGREP_TRADITIONAL "YES_IS_DEFINED" >/dev/null 2>&1 then : ac_cv_define_TCP_CORK=yes -else $as_nop - ac_cv_define_TCP_CORK=no +else case e in #( + e) ac_cv_define_TCP_CORK=no ;; +esac fi rm -rf conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_TCP_CORK" >&5 printf "%s\n" "$ac_cv_define_TCP_CORK" >&6; } @@ -32239,8 +33223,8 @@ printf %s "checking for TCP_NOPUSH in netinet/tcp.h... " >&6; } if test ${ac_cv_define_TCP_NOPUSH+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32251,15 +33235,17 @@ YES_IS_DEFINED _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "YES_IS_DEFINED" >/dev/null 2>&1 + $EGREP_TRADITIONAL "YES_IS_DEFINED" >/dev/null 2>&1 then : ac_cv_define_TCP_NOPUSH=yes -else $as_nop - ac_cv_define_TCP_NOPUSH=no +else case e in #( + e) ac_cv_define_TCP_NOPUSH=no ;; +esac fi rm -rf conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_TCP_NOPUSH" >&5 printf "%s\n" "$ac_cv_define_TCP_NOPUSH" >&6; } @@ -32287,7 +33273,7 @@ yes _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 then : apr_tcp_nopush_flag="3" @@ -32312,8 +33298,8 @@ printf %s "checking for SO_ACCEPTFILTER in sys/socket.h... " >&6; } if test ${ac_cv_define_SO_ACCEPTFILTER+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32324,15 +33310,17 @@ YES_IS_DEFINED _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "YES_IS_DEFINED" >/dev/null 2>&1 + $EGREP_TRADITIONAL "YES_IS_DEFINED" >/dev/null 2>&1 then : ac_cv_define_SO_ACCEPTFILTER=yes -else $as_nop - ac_cv_define_SO_ACCEPTFILTER=no +else case e in #( + e) ac_cv_define_SO_ACCEPTFILTER=no ;; +esac fi rm -rf conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_SO_ACCEPTFILTER" >&5 printf "%s\n" "$ac_cv_define_SO_ACCEPTFILTER" >&6; } @@ -32353,8 +33341,9 @@ fi if test ${enable_sctp+y} then : enableval=$enable_sctp; apr_wants_sctp=$enableval -else $as_nop - apr_wants_sctp=any +else case e in #( + e) apr_wants_sctp=any ;; +esac fi @@ -32366,13 +33355,13 @@ printf %s "checking whether SCTP is supported... " >&6; } if test ${apr_cv_sctp+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : apr_cv_sctp=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H @@ -32403,13 +33392,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_sctp=yes -else $as_nop - apr_cv_sctp=no +else case e in #( + e) apr_cv_sctp=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_sctp" >&5 printf "%s\n" "$apr_cv_sctp" >&6; } @@ -32431,8 +33423,8 @@ printf %s "checking for struct ip_mreq... " >&6; } if test ${apr_cv_struct_ipmreq+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32455,10 +33447,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : apr_cv_struct_ipmreq=yes -else $as_nop - apr_cv_struct_ipmreq=no +else case e in #( + e) apr_cv_struct_ipmreq=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_struct_ipmreq" >&5 printf "%s\n" "$apr_cv_struct_ipmreq" >&6; } @@ -32491,8 +33485,9 @@ then : enableval=$enable_ipv6; if test "$enableval" = "no"; then user_disabled_ipv6=1 fi -else $as_nop - user_disabled_ipv6=0 +else case e in #( + e) user_disabled_ipv6=0 ;; +esac fi @@ -32506,15 +33501,21 @@ printf %s "checking for library containing getaddrinfo... " >&6; } if test ${ac_cv_search_getaddrinfo+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char getaddrinfo (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char getaddrinfo (void); int main (void) { @@ -32545,11 +33546,13 @@ done if test ${ac_cv_search_getaddrinfo+y} then : -else $as_nop - ac_cv_search_getaddrinfo=no +else case e in #( + e) ac_cv_search_getaddrinfo=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5 printf "%s\n" "$ac_cv_search_getaddrinfo" >&6; } @@ -32565,15 +33568,21 @@ printf %s "checking for library containing gai_strerror... " >&6; } if test ${ac_cv_search_gai_strerror+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gai_strerror (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gai_strerror (void); int main (void) { @@ -32604,11 +33613,13 @@ done if test ${ac_cv_search_gai_strerror+y} then : -else $as_nop - ac_cv_search_gai_strerror=no +else case e in #( + e) ac_cv_search_gai_strerror=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gai_strerror" >&5 printf "%s\n" "$ac_cv_search_gai_strerror" >&6; } @@ -32624,15 +33635,21 @@ printf %s "checking for library containing getnameinfo... " >&6; } if test ${ac_cv_search_getnameinfo+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char getnameinfo (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char getnameinfo (void); int main (void) { @@ -32663,11 +33680,13 @@ done if test ${ac_cv_search_getnameinfo+y} then : -else $as_nop - ac_cv_search_getnameinfo=no +else case e in #( + e) ac_cv_search_getnameinfo=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getnameinfo" >&5 printf "%s\n" "$ac_cv_search_getnameinfo" >&6; } @@ -32703,15 +33722,15 @@ printf %s "checking for working getaddrinfo... " >&6; } if test ${ac_cv_working_getaddrinfo+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_working_getaddrinfo="yes" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_NETDB_H @@ -32759,15 +33778,18 @@ then : ac_cv_working_getaddrinfo="yes" -else $as_nop - +else case e in #( + e) ac_cv_working_getaddrinfo="no" - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_getaddrinfo" >&5 printf "%s\n" "$ac_cv_working_getaddrinfo" >&6; } @@ -32787,15 +33809,15 @@ printf %s "checking for negative error codes for getaddrinfo... " >&6; } if test ${ac_cv_negative_eai+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_negative_eai="no" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_NETDB_H @@ -32818,15 +33840,18 @@ then : ac_cv_negative_eai="yes" -else $as_nop - +else case e in #( + e) ac_cv_negative_eai="no" - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_negative_eai" >&5 printf "%s\n" "$ac_cv_negative_eai" >&6; } @@ -32842,15 +33867,15 @@ printf %s "checking for working getnameinfo... " >&6; } if test ${ac_cv_working_getnameinfo+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_working_getnameinfo="yes" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_NETDB_H @@ -32903,15 +33928,18 @@ then : ac_cv_working_getnameinfo="yes" -else $as_nop - +else case e in #( + e) ac_cv_working_getnameinfo="no" - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_getnameinfo" >&5 printf "%s\n" "$ac_cv_working_getnameinfo" >&6; } @@ -32927,8 +33955,8 @@ printf %s "checking for sockaddr_in6... " >&6; } if test ${ac_cv_define_sockaddr_in6+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32954,13 +33982,15 @@ then : ac_cv_define_sockaddr_in6=yes -else $as_nop - +else case e in #( + e) ac_cv_define_sockaddr_in6=no - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_sockaddr_in6" >&5 printf "%s\n" "$ac_cv_define_sockaddr_in6" >&6; } @@ -32977,8 +34007,8 @@ printf %s "checking for sockaddr_storage... " >&6; } if test ${apr_cv_define_sockaddr_storage+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -33000,10 +34030,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : apr_cv_define_sockaddr_storage=yes -else $as_nop - apr_cv_define_sockaddr_storage=no +else case e in #( + e) apr_cv_define_sockaddr_storage=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_define_sockaddr_storage" >&5 printf "%s\n" "$apr_cv_define_sockaddr_storage" >&6; } @@ -33021,8 +34053,8 @@ printf %s "checking for sockaddr_un... " >&6; } if test ${ac_cv_define_sockaddr_un+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -33051,13 +34083,15 @@ then : ac_cv_define_sockaddr_un=yes -else $as_nop - +else case e in #( + e) ac_cv_define_sockaddr_un=no - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_sockaddr_un" >&5 printf "%s\n" "$ac_cv_define_sockaddr_un" >&6; } @@ -33084,13 +34118,13 @@ printf %s "checking for working AI_ADDRCONFIG... " >&6; } if test ${apr_cv_gai_addrconfig+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : apr_cv_gai_addrconfig=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_NETDB_H @@ -33119,13 +34153,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : apr_cv_gai_addrconfig=yes -else $as_nop - apr_cv_gai_addrconfig=no +else case e in #( + e) apr_cv_gai_addrconfig=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $apr_cv_gai_addrconfig" >&5 printf "%s\n" "$apr_cv_gai_addrconfig" >&6; } @@ -33163,9 +34200,10 @@ printf "%s\n" "$ipv6_result" >&6; } if test ${enable_timedlocks+y} then : enableval=$enable_timedlocks; apr_has_timedlocks="0" -else $as_nop - apr_has_timedlocks="1" - +else case e in #( + e) apr_has_timedlocks="1" + ;; +esac fi @@ -33178,15 +34216,21 @@ printf %s "checking for library containing hstrerror... " >&6; } if test ${ac_cv_search_hstrerror+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char hstrerror (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char hstrerror (void); int main (void) { @@ -33217,11 +34261,13 @@ done if test ${ac_cv_search_hstrerror+y} then : -else $as_nop - ac_cv_search_hstrerror=no +else case e in #( + e) ac_cv_search_hstrerror=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_hstrerror" >&5 printf "%s\n" "$ac_cv_search_hstrerror" >&6; } @@ -33472,8 +34518,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -33503,14 +34549,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # `set' quotes correctly as required by POSIX, so do not add quotes. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -33601,7 +34647,6 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -33610,12 +34655,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -33687,7 +34733,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -33716,7 +34762,6 @@ as_fn_error () } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -33756,11 +34801,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -33774,11 +34820,12 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -33861,9 +34908,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -33944,10 +34991,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -33963,7 +35012,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -33995,7 +35044,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -34031,10 +35080,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.71, +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -34095,8 +35144,8 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -34104,8 +35153,8 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -34467,7 +35516,7 @@ do "test/internal/Makefile") CONFIG_FILES="$CONFIG_FILES test/internal/Makefile" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -34487,7 +35536,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -34511,7 +35560,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -34669,13 +35718,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. +# This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as +# Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -34785,7 +35834,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -34807,19 +35856,19 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` @@ -34947,7 +35996,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -34977,9 +36026,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" diff --git a/configure.in b/configure.in index 46440d1..b0457e2 100644 --- a/configure.in +++ b/configure.in @@ -100,7 +100,7 @@ AH_BOTTOM([ /* * Include common private declarations. */ -#include "../apr_private_common.h" +#include "arch/apr_private_common.h" #endif /* APR_PRIVATE_H */ ]) @@ -140,6 +140,18 @@ fi AC_SUBST(APR_CONFIG_LOCATION) +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + APR_CROSS_COMPILING=maybe + elif test "x$build_alias" != "x$host_alias"; then + APR_CROSS_COMPILING=yes + fi +else + APR_CROSS_COMPILING=no +fi + +AC_SUBST(APR_CROSS_COMPILING) + # Libtool might need this symbol -- it must point to the location of # the generated libtool script (not necessarily the "top" build dir). # @@ -546,37 +558,44 @@ if test "$ap_cv_atomic_builtins" = "yes" -o "$ap_cv__atomic_builtins" = "yes"; t if test "$ap_cv__atomic_builtins" = "yes"; then AC_DEFINE(HAVE__ATOMIC_BUILTINS, 1, [Define if compiler provides 32bit __atomic builtins]) fi + has_atomic_builtins=yes +else + has_atomic_builtins=no fi AC_CACHE_CHECK([whether the compiler provides 64bit atomic builtins], [ap_cv_atomic_builtins64], [AC_TRY_RUN([ #if HAVE_STDINT_H #include <stdint.h> +typedef uint64_t u64_t; +#else +typedef unsigned long long u64_t; #endif int main(int argc, const char *const *argv) { -#if HAVE_STDINT_H - uint64_t val = 1010, tmp, *mem = &val; -#else - unsigned long long val = 1010, tmp, *mem = &val; -#endif - - if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020) + struct { + char pad0; + u64_t val; + } s; + u64_t *mem = &s.val, tmp; + + s.val = 1010; + if (__sync_fetch_and_add(&s.val, 1010) != 1010 || s.val != 2020) return 1; - tmp = val; - if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010) + tmp = s.val; + if (__sync_fetch_and_sub(mem, 1010) != tmp || s.val != 1010) return 1; - if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0) + if (__sync_sub_and_fetch(&s.val, 1010) != 0 || s.val != 0) return 1; tmp = 3030; - if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp) + if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || s.val != tmp) return 1; __sync_synchronize(); - if (__sync_lock_test_and_set(&val, 4040) != 3030) + if (__sync_lock_test_and_set(&s.val, 4040) != 3030) return 1; return 0; @@ -586,31 +605,45 @@ AC_CACHE_CHECK([whether the compiler provides 64bit __atomic builtins], [ap_cv__ [AC_TRY_RUN([ #if HAVE_STDINT_H #include <stdint.h> +typedef uint64_t u64_t; +#else +typedef unsigned long long u64_t; #endif +static int test_always_lock_free(volatile u64_t *val) +{ + return __atomic_always_lock_free(sizeof(*val), val); +} int main(int argc, const char *const *argv) { -#if HAVE_STDINT_H - uint64_t val = 1010, tmp, *mem = &val; -#else - unsigned long long val = 1010, tmp, *mem = &val; -#endif + struct { + char pad0; + u64_t val; + char pad1; + u64_t tmp; + } s; + u64_t *mem = &s.val; + + /* check if alignment matters (no fallback to libatomic) */ + if (!test_always_lock_free(&s.val)) + return 1; - if (__atomic_fetch_add(&val, 1010, __ATOMIC_SEQ_CST) != 1010 || val != 2020) + s.val = 1010; + if (__atomic_fetch_add(&s.val, 1010, __ATOMIC_SEQ_CST) != 1010 || s.val != 2020) return 1; - tmp = val; - if (__atomic_fetch_sub(mem, 1010, __ATOMIC_SEQ_CST) != tmp || val != 1010) + s.tmp = s.val; + if (__atomic_fetch_sub(mem, 1010, __ATOMIC_SEQ_CST) != s.tmp || s.val != 1010) return 1; - if (__atomic_sub_fetch(&val, 1010, __ATOMIC_SEQ_CST) != 0 || val != 0) + if (__atomic_sub_fetch(&s.val, 1010, __ATOMIC_SEQ_CST) != 0 || s.val != 0) return 1; - tmp = val; - if (!__atomic_compare_exchange_n(mem, &tmp, 3030, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) - || tmp != 0) + s.tmp = s.val; + if (!__atomic_compare_exchange_n(mem, &s.tmp, 3030, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) + || s.tmp != 0) return 1; - if (__atomic_exchange_n(&val, 4040, __ATOMIC_SEQ_CST) != 3030) + if (__atomic_exchange_n(&s.val, 4040, __ATOMIC_SEQ_CST) != 3030) return 1; return 0; @@ -772,18 +805,30 @@ void main(void) fi fi +force_generic_atomics=no +force_generic_atomics64=no +AC_CHECK_SIZEOF(void*, 4) +if test "x$ac_cv_sizeof_voidp" = "x"; then + force_generic_atomics64=yes +elif test $ac_cv_sizeof_voidp -lt 8; then + force_generic_atomics64=yes +fi AC_ARG_ENABLE(nonportable-atomics, [ --enable-nonportable-atomics Use optimized atomic code which may produce nonportable binaries], -[if test $enableval = yes; then - force_generic_atomics=no - else +[if test "$enableval" = "upto32bit"; then + force_generic_atomics64=yes + elif test "$enableval" != "yes"; then force_generic_atomics=yes fi ], [case $host_cpu in - i[[456]]86) force_generic_atomics=yes ;; - *) force_generic_atomics=no - case $host in + i[[34]]86) + force_generic_atomics=yes + ;; + i[[56]]86) + force_generic_atomics64=yes + ;; + *) case $host in *solaris2.10*) AC_TRY_COMPILE( [#include <atomic.h>], @@ -798,11 +843,14 @@ AC_ARG_ENABLE(nonportable-atomics, ;; esac ]) - if test $force_generic_atomics = yes; then AC_DEFINE([USE_ATOMICS_GENERIC], 1, [Define if use of generic atomics is requested]) fi +if test $force_generic_atomics = yes -o $force_generic_atomics64 = yes; then + AC_DEFINE([USE_ATOMICS_GENERIC64], 1, + [Define if use of 64bit generic atomics is requested]) +fi AC_SUBST(proc_mutex_is_global) AC_SUBST(eolstr) @@ -1025,7 +1073,7 @@ AC_CACHE_CHECK([for epoll support], [apr_cv_epoll], #include <sys/epoll.h> #include <unistd.h> -int main() +int main(int argc, const char *argv[]) { return epoll_create(5) == -1; }], [apr_cv_epoll=yes], [apr_cv_epoll=no], [apr_cv_epoll=no])]) @@ -1041,7 +1089,7 @@ AC_CACHE_CHECK([for epoll_create1 support], [apr_cv_epoll_create1], #include <sys/epoll.h> #include <unistd.h> -int main() +int main(int argc, const char *argv[]) { return epoll_create1(0) == -1; }], [apr_cv_epoll_create1=yes], [apr_cv_epoll_create1=no], [apr_cv_epoll_create1=no])]) @@ -1050,12 +1098,53 @@ if test "$apr_cv_epoll_create1" = "yes"; then AC_DEFINE([HAVE_EPOLL_CREATE1], 1, [Define if epoll_create1 function is supported]) fi +AC_CACHE_CHECK([whether epoll_wait has a reliable timeout (min)], + [apr_cv_epoll_wait_has_reliable_timeout], +[AC_TRY_RUN([ +#include <unistd.h> +#include <sys/epoll.h> +#include <sys/time.h> /* for gettimeofday */ + +#define TV2US(tv) ((tv).tv_sec * 1000000LL + (tv).tv_usec) + +int main(int argc, const char *argv[]) +{ + struct epoll_event events[1]; + int fd, i; +#ifdef HAVE_EPOLL_CREATE1 + fd = epoll_create1(0); +#else + fd = epoll_create(1); +#endif + if (fd < 0) { + return 1; + } + for (i = 0; i < 10; ++i) { + struct timeval t1 = {0,}, + t2 = {0,}; + (void)gettimeofday(&t1, NULL); + (void)epoll_wait(fd, events, 1, 100); /* ms */ + (void)gettimeofday(&t2, NULL); + if (TV2US(t2) - TV2US(t1) < 100000) { /* us */ + return 1; + } + } + return 0; +}], [apr_cv_epoll_wait_has_reliable_timeout=yes], + [apr_cv_epoll_wait_has_reliable_timeout=no], + [apr_cv_epoll_wait_has_reliable_timeout=no])]) + +if test "$apr_cv_epoll_wait_has_reliable_timeout" = "yes"; then + AC_DEFINE([HAVE_EPOLL_WAIT_RELIABLE_TIMEOUT], 1, + [Define if epoll_wait has a reliable timeout (min)]) +fi + # test for dup3 AC_CACHE_CHECK([for dup3 support], [apr_cv_dup3], [AC_TRY_RUN([ #include <unistd.h> -int main() +int main(int argc, const char *argv[]) { return dup3(STDOUT_FILENO, STDERR_FILENO, 0) == -1; }], [apr_cv_dup3=yes], [apr_cv_dup3=no], [apr_cv_dup3=no])]) @@ -1116,7 +1205,7 @@ AC_CACHE_CHECK([for SOCK_CLOEXEC support], [apr_cv_sock_cloexec], #include <sys/types.h> #include <sys/socket.h> -int main() +int main(int argc, const char *argv[]) { return socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, 0) == -1; }], [apr_cv_sock_cloexec=yes], [apr_cv_sock_cloexec=no], [apr_cv_sock_cloexec=no])]) @@ -1313,7 +1402,7 @@ if test "$ac_cv_func_mmap" = "yes" && #ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> #endif - int main() + int main(int argc, const char *argv[]) { int fd; void *m; @@ -1438,6 +1527,13 @@ if test "$havemmapshm" = "1"; then APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_SHM) fi ]) +AC_ARG_ENABLE(sysv-shm, +[ --enable-sysv-shm Use SysV shared memory (shmget) if available], +[ +if test "$haveshmget" = "1"; then + APR_DECISION_OVERRIDE(USE_SHMEM_SHMGET) +fi +]) case $host in *linux* ) # Linux pre-2.4 had problems with MM_SHMT_MMANON even though @@ -1708,6 +1804,7 @@ AC_SUBST(netinet_sctph) AC_SUBST(netinet_sctp_uioh) AC_SUBST(netinet_tcph) AC_SUBST(stdargh) +AC_SUBST(stddefh) AC_SUBST(stdioh) AC_SUBST(stdlibh) AC_SUBST(stringh) @@ -2376,7 +2473,7 @@ AC_TRY_RUN([ #ifndef SEM_FAILED #define SEM_FAILED (-1) #endif -int main() +int main(int argc, const char *argv[]) { sem_t *psem; const char *sem_name = "/apr_autoconf"; @@ -2437,7 +2534,7 @@ if test "$threads" = "1"; then #include <sys/types.h> #include <pthread.h> #include <stdlib.h> - int main() + int main(int argc, const char *argv[]) { pthread_mutex_t mutex; pthread_mutexattr_t attr; @@ -2575,7 +2672,7 @@ const char *fname = "conftest.fcntl"; int lockit(); -int main() +int main(int argc, const char *argv[]) { int rc, status;; proc_mutex_lock_it.l_whence = SEEK_SET; /* from current point */ diff --git a/encoding/apr_escape.c b/encoding/apr_escape.c index 6074d73..461eef8 100644 --- a/encoding/apr_escape.c +++ b/encoding/apr_escape.c @@ -571,7 +571,7 @@ APR_DECLARE(apr_status_t) apr_escape_entity(char *escaped, const char *str, found = 1; } else if (toasc && !apr_isascii(c)) { - int offset = apr_snprintf((char *) d, 6, "&#%3.3d;", c); + int offset = apr_snprintf((char *) d, 7, "&#%3.3d;", c); size += offset; d += offset; found = 1; @@ -613,8 +613,7 @@ APR_DECLARE(apr_status_t) apr_escape_entity(char *escaped, const char *str, found = 1; } else if (toasc && !apr_isascii(c)) { - char buf[8]; - size += apr_snprintf(buf, 6, "&#%3.3d;", c); + size += apr_snprintf(NULL, 0, "&#%3.3d;", c); found = 1; } else { diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 8c8b745..e4e3f7c 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -128,6 +128,8 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if (thedir->dirhand == INVALID_HANDLE_VALUE) { apr_status_t rv; + FINDEX_INFO_LEVELS info_level; + if ((rv = utf8_to_unicode_path(wdirname, sizeof(wdirname) / sizeof(apr_wchar_t), thedir->dirname))) { @@ -136,7 +138,19 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, eos = wcschr(wdirname, '\0'); eos[0] = '*'; eos[1] = '\0'; - thedir->dirhand = FindFirstFileW(wdirname, thedir->w.entry); + + /* Do not request short file names on Windows 7 and later. */ + if (apr_os_level >= APR_WIN_7) { + info_level = FindExInfoBasic; + } + else { + info_level = FindExInfoStandard; + } + + thedir->dirhand = FindFirstFileExW(wdirname, info_level, + thedir->w.entry, + FindExSearchNameMatch, NULL, + 0); eos[0] = '\0'; if (thedir->dirhand == INVALID_HANDLE_VALUE) { return apr_get_os_error(); diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 701bec7..2275f51 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -140,6 +140,90 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le return rv; } +static apr_status_t read_buffered(apr_file_t *thefile, void *buf, apr_size_t *len) +{ + apr_status_t rv; + char *pos = (char *)buf; + apr_size_t bytes_read; + apr_size_t size; + apr_size_t remaining = *len; + + if (thefile->direction == 1) { + rv = apr_file_flush(thefile); + if (rv != APR_SUCCESS) { + return rv; + } + thefile->bufpos = 0; + thefile->direction = 0; + thefile->dataRead = 0; + } + + /* Copy the data we have in the buffer. */ + size = thefile->dataRead - thefile->bufpos; + if (size > remaining) { + size = remaining; + } + memcpy(pos, thefile->buffer + thefile->bufpos, size); + pos += size; + remaining -= size; + thefile->bufpos += size; + + if (remaining == 0) { + /* Nothing to do more, keep *LEN unchanged and return. */ + return APR_SUCCESS; + } + /* The buffer is empty, but the caller wants more. + * Decide on the most appropriate way to read from the file: + */ + if (remaining > thefile->bufsize) { + /* If the remaining chunk won't fit into the buffer, read it into + * the destination buffer with a single syscall. + */ + rv = read_with_timeout(thefile, pos, remaining, &bytes_read); + thefile->filePtr += bytes_read; + pos += bytes_read; + /* Also, copy the last BUFSIZE (or less in case of a short read) bytes + * from the chunk to our buffer so that seeking backwards and reading + * would work from the buffer. + */ + size = thefile->bufsize; + if (size > bytes_read) { + size = bytes_read; + } + memcpy(thefile->buffer, pos - size, size); + thefile->bufpos = size; + thefile->dataRead = size; + } + else { + /* The remaining chunk fits into the buffer. Read up to BUFSIZE bytes + * from the file to our internal buffer. + */ + rv = read_with_timeout(thefile, thefile->buffer, thefile->bufsize, &bytes_read); + thefile->filePtr += bytes_read; + thefile->bufpos = 0; + thefile->dataRead = bytes_read; + /* Copy the required part to the caller. */ + size = remaining; + if (size > bytes_read) { + size = bytes_read; + } + memcpy(pos, thefile->buffer, size); + pos += size; + thefile->bufpos += size; + } + + if (bytes_read == 0 && rv == APR_EOF) { + thefile->eof_hit = TRUE; + } + + *len = pos - (char *)buf; + if (*len) { + rv = APR_SUCCESS; + } + + return rv; +} + APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *len) { apr_status_t rv; @@ -177,57 +261,10 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } } if (thefile->buffered) { - char *pos = (char *)buf; - apr_size_t blocksize; - apr_size_t size = *len; - if (thefile->flags & APR_FOPEN_XTHREAD) { apr_thread_mutex_lock(thefile->mutex); } - - if (thefile->direction == 1) { - rv = apr_file_flush(thefile); - if (rv != APR_SUCCESS) { - if (thefile->flags & APR_FOPEN_XTHREAD) { - apr_thread_mutex_unlock(thefile->mutex); - } - return rv; - } - thefile->bufpos = 0; - thefile->direction = 0; - thefile->dataRead = 0; - } - - rv = 0; - while (rv == 0 && size > 0) { - if (thefile->bufpos >= thefile->dataRead) { - apr_size_t read; - rv = read_with_timeout(thefile, thefile->buffer, - thefile->bufsize, &read); - if (read == 0) { - if (rv == APR_EOF) - thefile->eof_hit = TRUE; - break; - } - else { - thefile->dataRead = read; - thefile->filePtr += thefile->dataRead; - thefile->bufpos = 0; - } - } - - blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size; - memcpy(pos, thefile->buffer + thefile->bufpos, blocksize); - thefile->bufpos += blocksize; - pos += blocksize; - size -= blocksize; - } - - *len = pos - (char *)buf; - if (*len) { - rv = APR_SUCCESS; - } - + rv = read_buffered(thefile, buf, len); if (thefile->flags & APR_FOPEN_XTHREAD) { apr_thread_mutex_unlock(thefile->mutex); } @@ -243,6 +280,91 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size return rv; } +/* Helper function that adapts WriteFile() to apr_size_t instead + * of DWORD. */ +static apr_status_t write_helper(HANDLE filehand, const char *buf, + apr_size_t len, apr_size_t *pwritten) +{ + apr_size_t remaining = len; + + *pwritten = 0; + do { + DWORD to_write; + DWORD written; + + if (remaining > APR_DWORD_MAX) { + to_write = APR_DWORD_MAX; + } + else { + to_write = (DWORD)remaining; + } + + if (!WriteFile(filehand, buf, to_write, &written, NULL)) { + *pwritten += written; + return apr_get_os_error(); + } + + *pwritten += written; + remaining -= written; + buf += written; + } while (remaining); + + return APR_SUCCESS; +} + +static apr_status_t write_buffered(apr_file_t *thefile, const char *buf, + apr_size_t len, apr_size_t *pwritten) +{ + apr_status_t rv; + + if (thefile->direction == 0) { + /* Position file pointer for writing at the offset we are logically reading from */ + apr_off_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + DWORD offlo = (DWORD)offset; + LONG offhi = (LONG)(offset >> 32); + if (offset != thefile->filePtr) + SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); + thefile->bufpos = thefile->dataRead = 0; + thefile->direction = 1; + } + + *pwritten = 0; + + while (len > 0) { + if (thefile->bufpos == thefile->bufsize) { /* write buffer is full */ + rv = apr_file_flush(thefile); + if (rv) { + return rv; + } + } + /* If our buffer is empty, and we cannot fit the remaining chunk + * into it, write the chunk with a single syscall and return. + */ + if (thefile->bufpos == 0 && len > thefile->bufsize) { + apr_size_t written; + + rv = write_helper(thefile->filehand, buf, len, &written); + thefile->filePtr += written; + *pwritten += written; + return rv; + } + else { + apr_size_t blocksize = len; + + if (blocksize > thefile->bufsize - thefile->bufpos) { + blocksize = thefile->bufsize - thefile->bufpos; + } + memcpy(thefile->buffer + thefile->bufpos, buf, blocksize); + thefile->bufpos += blocksize; + buf += blocksize; + len -= blocksize; + *pwritten += blocksize; + } + } + + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { apr_status_t rv; @@ -263,44 +385,53 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } if (thefile->buffered) { - char *pos = (char *)buf; - apr_size_t blocksize; - apr_size_t size = *nbytes; - if (thefile->flags & APR_FOPEN_XTHREAD) { apr_thread_mutex_lock(thefile->mutex); } - - if (thefile->direction == 0) { - /* Position file pointer for writing at the offset we are logically reading from */ - apr_off_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; - DWORD offlo = (DWORD)offset; - LONG offhi = (LONG)(offset >> 32); - if (offset != thefile->filePtr) - SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); - thefile->bufpos = thefile->dataRead = 0; - thefile->direction = 1; - } - - rv = 0; - while (rv == 0 && size > 0) { - if (thefile->bufpos == thefile->bufsize) /* write buffer is full */ - rv = apr_file_flush(thefile); - - blocksize = size > thefile->bufsize - thefile->bufpos ? - thefile->bufsize - thefile->bufpos : size; - memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); - thefile->bufpos += blocksize; - pos += blocksize; - size -= blocksize; - } - + rv = write_buffered(thefile, buf, *nbytes, nbytes); if (thefile->flags & APR_FOPEN_XTHREAD) { apr_thread_mutex_unlock(thefile->mutex); } return rv; } else { - if (!thefile->pipe) { + if (thefile->pipe) { + rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote, + thefile->pOverlapped); + } + else if (thefile->append && !thefile->pOverlapped) { + OVERLAPPED ov = {0}; + + /* If the file is opened for synchronous I/O, take advantage of the + * documented way to atomically append data by calling WriteFile() + * with both the OVERLAPPED.Offset and OffsetHigh members set to + * 0xFFFFFFFF. This avoids calling LockFile() that is otherwise + * required to avoid a race condition between seeking to the end + * and writing data. Not locking the file improves robustness of + * such appends and avoids a deadlock when appending to an already + * locked file, as described in PR50058. + * + * We use this approach only for files opened for synchronous I/O + * because in this case the I/O Manager maintains the current file + * position. Otherwise, the file offset returned or changed by + * the SetFilePointer() API is not guaranteed to be valid and that + * could, for instance, break apr_file_seek() calls after appending + * data. Sadly, if a file is opened for asynchronous I/O, this + * call doesn't update the OVERLAPPED.Offset member to reflect the + * actual offset used when appending the data (which we could then + * use to make seeking and other operations involving filePtr work). + * Therefore, when appending to files opened for asynchronous I/O, + * we still use the LockFile + SetFilePointer + WriteFile approach. + * + * References: + * https://bz.apache.org/bugzilla/show_bug.cgi?id=50058 + * https://msdn.microsoft.com/en-us/library/windows/desktop/aa365747 + * https://msdn.microsoft.com/en-us/library/windows/hardware/ff567121 + */ + ov.Offset = MAXDWORD; + ov.OffsetHigh = MAXDWORD; + rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote, &ov); + } + else { apr_off_t offset = 0; apr_status_t rc; if (thefile->append) { @@ -332,10 +463,6 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a apr_thread_mutex_unlock(thefile->mutex); } } - else { - rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote, - thefile->pOverlapped); - } if (rv) { *nbytes = bwrote; rv = APR_SUCCESS; @@ -455,64 +582,121 @@ APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile) APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) { - apr_size_t readlen; apr_status_t rv = APR_SUCCESS; - int i; + apr_size_t nbytes; + const char *str_start = str; + char *final = str + len - 1; - for (i = 0; i < len-1; i++) { - readlen = 1; - rv = apr_file_read(thefile, str+i, &readlen); - - if (rv != APR_SUCCESS && rv != APR_EOF) + /* If the file is open for xthread support, allocate and + * initialize the overlapped and io completion event (hEvent). + * Threads should NOT share an apr_file_t or its hEvent. + */ + if ((thefile->flags & APR_FOPEN_XTHREAD) && !thefile->pOverlapped) { + thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->pool, + sizeof(OVERLAPPED)); + thefile->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + if (!thefile->pOverlapped->hEvent) { + rv = apr_get_os_error(); return rv; + } + } - if (readlen == 0) { - /* If we have bytes, defer APR_EOF to the next call */ - if (i > 0) - rv = APR_SUCCESS; - break; + /* Handle the ungetchar if there is one. */ + if (thefile->ungetchar != -1 && str < final) { + *str = thefile->ungetchar; + thefile->ungetchar = -1; + if (*str == '\n') { + *(++str) = '\0'; + return APR_SUCCESS; } - - if (str[i] == '\n') { - i++; /* don't clobber this char below */ - break; + ++str; + } + + /* If we have an underlying buffer, we can be *much* more efficient + * and skip over the read_with_timeout() calls. + */ + if (thefile->buffered) { + if (thefile->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_lock(thefile->mutex); + } + + if (thefile->direction == 1) { + rv = apr_file_flush(thefile); + if (rv) { + if (thefile->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_unlock(thefile->mutex); + } + return rv; + } + + thefile->direction = 0; + thefile->bufpos = 0; + thefile->dataRead = 0; } + + while (str < final) { /* leave room for trailing '\0' */ + if (thefile->bufpos < thefile->dataRead) { + *str = thefile->buffer[thefile->bufpos++]; + } + else { + nbytes = 1; + rv = read_buffered(thefile, str, &nbytes); + if (rv != APR_SUCCESS) { + break; + } + } + if (*str == '\n') { + ++str; + break; + } + ++str; + } + if (thefile->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_unlock(thefile->mutex); + } + } + else { + while (str < final) { /* leave room for trailing '\0' */ + nbytes = 1; + rv = read_with_timeout(thefile, str, nbytes, &nbytes); + if (rv == APR_EOF) + thefile->eof_hit = TRUE; + + if (rv != APR_SUCCESS) { + break; + } + if (*str == '\n') { + ++str; + break; + } + ++str; + } + } + + /* We must store a terminating '\0' if we've stored any chars. We can + * get away with storing it if we hit an error first. + */ + *str = '\0'; + if (str > str_start) { + /* We stored chars; don't report EOF or any other errors; + * the app will find out about that on the next call. + */ + return APR_SUCCESS; } - str[i] = 0; return rv; } APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) { if (thefile->buffered) { - DWORD numbytes, written = 0; apr_status_t rc = 0; - char *buffer; - apr_size_t bytesleft; if (thefile->direction == 1 && thefile->bufpos) { - buffer = thefile->buffer; - bytesleft = thefile->bufpos; - - do { - if (bytesleft > APR_DWORD_MAX) { - numbytes = APR_DWORD_MAX; - } - else { - numbytes = (DWORD)bytesleft; - } - - if (!WriteFile(thefile->filehand, buffer, numbytes, &written, NULL)) { - rc = apr_get_os_error(); - thefile->filePtr += written; - break; - } - - thefile->filePtr += written; - bytesleft -= written; - buffer += written; + apr_size_t written; - } while (bytesleft > 0); + rc = write_helper(thefile->filehand, thefile->buffer, + thefile->bufpos, &written); + thefile->filePtr += written; if (rc == 0) thefile->bufpos = 0; diff --git a/include/apr.h.in b/include/apr.h.in index ee99def..c5bb227 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -47,8 +47,8 @@ /* So that we can use inline on some critical functions, and use * GNUC attributes (such as to get -Wall warnings for printf-like - * functions). Only do this in gcc 2.7 or later ... it may work - * on earlier stuff, but why chance it. + * functions). Both __inline__ and __attribute__ exist for gcc >= 2.7, + * other !__GNUC__ compilers may provide __attribute__ still. * * We've since discovered that the gcc shipped with NeXT systems * as "cc" is completely broken. It claims to be __GNUC__ and so @@ -56,18 +56,22 @@ * means. In particular it's missing inline and the __attribute__ * stuff. So we hack around it. PR#1613. -djg */ -#if !defined(__GNUC__) || __GNUC__ < 2 || \ - (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\ - defined(NEXT) -#ifndef __attribute__ -#define __attribute__(__x) -#endif +#if defined(__GNUC__) \ + && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) \ + && !defined(NEXT) +#define APR_INLINE __inline__ +#define APR_HAS_INLINE 1 +#else /* !__GNUC__ */ #define APR_INLINE -#define APR_HAS_INLINE 0 -#else -#define APR_INLINE __inline__ -#define APR_HAS_INLINE 1 +#define APR_HAS_INLINE 0 +/* __has_attribute should always be a pre-defined macro, but not + * necessarily __attribute__ (e.g. builtin), so check for both to + * avoid overriding __attribute__. + */ +#if !(defined(__attribute__) || defined(__has_attribute)) +#define __attribute__(__x) #endif +#endif /* !__GNUC__ */ #define APR_HAVE_ARPA_INET_H @arpa_ineth@ #define APR_HAVE_CONIO_H @conioh@ @@ -88,6 +92,7 @@ #define APR_HAVE_SEMAPHORE_H @semaphoreh@ #define APR_HAVE_SIGNAL_H @signalh@ #define APR_HAVE_STDARG_H @stdargh@ +#define APR_HAVE_STDDEF_H @stddefh@ #define APR_HAVE_STDINT_H @stdint@ #define APR_HAVE_STDIO_H @stdioh@ #define APR_HAVE_STDLIB_H @stdlibh@ @@ -165,6 +170,10 @@ #include <sys/types.h> #endif +#if APR_HAVE_STDDEF_H +#include <stddef.h> +#endif + #if APR_HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif diff --git a/include/apr.hw b/include/apr.hw index 4247d61..f34727c 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -125,11 +125,38 @@ * are platform specific and should NOT be relied upon!</em></strong> */ -#define APR_INLINE __inline +/* So that we can use inline on some critical functions, and use + * GNUC attributes (such as to get -Wall warnings for printf-like + * functions). Both __inline__ and __attribute__ exist for gcc >= 2.7, + * other !__GNUC__ compilers may provide __attribute__ still. + * + * We've since discovered that the gcc shipped with NeXT systems + * as "cc" is completely broken. It claims to be __GNUC__ and so + * on, but it doesn't implement half of the things that __GNUC__ + * means. In particular it's missing inline and the __attribute__ + * stuff. So we hack around it. PR#1613. -djg + */ +#if defined(__GNUC__) \ + && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) \ + && !defined(NEXT) +#define APR_INLINE __inline__ #define APR_HAS_INLINE 1 -#if !defined(__GNUC__) && !defined(__attribute__) +#else /* !__GNUC__ */ +#if defined(_MSC_VER) +#define APR_INLINE __inline +#define APR_HAS_INLINE 1 +#else /* !_MSC_VER */ +#define APR_INLINE +#define APR_HAS_INLINE 0 +#endif /* !_MSC_VER */ +/* __has_attribute should always be a pre-defined macro, but not + * necessarily __attribute__ (e.g. builtin), so check for both to + * avoid overriding __attribute__. + */ +#if !(defined(__attribute__) || defined(__has_attribute)) #define __attribute__(__x) #endif +#endif /* !__GNUC__ */ #ifndef _WIN32_WCE #define APR_HAVE_ARPA_INET_H 0 diff --git a/include/apr.hwc b/include/apr.hwc index ef00a45..158ee52 100644 --- a/include/apr.hwc +++ b/include/apr.hwc @@ -64,16 +64,6 @@ #pragma warning(disable: 4100 4127 4163 4201 4514; once: 4057 4075 4244) #endif -/* Ignore Microsoft's interpretation of secure development - * and the POSIX string handling API - */ -#if defined(_MSC_VER) && _MSC_VER >= 1400 -#ifndef _CRT_SECURE_NO_DEPRECATE -#define _CRT_SECURE_NO_DEPRECATE -#endif -#pragma warning(disable: 4996) -#endif - /* Has windows.h already been included? If so, our preferences don't matter, * but we will still need the winsock things no matter what was included. * If not, include a restricted set of windows headers to our tastes. @@ -122,11 +112,38 @@ * are platform specific and should NOT be relied upon!</em></strong> */ -#define APR_INLINE __inline +/* So that we can use inline on some critical functions, and use + * GNUC attributes (such as to get -Wall warnings for printf-like + * functions). Both __inline__ and __attribute__ exist for gcc >= 2.7, + * other !__GNUC__ compilers may provide __attribute__ still. + * + * We've since discovered that the gcc shipped with NeXT systems + * as "cc" is completely broken. It claims to be __GNUC__ and so + * on, but it doesn't implement half of the things that __GNUC__ + * means. In particular it's missing inline and the __attribute__ + * stuff. So we hack around it. PR#1613. -djg + */ +#if defined(__GNUC__) \ + && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) \ + && !defined(NEXT) +#define APR_INLINE __inline__ +#define APR_HAS_INLINE 1 +#else /* !__GNUC__ */ +#if defined(_MSC_VER) +#define APR_INLINE __inline #define APR_HAS_INLINE 1 -#if !defined(__GNUC__) && !defined(__attribute__) +#else /* !_MSC_VER */ +#define APR_INLINE +#define APR_HAS_INLINE 0 +#endif /* !_MSC_VER */ +/* __has_attribute should always be a pre-defined macro, but not + * necessarily __attribute__ (e.g. builtin), so check for both to + * avoid overriding __attribute__. + */ +#if !(defined(__attribute__) || defined(__has_attribute)) #define __attribute__(__x) #endif +#endif /* !__GNUC__ */ #ifndef _WIN32_WCE #define APR_HAVE_ARPA_INET_H 0 @@ -654,9 +671,6 @@ typedef int gid_t; */ #if defined(_MSC_VER) && _MSC_VER >= 1200 #pragma warning(pop) -#if _MSC_VER >= 1400 -#pragma warning(disable: 4996) -#endif #endif #endif /* WIN32 */ diff --git a/include/apr_general.h b/include/apr_general.h index fa073c8..48d8b89 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -103,11 +103,18 @@ typedef int apr_signum_t; * @param field data field within the structure * @return offset */ +#if defined(__has_builtin) +#if __has_builtin(__builtin_offsetof) +#define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field) +#endif +#endif /* __has_builtin */ +#ifndef APR_OFFSETOF #if defined(offsetof) && !defined(__cplusplus) #define APR_OFFSETOF(s_type,field) offsetof(s_type,field) #else #define APR_OFFSETOF(s_type,field) APR_OFFSET(s_type*,field) #endif +#endif /* ndef APR_OFFSETOF */ #ifndef DOXYGEN diff --git a/include/apr_version.h b/include/apr_version.h index cfa1cab..34268da 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -38,8 +38,7 @@ */ -#define APR_COPYRIGHT "Copyright (c) 2000-2023 The Apache Software " \ - "Foundation or its licensors, as applicable." +#define APR_COPYRIGHT "Copyright 2024 The Apache Software Foundation." /* The numeric compile-time version constants. These constants are the * authoritative version numbers for APR. @@ -62,7 +61,7 @@ * The Patch Level never includes API changes, simply bug fixes. * Reset to 0 when upgrading APR_MINOR_VERSION */ -#define APR_PATCH_VERSION 2 +#define APR_PATCH_VERSION 5 /** * The symbol APR_IS_DEV_VERSION is only defined for internal, diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 04f336d..69b8ff4 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -199,7 +199,7 @@ void* getStatCache(); /* * Include common private declarations. */ -#include "../apr_private_common.h" +#include "arch/apr_private_common.h" #endif /*APR_PRIVATE_H*/ #endif /*NETWARE*/ diff --git a/include/arch/unix/apr_arch_atomic.h b/include/arch/unix/apr_arch_atomic.h index ce771ad..a443b9d 100644 --- a/include/arch/unix/apr_arch_atomic.h +++ b/include/arch/unix/apr_arch_atomic.h @@ -23,37 +23,35 @@ #include "apr_atomic.h" #if defined(USE_ATOMICS_GENERIC) -/* noop */ + /* noop */ #elif HAVE_ATOMIC_BUILTINS # define USE_ATOMICS_BUILTINS -# if HAVE_ATOMIC_BUILTINS64 -# define USE_ATOMICS_BUILTINS64 -# else -# define NEED_ATOMICS_GENERIC64 -# endif #elif defined(SOLARIS2) && SOLARIS2 >= 10 # define USE_ATOMICS_SOLARIS -# define NEED_ATOMICS_GENERIC64 #elif defined(__GNUC__) && defined(__STRICT_ANSI__) /* force use of generic atomics if building e.g. with -std=c89, which * doesn't allow inline asm */ # define USE_ATOMICS_GENERIC #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) # define USE_ATOMICS_IA32 -# define NEED_ATOMICS_GENERIC64 #elif defined(__GNUC__) && (defined(__powerpc__) \ || defined(__PPC__) \ || defined(__ppc__)) # define USE_ATOMICS_PPC -# define NEED_ATOMICS_GENERIC64 #elif defined(__GNUC__) && (defined(__s390__) || defined(__s390x__)) # define USE_ATOMICS_S390 -# define NEED_ATOMICS_GENERIC64 #else # define USE_ATOMICS_GENERIC #endif -#if defined(USE_ATOMICS_GENERIC) || defined (NEED_ATOMICS_GENERIC64) +#if defined(USE_ATOMICS_GENERIC64) + /* noop */ +#elif HAVE_ATOMIC_BUILTINS64 +# define USE_ATOMICS_BUILTINS64 +#else +# define USE_ATOMICS_GENERIC64 +#endif +#if defined(USE_ATOMICS_GENERIC64) apr_status_t apr__atomic_generic64_init(apr_pool_t *p); #endif diff --git a/include/arch/unix/apr_private.h.in b/include/arch/unix/apr_private.h.in index 8f2aa3f..c8c2139 100644 --- a/include/arch/unix/apr_private.h.in +++ b/include/arch/unix/apr_private.h.in @@ -84,10 +84,10 @@ /* Define if accept4 function is supported */ #undef HAVE_ACCEPT4 -/* Define to 1 if you have the `acquire_sem' function. */ +/* Define to 1 if you have the 'acquire_sem' function. */ #undef HAVE_ACQUIRE_SEM -/* Define to 1 if you have the `acquire_sem_etc' function. */ +/* Define to 1 if you have the 'acquire_sem_etc' function. */ #undef HAVE_ACQUIRE_SEM_ETC /* Define if async i/o supports message q's */ @@ -99,7 +99,7 @@ /* Define to 1 if <alloca.h> works. */ #undef HAVE_ALLOCA_H -/* Define to 1 if you have the `arc4random_buf' function. */ +/* Define to 1 if you have the 'arc4random_buf' function. */ #undef HAVE_ARC4RANDOM_BUF /* Define to 1 if you have the <arpa/inet.h> header file. */ @@ -117,16 +117,16 @@ /* Define to 1 if you have the <ByteOrder.h> header file. */ #undef HAVE_BYTEORDER_H -/* Define to 1 if you have the `calloc' function. */ +/* Define to 1 if you have the 'calloc' function. */ #undef HAVE_CALLOC /* Define to 1 if you have the <conio.h> header file. */ #undef HAVE_CONIO_H -/* Define to 1 if you have the `create_area' function. */ +/* Define to 1 if you have the 'create_area' function. */ #undef HAVE_CREATE_AREA -/* Define to 1 if you have the `create_sem' function. */ +/* Define to 1 if you have the 'create_sem' function. */ #undef HAVE_CREATE_SEM /* Define to 1 if you have the <crypt.h> header file. */ @@ -135,11 +135,11 @@ /* Define to 1 if you have the <ctype.h> header file. */ #undef HAVE_CTYPE_H -/* Define to 1 if you have the declaration of `SYS_getrandom', and to 0 if you +/* Define to 1 if you have the declaration of 'SYS_getrandom', and to 0 if you don't. */ #undef HAVE_DECL_SYS_GETRANDOM -/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you +/* Define to 1 if you have the declaration of 'sys_siglist', and to 0 if you don't. */ #undef HAVE_DECL_SYS_SIGLIST @@ -167,19 +167,22 @@ /* Define if epoll_create1 function is supported */ #undef HAVE_EPOLL_CREATE1 +/* Define if epoll_wait has a reliable timeout (min) */ +#undef HAVE_EPOLL_WAIT_RELIABLE_TIMEOUT + /* Define to 1 if you have the <errno.h> header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the <fcntl.h> header file. */ #undef HAVE_FCNTL_H -/* Define to 1 if you have the `fdatasync' function. */ +/* Define to 1 if you have the 'fdatasync' function. */ #undef HAVE_FDATASYNC -/* Define to 1 if you have the `flock' function. */ +/* Define to 1 if you have the 'flock' function. */ #undef HAVE_FLOCK -/* Define to 1 if you have the `fork' function. */ +/* Define to 1 if you have the 'fork' function. */ #undef HAVE_FORK /* Define if F_SETLK is defined in fcntl.h */ @@ -188,55 +191,55 @@ /* Define if getaddrinfo accepts the AI_ADDRCONFIG flag */ #undef HAVE_GAI_ADDRCONFIG -/* Define to 1 if you have the `gai_strerror' function. */ +/* Define to 1 if you have the 'gai_strerror' function. */ #undef HAVE_GAI_STRERROR /* Define if getaddrinfo exists and works well enough for APR */ #undef HAVE_GETADDRINFO -/* Define to 1 if you have the `getenv' function. */ +/* Define to 1 if you have the 'getenv' function. */ #undef HAVE_GETENV -/* Define to 1 if you have the `getgrgid_r' function. */ +/* Define to 1 if you have the 'getgrgid_r' function. */ #undef HAVE_GETGRGID_R -/* Define to 1 if you have the `getgrnam_r' function. */ +/* Define to 1 if you have the 'getgrnam_r' function. */ #undef HAVE_GETGRNAM_R -/* Define to 1 if you have the `gethostbyaddr_r' function. */ +/* Define to 1 if you have the 'gethostbyaddr_r' function. */ #undef HAVE_GETHOSTBYADDR_R -/* Define to 1 if you have the `gethostbyname_r' function. */ +/* Define to 1 if you have the 'gethostbyname_r' function. */ #undef HAVE_GETHOSTBYNAME_R -/* Define to 1 if you have the `getifaddrs' function. */ +/* Define to 1 if you have the 'getifaddrs' function. */ #undef HAVE_GETIFADDRS /* Define if getnameinfo exists */ #undef HAVE_GETNAMEINFO -/* Define to 1 if you have the `getpass' function. */ +/* Define to 1 if you have the 'getpass' function. */ #undef HAVE_GETPASS -/* Define to 1 if you have the `getpassphrase' function. */ +/* Define to 1 if you have the 'getpassphrase' function. */ #undef HAVE_GETPASSPHRASE -/* Define to 1 if you have the `getpwnam_r' function. */ +/* Define to 1 if you have the 'getpwnam_r' function. */ #undef HAVE_GETPWNAM_R -/* Define to 1 if you have the `getpwuid_r' function. */ +/* Define to 1 if you have the 'getpwuid_r' function. */ #undef HAVE_GETPWUID_R -/* Define to 1 if you have the `getrandom' function. */ +/* Define to 1 if you have the 'getrandom' function. */ #undef HAVE_GETRANDOM -/* Define to 1 if you have the `getrlimit' function. */ +/* Define to 1 if you have the 'getrlimit' function. */ #undef HAVE_GETRLIMIT -/* Define to 1 if you have the `getservbyname_r' function. */ +/* Define to 1 if you have the 'getservbyname_r' function. */ #undef HAVE_GETSERVBYNAME_R -/* Define to 1 if you have the `gmtime_r' function. */ +/* Define to 1 if you have the 'gmtime_r' function. */ #undef HAVE_GMTIME_R /* Define to 1 if you have the <grp.h> header file. */ @@ -245,10 +248,10 @@ /* Define if hstrerror is present */ #undef HAVE_HSTRERROR -/* Define to 1 if you have the `if_indextoname' function. */ +/* Define to 1 if you have the 'if_indextoname' function. */ #undef HAVE_IF_INDEXTONAME -/* Define to 1 if you have the `if_nametoindex' function. */ +/* Define to 1 if you have the 'if_nametoindex' function. */ #undef HAVE_IF_NAMETOINDEX /* Define to 1 if you have the <inttypes.h> header file. */ @@ -257,28 +260,28 @@ /* Define to 1 if you have the <io.h> header file. */ #undef HAVE_IO_H -/* Define to 1 if you have the `isinf' function. */ +/* Define to 1 if you have the 'isinf' function. */ #undef HAVE_ISINF -/* Define to 1 if you have the `isnan' function. */ +/* Define to 1 if you have the 'isnan' function. */ #undef HAVE_ISNAN /* Define to 1 if you have the <kernel/OS.h> header file. */ #undef HAVE_KERNEL_OS_H -/* Define to 1 if you have the `kqueue' function. */ +/* Define to 1 if you have the 'kqueue' function. */ #undef HAVE_KQUEUE /* Define to 1 if you have the <langinfo.h> header file. */ #undef HAVE_LANGINFO_H -/* Define to 1 if you have the `bsd' library (-lbsd). */ +/* Define to 1 if you have the 'bsd' library (-lbsd). */ #undef HAVE_LIBBSD -/* Define to 1 if you have the `sendfile' library (-lsendfile). */ +/* Define to 1 if you have the 'sendfile' library (-lsendfile). */ #undef HAVE_LIBSENDFILE -/* Define to 1 if you have the `truerand' library (-ltruerand). */ +/* Define to 1 if you have the 'truerand' library (-ltruerand). */ #undef HAVE_LIBTRUERAND /* Define to 1 if you have the <limits.h> header file. */ @@ -287,7 +290,7 @@ /* Define to 1 if you have the <linux/random.h> header file. */ #undef HAVE_LINUX_RANDOM_H -/* Define to 1 if you have the `localtime_r' function. */ +/* Define to 1 if you have the 'localtime_r' function. */ #undef HAVE_LOCALTIME_R /* Define if LOCK_EX is defined in sys/file.h */ @@ -305,10 +308,10 @@ /* Define to 1 if you have the <memcheck.h> header file. */ #undef HAVE_MEMCHECK_H -/* Define to 1 if you have the `memchr' function. */ +/* Define to 1 if you have the 'memchr' function. */ #undef HAVE_MEMCHR -/* Define to 1 if you have the `memmove' function. */ +/* Define to 1 if you have the 'memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the <memory.h> header file. */ @@ -317,22 +320,22 @@ /* Define to 1 if you have the <minix/config.h> header file. */ #undef HAVE_MINIX_CONFIG_H -/* Define to 1 if you have the `mkstemp' function. */ +/* Define to 1 if you have the 'mkstemp' function. */ #undef HAVE_MKSTEMP -/* Define to 1 if you have the `mkstemp64' function. */ +/* Define to 1 if you have the 'mkstemp64' function. */ #undef HAVE_MKSTEMP64 -/* Define to 1 if you have the `mmap' function. */ +/* Define to 1 if you have the 'mmap' function. */ #undef HAVE_MMAP -/* Define to 1 if you have the `mmap64' function. */ +/* Define to 1 if you have the 'mmap64' function. */ #undef HAVE_MMAP64 -/* Define to 1 if you have the `mprotect' function. */ +/* Define to 1 if you have the 'mprotect' function. */ #undef HAVE_MPROTECT -/* Define to 1 if you have the `munmap' function. */ +/* Define to 1 if you have the 'munmap' function. */ #undef HAVE_MUNMAP /* Define to 1 if you have the <netdb.h> header file. */ @@ -356,7 +359,7 @@ /* Define to 1 if you have the <net/if.h> header file. */ #undef HAVE_NET_IF_H -/* Define to 1 if you have the `nl_langinfo' function. */ +/* Define to 1 if you have the 'nl_langinfo' function. */ #undef HAVE_NL_LANGINFO /* Define to 1 if you have the <os2.h> header file. */ @@ -368,7 +371,7 @@ /* Define to 1 if you have the <OS.h> header file. */ #undef HAVE_OS_H -/* Define to 1 if you have the `poll' function. */ +/* Define to 1 if you have the 'poll' function. */ #undef HAVE_POLL /* Define if POLLIN is defined */ @@ -377,25 +380,25 @@ /* Define to 1 if you have the <poll.h> header file. */ #undef HAVE_POLL_H -/* Define to 1 if you have the `port_create' function. */ +/* Define to 1 if you have the 'port_create' function. */ #undef HAVE_PORT_CREATE /* Define to 1 if you have the <process.h> header file. */ #undef HAVE_PROCESS_H -/* Define to 1 if you have the `pthread_attr_setguardsize' function. */ +/* Define to 1 if you have the 'pthread_attr_setguardsize' function. */ #undef HAVE_PTHREAD_ATTR_SETGUARDSIZE -/* Define to 1 if you have the `pthread_condattr_setpshared' function. */ +/* Define to 1 if you have the 'pthread_condattr_setpshared' function. */ #undef HAVE_PTHREAD_CONDATTR_SETPSHARED /* Define to 1 if you have the <pthread.h> header file. */ #undef HAVE_PTHREAD_H -/* Define to 1 if you have the `pthread_key_delete' function. */ +/* Define to 1 if you have the 'pthread_key_delete' function. */ #undef HAVE_PTHREAD_KEY_DELETE -/* Define to 1 if you have the `pthread_mutexattr_setpshared' function. */ +/* Define to 1 if you have the 'pthread_mutexattr_setpshared' function. */ #undef HAVE_PTHREAD_MUTEXATTR_SETPSHARED /* Define if recursive pthread mutexes are available */ @@ -407,7 +410,7 @@ /* Define if non-posix/portable cross-process robust mutexes are available */ #undef HAVE_PTHREAD_MUTEX_ROBUST_NP -/* Define to 1 if you have the `pthread_mutex_timedlock' function. */ +/* Define to 1 if you have the 'pthread_mutex_timedlock' function. */ #undef HAVE_PTHREAD_MUTEX_TIMEDLOCK /* Define if PTHREAD_PROCESS_SHARED is defined in pthread.h */ @@ -416,115 +419,115 @@ /* Define if pthread rwlocks are available */ #undef HAVE_PTHREAD_RWLOCKS -/* Define to 1 if you have the `pthread_rwlock_init' function. */ +/* Define to 1 if you have the 'pthread_rwlock_init' function. */ #undef HAVE_PTHREAD_RWLOCK_INIT -/* Define to 1 if you have the `pthread_yield' function. */ +/* Define to 1 if you have the 'pthread_yield' function. */ #undef HAVE_PTHREAD_YIELD -/* Define to 1 if you have the `putenv' function. */ +/* Define to 1 if you have the 'putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the <pwd.h> header file. */ #undef HAVE_PWD_H -/* Define to 1 if you have the `readdir64_r' function. */ +/* Define to 1 if you have the 'readdir64_r' function. */ #undef HAVE_READDIR64_R /* Define to 1 if you have the <sched.h> header file. */ #undef HAVE_SCHED_H -/* Define to 1 if you have the `sched_yield' function. */ +/* Define to 1 if you have the 'sched_yield' function. */ #undef HAVE_SCHED_YIELD /* Define to 1 if you have the <semaphore.h> header file. */ #undef HAVE_SEMAPHORE_H -/* Define to 1 if you have the `semctl' function. */ +/* Define to 1 if you have the 'semctl' function. */ #undef HAVE_SEMCTL -/* Define to 1 if you have the `semget' function. */ +/* Define to 1 if you have the 'semget' function. */ #undef HAVE_SEMGET -/* Define to 1 if you have the `semop' function. */ +/* Define to 1 if you have the 'semop' function. */ #undef HAVE_SEMOP -/* Define to 1 if you have the `semtimedop' function. */ +/* Define to 1 if you have the 'semtimedop' function. */ #undef HAVE_SEMTIMEDOP -/* Define to 1 if you have the `sem_close' function. */ +/* Define to 1 if you have the 'sem_close' function. */ #undef HAVE_SEM_CLOSE -/* Define to 1 if you have the `sem_post' function. */ +/* Define to 1 if you have the 'sem_post' function. */ #undef HAVE_SEM_POST -/* Define to 1 if you have the `sem_timedwait' function. */ +/* Define to 1 if you have the 'sem_timedwait' function. */ #undef HAVE_SEM_TIMEDWAIT /* Define if SEM_UNDO is defined in sys/sem.h */ #undef HAVE_SEM_UNDO -/* Define to 1 if you have the `sem_unlink' function. */ +/* Define to 1 if you have the 'sem_unlink' function. */ #undef HAVE_SEM_UNLINK -/* Define to 1 if you have the `sem_wait' function. */ +/* Define to 1 if you have the 'sem_wait' function. */ #undef HAVE_SEM_WAIT -/* Define to 1 if you have the `sendfile' function. */ +/* Define to 1 if you have the 'sendfile' function. */ #undef HAVE_SENDFILE -/* Define to 1 if you have the `sendfile64' function. */ +/* Define to 1 if you have the 'sendfile64' function. */ #undef HAVE_SENDFILE64 -/* Define to 1 if you have the `sendfilev' function. */ +/* Define to 1 if you have the 'sendfilev' function. */ #undef HAVE_SENDFILEV -/* Define to 1 if you have the `sendfilev64' function. */ +/* Define to 1 if you have the 'sendfilev64' function. */ #undef HAVE_SENDFILEV64 -/* Define to 1 if you have the `send_file' function. */ +/* Define to 1 if you have the 'send_file' function. */ #undef HAVE_SEND_FILE -/* Define to 1 if you have the `setenv' function. */ +/* Define to 1 if you have the 'setenv' function. */ #undef HAVE_SETENV -/* Define to 1 if you have the `setrlimit' function. */ +/* Define to 1 if you have the 'setrlimit' function. */ #undef HAVE_SETRLIMIT -/* Define to 1 if you have the `setsid' function. */ +/* Define to 1 if you have the 'setsid' function. */ #undef HAVE_SETSID -/* Define to 1 if you have the `set_h_errno' function. */ +/* Define to 1 if you have the 'set_h_errno' function. */ #undef HAVE_SET_H_ERRNO -/* Define to 1 if you have the `shmat' function. */ +/* Define to 1 if you have the 'shmat' function. */ #undef HAVE_SHMAT -/* Define to 1 if you have the `shmctl' function. */ +/* Define to 1 if you have the 'shmctl' function. */ #undef HAVE_SHMCTL -/* Define to 1 if you have the `shmdt' function. */ +/* Define to 1 if you have the 'shmdt' function. */ #undef HAVE_SHMDT -/* Define to 1 if you have the `shmget' function. */ +/* Define to 1 if you have the 'shmget' function. */ #undef HAVE_SHMGET -/* Define to 1 if you have the `shm_open' function. */ +/* Define to 1 if you have the 'shm_open' function. */ #undef HAVE_SHM_OPEN -/* Define to 1 if you have the `shm_unlink' function. */ +/* Define to 1 if you have the 'shm_unlink' function. */ #undef HAVE_SHM_UNLINK -/* Define to 1 if you have the `sigaction' function. */ +/* Define to 1 if you have the 'sigaction' function. */ #undef HAVE_SIGACTION /* Define to 1 if you have the <signal.h> header file. */ #undef HAVE_SIGNAL_H -/* Define to 1 if you have the `sigsuspend' function. */ +/* Define to 1 if you have the 'sigsuspend' function. */ #undef HAVE_SIGSUSPEND -/* Define to 1 if you have the `sigwait' function. */ +/* Define to 1 if you have the 'sigwait' function. */ #undef HAVE_SIGWAIT /* Whether you have socklen_t */ @@ -551,16 +554,16 @@ /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H -/* Define to 1 if you have the `strcasecmp' function. */ +/* Define to 1 if you have the 'strcasecmp' function. */ #undef HAVE_STRCASECMP -/* Define to 1 if you have the `strdup' function. */ +/* Define to 1 if you have the 'strdup' function. */ #undef HAVE_STRDUP -/* Define to 1 if you have the `strerror_r' function. */ +/* Define to 1 if you have the 'strerror_r' function. */ #undef HAVE_STRERROR_R -/* Define to 1 if you have the `stricmp' function. */ +/* Define to 1 if you have the 'stricmp' function. */ #undef HAVE_STRICMP /* Define to 1 if you have the <strings.h> header file. */ @@ -569,52 +572,52 @@ /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H -/* Define to 1 if you have the `strncasecmp' function. */ +/* Define to 1 if you have the 'strncasecmp' function. */ #undef HAVE_STRNCASECMP -/* Define to 1 if you have the `strnicmp' function. */ +/* Define to 1 if you have the 'strnicmp' function. */ #undef HAVE_STRNICMP -/* Define to 1 if you have the `strstr' function. */ +/* Define to 1 if you have the 'strstr' function. */ #undef HAVE_STRSTR /* Define if struct impreq was found */ #undef HAVE_STRUCT_IPMREQ -/* Define to 1 if `st_atimensec' is a member of `struct stat'. */ +/* Define to 1 if 'st_atimensec' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_ATIMENSEC -/* Define to 1 if `st_atime_n' is a member of `struct stat'. */ +/* Define to 1 if 'st_atime_n' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_ATIME_N -/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */ +/* Define to 1 if 'st_atim.tv_nsec' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC -/* Define to 1 if `st_blocks' is a member of `struct stat'. */ +/* Define to 1 if 'st_blocks' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLOCKS -/* Define to 1 if `st_ctimensec' is a member of `struct stat'. */ +/* Define to 1 if 'st_ctimensec' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_CTIMENSEC -/* Define to 1 if `st_ctime_n' is a member of `struct stat'. */ +/* Define to 1 if 'st_ctime_n' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_CTIME_N -/* Define to 1 if `st_ctim.tv_nsec' is a member of `struct stat'. */ +/* Define to 1 if 'st_ctim.tv_nsec' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC -/* Define to 1 if `st_mtimensec' is a member of `struct stat'. */ +/* Define to 1 if 'st_mtimensec' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_MTIMENSEC -/* Define to 1 if `st_mtime_n' is a member of `struct stat'. */ +/* Define to 1 if 'st_mtime_n' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_MTIME_N -/* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */ +/* Define to 1 if 'st_mtim.tv_nsec' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC -/* Define to 1 if `tm_gmtoff' is a member of `struct tm'. */ +/* Define to 1 if 'tm_gmtoff' is a member of 'struct tm'. */ #undef HAVE_STRUCT_TM_TM_GMTOFF -/* Define to 1 if `__tm_gmtoff' is a member of `struct tm'. */ +/* Define to 1 if '__tm_gmtoff' is a member of 'struct tm'. */ #undef HAVE_STRUCT_TM___TM_GMTOFF /* Define to 1 if you have the <sysapi.h> header file. */ @@ -731,19 +734,19 @@ /* Define to 1 if you have the <unix.h> header file. */ #undef HAVE_UNIX_H -/* Define to 1 if you have the `unsetenv' function. */ +/* Define to 1 if you have the 'unsetenv' function. */ #undef HAVE_UNSETENV -/* Define to 1 if you have the `utime' function. */ +/* Define to 1 if you have the 'utime' function. */ #undef HAVE_UTIME -/* Define to 1 if you have the `utimes' function. */ +/* Define to 1 if you have the 'utimes' function. */ #undef HAVE_UTIMES -/* Define to 1 if you have the `uuid_create' function. */ +/* Define to 1 if you have the 'uuid_create' function. */ #undef HAVE_UUID_CREATE -/* Define to 1 if you have the `uuid_generate' function. */ +/* Define to 1 if you have the 'uuid_generate' function. */ #undef HAVE_UUID_GENERATE /* Define to 1 if you have the <uuid.h> header file. */ @@ -761,7 +764,7 @@ /* Define if C compiler supports VLA */ #undef HAVE_VLA -/* Define to 1 if you have the `waitpid' function. */ +/* Define to 1 if you have the 'waitpid' function. */ #undef HAVE_WAITPID /* Define to 1 if you have the <wchar.h> header file. */ @@ -773,7 +776,7 @@ /* Define to 1 if you have the <winsock2.h> header file. */ #undef HAVE_WINSOCK2_H -/* Define to 1 if you have the `writev' function. */ +/* Define to 1 if you have the 'writev' function. */ #undef HAVE_WRITEV /* Define for z/OS pthread API nuances */ @@ -824,46 +827,46 @@ /* Modern readdir is thread safe */ #undef READDIR_IS_THREAD_SAFE -/* Define to 1 if the `setpgrp' function requires zero arguments. */ +/* Define to 1 if the 'setpgrp' function requires zero arguments. */ #undef SETPGRP_VOID /* */ #undef SIGWAIT_TAKES_ONE_ARG -/* The size of `char', as computed by sizeof. */ +/* The size of 'char', as computed by sizeof. */ #undef SIZEOF_CHAR -/* The size of `ino_t', as computed by sizeof. */ +/* The size of 'ino_t', as computed by sizeof. */ #undef SIZEOF_INO_T -/* The size of `int', as computed by sizeof. */ +/* The size of 'int', as computed by sizeof. */ #undef SIZEOF_INT -/* The size of `long', as computed by sizeof. */ +/* The size of 'long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The size of `long long', as computed by sizeof. */ +/* The size of 'long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG -/* The size of `off_t', as computed by sizeof. */ +/* The size of 'off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T -/* The size of `pid_t', as computed by sizeof. */ +/* The size of 'pid_t', as computed by sizeof. */ #undef SIZEOF_PID_T -/* The size of `short', as computed by sizeof. */ +/* The size of 'short', as computed by sizeof. */ #undef SIZEOF_SHORT -/* The size of `size_t', as computed by sizeof. */ +/* The size of 'size_t', as computed by sizeof. */ #undef SIZEOF_SIZE_T -/* The size of `ssize_t', as computed by sizeof. */ +/* The size of 'ssize_t', as computed by sizeof. */ #undef SIZEOF_SSIZE_T -/* The size of `struct iovec', as computed by sizeof. */ +/* The size of 'struct iovec', as computed by sizeof. */ #undef SIZEOF_STRUCT_IOVEC -/* The size of `void*', as computed by sizeof. */ +/* The size of 'void*', as computed by sizeof. */ #undef SIZEOF_VOIDP /* If using the C implementation of alloca, define if you know the @@ -874,7 +877,7 @@ STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION -/* Define to 1 if all of the C90 standard headers exist (not just the ones +/* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS @@ -891,6 +894,9 @@ /* Define if use of generic atomics is requested */ #undef USE_ATOMICS_GENERIC +/* Define if use of 64bit generic atomics is requested */ +#undef USE_ATOMICS_GENERIC64 + /* Define if BeOS Semaphores will be used */ #undef USE_BEOSSEM @@ -939,7 +945,7 @@ /* Define if Windows CreateFileMapping() will be used */ #undef USE_SHMEM_WIN32_ANON -/* Enable extensions on AIX 3, Interix. */ +/* Enable extensions on AIX, Interix, z/OS. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif @@ -1000,11 +1006,15 @@ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # undef __STDC_WANT_IEC_60559_DFP_EXT__ #endif +/* Enable extensions specified by C23 Annex F. */ +#ifndef __STDC_WANT_IEC_60559_EXT__ +# undef __STDC_WANT_IEC_60559_EXT__ +#endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ #endif -/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # undef __STDC_WANT_IEC_60559_TYPES_EXT__ #endif @@ -1045,31 +1055,31 @@ # endif #endif -/* Define to empty if `const' does not conform to ANSI C. */ +/* Define to empty if 'const' does not conform to ANSI C. */ #undef const -/* Define to `int' if <sys/types.h> doesn't define. */ +/* Define as 'int' if <sys/types.h> doesn't define. */ #undef gid_t -/* Define to `__inline__' or `__inline' if that's what the C compiler +/* Define to '__inline__' or '__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif -/* Define to `long int' if <sys/types.h> does not define. */ +/* Define to 'long int' if <sys/types.h> does not define. */ #undef off_t /* Define as a signed integer type capable of holding a process identifier. */ #undef pid_t -/* Define to `unsigned int' if <sys/types.h> does not define. */ +/* Define as 'unsigned int' if <stddef.h> doesn't define. */ #undef size_t -/* Define to `int' if <sys/types.h> does not define. */ +/* Define to 'int' if <sys/types.h> does not define. */ #undef ssize_t -/* Define to `int' if <sys/types.h> doesn't define. */ +/* Define as 'int' if <sys/types.h> doesn't define. */ #undef uid_t @@ -1137,6 +1147,6 @@ /* * Include common private declarations. */ -#include "../apr_private_common.h" +#include "arch/apr_private_common.h" #endif /* APR_PRIVATE_H */ diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index 4dbe899..3cc91b0 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -198,15 +198,16 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); */ #define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ typedef rettype (calltype *apr_winapi_fpt_##fn) args; \ - static apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \ - static int apr_winapi_chk_##fn = 0; \ + static volatile apr_winapi_fpt_##fn apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) (ULONG_PTR) (-1); \ static APR_INLINE int apr_winapi_ld_##fn(void) \ - { if (apr_winapi_pfn_##fn) return 1; \ - if (apr_winapi_chk_##fn ++) return 0; \ - if (!apr_winapi_pfn_##fn) \ - apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \ - apr_load_dll_func(lib, #fn, ord); \ - if (apr_winapi_pfn_##fn) return 1; else return 0; }; \ + { \ + apr_winapi_fpt_##fn cached_func = apr_winapi_pfn_##fn; \ + if (cached_func == (apr_winapi_fpt_##fn) (ULONG_PTR) (-1)) { \ + cached_func = (apr_winapi_fpt_##fn) apr_load_dll_func(lib, #fn, ord); \ + /* Pointer-sized writes are atomic on Windows. */ \ + apr_winapi_pfn_##fn = cached_func; \ + } \ + if (cached_func) return 1; else return 0; }; \ static APR_INLINE rettype apr_winapi_##fn args \ { if (apr_winapi_ld_##fn()) \ return (*(apr_winapi_pfn_##fn)) names; \ diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index c631ad4..ba0c4d3 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -169,7 +169,7 @@ APR_DECLARE_DATA int errno; /* * Include common private declarations. */ -#include "../apr_private_common.h" +#include "arch/apr_private_common.h" #endif /*APR_PRIVATE_H*/ #endif /*WIN32*/ @@ -173,7 +173,7 @@ BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapr.bsc" BSC32_SBRS= \
LINK32=link.exe
-LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib" /opt:ref
+LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib" /opt:ref
LINK32_OBJS= \
"$(INTDIR)\apr_atomic.obj" \
"$(INTDIR)\apr_atomic64.obj" \
@@ -417,7 +417,7 @@ BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapr.bsc" BSC32_SBRS= \
LINK32=link.exe
-LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib"
+LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib"
LINK32_OBJS= \
"$(INTDIR)\apr_atomic.obj" \
"$(INTDIR)\apr_atomic64.obj" \
@@ -661,7 +661,7 @@ BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapr.bsc" BSC32_SBRS= \
LINK32=link.exe
-LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib" /opt:ref
+LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib" /opt:ref
LINK32_OBJS= \
"$(INTDIR)\apr_atomic.obj" \
"$(INTDIR)\apr_atomic64.obj" \
@@ -905,7 +905,7 @@ BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapr.bsc" BSC32_SBRS= \
LINK32=link.exe
-LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib"
+LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib"
LINK32_OBJS= \
"$(INTDIR)\apr_atomic.obj" \
"$(INTDIR)\apr_atomic64.obj" \
diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index ef08f93..64ffd8b 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -467,9 +467,12 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = #if APR_HAS_PROC_PTHREAD_SERIALIZE #ifndef APR_USE_PROC_PTHREAD_MUTEX_COND -#define APR_USE_PROC_PTHREAD_MUTEX_COND \ - (defined(HAVE_PTHREAD_CONDATTR_SETPSHARED) \ - && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK)) +#if defined(HAVE_PTHREAD_CONDATTR_SETPSHARED) \ + && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) +#define APR_USE_PROC_PTHREAD_MUTEX_COND 1 +#else +#define APR_USE_PROC_PTHREAD_MUTEX_COND 0 +#endif #endif /* The mmap()ed pthread_interproc is the native pthread_mutex_t followed diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 396506d..ceb3dfb 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -2029,6 +2029,13 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, pool->file_line = file_line; #if APR_HAS_THREADS + pool->owner = apr_os_thread_current(); +#endif /* APR_HAS_THREADS */ +#ifdef NETWARE + pool->owner_proc = (apr_os_proc_t)getnlmhandle(); +#endif /* defined(NETWARE) */ + +#if APR_HAS_THREADS if (parent == NULL || parent->allocator != allocator) { apr_status_t rv; @@ -2067,13 +2074,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, pool->ref = NULL; } -#if APR_HAS_THREADS - pool->owner = apr_os_thread_current(); -#endif /* APR_HAS_THREADS */ -#ifdef NETWARE - pool->owner_proc = (apr_os_proc_t)getnlmhandle(); -#endif /* defined(NETWARE) */ - #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) apr_pool_log_event(pool, "CREATE", file_line, 1); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ diff --git a/misc/win32/misc.c b/misc/win32/misc.c index bfb7efa..807ad60 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -161,32 +161,61 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) * missing from one or more releases of the Win32 API */ -static const char* const lateDllName[DLL_defined] = { - "kernel32", "advapi32", "mswsock", "ws2_32", "shell32", "ntdll.dll", - "Iphplapi" }; -static HMODULE lateDllHandle[DLL_defined] = { - NULL, NULL, NULL, NULL, NULL, NULL, - NULL }; +typedef struct win32_late_dll_t { + const char *dll_name; + volatile HMODULE dll_handle; +} win32_late_dll_t; + +static win32_late_dll_t late_dll[DLL_defined] = { + {"kernel32", INVALID_HANDLE_VALUE}, + {"advapi32", INVALID_HANDLE_VALUE}, + {"mswsock", INVALID_HANDLE_VALUE}, + {"ws2_32", INVALID_HANDLE_VALUE}, + {"shell32", INVALID_HANDLE_VALUE}, + {"ntdll.dll", INVALID_HANDLE_VALUE}, + {"Iphplapi", INVALID_HANDLE_VALUE} +}; FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) { - if (!lateDllHandle[fnLib]) { - lateDllHandle[fnLib] = LoadLibraryA(lateDllName[fnLib]); - if (!lateDllHandle[fnLib]) - return NULL; + win32_late_dll_t *dll = &late_dll[fnLib]; + HMODULE cached_dll_handle; + + /* Pointer sized reads are atomic on Windows. */ + cached_dll_handle = dll->dll_handle; + if (cached_dll_handle == INVALID_HANDLE_VALUE) { + HMODULE dll_handle = NULL; + + dll_handle = LoadLibrary(dll->dll_name); + + cached_dll_handle = InterlockedCompareExchangePointer(&dll->dll_handle, + dll_handle, + INVALID_HANDLE_VALUE); + if (cached_dll_handle == INVALID_HANDLE_VALUE) { + cached_dll_handle = dll_handle; + } + else if (dll_handle) { + /* Other thread won the race: release our library handle. */ + FreeLibrary(dll_handle); + } + } + + if (!cached_dll_handle) { + return NULL; } + #if defined(_WIN32_WCE) if (ordinal) - return GetProcAddressA(lateDllHandle[fnLib], (const char *) - (apr_ssize_t)ordinal); + return GetProcAddressA(cached_dll_handle, + (const char *) (apr_ssize_t)ordinal); else - return GetProcAddressA(lateDllHandle[fnLib], fnName); + return GetProcAddressA(cached_dll_handle, fnName); #else if (ordinal) - return GetProcAddress(lateDllHandle[fnLib], (const char *) - (apr_ssize_t)ordinal); + return GetProcAddress(cached_dll_handle, + (const char *) (apr_ssize_t)ordinal); else - return GetProcAddress(lateDllHandle[fnLib], fnName); + return GetProcAddress(cached_dll_handle, fnName); #endif } diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 6620e13..4a01c09 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -255,11 +255,29 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, int disconnected = 0; int sendv_trailers = 0; char hdtrbuf[4096]; + LPFN_TRANSMITFILE pfn_transmit_file = NULL; + static GUID wsaid_transmitfile = WSAID_TRANSMITFILE; + DWORD dw; if (apr_os_level < APR_WIN_NT) { return APR_ENOTIMPL; } + /* According to documentation TransmitFile() should not be used directly. + * Pointer to function should retrieved using WSAIoctl: + * https://docs.microsoft.com/en-gb/windows/win32/api/mswsock/nf-mswsock-transmitfile#remarks + */ + if (WSAIoctl(sock->socketdes, SIO_GET_EXTENSION_FUNCTION_POINTER, + &wsaid_transmitfile, sizeof(wsaid_transmitfile), + &pfn_transmit_file, sizeof(pfn_transmit_file), + &dw, NULL, NULL) == SOCKET_ERROR) { + return apr_get_os_error(); + } + + if (dw != sizeof(pfn_transmit_file)) { + return APR_EINVAL; + } + /* Use len to keep track of number of total bytes sent (including headers) */ bytes_to_send = *len; *len = 0; @@ -351,13 +369,13 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, sock->overlapped->OffsetHigh = (DWORD)(curoff >> 32); #endif /* XXX BoundsChecker claims dwFlags must not be zero. */ - rv = TransmitFile(sock->socketdes, /* socket */ - file->filehand, /* open file descriptor of the file to be sent */ - xmitbytes, /* number of bytes to send. 0=send all */ - 0, /* Number of bytes per send. 0=use default */ - sock->overlapped, /* OVERLAPPED structure */ - ptfb, /* header and trailer buffers */ - dwFlags); /* flags to control various aspects of TransmitFile */ + rv = pfn_transmit_file(sock->socketdes, /* socket */ + file->filehand, /* open file descriptor of the file to be sent */ + xmitbytes, /* number of bytes to send. 0=send all */ + 0, /* Number of bytes per send. 0=use default */ + sock->overlapped, /* OVERLAPPED structure */ + ptfb, /* header and trailer buffers */ + dwFlags); /* flags to control various aspects of TransmitFile */ if (!rv) { status = apr_get_netos_error(); if ((status == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) || diff --git a/poll/os2/poll.c b/poll/os2/poll.c index 3c36e5e..a9d5153 100644 --- a/poll/os2/poll.c +++ b/poll/os2/poll.c @@ -61,7 +61,8 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, } if (timeout > 0) { - timeout /= 1000; /* convert microseconds to milliseconds */ + /* convert microseconds to milliseconds (round up) */ + timeout = (timeout + 999) / 1000; } i = select(pollset, num_read, num_write, num_except, timeout); diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c index 87b3c18..c032199 100644 --- a/poll/os2/pollset.c +++ b/poll/os2/pollset.c @@ -223,7 +223,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, (*num) = 0; if (timeout > 0) { - timeout /= 1000; + timeout = (timeout + 999) / 1000; } rv = select(pollresult, pollset->num_read, pollset->num_write, pollset->num_except, timeout); diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 4ab03f6..ad3cc0b 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -261,7 +261,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, *num = 0; if (timeout > 0) { - timeout /= 1000; + timeout = (timeout + 999) / 1000; } ret = epoll_wait(pollset->p->epoll_fd, pollset->p->pollset, pollset->nalloc, @@ -442,7 +442,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, apr_status_t rv = APR_SUCCESS; if (timeout > 0) { - timeout /= 1000; + timeout = (timeout + 999) / 1000; } ret = epoll_wait(pollcb->fd, pollcb->pollset.epoll, pollcb->nalloc, diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 5b878f1..28090c4 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -114,7 +114,8 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, num_to_poll = i; if (timeout > 0) { - timeout /= 1000; /* convert microseconds to milliseconds */ + /* convert microseconds to milliseconds (round up) */ + timeout = (timeout + 999) / 1000; } i = poll(pollset, num_to_poll, timeout); @@ -252,14 +253,15 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, } return APR_SUCCESS; } +#endif + if (timeout > 0) { - timeout /= 1000; + timeout = (timeout + 999) / 1000; } + +#ifdef WIN32 ret = WSAPoll(pollset->p->pollset, pollset->nelts, (int)timeout); #else - if (timeout > 0) { - timeout /= 1000; - } ret = poll(pollset->p->pollset, pollset->nelts, timeout); #endif if (ret < 0) { @@ -407,14 +409,15 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, } return APR_SUCCESS; } +#endif + if (timeout > 0) { - timeout /= 1000; + timeout = (timeout + 999) / 1000; } + +#ifdef WIN32 ret = WSAPoll(pollcb->pollset.ps, pollcb->nelts, (int)timeout); #else - if (timeout > 0) { - timeout /= 1000; - } ret = poll(pollcb->pollset.ps, pollcb->nelts, timeout); #endif if (ret < 0) { diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index 48b531c..e7d9d9d 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -554,7 +554,7 @@ static posix_poll(apr_pollset_t *pollset, DBG(4, "entered\n"); if (timeout > 0) { - timeout /= 1000; + timeout = (timeout + 999) / 1000; } rv = poll(priv->pollset, pollset->nelts, timeout); (*num) = rv; @@ -698,6 +698,7 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, tv.tv_nsec = apr_time_usec(timeout) * 1000; } else { tv.tv_sec = INT_MAX; /* block until something is ready */ + tv.tv_nsec = 0; } DBG2(6, "nothing on the ready ring " diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index f99afec..ea9b942 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -287,10 +287,9 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, status = APR_SUCCESS; #if APR_USE_SHMEM_MMAP_TMP - /* FIXME: Is APR_OS_DEFAULT sufficient? */ - status = apr_file_open(&file, filename, - APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, - APR_OS_DEFAULT, pool); + status = apr_file_open(&file, filename, + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL, + APR_FPROT_UREAD | APR_FPROT_UWRITE, pool); if (status != APR_SUCCESS) { return status; } @@ -319,8 +318,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, } #endif /* APR_USE_SHMEM_MMAP_TMP */ #if APR_USE_SHMEM_MMAP_SHM - /* FIXME: SysV uses 0600... should we? */ - tmpfd = shm_open(shm_name, O_RDWR | O_CREAT | O_EXCL, 0644); + tmpfd = shm_open(shm_name, O_RDWR | O_CREAT | O_EXCL, 0600); if (tmpfd == -1) { return errno; } @@ -361,10 +359,9 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #elif APR_USE_SHMEM_SHMGET new_m->realsize = reqsize; - /* FIXME: APR_OS_DEFAULT is too permissive, switch to 600 I think. */ - status = apr_file_open(&file, filename, + status = apr_file_open(&file, filename, APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL, - APR_OS_DEFAULT, pool); + APR_FPROT_UREAD | APR_FPROT_UWRITE, pool); if (status != APR_SUCCESS) { return status; } @@ -555,8 +552,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, #if APR_USE_SHMEM_MMAP_SHM const char *shm_name = make_shm_open_safe_name(filename, pool); - /* FIXME: SysV uses 0600... should we? */ - tmpfd = shm_open(shm_name, O_RDWR, 0644); + tmpfd = shm_open(shm_name, O_RDWR, 0600); if (tmpfd == -1) { return errno; } @@ -709,6 +705,49 @@ APR_PERMS_SET_IMPLEMENT(shm) return errno; } return APR_SUCCESS; +#elif APR_USE_SHMEM_MMAP_SHM && !defined(DARWIN) + /* ### This hangs or fails on MacOS, so skipping this for the + * ENOTIMPL case there - unclear why or if that's fixable. */ + apr_shm_t *shm = (apr_shm_t *)theshm; + const char *shm_name; + int fd; + apr_status_t rv; + + if (!shm->filename) + return APR_ENOTIMPL; + + shm_name = make_shm_open_safe_name(shm->filename, shm->pool); + + fd = shm_open(shm_name, O_RDWR, 0); + if (fd == -1) + return errno; + + if (fchown(fd, uid, gid)) { + rv = errno; + close(fd); + return rv; + } + + if (fchmod(fd, apr_unix_perms2mode(perms))) { + rv = errno; + close(fd); + return rv; + } + close(fd); + return APR_SUCCESS; +#elif APR_USE_SHMEM_MMAP_TMP + apr_shm_t *shm = (apr_shm_t *)theshm; + + if (!shm->filename) + return APR_ENOTIMPL; + + if (chown(shm->filename, uid, gid)) + return errno; + + if (chmod(shm->filename, apr_unix_perms2mode(perms))) + return errno; + + return APR_SUCCESS; #else return APR_ENOTIMPL; #endif diff --git a/support/unix/waitio.c b/support/unix/waitio.c index fa5edb6..a3c6a83 100644 --- a/support/unix/waitio.c +++ b/support/unix/waitio.c @@ -42,10 +42,13 @@ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, struct pollfd pfd; int rc, timeout; - timeout = f ? f->timeout / 1000 : s->timeout / 1000; + timeout = f ? f->timeout : s->timeout; pfd.fd = f ? f->filedes : s->socketdes; pfd.events = for_read ? POLLIN : POLLOUT; + if (timeout > 0) { + timeout = (timeout + 999) / 1000; + } do { rc = poll(&pfd, 1, timeout); } while (rc == -1 && errno == EINTR); diff --git a/test/abts.c b/test/abts.c index ef9f9db..e03ccc4 100644 --- a/test/abts.c +++ b/test/abts.c @@ -76,6 +76,10 @@ static void end_suite(abts_suite *suite) fprintf(stdout, "\b"); fflush(stdout); } + if (last->skipped > 0) { + fprintf(stdout, "SKIPPED %d of %d\n", last->skipped, last->num_test); + fflush(stdout); + } if (last->failed == 0) { fprintf(stdout, "SUCCESS\n"); fflush(stdout); @@ -102,6 +106,7 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name_full) subsuite = malloc(sizeof(*subsuite)); subsuite->num_test = 0; subsuite->failed = 0; + subsuite->skipped = 0; subsuite->next = NULL; /* suite_name_full may be an absolute path depending on __FILE__ * expansion */ @@ -178,6 +183,7 @@ void abts_run_test(abts_suite *ts, test_func f, void *value) ss = ts->tail; tc.failed = 0; + tc.skipped = 0; tc.suite = ss; ss->num_test++; @@ -188,11 +194,25 @@ void abts_run_test(abts_suite *ts, test_func f, void *value) if (tc.failed) { ss->failed++; } + + if (tc.skipped) { + ss->skipped++; + } +} + +static void report_summary(const char *kind_header, + const char *name_header, + const char *percent_header) +{ + fprintf(stdout, "%-15s\t\tTotal\t%s\t%s\n", + kind_header, name_header, percent_header); + fprintf(stdout, "===================================================\n"); } static int report(abts_suite *suite) { - int count = 0; + int failed_count = 0; + int skipped_count = 0; sub_suite *dptr; if (suite && suite->tail &&!suite->tail->not_run) { @@ -200,25 +220,46 @@ static int report(abts_suite *suite) } for (dptr = suite->head; dptr; dptr = dptr->next) { - count += dptr->failed; + failed_count += dptr->failed; + } + + for (dptr = suite->head; dptr; dptr = dptr->next) { + skipped_count += dptr->skipped; } if (list_tests) { return 0; } - if (count == 0) { + /* Report skipped tests */ + if (skipped_count > 0) { + dptr = suite->head; + report_summary("Skipped Tests", "Skip", "Skipped %"); + while (dptr != NULL) { + if (dptr->skipped != 0) { + float percent = ((float)dptr->skipped / (float)dptr->num_test); + fprintf(stdout, "%-15s\t\t%5d\t%4d\t%8.2f%%\n", dptr->name, + dptr->num_test, dptr->skipped, percent * 100); + } + dptr = dptr->next; + } + } + + if (failed_count == 0) { printf("All tests passed.\n"); return 0; } + /* Report failed tests */ dptr = suite->head; - fprintf(stdout, "%-15s\t\tTotal\tFail\tFailed %%\n", "Failed Tests"); - fprintf(stdout, "===================================================\n"); + if (skipped_count > 0) { + fprintf(stdout, "\n"); + } + report_summary("Failed Tests", "Fail", " Failed %"); while (dptr != NULL) { if (dptr->failed != 0) { float percent = ((float)dptr->failed / (float)dptr->num_test); - fprintf(stdout, "%-15s\t\t%5d\t%4d\t%6.2f%%\n", dptr->name, + fprintf(stdout, "%-15s\t\t%5d\t%4d\t%8.2f%%\n", dptr->name, dptr->num_test, dptr->failed, percent * 100); } dptr = dptr->next; @@ -240,50 +281,52 @@ void abts_log_message(const char *fmt, ...) } } -void abts_int_equal(abts_case *tc, const int expected, const int actual, int lineno) -{ - update_status(); - if (tc->failed) return; - - if (expected == actual) return; - - tc->failed = TRUE; - if (verbose) { - fprintf(stderr, "Line %d: expected <%d>, but saw <%d>\n", lineno, expected, actual); - fflush(stderr); - } +#define IMPL_abts_T_equal(T, NAME, FMT, CAST) \ +void abts_##NAME##_equal(abts_case *tc, const T expected, const T actual, int lineno) \ +{ \ + update_status(); \ + if (tc->failed) return; \ + \ + if (expected == actual) return; \ + \ + tc->failed = TRUE; \ + if (verbose) { \ + fprintf(stderr, "Line %d: expected <%" FMT ">, but saw <%" FMT ">\n", \ + lineno, CAST expected, CAST actual); \ + fflush(stderr); \ + } \ } - -void abts_int_nequal(abts_case *tc, const int expected, const int actual, int lineno) -{ - update_status(); - if (tc->failed) return; - - if (expected != actual) return; - - tc->failed = TRUE; - if (verbose) { - fprintf(stderr, "Line %d: expected something other than <%d>, but saw <%d>\n", - lineno, expected, actual); - fflush(stderr); - } -} - -void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno) -{ - update_status(); - if (tc->failed) return; - - if (expected == actual) return; - - tc->failed = TRUE; - if (verbose) { - /* Note that the comparison is type-exact, reporting must be a best-fit */ - fprintf(stderr, "Line %d: expected %lu, but saw %lu\n", lineno, - (unsigned long)expected, (unsigned long)actual); - fflush(stderr); - } +IMPL_abts_T_equal(int, int, "d", (int)) +IMPL_abts_T_equal(unsigned int, uint, "u", (unsigned int)) +IMPL_abts_T_equal(long, long, "ld", (long)) +IMPL_abts_T_equal(unsigned long, ulong, "lu", (unsigned long)) +IMPL_abts_T_equal(long long, llong, "lld", (long long)) +IMPL_abts_T_equal(unsigned long long, ullong, "llu", (unsigned long long)) +IMPL_abts_T_equal(size_t, size, "lu", (unsigned long)) + +#define IMPL_abts_T_nequal(T, NAME, FMT, CAST) \ +void abts_##NAME##_nequal(abts_case *tc, const T expected, const T actual, int lineno) \ +{ \ + update_status(); \ + if (tc->failed) return; \ + \ + if (expected != actual) return; \ + \ + tc->failed = TRUE; \ + if (verbose) { \ + fprintf(stderr, "Line %d: expected something other than <%" FMT ">, " \ + "but saw <%" FMT ">\n", \ + lineno, CAST expected, CAST actual); \ + fflush(stderr); \ + } \ } +IMPL_abts_T_nequal(int, int, "d", (int)) +IMPL_abts_T_nequal(unsigned int, uint, "u", (unsigned int)) +IMPL_abts_T_nequal(long, long, "ld", (long)) +IMPL_abts_T_nequal(unsigned long, ulong, "lu", (unsigned long)) +IMPL_abts_T_nequal(long long, llong, "lld", (long long)) +IMPL_abts_T_nequal(unsigned long long, ullong, "llu", (unsigned long long)) +IMPL_abts_T_nequal(size_t, size, "lu", (unsigned long)) void abts_str_equal(abts_case *tc, const char *expected, const char *actual, int lineno) { @@ -356,7 +399,19 @@ void abts_fail(abts_case *tc, const char *message, int lineno) fflush(stderr); } } - + +void abts_skip(abts_case *tc, const char *message, int lineno) +{ + update_status(); + if (tc->skipped) return; + + tc->skipped = TRUE; + if (verbose) { + fprintf(stderr, "\bSKIP: Line %d: %s\n", lineno, message); + fflush(stderr); + } +} + void abts_assert(abts_case *tc, const char *message, int condition, int lineno) { update_status(); diff --git a/test/abts.h b/test/abts.h index ed1c092..dffb0c5 100644 --- a/test/abts.h +++ b/test/abts.h @@ -42,6 +42,7 @@ struct sub_suite { char *name; int num_test; int failed; + int skipped; int not_run; int not_impl; struct sub_suite *next; @@ -56,6 +57,7 @@ typedef struct abts_suite abts_suite; struct abts_case { int failed; + int skipped; sub_suite *suite; }; typedef struct abts_case abts_case; @@ -70,6 +72,28 @@ void abts_log_message(const char *fmt, ...); void abts_int_equal(abts_case *tc, const int expected, const int actual, int lineno); void abts_int_nequal(abts_case *tc, const int expected, const int actual, int lineno); +void abts_uint_equal(abts_case *tc, const unsigned int expected, + const unsigned int actual, int lineno); +void abts_uint_nequal(abts_case *tc, const unsigned int expected, + const unsigned int actual, int lineno); +void abts_long_equal(abts_case *tc, const long expected, + const long actual, int lineno); +void abts_long_nequal(abts_case *tc, const long expected, + const long actual, int lineno); +void abts_ulong_equal(abts_case *tc, const unsigned long expected, + const unsigned long actual, int lineno); +void abts_ulong_nequal(abts_case *tc, const unsigned long expected, + const unsigned long actual, int lineno); +void abts_llong_equal(abts_case *tc, const long long expected, + const long long actual, int lineno); +void abts_llong_nequal(abts_case *tc, const long long expected, + const long long actual, int lineno); +void abts_ullong_equal(abts_case *tc, const unsigned long long expected, + const unsigned long long actual, int lineno); +void abts_ullong_nequal(abts_case *tc, const unsigned long long expected, + const unsigned long long actual, int lineno); +void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno); +void abts_size_nequal(abts_case *tc, size_t expected, size_t actual, int lineno); void abts_str_equal(abts_case *tc, const char *expected, const char *actual, int lineno); void abts_str_nequal(abts_case *tc, const char *expected, const char *actual, size_t n, int lineno); @@ -77,13 +101,25 @@ void abts_ptr_notnull(abts_case *tc, const void *ptr, int lineno); void abts_ptr_equal(abts_case *tc, const void *expected, const void *actual, int lineno); void abts_true(abts_case *tc, int condition, int lineno); void abts_fail(abts_case *tc, const char *message, int lineno); +void abts_skip(abts_case *tc, const char *message, int lineno); void abts_not_impl(abts_case *tc, const char *message, int lineno); void abts_assert(abts_case *tc, const char *message, int condition, int lineno); -void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno); /* Convenience macros. Ryan hates these! */ #define ABTS_INT_EQUAL(a, b, c) abts_int_equal(a, b, c, __LINE__) #define ABTS_INT_NEQUAL(a, b, c) abts_int_nequal(a, b, c, __LINE__) +#define ABTS_UINT_EQUAL(a, b, c) abts_uint_equal(a, b, c, __LINE__) +#define ABTS_UINT_NEQUAL(a, b, c) abts_uint_nequal(a, b, c, __LINE__) +#define ABTS_LONG_EQUAL(a, b, c) abts_long_equal(a, b, c, __LINE__) +#define ABTS_LONG_NEQUAL(a, b, c) abts_long_nequal(a, b, c, __LINE__) +#define ABTS_ULONG_EQUAL(a, b, c) abts_ulong_equal(a, b, c, __LINE__) +#define ABTS_ULONG_NEQUAL(a, b, c) abts_ulong_nequal(a, b, c, __LINE__) +#define ABTS_LLONG_EQUAL(a, b, c) abts_llong_equal(a, b, c, __LINE__) +#define ABTS_LLONG_NEQUAL(a, b, c) abts_llong_nequal(a, b, c, __LINE__) +#define ABTS_ULLONG_EQUAL(a, b, c) abts_ullong_equal(a, b, c, __LINE__) +#define ABTS_ULLONG_NEQUAL(a, b, c) abts_ullong_nequal(a, b, c, __LINE__) +#define ABTS_SIZE_EQUAL(a, b, c) abts_size_equal(a, b, c, __LINE__) +#define ABTS_SIZE_NEQUAL(a, b, c) abts_size_nequal(a, b, c, __LINE__) #define ABTS_STR_EQUAL(a, b, c) abts_str_equal(a, b, c, __LINE__) #define ABTS_STR_NEQUAL(a, b, c, d) abts_str_nequal(a, b, c, d, __LINE__) #define ABTS_PTR_NOTNULL(a, b) abts_ptr_notnull(a, b, __LINE__) @@ -93,8 +129,13 @@ void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno); #define ABTS_NOT_IMPL(a, b) abts_not_impl(a, b, __LINE__); #define ABTS_ASSERT(a, b, c) abts_assert(a, b, c, __LINE__); -#define ABTS_SIZE_EQUAL(a, b, c) abts_size_equal(a, b, c, __LINE__) +/* When skipping tests, make a reference to the test data parameter + to avoid unused variable warnings. */ +#define ABTS_SKIP(tc, data, msg) do { \ + ((void)(data)); \ + abts_skip((tc), (msg), __LINE__); \ + } while (0) abts_suite *run_tests(abts_suite *suite); abts_suite *run_tests1(abts_suite *suite); diff --git a/test/testatomic.c b/test/testatomic.c index bf388c7..efcc148 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -43,14 +43,14 @@ static void test_set32(abts_case *tc, void *data) { apr_uint32_t y32; apr_atomic_set32(&y32, 2); - ABTS_INT_EQUAL(tc, 2, y32); + ABTS_UINT_EQUAL(tc, 2, y32); } static void test_read32(abts_case *tc, void *data) { apr_uint32_t y32; apr_atomic_set32(&y32, 2); - ABTS_INT_EQUAL(tc, 2, apr_atomic_read32(&y32)); + ABTS_UINT_EQUAL(tc, 2, apr_atomic_read32(&y32)); } static void test_dec32(abts_case *tc, void *data) @@ -61,11 +61,11 @@ static void test_dec32(abts_case *tc, void *data) apr_atomic_set32(&y32, 2); rv = apr_atomic_dec32(&y32); - ABTS_INT_EQUAL(tc, 1, y32); + ABTS_UINT_EQUAL(tc, 1, y32); ABTS_ASSERT(tc, "atomic_dec returned zero when it shouldn't", rv != 0); rv = apr_atomic_dec32(&y32); - ABTS_INT_EQUAL(tc, 0, y32); + ABTS_UINT_EQUAL(tc, 0, y32); ABTS_ASSERT(tc, "atomic_dec didn't returned zero when it should", rv == 0); } @@ -77,8 +77,8 @@ static void test_xchg32(abts_case *tc, void *data) apr_atomic_set32(&y32, 100); oldval = apr_atomic_xchg32(&y32, 50); - ABTS_INT_EQUAL(tc, 100, oldval); - ABTS_INT_EQUAL(tc, 50, y32); + ABTS_UINT_EQUAL(tc, 100, oldval); + ABTS_UINT_EQUAL(tc, 50, y32); } static void test_xchgptr(abts_case *tc, void *data) @@ -99,8 +99,8 @@ static void test_cas_equal(abts_case *tc, void *data) apr_uint32_t oldval; oldval = apr_atomic_cas32(&casval, 12, 0); - ABTS_INT_EQUAL(tc, 0, oldval); - ABTS_INT_EQUAL(tc, 12, casval); + ABTS_UINT_EQUAL(tc, 0, oldval); + ABTS_UINT_EQUAL(tc, 12, casval); } static void test_cas_equal_nonnull(abts_case *tc, void *data) @@ -109,8 +109,8 @@ static void test_cas_equal_nonnull(abts_case *tc, void *data) apr_uint32_t oldval; oldval = apr_atomic_cas32(&casval, 23, 12); - ABTS_INT_EQUAL(tc, 12, oldval); - ABTS_INT_EQUAL(tc, 23, casval); + ABTS_UINT_EQUAL(tc, 12, oldval); + ABTS_UINT_EQUAL(tc, 23, casval); } static void test_cas_notequal(abts_case *tc, void *data) @@ -119,8 +119,8 @@ static void test_cas_notequal(abts_case *tc, void *data) apr_uint32_t oldval; oldval = apr_atomic_cas32(&casval, 23, 2); - ABTS_INT_EQUAL(tc, 12, oldval); - ABTS_INT_EQUAL(tc, 12, casval); + ABTS_UINT_EQUAL(tc, 12, oldval); + ABTS_UINT_EQUAL(tc, 12, casval); } static void test_casptr_equal(abts_case *tc, void *data) @@ -163,8 +163,8 @@ static void test_add32(abts_case *tc, void *data) apr_atomic_set32(&y32, 23); oldval = apr_atomic_add32(&y32, 4); - ABTS_INT_EQUAL(tc, 23, oldval); - ABTS_INT_EQUAL(tc, 27, y32); + ABTS_UINT_EQUAL(tc, 23, oldval); + ABTS_UINT_EQUAL(tc, 27, y32); } static void test_add32_neg(abts_case *tc, void *data) @@ -174,8 +174,8 @@ static void test_add32_neg(abts_case *tc, void *data) apr_atomic_set32(&y32, 23); oldval = apr_atomic_add32(&y32, -10); - ABTS_INT_EQUAL(tc, 23, oldval); - ABTS_INT_EQUAL(tc, 13, y32); + ABTS_UINT_EQUAL(tc, 23, oldval); + ABTS_UINT_EQUAL(tc, 13, y32); } static void test_inc32(abts_case *tc, void *data) @@ -185,8 +185,8 @@ static void test_inc32(abts_case *tc, void *data) apr_atomic_set32(&y32, 23); oldval = apr_atomic_inc32(&y32); - ABTS_INT_EQUAL(tc, 23, oldval); - ABTS_INT_EQUAL(tc, 24, y32); + ABTS_UINT_EQUAL(tc, 23, oldval); + ABTS_UINT_EQUAL(tc, 24, y32); } static void test_set_add_inc_sub(abts_case *tc, void *data) @@ -198,7 +198,7 @@ static void test_set_add_inc_sub(abts_case *tc, void *data) apr_atomic_inc32(&y32); apr_atomic_sub32(&y32, 10); - ABTS_INT_EQUAL(tc, 11, y32); + ABTS_UINT_EQUAL(tc, 11, y32); } static void test_wrap_zero(abts_case *tc, void *data) @@ -234,14 +234,14 @@ static void test_set64(abts_case *tc, void *data) { apr_uint64_t y64; apr_atomic_set64(&y64, 2); - ABTS_INT_EQUAL(tc, 2, y64); + ABTS_ULLONG_EQUAL(tc, 2, y64); } static void test_read64(abts_case *tc, void *data) { apr_uint64_t y64; apr_atomic_set64(&y64, 2); - ABTS_INT_EQUAL(tc, 2, apr_atomic_read64(&y64)); + ABTS_ULLONG_EQUAL(tc, 2, apr_atomic_read64(&y64)); } static void test_dec64(abts_case *tc, void *data) @@ -252,11 +252,11 @@ static void test_dec64(abts_case *tc, void *data) apr_atomic_set64(&y64, 2); rv = apr_atomic_dec64(&y64); - ABTS_INT_EQUAL(tc, 1, y64); + ABTS_ULLONG_EQUAL(tc, 1, y64); ABTS_ASSERT(tc, "atomic_dec returned zero when it shouldn't", rv != 0); rv = apr_atomic_dec64(&y64); - ABTS_INT_EQUAL(tc, 0, y64); + ABTS_ULLONG_EQUAL(tc, 0, y64); ABTS_ASSERT(tc, "atomic_dec didn't returned zero when it should", rv == 0); } @@ -268,8 +268,8 @@ static void test_xchg64(abts_case *tc, void *data) apr_atomic_set64(&y64, 100); oldval = apr_atomic_xchg64(&y64, 50); - ABTS_INT_EQUAL(tc, 100, oldval); - ABTS_INT_EQUAL(tc, 50, y64); + ABTS_ULLONG_EQUAL(tc, 100, oldval); + ABTS_ULLONG_EQUAL(tc, 50, y64); } static void test_add64(abts_case *tc, void *data) @@ -279,8 +279,8 @@ static void test_add64(abts_case *tc, void *data) apr_atomic_set64(&y64, 23); oldval = apr_atomic_add64(&y64, 4); - ABTS_INT_EQUAL(tc, 23, oldval); - ABTS_INT_EQUAL(tc, 27, y64); + ABTS_ULLONG_EQUAL(tc, 23, oldval); + ABTS_ULLONG_EQUAL(tc, 27, y64); } static void test_add64_neg(abts_case *tc, void *data) @@ -290,8 +290,8 @@ static void test_add64_neg(abts_case *tc, void *data) apr_atomic_set64(&y64, 23); oldval = apr_atomic_add64(&y64, -10); - ABTS_INT_EQUAL(tc, 23, oldval); - ABTS_INT_EQUAL(tc, 13, y64); + ABTS_ULLONG_EQUAL(tc, 23, oldval); + ABTS_ULLONG_EQUAL(tc, 13, y64); } static void test_inc64(abts_case *tc, void *data) @@ -301,8 +301,8 @@ static void test_inc64(abts_case *tc, void *data) apr_atomic_set64(&y64, 23); oldval = apr_atomic_inc64(&y64); - ABTS_INT_EQUAL(tc, 23, oldval); - ABTS_INT_EQUAL(tc, 24, y64); + ABTS_ULLONG_EQUAL(tc, 23, oldval); + ABTS_ULLONG_EQUAL(tc, 24, y64); } static void test_set_add_inc_sub64(abts_case *tc, void *data) @@ -314,7 +314,7 @@ static void test_set_add_inc_sub64(abts_case *tc, void *data) apr_atomic_inc64(&y64); apr_atomic_sub64(&y64, 10); - ABTS_INT_EQUAL(tc, 11, y64); + ABTS_ULLONG_EQUAL(tc, 11, y64); } static void test_wrap_zero64(abts_case *tc, void *data) @@ -356,10 +356,18 @@ void *APR_THREAD_FUNC thread_func_atomic64(apr_thread_t *thd, void *data); apr_thread_mutex_t *thread_lock; apr_thread_mutex_t *thread_lock64; -volatile apr_uint32_t mutex_locks = 0; -volatile apr_uint64_t mutex_locks64 = 0; -volatile apr_uint32_t atomic_ops = 0; -volatile apr_uint64_t atomic_ops64 = 0; +apr_uint32_t mutex_locks = 0; +apr_uint64_t mutex_locks64 = 0; +apr_uint32_t atomic_ops = 0; +apr_uint64_t atomic_ops64 = 0; +#ifndef CACHELINE_SIZE +#define CACHELINE_SIZE 64 +#endif +struct { + char pad[CACHELINE_SIZE - 5]; + apr_uint64_t ops64; +} atomic_pad __attribute__((aligned(CACHELINE_SIZE))); + apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ #define NUM_THREADS 40 @@ -422,9 +430,9 @@ static void test_atomics_threaded(abts_case *tc, void *data) s1 == exit_ret_val && s2 == exit_ret_val); } - ABTS_INT_EQUAL(tc, NUM_THREADS * NUM_ITERATIONS, mutex_locks); - ABTS_INT_EQUAL(tc, NUM_THREADS * NUM_ITERATIONS, - apr_atomic_read32(&atomic_ops)); + ABTS_UINT_EQUAL(tc, NUM_THREADS * NUM_ITERATIONS, mutex_locks); + ABTS_UINT_EQUAL(tc, NUM_THREADS * NUM_ITERATIONS, + apr_atomic_read32(&atomic_ops)); rv = apr_thread_mutex_destroy(thread_lock); ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS); @@ -475,7 +483,7 @@ static void busyloop_add32(tbox_t *tbox) busyloop_read32(tbox); val = apr_atomic_add32(tbox->mem, tbox->postval); apr_thread_mutex_lock(thread_lock); - ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); + ABTS_UINT_EQUAL(tbox->tc, val, tbox->preval); apr_thread_mutex_unlock(thread_lock); } while (--tbox->loop); } @@ -496,7 +504,7 @@ static void busyloop_inc32(tbox_t *tbox) busyloop_read32(tbox); val = apr_atomic_inc32(tbox->mem); apr_thread_mutex_lock(thread_lock); - ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); + ABTS_UINT_EQUAL(tbox->tc, val, tbox->preval); apr_thread_mutex_unlock(thread_lock); } while (--tbox->loop); } @@ -509,7 +517,7 @@ static void busyloop_dec32(tbox_t *tbox) busyloop_read32(tbox); val = apr_atomic_dec32(tbox->mem); apr_thread_mutex_lock(thread_lock); - ABTS_INT_NEQUAL(tbox->tc, 0, val); + ABTS_UINT_NEQUAL(tbox->tc, 0, val); apr_thread_mutex_unlock(thread_lock); } while (--tbox->loop); } @@ -538,7 +546,7 @@ static void busyloop_xchg32(tbox_t *tbox) busyloop_read32(tbox); val = apr_atomic_xchg32(tbox->mem, tbox->postval); apr_thread_mutex_lock(thread_lock); - ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); + ABTS_UINT_EQUAL(tbox->tc, val, tbox->preval); apr_thread_mutex_unlock(thread_lock); } while (--tbox->loop); } @@ -617,7 +625,7 @@ static void test_atomics_busyloop_threaded(abts_case *tc, void *data) ABTS_ASSERT(tc, "Invalid return value from thread_join", retval == 0); } - ABTS_INT_EQUAL(tbox->tc, 98, count); + ABTS_UINT_EQUAL(tbox->tc, 98, count); rv = apr_thread_mutex_destroy(thread_lock); ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS); @@ -639,13 +647,14 @@ void *APR_THREAD_FUNC thread_func_mutex64(apr_thread_t *thd, void *data) void *APR_THREAD_FUNC thread_func_atomic64(apr_thread_t *thd, void *data) { + apr_uint64_t *ops64 = data; int i; for (i = 0; i < NUM_ITERATIONS ; i++) { - apr_atomic_inc64(&atomic_ops64); - apr_atomic_add64(&atomic_ops64, 2); - apr_atomic_dec64(&atomic_ops64); - apr_atomic_dec64(&atomic_ops64); + apr_atomic_inc64(ops64); + apr_atomic_add64(ops64, 2); + apr_atomic_dec64(ops64); + apr_atomic_dec64(ops64); } apr_thread_exit(thd, exit_ret_val); return NULL; @@ -653,6 +662,7 @@ void *APR_THREAD_FUNC thread_func_atomic64(apr_thread_t *thd, void *data) static void test_atomics_threaded64(abts_case *tc, void *data) { + apr_uint64_t *ops64 = data; apr_thread_t *t1[NUM_THREADS]; apr_thread_t *t2[NUM_THREADS]; apr_status_t rv; @@ -662,13 +672,16 @@ static void test_atomics_threaded64(abts_case *tc, void *data) pthread_setconcurrency(8); #endif + mutex_locks64 = 0; + apr_atomic_set64(ops64, 0); + rv = apr_thread_mutex_create(&thread_lock64, APR_THREAD_MUTEX_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "Could not create lock", rv); for (i = 0; i < NUM_THREADS; i++) { apr_status_t r1, r2; r1 = apr_thread_create(&t1[i], NULL, thread_func_mutex64, NULL, p); - r2 = apr_thread_create(&t2[i], NULL, thread_func_atomic64, NULL, p); + r2 = apr_thread_create(&t2[i], NULL, thread_func_atomic64, ops64, p); ABTS_ASSERT(tc, "Failed creating threads", !r1 && !r2); } @@ -681,9 +694,9 @@ static void test_atomics_threaded64(abts_case *tc, void *data) s1 == exit_ret_val && s2 == exit_ret_val); } - ABTS_INT_EQUAL(tc, NUM_THREADS * NUM_ITERATIONS, mutex_locks64); - ABTS_INT_EQUAL(tc, NUM_THREADS * NUM_ITERATIONS, - apr_atomic_read64(&atomic_ops64)); + ABTS_ULLONG_EQUAL(tc, NUM_THREADS * NUM_ITERATIONS, mutex_locks64); + ABTS_ULLONG_EQUAL(tc, NUM_THREADS * NUM_ITERATIONS, + apr_atomic_read64(ops64)); rv = apr_thread_mutex_destroy(thread_lock64); ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS); @@ -728,7 +741,7 @@ static void busyloop_add64(tbox_t64 *tbox) busyloop_read64(tbox); val = apr_atomic_add64(tbox->mem, tbox->postval); apr_thread_mutex_lock(thread_lock64); - ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); + ABTS_ULLONG_EQUAL(tbox->tc, val, tbox->preval); apr_thread_mutex_unlock(thread_lock64); } while (--tbox->loop); } @@ -749,7 +762,7 @@ static void busyloop_inc64(tbox_t64 *tbox) busyloop_read64(tbox); val = apr_atomic_inc64(tbox->mem); apr_thread_mutex_lock(thread_lock64); - ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); + ABTS_ULLONG_EQUAL(tbox->tc, val, tbox->preval); apr_thread_mutex_unlock(thread_lock64); } while (--tbox->loop); } @@ -762,7 +775,7 @@ static void busyloop_dec64(tbox_t64 *tbox) busyloop_read64(tbox); val = apr_atomic_dec64(tbox->mem); apr_thread_mutex_lock(thread_lock64); - ABTS_INT_NEQUAL(tbox->tc, 0, val); + ABTS_ULLONG_NEQUAL(tbox->tc, 0, val); apr_thread_mutex_unlock(thread_lock64); } while (--tbox->loop); } @@ -791,7 +804,7 @@ static void busyloop_xchg64(tbox_t64 *tbox) busyloop_read64(tbox); val = apr_atomic_xchg64(tbox->mem, tbox->postval); apr_thread_mutex_lock(thread_lock64); - ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); + ABTS_ULLONG_EQUAL(tbox->tc, val, tbox->preval); apr_thread_mutex_unlock(thread_lock64); } while (--tbox->loop); } @@ -870,7 +883,7 @@ static void test_atomics_busyloop_threaded64(abts_case *tc, void *data) ABTS_ASSERT(tc, "Invalid return value from thread_join", retval == 0); } - ABTS_INT_EQUAL(tbox->tc, 98, count); + ABTS_ULLONG_EQUAL(tbox->tc, 98, count); rv = apr_thread_mutex_destroy(thread_lock64); ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS); @@ -878,11 +891,12 @@ static void test_atomics_busyloop_threaded64(abts_case *tc, void *data) static void *APR_THREAD_FUNC test_func_set64(apr_thread_t *thd, void *data) { + apr_uint64_t *ops64 = data; int i; for (i = 0; i < 1000 * 1000; i++) { - apr_atomic_set64(&atomic_ops64, APR_UINT64_C(0x1111222233334444)); - apr_atomic_set64(&atomic_ops64, APR_UINT64_C(0x4444555566667777)); + apr_atomic_set64(ops64, APR_UINT64_C(0x1111222233334444)); + apr_atomic_set64(ops64, APR_UINT64_C(0x4444555566667777)); } apr_thread_exit(thd, APR_SUCCESS); @@ -891,16 +905,17 @@ static void *APR_THREAD_FUNC test_func_set64(apr_thread_t *thd, void *data) static void test_atomics_threaded_setread64(abts_case *tc, void *data) { - apr_status_t retval; + apr_uint64_t *ops64 = data; apr_thread_t *thread; + apr_status_t retval; int i; - apr_atomic_set64(&atomic_ops64, APR_UINT64_C(0x1111222233334444)); + apr_atomic_set64(ops64, APR_UINT64_C(0x1111222233334444)); - apr_thread_create(&thread, NULL, test_func_set64, NULL, p); + apr_thread_create(&thread, NULL, test_func_set64, ops64, p); for (i = 0; i < 1000 * 1000 * 2; i++) { - apr_uint64_t val = apr_atomic_read64(&atomic_ops64); + apr_uint64_t val = apr_atomic_read64(ops64); if (val != APR_UINT64_C(0x1111222233334444) && val != APR_UINT64_C(0x4444555566667777)) @@ -950,10 +965,12 @@ abts_suite *testatomic(abts_suite *suite) #if APR_HAS_THREADS abts_run_test(suite, test_atomics_threaded, NULL); - abts_run_test(suite, test_atomics_threaded64, NULL); + abts_run_test(suite, test_atomics_threaded64, &atomic_ops64); + abts_run_test(suite, test_atomics_threaded64, &atomic_pad.ops64); abts_run_test(suite, test_atomics_busyloop_threaded, NULL); abts_run_test(suite, test_atomics_busyloop_threaded64, NULL); - abts_run_test(suite, test_atomics_threaded_setread64, NULL); + abts_run_test(suite, test_atomics_threaded_setread64, &atomic_ops64); + abts_run_test(suite, test_atomics_threaded_setread64, &atomic_pad.ops64); #endif return suite; diff --git a/test/testdir.c b/test/testdir.c index ac1bcfa..95b559d 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -60,43 +60,51 @@ static void test_mkdir_recurs(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype); } -struct thread_data -{ - abts_case *tc; - apr_pool_t *pool; -}; - -static void *APR_THREAD_FUNC thread_mkdir_func(apr_thread_t *thd, void *data) +static void mkdir_func(abts_case *tc, apr_pool_t *pool) { - struct thread_data *td = data; apr_status_t s1, s2, s3, s4, s5; s1 = apr_dir_make_recursive("data/prll/one/thwo/three", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - td->pool); + pool); s2 = apr_dir_make_recursive("data/prll/four/five/six/seven/eight", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - td->pool); + pool); s3 = apr_dir_make_recursive("data/prll/nine/ten", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - td->pool); + pool); s4 = apr_dir_make_recursive("data/prll/11/12/13/14/15/16/17/18/19/20", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - td->pool); + pool); s5 = apr_dir_make_recursive("data/fortytwo", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - td->pool); + pool); - ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s1); - ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s2); - ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s3); - ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s4); - ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s5); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s2); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s3); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s4); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s5); +} + +#if APR_HAS_THREADS +struct thread_data +{ + abts_case *tc; + apr_pool_t *pool; +}; + +static void *APR_THREAD_FUNC thread_mkdir_func(apr_thread_t *thd, void *data) +{ + struct thread_data *td = data; + mkdir_func(td->tc, td->pool); return NULL; } +#endif /* APR_HAS_THREADS */ static void test_mkdir_recurs_parallel(abts_case *tc, void *data) { +#if APR_HAS_THREADS struct thread_data td1, td2, td3, td4; apr_thread_t *t1, *t2, *t3, *t4; apr_status_t s1, s2, s3, s4; @@ -125,6 +133,11 @@ static void test_mkdir_recurs_parallel(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, s2); ABTS_INT_EQUAL(tc, APR_SUCCESS, s3); ABTS_INT_EQUAL(tc, APR_SUCCESS, s4); +#else + /* Create the test directories for test_removeall anwyay. */ + mkdir_func(tc, p); + ABTS_SKIP(tc, data, "This test requires APR thread support."); +#endif /* APR_HAS_THREADS */ } static void test_remove(abts_case *tc, void *data) diff --git a/test/testencode.c b/test/testencode.c index 6d78310..ca9ddb3 100644 --- a/test/testencode.c +++ b/test/testencode.c @@ -189,42 +189,42 @@ static void test_decode_base64_binary(abts_case * tc, void *data) src = ""; udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(ufoobar, udest, 0) == 0); - ABTS_INT_EQUAL(tc, len, 0); + ABTS_SIZE_EQUAL(tc, len, 0); src = "Zg=="; udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(ufoobar, udest, 1) == 0); - ABTS_INT_EQUAL(tc, len, 1); + ABTS_SIZE_EQUAL(tc, len, 1); src = "Zg="; udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(ufoobar, udest, 1) == 0); - ABTS_INT_EQUAL(tc, len, 1); + ABTS_SIZE_EQUAL(tc, len, 1); src = "Zg"; udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(ufoobar, udest, 1) == 0); - ABTS_INT_EQUAL(tc, len, 1); + ABTS_SIZE_EQUAL(tc, len, 1); src = "Zm8="; udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(ufoobar, udest, 2) == 0); - ABTS_INT_EQUAL(tc, len, 2); + ABTS_SIZE_EQUAL(tc, len, 2); src = "Zm8"; udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(ufoobar, udest, 2) == 0); - ABTS_INT_EQUAL(tc, len, 2); + ABTS_SIZE_EQUAL(tc, len, 2); src = "Zm9v"; udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(ufoobar, udest, 3) == 0); - ABTS_INT_EQUAL(tc, len, 3); + ABTS_SIZE_EQUAL(tc, len, 3); src = "Zm9v"; udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(ufoobar, udest, 3) == 0); - ABTS_INT_EQUAL(tc, len, 3); + ABTS_SIZE_EQUAL(tc, len, 3); apr_pool_destroy(pool); } @@ -639,127 +639,127 @@ static void test_decode_base32_binary(abts_case * tc, void *data) src = ""; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 0) == 0); - ABTS_INT_EQUAL(tc, 0, len); + ABTS_SIZE_EQUAL(tc, 0, len); src = "MY======"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 1) == 0); - ABTS_INT_EQUAL(tc, 1, len); + ABTS_SIZE_EQUAL(tc, 1, len); src = "MY"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 1) == 0); - ABTS_INT_EQUAL(tc, 1, len); + ABTS_SIZE_EQUAL(tc, 1, len); src = "CO======"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 1) == 0); - ABTS_INT_EQUAL(tc, 1, len); + ABTS_SIZE_EQUAL(tc, 1, len); src = "CO"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 1) == 0); - ABTS_INT_EQUAL(tc, 1, len); + ABTS_SIZE_EQUAL(tc, 1, len); src = "MZXQ===="; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 2) == 0); - ABTS_INT_EQUAL(tc, 2, len); + ABTS_SIZE_EQUAL(tc, 2, len); src = "MZXQ"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 2) == 0); - ABTS_INT_EQUAL(tc, 2, len); + ABTS_SIZE_EQUAL(tc, 2, len); src = "CPNG===="; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 2) == 0); - ABTS_INT_EQUAL(tc, 2, len); + ABTS_SIZE_EQUAL(tc, 2, len); src = "CPNG"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 2) == 0); - ABTS_INT_EQUAL(tc, 2, len); + ABTS_SIZE_EQUAL(tc, 2, len); src = "MZXW6==="; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 3) == 0); - ABTS_INT_EQUAL(tc, 3, len); + ABTS_SIZE_EQUAL(tc, 3, len); src = "MZXW6"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 3) == 0); - ABTS_INT_EQUAL(tc, 3, len); + ABTS_SIZE_EQUAL(tc, 3, len); src = "CPNMU==="; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 3) == 0); - ABTS_INT_EQUAL(tc, 3, len); + ABTS_SIZE_EQUAL(tc, 3, len); src = "CPNMU"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 3) == 0); - ABTS_INT_EQUAL(tc, 3, len); + ABTS_SIZE_EQUAL(tc, 3, len); src = "MZXW6YQ="; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 4) == 0); - ABTS_INT_EQUAL(tc, 4, len); + ABTS_SIZE_EQUAL(tc, 4, len); src = "MZXW6YQ="; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 4) == 0); - ABTS_INT_EQUAL(tc, 4, len); + ABTS_SIZE_EQUAL(tc, 4, len); src = "CPNMUOG="; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 4) == 0); - ABTS_INT_EQUAL(tc, 4, len); + ABTS_SIZE_EQUAL(tc, 4, len); src = "CPNMUOG"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 4) == 0); - ABTS_INT_EQUAL(tc, 4, len); + ABTS_SIZE_EQUAL(tc, 4, len); src = "MZXW6YTB"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 5) == 0); - ABTS_INT_EQUAL(tc, 5, len); + ABTS_SIZE_EQUAL(tc, 5, len); src = "MZXW6YTB"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 5) == 0); - ABTS_INT_EQUAL(tc, 5, len); + ABTS_SIZE_EQUAL(tc, 5, len); src = "CPNMUOJ1"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 5) == 0); - ABTS_INT_EQUAL(tc, 5, len); + ABTS_SIZE_EQUAL(tc, 5, len); src = "CPNMUOJ1"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 5) == 0); - ABTS_INT_EQUAL(tc, 5, len); + ABTS_SIZE_EQUAL(tc, 5, len); src = "MZXW6YTBOI======"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 6) == 0); - ABTS_INT_EQUAL(tc, 6, len); + ABTS_SIZE_EQUAL(tc, 6, len); src = "MZXW6YTBOI"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 6) == 0); - ABTS_INT_EQUAL(tc, 6, len); + ABTS_SIZE_EQUAL(tc, 6, len); src = "CPNMUOJ1E8======"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 6) == 0); - ABTS_INT_EQUAL(tc, 6, len); + ABTS_SIZE_EQUAL(tc, 6, len); src = "CPNMUOJ1E8"; udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(ufoobar, udest, 6) == 0); - ABTS_INT_EQUAL(tc, 6, len); + ABTS_SIZE_EQUAL(tc, 6, len); apr_pool_destroy(pool); } @@ -872,7 +872,7 @@ static void test_decode_base16(abts_case * tc, void *data) target = ":;<="; dest = apr_pdecode_base16(pool, src, APR_ENCODE_STRING, APR_ENCODE_COLON, &len); ABTS_STR_EQUAL(tc, target, dest); - ABTS_INT_EQUAL(tc, 4, (int)len); + ABTS_SIZE_EQUAL(tc, 4, len); apr_decode_base16(NULL, src, APR_ENCODE_STRING, APR_ENCODE_COLON, &len); ABTS_ASSERT(tc, apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, (apr_size_t) 5), @@ -896,7 +896,7 @@ static void test_decode_base16_binary(abts_case * tc, void *data) src = "ff:00:ff:00"; udest = apr_pdecode_base16_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_COLON, &vlen); ABTS_ASSERT(tc, "apr_pdecode_base16_binary target!=dest", memcmp(utarget, udest, 4) == 0); - ABTS_INT_EQUAL(tc, (int)vlen, 4); + ABTS_SIZE_EQUAL(tc, vlen, 4); apr_decode_base16_binary(NULL, src, APR_ENCODE_STRING, APR_ENCODE_COLON, &len); ABTS_ASSERT(tc, apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, (apr_size_t) 4), diff --git a/test/testescape.c b/test/testescape.c index 6645227..bd6c072 100644 --- a/test/testescape.c +++ b/test/testescape.c @@ -172,7 +172,7 @@ static void test_escape(abts_case *tc, void *data) ABTS_PTR_EQUAL(tc, src, dest); src = "\xFF<>&\'\"Hello World"; - target = "ÿ<>&'"Hello World"; + target = "ÿ<>&'"Hello World"; dest = apr_pescape_entity(pool, src, 1); ABTS_STR_EQUAL(tc, target, dest); apr_escape_entity(NULL, src, APR_ESCAPE_STRING, 1, &len); diff --git a/test/testfile.c b/test/testfile.c index b1e9c55..f135bed 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -21,6 +21,8 @@ #include "apr_general.h" #include "apr_poll.h" #include "apr_lib.h" +#include "apr_strings.h" +#include "apr_thread_proc.h" #include "testutil.h" #define DIRNAME "data" @@ -430,6 +432,10 @@ static void test_gets(abts_case *tc, void *data) rv = apr_file_gets(str, 256, f); ABTS_INT_EQUAL(tc, APR_EOF, rv); ABTS_STR_EQUAL(tc, "", str); + /* Calling gets after EOF should return EOF. */ + rv = apr_file_gets(str, 256, f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", str); apr_file_close(f); } @@ -453,6 +459,214 @@ static void test_gets_buffered(abts_case *tc, void *data) rv = apr_file_gets(str, 256, f); ABTS_INT_EQUAL(tc, APR_EOF, rv); ABTS_STR_EQUAL(tc, "", str); + /* Calling gets after EOF should return EOF. */ + rv = apr_file_gets(str, 256, f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", str); + apr_file_close(f); +} + +static void test_gets_empty(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testgets_empty.dat"; + char buf[256]; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "re-open test file", rv); + + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + /* Calling gets after EOF should return EOF. */ + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + apr_file_close(f); +} + +static void test_gets_multiline(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testgets_multiline.dat"; + char buf[256]; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file", rv); + rv = apr_file_puts("a\nb\n", f); + APR_ASSERT_SUCCESS(tc, "write test data", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "re-open test file", rv); + + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read first line", rv); + ABTS_STR_EQUAL(tc, "a\n", buf); + + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read second line", rv); + ABTS_STR_EQUAL(tc, "b\n", buf); + + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + /* Calling gets after EOF should return EOF. */ + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + apr_file_close(f); +} + +static void test_gets_small_buf(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testgets_small_buf.dat"; + char buf[2]; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file", rv); + rv = apr_file_puts("ab\n", f); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "re-open test file", rv); + /* Buffer is too small to hold the full line, test that gets properly + * returns the line content character by character. + */ + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read first chunk", rv); + ABTS_STR_EQUAL(tc, "a", buf); + + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read second chunk", rv); + ABTS_STR_EQUAL(tc, "b", buf); + + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read third chunk", rv); + ABTS_STR_EQUAL(tc, "\n", buf); + + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + /* Calling gets after EOF should return EOF. */ + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + apr_file_close(f); +} + +static void test_gets_ungetc(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testgets_ungetc.dat"; + char buf[256]; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file", rv); + rv = apr_file_puts("a\n", f); + APR_ASSERT_SUCCESS(tc, "write test data", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "re-open test file", rv); + + rv = apr_file_ungetc('b', f); + APR_ASSERT_SUCCESS(tc, "call ungetc", rv); + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read line", rv); + ABTS_STR_EQUAL(tc, "ba\n", buf); + + rv = apr_file_ungetc('\n', f); + APR_ASSERT_SUCCESS(tc, "call ungetc with EOL", rv); + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read line", rv); + ABTS_STR_EQUAL(tc, "\n", buf); + + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + /* Calling gets after EOF should return EOF. */ + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + apr_file_close(f); +} + +static void test_gets_buffered_big(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testgets_buffered_big.dat"; + char hugestr[APR_BUFFERSIZE + 2]; + char buf[APR_BUFFERSIZE + 2]; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file", rv); + /* Test an edge case with a buffered file and the line that exceeds + * the default buffer size by 1 (the line itself fits into the buffer, + * but the line + EOL does not). + */ + memset(hugestr, 'a', sizeof(hugestr)); + hugestr[sizeof(hugestr) - 2] = '\n'; + hugestr[sizeof(hugestr) - 1] = '\0'; + rv = apr_file_puts(hugestr, f); + APR_ASSERT_SUCCESS(tc, "write first line", rv); + rv = apr_file_puts("b\n", f); + APR_ASSERT_SUCCESS(tc, "write second line", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "re-open test file", rv); + + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read first line", rv); + ABTS_STR_EQUAL(tc, hugestr, buf); + + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read second line", rv); + ABTS_STR_EQUAL(tc, "b\n", buf); + + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + /* Calling gets after EOF should return EOF. */ + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); apr_file_close(f); } @@ -1260,6 +1474,759 @@ static void test_datasync_on_stream(abts_case *tc, void *data) } } +#if APR_HAS_THREADS +typedef struct thread_file_append_ctx_t { + apr_pool_t *pool; + const char *fname; + apr_size_t chunksize; + char val; + int num_writes; + char *errmsg; +} thread_file_append_ctx_t; + +static void * APR_THREAD_FUNC thread_file_append_func(apr_thread_t *thd, void *data) +{ + thread_file_append_ctx_t *ctx = data; + apr_status_t rv; + apr_file_t *f; + int i; + char *writebuf; + char *readbuf; + + rv = apr_file_open(&f, ctx->fname, + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_APPEND, + APR_FPROT_OS_DEFAULT, ctx->pool); + if (rv) { + apr_thread_exit(thd, rv); + return NULL; + } + + writebuf = apr_palloc(ctx->pool, ctx->chunksize); + memset(writebuf, ctx->val, ctx->chunksize); + readbuf = apr_palloc(ctx->pool, ctx->chunksize); + + for (i = 0; i < ctx->num_writes; i++) { + apr_size_t bytes_written; + apr_size_t bytes_read; + apr_off_t offset; + + rv = apr_file_write_full(f, writebuf, ctx->chunksize, &bytes_written); + if (rv) { + apr_thread_exit(thd, rv); + return NULL; + } + /* After writing the data, seek back from the current offset and + * verify what we just wrote. */ + offset = -((apr_off_t)ctx->chunksize); + rv = apr_file_seek(f, APR_CUR, &offset); + if (rv) { + apr_thread_exit(thd, rv); + return NULL; + } + rv = apr_file_read_full(f, readbuf, ctx->chunksize, &bytes_read); + if (rv) { + apr_thread_exit(thd, rv); + return NULL; + } + if (memcmp(readbuf, writebuf, ctx->chunksize) != 0) { + ctx->errmsg = apr_psprintf( + ctx->pool, + "Unexpected data at file offset %" APR_OFF_T_FMT, + offset); + apr_thread_exit(thd, APR_SUCCESS); + return NULL; + } + } + + apr_file_close(f); + apr_thread_exit(thd, APR_SUCCESS); + + return NULL; +} +#endif /* APR_HAS_THREADS */ + +static void test_atomic_append(abts_case *tc, void *data) +{ +#if APR_HAS_THREADS + apr_status_t rv; + apr_status_t thread_rv; + apr_file_t *f; + const char *fname = "data/testatomic_append.dat"; + unsigned int seed; + thread_file_append_ctx_t ctx1 = {0}; + thread_file_append_ctx_t ctx2 = {0}; + apr_thread_t *t1; + apr_thread_t *t2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_WRITE | APR_FOPEN_CREATE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "create file", rv); + apr_file_close(f); + + seed = (unsigned int)apr_time_now(); + abts_log_message("Random seed for test_atomic_append() is %u", seed); + srand(seed); + + /* Create two threads appending data to the same file. */ + apr_pool_create(&ctx1.pool, p); + ctx1.fname = fname; + ctx1.chunksize = 1 + rand() % 8192; + ctx1.val = 'A'; + ctx1.num_writes = 1000; + rv = apr_thread_create(&t1, NULL, thread_file_append_func, &ctx1, p); + APR_ASSERT_SUCCESS(tc, "create thread", rv); + + apr_pool_create(&ctx2.pool, p); + ctx2.fname = fname; + ctx2.chunksize = 1 + rand() % 8192; + ctx2.val = 'B'; + ctx2.num_writes = 1000; + rv = apr_thread_create(&t2, NULL, thread_file_append_func, &ctx2, p); + APR_ASSERT_SUCCESS(tc, "create thread", rv); + + rv = apr_thread_join(&thread_rv, t1); + APR_ASSERT_SUCCESS(tc, "join thread", rv); + APR_ASSERT_SUCCESS(tc, "no thread errors", thread_rv); + if (ctx1.errmsg) { + ABTS_FAIL(tc, ctx1.errmsg); + } + rv = apr_thread_join(&thread_rv, t2); + APR_ASSERT_SUCCESS(tc, "join thread", rv); + APR_ASSERT_SUCCESS(tc, "no thread errors", thread_rv); + if (ctx2.errmsg) { + ABTS_FAIL(tc, ctx2.errmsg); + } + + apr_file_remove(fname, p); +#else + ABTS_SKIP(tc, data, "This test requires APR thread support."); +#endif /* APR_HAS_THREADS */ +} + +static void test_append_locked(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testappend_locked.dat"; + apr_size_t bytes_written; + apr_size_t bytes_read; + char buf[64] = {0}; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, + APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_APPEND, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "create file", rv); + + rv = apr_file_lock(f, APR_FLOCK_EXCLUSIVE); + APR_ASSERT_SUCCESS(tc, "lock file", rv); + + /* PR50058: Appending to a locked file should not deadlock. */ + rv = apr_file_write_full(f, "abc", 3, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + + apr_file_unlock(f); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open file", rv); + + rv = apr_file_read_full(f, buf, sizeof(buf), &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, 3, (int)bytes_read); + ABTS_STR_EQUAL(tc, "abc", buf); + + apr_file_close(f); + apr_file_remove(fname, p); +} + +static void test_large_write_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testlarge_write_buffered.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, + APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + + /* Test a single large write. */ + len = 80000; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + rv = apr_file_write_full(f, buf, len, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + ABTS_INT_EQUAL(tc, (int)len, (int)bytes_written); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + buf2 = apr_palloc(p, len + 1); + rv = apr_file_read_full(f, buf2, len + 1, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, (int)len, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, len) == 0); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_two_large_writes_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtwo_large_writes_buffered.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, + APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + + /* Test two consecutive large writes. */ + len = 80000; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + + rv = apr_file_write_full(f, buf, len / 2, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + ABTS_INT_EQUAL(tc, (int)(len / 2), (int)bytes_written); + + rv = apr_file_write_full(f, buf, len / 2, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + ABTS_INT_EQUAL(tc, (int)(len / 2), (int)bytes_written); + + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + buf2 = apr_palloc(p, len + 1); + rv = apr_file_read_full(f, buf2, len + 1, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, (int) len, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, len) == 0); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_small_and_large_writes_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtwo_large_writes_buffered.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, + APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + + /* Test small write followed by a large write. */ + len = 80000; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + + rv = apr_file_write_full(f, buf, 5, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + ABTS_INT_EQUAL(tc, 5, (int)bytes_written); + + rv = apr_file_write_full(f, buf, len - 5, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + ABTS_INT_EQUAL(tc, (int)(len - 5), (int)bytes_written); + + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + buf2 = apr_palloc(p, len + 1); + rv = apr_file_read_full(f, buf2, len + 1, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, (int) len, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, len) == 0); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_write_buffered_spanning_over_bufsize(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testwrite_buffered_spanning_over_bufsize.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, + APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + + /* Test three writes than span over the default buffer size. */ + len = APR_BUFFERSIZE + 1; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + + rv = apr_file_write_full(f, buf, APR_BUFFERSIZE - 1, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + ABTS_INT_EQUAL(tc, APR_BUFFERSIZE - 1, (int)bytes_written); + + rv = apr_file_write_full(f, buf, 2, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + ABTS_INT_EQUAL(tc, 2, (int)bytes_written); + + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + buf2 = apr_palloc(p, len + 1); + rv = apr_file_read_full(f, buf2, len + 1, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, (int)len, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, len) == 0); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_empty_read_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testempty_read_buffered.dat"; + apr_size_t len; + apr_size_t bytes_read; + char buf[64]; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "create empty test file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + /* Test an empty read. */ + len = 1; + rv = apr_file_read_full(f, buf, len, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, 0, (int)bytes_read); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_large_read_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testlarge_read_buffered.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + len = 80000; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + rv = apr_file_write_full(f, buf, len, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + /* Test a single large read. */ + buf2 = apr_palloc(p, len); + rv = apr_file_read_full(f, buf2, len, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, (int)len, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, bytes_read) == 0); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + /* Test that we receive an EOF. */ + len = 1; + rv = apr_file_read_full(f, buf2, len, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, 0, (int)bytes_read); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_two_large_reads_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtwo_large_reads_buffered.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + len = 80000; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + rv = apr_file_write_full(f, buf, len, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + /* Test two consecutive large reads. */ + buf2 = apr_palloc(p, len); + memset(buf2, 0, len); + rv = apr_file_read_full(f, buf2, len / 2, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, (int)(len / 2), (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, bytes_read) == 0); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + memset(buf2, 0, len); + rv = apr_file_read_full(f, buf2, len / 2, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, (int)(len / 2), (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf + len / 2, buf2, bytes_read) == 0); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + /* Test that we receive an EOF. */ + len = 1; + rv = apr_file_read_full(f, buf2, len, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, 0, (int)bytes_read); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_small_and_large_reads_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtwo_large_reads_buffered.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + len = 80000; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + rv = apr_file_write_full(f, buf, len, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + /* Test small read followed by a large read. */ + buf2 = apr_palloc(p, len); + memset(buf2, 0, len); + rv = apr_file_read_full(f, buf2, 5, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, 5, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, bytes_read) == 0); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + memset(buf2, 0, len); + rv = apr_file_read_full(f, buf2, len - 5, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, (int)(len - 5), (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf + 5, buf2, bytes_read) == 0); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + /* Test that we receive an EOF. */ + len = 1; + rv = apr_file_read_full(f, buf2, len, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, 0, (int)bytes_read); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_read_buffered_spanning_over_bufsize(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testread_buffered_spanning_over_bufsize.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + len = APR_BUFFERSIZE + 1; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + rv = apr_file_write_full(f, buf, len, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + /* Test reads than span over the default buffer size. */ + buf2 = apr_palloc(p, len); + memset(buf2, 0, len); + rv = apr_file_read_full(f, buf2, APR_BUFFERSIZE - 1, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, APR_BUFFERSIZE - 1, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, bytes_read) == 0); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + memset(buf2, 0, len); + rv = apr_file_read_full(f, buf2, 2, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, 2, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, bytes_read) == 0); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + /* Test that we receive an EOF. */ + len = 1; + rv = apr_file_read_full(f, buf2, len, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, 0, (int)bytes_read); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_single_byte_reads_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testsingle_byte_reads_buffered.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + apr_size_t total; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + len = 40000; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + rv = apr_file_write_full(f, buf, len, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + total = 0; + while (1) { + memset(buf, 0, len); + rv = apr_file_read_full(f, buf, 1, &bytes_read); + if (rv == APR_EOF) { + break; + } + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, 1, (int)bytes_read); + ABTS_INT_EQUAL(tc, 'a', buf[0]); + total += bytes_read; + } + ABTS_INT_EQUAL(tc, (int)len, (int)total); + + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_read_buffered_seek(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtest_read_buffered_seek.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char buf[64]; + apr_off_t off; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + rv = apr_file_write_full(f, "abcdef", 6, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + /* Read one byte. */ + memset(buf, 0, sizeof(buf)); + rv = apr_file_read_full(f, buf, 1, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, 1, (int)bytes_read); + ABTS_INT_EQUAL(tc, 'a', buf[0]); + + /* Seek into the middle of the file. */ + off = 3; + rv = apr_file_seek(f, APR_SET, &off); + APR_ASSERT_SUCCESS(tc, "change file read offset", rv); + ABTS_INT_EQUAL(tc, 3, (int)off); + + /* Read three bytes. */ + memset(buf, 0, sizeof(buf)); + rv = apr_file_read_full(f, buf, 3, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, 3, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, "def", bytes_read) == 0); + + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + /* Test that we receive an EOF. */ + len = 1; + rv = apr_file_read_full(f, buf, len, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, 0, (int)bytes_read); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_append_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testappend_buffered.dat"; + apr_size_t bytes_written; + char buf[64]; + + apr_file_remove(fname, p); + + /* Create file with contents. */ + rv = apr_file_open(&f, fname, APR_FOPEN_WRITE | APR_FOPEN_CREATE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "create file", rv); + + rv = apr_file_write_full(f, "abc", 3, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + /* Re-open it with APR_FOPEN_APPEND and APR_FOPEN_BUFFERED. */ + rv = apr_file_open(&f, fname, + APR_FOPEN_READ | APR_FOPEN_WRITE | + APR_FOPEN_APPEND | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open file", rv); + + /* Append to the file. */ + rv = apr_file_write_full(f, "def", 3, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open file", rv); + + /* Test the file contents. */ + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_STR_EQUAL(tc, "abcdef", buf); + + apr_file_close(f); + apr_file_remove(fname, p); +} + abts_suite *testfile(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -1286,6 +2253,11 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_ungetc, NULL); abts_run_test(suite, test_gets, NULL); abts_run_test(suite, test_gets_buffered, NULL); + abts_run_test(suite, test_gets_empty, NULL); + abts_run_test(suite, test_gets_multiline, NULL); + abts_run_test(suite, test_gets_small_buf, NULL); + abts_run_test(suite, test_gets_ungetc, NULL); + abts_run_test(suite, test_gets_buffered_big, NULL); abts_run_test(suite, test_puts, NULL); abts_run_test(suite, test_writev, NULL); abts_run_test(suite, test_writev_full, NULL); @@ -1306,6 +2278,20 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_xthread, NULL); abts_run_test(suite, test_datasync_on_file, NULL); abts_run_test(suite, test_datasync_on_stream, NULL); + abts_run_test(suite, test_atomic_append, NULL); + abts_run_test(suite, test_append_locked, NULL); + abts_run_test(suite, test_large_write_buffered, NULL); + abts_run_test(suite, test_two_large_writes_buffered, NULL); + abts_run_test(suite, test_small_and_large_writes_buffered, NULL); + abts_run_test(suite, test_write_buffered_spanning_over_bufsize, NULL); + abts_run_test(suite, test_empty_read_buffered, NULL); + abts_run_test(suite, test_large_read_buffered, NULL); + abts_run_test(suite, test_two_large_reads_buffered, NULL); + abts_run_test(suite, test_small_and_large_reads_buffered, NULL); + abts_run_test(suite, test_read_buffered_spanning_over_bufsize, NULL); + abts_run_test(suite, test_single_byte_reads_buffered, NULL); + abts_run_test(suite, test_read_buffered_seek, NULL); + abts_run_test(suite, test_append_buffered, NULL); return suite; } diff --git a/test/testmutexscope.c b/test/testmutexscope.c index 2120fff..8dc1afc 100644 --- a/test/testmutexscope.c +++ b/test/testmutexscope.c @@ -93,7 +93,7 @@ static void lock_release(test_mode_e test_mode) static void * APR_THREAD_FUNC eachThread(apr_thread_t *id, void *p) { - test_mode_e test_mode = (test_mode_e)p; + test_mode_e test_mode = (test_mode_e)(apr_uintptr_t)p; lock_grab(test_mode); ++counter; @@ -142,7 +142,7 @@ static void test_mech_mode(apr_lockmech_e mech, const char *mech_name, rv = apr_thread_create(&threads[i], NULL, eachThread, - (void *)test_mode, + (void *)(apr_uintptr_t)test_mode, p); if (rv != APR_SUCCESS) { fprintf(stderr, "apr_thread_create->%d\n", rv); diff --git a/test/testpoll.c b/test/testpoll.c index 9f90af2..960b6a7 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -22,6 +22,13 @@ #include "apr_network_io.h" #include "apr_poll.h" +#if defined(__linux__) +#include "arch/unix/apr_private.h" +#endif +#ifndef HAVE_EPOLL_WAIT_RELIABLE_TIMEOUT +#define HAVE_EPOLL_WAIT_RELIABLE_TIMEOUT 0 +#endif + #define SMALL_NUM_SOCKETS 3 /* We can't use 64 here, because some platforms *ahem* Solaris *ahem* have * a default limit of 64 open file descriptors per process. If we use @@ -854,6 +861,16 @@ static void pollcb_wakeup(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_EINTR, rv); } +#define JUSTSLEEP_DELAY apr_time_from_msec(200) +#if HAVE_EPOLL_WAIT_RELIABLE_TIMEOUT +#define JUSTSLEEP_ENOUGH(ts, te) \ + ((te) - (ts) >= JUSTSLEEP_DELAY) +#else +#define JUSTSLEEP_JIFFY apr_time_from_msec(10) +#define JUSTSLEEP_ENOUGH(ts, te) \ + ((te) - (ts) >= JUSTSLEEP_DELAY - JUSTSLEEP_JIFFY) +#endif + static void justsleep(abts_case *tc, void *data) { apr_int32_t nsds; @@ -872,13 +889,13 @@ static void justsleep(abts_case *tc, void *data) nsds = 1; t1 = apr_time_now(); - rv = apr_poll(NULL, 0, &nsds, apr_time_from_msec(200)); + rv = apr_poll(NULL, 0, &nsds, JUSTSLEEP_DELAY); t2 = apr_time_now(); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, nsds); ABTS_ASSERT(tc, "apr_poll() didn't sleep", - (t2 - t1) > apr_time_from_msec(100)); + JUSTSLEEP_ENOUGH(t1, t2)); for (i = 0; i < sizeof methods / sizeof methods[0]; i++) { rv = apr_pollset_create_ex(&pollset, 5, p, 0, methods[i]); @@ -887,14 +904,13 @@ static void justsleep(abts_case *tc, void *data) nsds = 1; t1 = apr_time_now(); - rv = apr_pollset_poll(pollset, apr_time_from_msec(200), &nsds, - &hot_files); + rv = apr_pollset_poll(pollset, JUSTSLEEP_DELAY, &nsds, &hot_files); t2 = apr_time_now(); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, nsds); ABTS_ASSERT(tc, "apr_pollset_poll() didn't sleep", - (t2 - t1) > apr_time_from_msec(100)); + JUSTSLEEP_ENOUGH(t1, t2)); rv = apr_pollset_destroy(pollset); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -905,12 +921,12 @@ static void justsleep(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); t1 = apr_time_now(); - rv = apr_pollcb_poll(pollcb, apr_time_from_msec(200), NULL, NULL); + rv = apr_pollcb_poll(pollcb, JUSTSLEEP_DELAY, NULL, NULL); t2 = apr_time_now(); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_ASSERT(tc, "apr_pollcb_poll() didn't sleep", - (t2 - t1) > apr_time_from_msec(100)); + JUSTSLEEP_ENOUGH(t1, t2)); /* no apr_pollcb_destroy() */ } diff --git a/test/testproc.c b/test/testproc.c index 096ecfd..3c32465 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -65,6 +65,9 @@ static void test_create_proc(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_SIZE_EQUAL(tc, strlen(TESTSTR), length); + rv = apr_file_close(testfile); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + testfile = newproc.out; length = 256; buf = apr_pcalloc(p, length); diff --git a/test/testshm.c b/test/testshm.c index 7387069..3b97471 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -31,36 +31,6 @@ #if APR_HAS_SHARED_MEMORY -#if APR_HAS_FORK -static int msgwait(int sleep_sec, int first_box, int last_box) -{ - int i; - int recvd = 0; - apr_time_t start = apr_time_now(); - apr_interval_time_t sleep_duration = apr_time_from_sec(sleep_sec); - while (apr_time_now() - start < sleep_duration) { - for (i = first_box; i < last_box; i++) { - if (boxes[i].msgavail && !strcmp(boxes[i].msg, MSG)) { - recvd++; - boxes[i].msgavail = 0; /* reset back to 0 */ - /* reset the msg field. 1024 is a magic number and it should - * be a macro, but I am being lazy. - */ - memset(boxes[i].msg, 0, 1024); - } - } - apr_sleep(apr_time_make(0, 10000)); /* 10ms */ - } - return recvd; -} - -static void msgput(int boxnum, char *msg) -{ - apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg) + 1); - boxes[boxnum].msgavail = 1; -} -#endif /* APR_HAS_FORK */ - static void test_anon_create(abts_case *tc, void *data) { apr_status_t rv; @@ -102,6 +72,7 @@ static void test_shm_allocate(abts_case *tc, void *data) boxes = apr_shm_baseaddr_get(shm); ABTS_PTR_NOTNULL(tc, boxes); + memset(boxes, 0, SHARED_SIZE); rv = apr_shm_destroy(shm); APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); @@ -126,10 +97,13 @@ static void test_anon(abts_case *tc, void *data) boxes = apr_shm_baseaddr_get(shm); ABTS_PTR_NOTNULL(tc, boxes); + memset(boxes, 0, SHARED_SIZE); rv = apr_proc_fork(&proc, p); if (rv == APR_INCHILD) { /* child */ - int num = msgwait(5, 0, N_BOXES); + int num = msgwait("anon_test", N_MESSAGES, + 5, /* wait for 5s */ + 10 /* with 10ms spin delay */); /* exit with the number of messages received so that the parent * can check that all messages were received. */ @@ -142,8 +116,10 @@ static void test_anon(abts_case *tc, void *data) if ((i-=3) < 0) { i += N_BOXES; /* start over at the top */ } - msgput(i, MSG); - apr_sleep(apr_time_make(0, 10000)); + if (!msgput("anon_test", i)) { + cnt--; + } + apr_sleep(apr_time_from_msec(10)); } } else { @@ -183,6 +159,7 @@ static void test_named(abts_case *tc, void *data) boxes = apr_shm_baseaddr_get(shm); ABTS_PTR_NOTNULL(tc, boxes); + memset(boxes, 0, SHARED_SIZE); rv = apr_procattr_create(&attr1, p); ABTS_PTR_NOTNULL(tc, attr1); @@ -308,6 +285,36 @@ static void test_named_delete(abts_case *tc, void *data) ABTS_TRUE(tc, rv != 0); } +static void test_named_perms(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_shm_t *shm; + apr_uid_t uid; + apr_gid_t gid; + + apr_shm_remove(SHARED_FILENAME, p); + + rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); + if (rv != APR_SUCCESS) { + return; + } + ABTS_PTR_NOTNULL(tc, shm); + + rv = apr_uid_current(&uid, &gid, p); + APR_ASSERT_SUCCESS(tc, "retrieve current uid/gid", rv); + if (rv) return; + + rv = apr_shm_perms_set(shm, + APR_FPROT_UREAD|APR_FPROT_UWRITE, uid, gid); + apr_shm_destroy(shm); + + if (rv == APR_ENOTIMPL) + ABTS_SKIP(tc, data, "apr_shm_perms_set not implemented for named shm"); + else + APR_ASSERT_SUCCESS(tc, "Could not change permissions of shm segment", rv); +} + #endif abts_suite *testshm(abts_suite *suite) @@ -324,6 +331,7 @@ abts_suite *testshm(abts_suite *suite) abts_run_test(suite, test_named, NULL); abts_run_test(suite, test_named_remove, NULL); abts_run_test(suite, test_named_delete, NULL); + abts_run_test(suite, test_named_perms, NULL); #endif return suite; diff --git a/test/testshm.h b/test/testshm.h index 5b24a9d..4d4f0c5 100644 --- a/test/testshm.h +++ b/test/testshm.h @@ -17,17 +17,67 @@ #ifndef TESTSHM_H #define TESTSHM_H +#include "apr.h" +#include "apr_time.h" +#include "apr_atomic.h" +#include "apr_strings.h" + +#include <assert.h> + typedef struct mbox { char msg[1024]; - int msgavail; + apr_uint32_t msgavail; } mbox; mbox *boxes; #define N_BOXES 10 +#define N_MESSAGES 100 #define SHARED_SIZE (apr_size_t)(N_BOXES * sizeof(mbox)) #define SHARED_FILENAME "data/apr.testshm.shm" -#define N_MESSAGES 100 #define MSG "Sending a message" -#endif +#if APR_HAS_SHARED_MEMORY +static APR_INLINE +int msgwait(const char *msg, int count, int duration, int sleep_ms) +{ + int recvd = 0, i; + apr_time_t start = apr_time_now(); + apr_interval_time_t sleep_duration = apr_time_from_sec(duration); + apr_interval_time_t sleep_delay = apr_time_from_msec(sleep_ms); + while (apr_time_now() - start < sleep_duration) { + for (i = 0; i < N_BOXES; i++) { + if (apr_atomic_cas32(&boxes[i].msgavail, 0, 1) == 1) { + if (msg) { + assert(strcmp(boxes[i].msg, msg) == 0); + } + *boxes[i].msg = '\0'; + if (++recvd == count) { + return recvd; + } + } + } + apr_sleep(sleep_delay); + } + return recvd; +} + +static APR_INLINE +int msgput(const char *msg, int boxnum) +{ + if (apr_atomic_cas32(&boxes[boxnum].msgavail, -1, 0) != 0) { + return 0; + } + if (msg) { + apr_cpystrn(boxes[boxnum].msg, msg, sizeof(boxes[boxnum].msg)); + } + else { + *boxes[boxnum].msg = '\0'; + } + apr_atomic_set32(&boxes[boxnum].msgavail, 1); + return 1; +} + +#endif /* APR_HAS_SHARED_MEMORY */ + +#endif diff --git a/test/testshmconsumer.c b/test/testshmconsumer.c index 6a2a3c3..bf70e72 100644 --- a/test/testshmconsumer.c +++ b/test/testshmconsumer.c @@ -30,25 +30,6 @@ #if APR_HAS_SHARED_MEMORY -static int msgwait(int sleep_sec, int first_box, int last_box) -{ - int i; - int recvd = 0; - apr_time_t start = apr_time_now(); - apr_interval_time_t sleep_duration = apr_time_from_sec(sleep_sec); - while (apr_time_now() - start < sleep_duration) { - for (i = first_box; i < last_box; i++) { - if (boxes[i].msgavail && !strcmp(boxes[i].msg, MSG)) { - recvd++; - boxes[i].msgavail = 0; /* reset back to 0 */ - memset(boxes[i].msg, 0, 1024); - } - } - apr_sleep(apr_time_from_sec(1)); - } - return recvd; -} - int main(void) { apr_status_t rv; @@ -70,7 +51,7 @@ int main(void) boxes = apr_shm_baseaddr_get(shm); /* consume messages on all of the boxes */ - recvd = msgwait(30, 0, N_BOXES); /* wait for 30 seconds for messages */ + recvd = msgwait(MSG, N_MESSAGES, 30, 1); rv = apr_shm_detach(shm); if (rv != APR_SUCCESS) { diff --git a/test/testshmproducer.c b/test/testshmproducer.c index 58eb94f..eb61e76 100644 --- a/test/testshmproducer.c +++ b/test/testshmproducer.c @@ -29,11 +29,6 @@ #if APR_HAS_SHARED_MEMORY -static void msgput(int boxnum, char *msg) -{ - apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg) + 1); - boxes[boxnum].msgavail = 1; -} int main(void) { @@ -63,7 +58,7 @@ int main(void) * are returning the right number. */ for (i = N_BOXES - 1, sent = 0; i >= 0; i--, sent++) { - msgput(i, MSG); + msgput(MSG, i); apr_sleep(apr_time_from_sec(1)); } diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 00ec4eb..55d334e 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -119,7 +119,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t -APR_DECLARE(apr_os_thread_t) apr_os_thread_current() +APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) { PIB *ppib; TIB *ptib; diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 2503457..1844335 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -179,7 +179,7 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) } } -APR_DECLARE(void) apr_thread_yield() +APR_DECLARE(void) apr_thread_yield(void) { /* SwitchToThread is not supported on Win9x, but since it's * primarily a noop (entering time consuming code, therefore |