diff --git a/.flake8 b/.flake8 index f5b8e6b9e39..9e5d50809d3 100644 --- a/.flake8 +++ b/.flake8 @@ -50,6 +50,7 @@ per-file-ignores = gui/wxpython/core/giface.py: E501 gui/wxpython/core/gthread.py: F841 gui/wxpython/core/gconsole.py: E722, W605 + gui/wxpython/core/globalvar.py: W605 gui/wxpython/core/toolboxes.py: E722, E501 gui/wxpython/core/utils.py: E722, F841, W605 gui/wxpython/core/workspace.py: E722, E501 diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000000..a1228e2180a --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,88 @@ +--- +libraries: + - changed-files: + - any-glob-to-any-file: + - lib/**/* + - include/grass/* + - include/grass/**/* + - python/**/* +module: + - changed-files: + - any-glob-to-any-file: + - db/**/* + - display/**/* + - general/**/* + - imagery/**/* + - misc/**/* + - ps/**/* + - raster/**/* + - raster3d/**/* + - scripts/**/* + - temporal/**/* + - vector/**/* +vector: + - changed-files: + - any-glob-to-any-file: vector/**/* +raster: + - changed-files: + - any-glob-to-any-file: raster/**/* +temporal: + - changed-files: + - any-glob-to-any-file: temporal/**/* +database: + - changed-files: + - any-glob-to-any-file: db/**/* +GUI: + - changed-files: + - any-glob-to-any-file: gui/**/* +Windows: + - changed-files: + - any-glob-to-any-file: mswindows/**/* +macOS: + - changed-files: + - any-glob-to-any-file: macosx/**/* +Linux: + - changed-files: + - any-glob-to-any-file: singularity/**/* +docker: + - changed-files: + - any-glob-to-any-file: docker/**/* +docs: + - changed-files: + - any-glob-to-any-file: + - doc/**/* + - man/**/* +RFC: + - changed-files: + - any-glob-to-any-file: doc/development/rfc/* +translation: + - changed-files: + - any-glob-to-any-file: locale/**/* +CI: + - changed-files: + - any-glob-to-any-file: + - .github/**/* + - .travis/**/* + +# based on file types +Python: + - changed-files: + - any-glob-to-any-file: '**/*.py' +C: + - changed-files: + - any-glob-to-any-file: '**/*.c' +C++: + - changed-files: + - any-glob-to-any-file: '**/*.cpp' +CSS: + - changed-files: + - any-glob-to-any-file: '**/*.css' +HTML: + - changed-files: + - any-glob-to-any-file: '**/*.html' +JavaScript: + - changed-files: + - any-glob-to-any-file: '**/*.js' +Markdown: + - changed-files: + - any-glob-to-any-file: '**/*.md' diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7e628404348..97908f62fa1 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -34,7 +34,7 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} config-file: ./.github/codeql/codeql-config.yml @@ -61,4 +61,4 @@ jobs: run: .github/workflows/build_ubuntu-22.04.sh $HOME/install - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/create_release_draft.yml b/.github/workflows/create_release_draft.yml index d9c95278844..283f6c7557f 100644 --- a/.github/workflows/create_release_draft.yml +++ b/.github/workflows/create_release_draft.yml @@ -93,7 +93,7 @@ jobs: asset_content_type: application/gzip - name: Make the created files available - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: artifacts diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 00000000000..4dbe6c47417 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,25 @@ +--- +name: Pull Request Labeler + +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler/blob/master/README.md + +on: + - pull_request_target + +permissions: {} + +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 + with: + sync-labels: true diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d00b7ba66c7..6aa5e89b921 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -80,7 +80,7 @@ jobs: nc_spm_full_v2alpha2.tar.gz" - name: Make HTML test report available if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: testreport-macOS path: testreport diff --git a/.github/workflows/macos_gunittest.cfg b/.github/workflows/macos_gunittest.cfg index 9a124d438a5..65c839474c1 100644 --- a/.github/workflows/macos_gunittest.cfg +++ b/.github/workflows/macos_gunittest.cfg @@ -16,7 +16,6 @@ exclude = python/grass/script/testsuite/test_script_doctests.py python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py python/grass/temporal/testsuite/unittests_temporal_raster_conditionals_complement_else.py - raster/r.contour/testsuite/testrc.py raster/r.in.gdal/testsuite/test_r_in_gdal.py raster/r.in.lidar/testsuite/test_base_resolution.sh raster/r.in.lidar/testsuite/test_base_resolution.sh diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 459afd80000..9b8db8ae440 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -25,6 +25,7 @@ jobs: python-version: - '3.8' - '3.10' + - '3.12' fail-fast: true runs-on: ${{ matrix.os }} @@ -79,3 +80,11 @@ jobs: - name: Print installed versions if: always() run: .github/workflows/print_versions.sh + pytest-success: + name: pytest Result + needs: + - pytest + if: ${{ always() }} + uses: ./.github/workflows/verify-success.yml + with: + needs_context: ${{ toJson(needs) }} diff --git a/.github/workflows/python-code-quality.yml b/.github/workflows/python-code-quality.yml index 831e041519d..4c872e5df87 100644 --- a/.github/workflows/python-code-quality.yml +++ b/.github/workflows/python-code-quality.yml @@ -13,11 +13,12 @@ on: jobs: python-checks: - name: Python Code Quality + name: Python Code Quality Checks concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}-${{ - matrix.pylint-version }} + group: ${{ github.workflow }}-${{ github.job }}-${{ + github.event_name == 'pull_request' && + github.head_ref || github.sha }}-${{ matrix.pylint-version }} cancel-in-progress: true # Using matrix just to get variables which are not environmental variables @@ -26,11 +27,11 @@ jobs: matrix: include: - os: ubuntu-22.04 - python-version: '3.10' - min-python-version: '3.7' - black-version: '23.1.0' - flake8-version: '3.9.2' - pylint-version: '2.12.2' + python-version: "3.10" + min-python-version: "3.7" + black-version: "23.1.0" + flake8-version: "3.9.2" + pylint-version: "2.12.2" runs-on: ${{ matrix.os }} @@ -39,7 +40,7 @@ jobs: run: | echo OS: ${{ matrix.os }} echo Python: ${{ matrix.python-version }} - echo Minimimal Python version: ${{ matrix.min-python-version }} + echo Minimal Python version: ${{ matrix.min-python-version }} echo Black: ${{ matrix.black-version }} echo Flake8: ${{ matrix.flake8-version }} echo Pylint: ${{ matrix.pylint-version }} @@ -50,13 +51,14 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: pip - name: Install non-Python dependencies run: | sudo apt-get update -y sudo apt-get install -y wget git gawk findutils xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \ - sudo apt-get install -y --no-install-recommends --no-install-suggests + sudo apt-get install -y --no-install-recommends --no-install-suggests - name: Install Python dependencies run: | @@ -141,8 +143,16 @@ jobs: cp -rp dist.$ARCH/docs/html/libpython sphinx-grass - name: Make Sphinx documentation available - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: sphinx-grass path: sphinx-grass retention-days: 3 + python-success: + name: Python Code Quality Result + needs: + - python-checks + if: ${{ always() }} + uses: ./.github/workflows/verify-success.yml + with: + needs_context: ${{ toJson(needs) }} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 213b1ff8937..032234db885 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -14,7 +14,7 @@ on: - releasebranch_* jobs: - build-and-test: + ubuntu: name: ${{ matrix.name }} tests concurrency: @@ -26,7 +26,7 @@ jobs: strategy: matrix: include: - - name: '22.04' + - name: "22.04" os: ubuntu-22.04 config: ubuntu-22.04 # This is without optional things but it still keeps things useful, @@ -86,7 +86,7 @@ jobs: - name: Make HTML test report available if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: testreport-${{ matrix.config }} path: testreport @@ -95,3 +95,11 @@ jobs: - name: Print installed versions if: always() run: .github/workflows/print_versions.sh + build-and-test-success: + name: Build & Test Result + needs: + - ubuntu + if: ${{ always() }} + uses: ./.github/workflows/verify-success.yml + with: + needs_context: ${{ toJson(needs) }} diff --git a/.github/workflows/verify-success.yml b/.github/workflows/verify-success.yml new file mode 100644 index 00000000000..8ebeb7c4665 --- /dev/null +++ b/.github/workflows/verify-success.yml @@ -0,0 +1,155 @@ +--- +name: Verify Success reusable workflow + +# Use this reusable workflow as a job of workflow to check that +# all jobs, including ones ran through a matrix, were successful. +# This job can then be used as a required status check in the +# repo's rulesets, that allows to change the required jobs or +# the matrix values of a required job without needing to change +# the rulesets settings. In the future, GitHub might have a +# solution to this natively. + +# This reusable workflow has inputs to change what is required +# to have this workflow pass. It handles the cases were there were +# skipped jobs, and no successful jobs. + +# The jobs to check must set as the `needs` for the job calling this +# reusable workflow. This also means that the job ids should be in the +# same workflow file. The calling job must be set to always run to be +# triggered when jobs are skipped or cancelled. +# Then, set the `needs_context` input like: +# `needs_context: ${{ toJson(needs) }}` + +# Example usage, as a job inside a workflow: +# ``` +# jobs: +# a-job-id: +# ... +# another-job-id: +# ... +# some-job-success: +# name: Some Job Result +# needs: +# - a-job-id +# - another-job-id +# if: ${{ always() }} +# uses: ./.github/workflows/verify-success.yml +# with: +# needs_context: ${{ toJson(needs) }} +# ``` + +on: + workflow_call: + inputs: + needs_context: + type: string + required: true + # Can't escape the handlebars in the description + description: + In the calling job that defines all the needed jobs, + send `toJson(needs)` inside `$` followed by `{{ }}` + fail_if_failure: + type: boolean + default: true + description: + If true, this workflow will fail if any job from 'needs_context was + failed + fail_if_cancelled: + type: boolean + default: true + description: + If true, this workflow will fail if any job from 'needs_context' was + cancelled + fail_if_skipped: + type: boolean + default: false + description: + If true, this workflow will fail if any job from 'needs_context' was + skipped + require_success: + type: boolean + default: true + description: + If true, this workflow will fail if no job from 'needs_context' was + successful + +jobs: + verify-success: + name: Success + runs-on: ubuntu-latest + continue-on-error: true + steps: + - name: Set outputs for each job result type + id: has-result + run: | + echo "failure=${{ + contains(env.NEEDS_RESULT, 'failure') }}" >> "$GITHUB_OUTPUT" + echo "cancelled=${{ + contains(env.NEEDS_RESULT, 'cancelled') }}" >> "$GITHUB_OUTPUT" + echo "skipped=${{ + contains(env.NEEDS_RESULT, 'skipped') }}" >> "$GITHUB_OUTPUT" + echo "success=${{ + contains(env.NEEDS_RESULT, 'success') }}" >> "$GITHUB_OUTPUT" + env: + NEEDS_RESULT: ${{ toJson(fromJson(inputs.needs_context).*.result) }} + - name: Set exit codes for each job result type + id: exit-code + run: | + echo "failure=${{ inputs.fail_if_failure && + fromJson(steps.has-result.outputs.failure) && 1 || 0 + }}" >> "$GITHUB_OUTPUT" + echo "cancelled=${{ inputs.fail_if_cancelled && + fromJson(steps.has-result.outputs.cancelled) && 1 || 0 + }}" >> "$GITHUB_OUTPUT" + echo "skipped=${{ inputs.fail_if_skipped && + fromJson(steps.has-result.outputs.skipped) && 1 || 0 + }}" >> "$GITHUB_OUTPUT" + echo "success=${{ inputs.require_success && + !fromJson(steps.has-result.outputs.success) && 1 || 0 + }}" >> "$GITHUB_OUTPUT" + - name: Set messages for each job result type + id: message + run: | + echo "failure=${{ format('{0}{1} were failed', + (steps.exit-code.outputs.failure == 1) && env.P1 || env.P2, + (steps.has-result.outputs.failure == 'true') && env.M1 || env.M2) + }}" >> "$GITHUB_OUTPUT" + echo "cancelled=${{ format('{0}{1} were cancelled', + (steps.exit-code.outputs.cancelled == 1) && env.P1 || env.P2, + (steps.has-result.outputs.cancelled == 'true') && env.M1 || env.M2) + }}" >> "$GITHUB_OUTPUT" + echo "skipped=${{ format('{0}{1} were skipped', + (steps.exit-code.outputs.skipped == 1) && env.P1 || env.P2, + (steps.has-result.outputs.skipped == 'true') && env.M1 || env.M2) + }}" >> "$GITHUB_OUTPUT" + echo "success=${{ format('{0}{1} were successful', + (steps.exit-code.outputs.success == 1) && env.P1 || env.P2, + (steps.has-result.outputs.success == 'true') && env.M1 || env.M2) + }}" >> "$GITHUB_OUTPUT" + env: + P1: "::error ::" # Common message prefix if step will fail + P2: "" # Common message prefix if step will not fail + M1: "Some jobs" # Common message if result is true + M2: "No jobs" # Common message if result is false + + - name: Check for failed jobs + run: | + echo "${{ steps.message.outputs.failure }}" + exit ${{ steps.exit-code.outputs.failure }} + - name: Check for cancelled jobs + run: | + echo "${{ steps.message.outputs.cancelled }}" + exit ${{ steps.exit-code.outputs.cancelled }} + - name: Check for skipped jobs + run: | + echo "${{ steps.message.outputs.skipped }}" + exit ${{ steps.exit-code.outputs.skipped }} + - name: Check for successful jobs + run: | + echo "${{ steps.message.outputs.success }}" + exit ${{ steps.exit-code.outputs.success }} + + - run: echo "Checks passed successfully" + if: ${{ success() }} + - run: echo "Checks failed" + if: ${{ !success() }} diff --git a/.gunittest.cfg b/.gunittest.cfg index d68237e12fe..19c2cc950dd 100644 --- a/.gunittest.cfg +++ b/.gunittest.cfg @@ -16,7 +16,6 @@ exclude = python/grass/script/testsuite/test_script_doctests.py python/grass/temporal/testsuite/unittests_temporal_raster_algebra_equal_ts.py python/grass/temporal/testsuite/unittests_temporal_raster_conditionals_complement_else.py - raster/r.contour/testsuite/testrc.py raster/r.in.gdal/testsuite/test_r_in_gdal.py raster/r.in.lidar/testsuite/test_base_resolution.sh raster/r.in.lidar/testsuite/test_base_resolution.sh diff --git a/Makefile b/Makefile index e2f389cf0de..c95128f3cec 100644 --- a/Makefile +++ b/Makefile @@ -91,6 +91,7 @@ $(ARCH_DISTDIR)/%: % $(INSTALL_DATA) $< $@ LIBDIRS = \ + lib/external/parson \ lib/external/shapelib \ lib/datetime \ lib/gis \ diff --git a/aclocal.m4 b/aclocal.m4 index 57402f7993b..0110500aa8a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -410,7 +410,7 @@ AC_DEFUN([SC_ENABLE_SHARED], [ else AC_MSG_RESULT([static]) SHARED_BUILD=0 - AC_DEFINE(STATIC_BUILD, 1, [define for Windows static build]) + AC_DEFINE(STATIC_BUILD, 1, [Define to 1 for Windows static build.]) GRASS_LIBRARY_TYPE='stlib' fi AC_SUBST(GRASS_LIBRARY_TYPE) @@ -520,8 +520,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ *-sun-solaris*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. - AC_DEFINE(_REENTRANT, 1, [define _REENTRANT flag (for SunOS)]) - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [enable threading extensions on Solaris]) + AC_DEFINE(_REENTRANT, 1, [Define to 1 for _REENTRANT flag (for SunOS).]) + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to 1 to enable threading extensions on Solaris.]) # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. if test "$GCC" = "yes" ; then @@ -543,8 +543,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # derives from UNIX System V Release 4 # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. - AC_DEFINE(_REENTRANT, 1, [define _REENTRANT flag (for SunOS)]) - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [enable threading extensions on Solaris]) + AC_DEFINE(_REENTRANT, 1, [Define to 1 for _REENTRANT flag (for SunOS).]) + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to 1 to enable threading extensions on Solaris.]) # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. if test "$GCC" = "yes" ; then @@ -574,8 +574,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # TODO: add optional pthread support with any combination of: # CFLAGS="$CFLAGS -pthread" # LDFLAGS="$LDFLAGS -lpthread" - # AC_DEFINE(_REENTRANT, 1, [define _REENTRANT flag (for SunOS)]) - # AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [enable threading extensions on Solaris]) + # AC_DEFINE(_REENTRANT, 1, [Define to 1 for _REENTRANT flag (for SunOS).]) + # AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to 1 to enable threading extensions on Solaris.]) ;; *-netbsd*) # NetBSD has ELF. @@ -596,8 +596,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # TODO: add optional pthread support with any combination of: # CFLAGS="$CFLAGS -pthread" # LDFLAGS="$LDFLAGS -lpthread" - # AC_DEFINE(_REENTRANT, 1, [define _REENTRANT flag (for SunOS)]) - # AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [enable threading extensions on Solaris]) + # AC_DEFINE(_REENTRANT, 1, [Define to 1 for _REENTRANT flag (for SunOS).]) + # AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to 1 to enable threading extensions on Solaris.]) ;; *aix*) # NOTE: do we need to support aix < 6 ? @@ -638,8 +638,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ AC_SUBST(STLIB_SUFFIX) ]) + dnl -------------------- OpenMP ----------------------------------------------- -dnl OpenMP code borrowed and modified from Autoconf 2.69 (AC_OPENMP) +dnl OpenMP code borrowed and modified from Autoconf 2.71 (AC_OPENMP) dnl to enable Clang detection # _LOC_LANG_OPENMP @@ -654,10 +655,10 @@ AC_DEFUN([_LOC_LANG_OPENMP], m4_define([_LOC_LANG_OPENMP(C)], [ #ifndef _OPENMP - choke me +#error "OpenMP not supported" #endif #include -int main () { return omp_get_num_threads (); } +int main (void) { return omp_get_num_threads (); } ]) # _LOC_LANG_OPENMP(C++) @@ -688,57 +689,91 @@ m4_copy([_LOC_LANG_OPENMP(Fortran 77)], [_LOC_LANG_OPENMP(Fortran)]) # The options are necessary at compile time (so the #pragmas are understood) # and at link time (so the appropriate library is linked with). # This macro takes care to not produce redundant options if $CC $CFLAGS already -# supports OpenMP. It also is careful to not pass options to compilers that -# misinterpret them; for example, most compilers accept "-openmp" and create -# an output file called 'penmp' rather than activating OpenMP support. +# supports OpenMP. +# +# For each candidate option, we do a compile test first, then a link test; +# if the compile test succeeds but the link test fails, that means we have +# found the correct option but it doesn't work because the libraries are +# broken. (This can happen, for instance, with SunPRO C and a bad combination +# of operating system patches.) +# +# Several of the options in our candidate list can be misinterpreted by +# compilers that don't use them to activate OpenMP support; for example, +# many compilers understand "-openmp" to mean "write output to a file +# named 'penmp'" rather than "enable OpenMP". We can't completely avoid +# the possibility of clobbering files named 'penmp' or 'mp' in configure's +# working directory; therefore, this macro will bomb out if any such file +# already exists when it's invoked. AC_DEFUN([LOC_OPENMP], +[AC_REQUIRE([_LOC_OPENMP_SAFE_WD])]dnl +[AC_ARG_ENABLE([openmp], + [AS_HELP_STRING([--disable-openmp], [do not use OpenMP])])]dnl [ OPENMP_[]_AC_LANG_PREFIX[]FLAGS= - AC_ARG_ENABLE([openmp], - [AS_HELP_STRING([--disable-openmp], [do not use OpenMP])]) if test "$enable_openmp" != no; then AC_CACHE_CHECK([for $[]_AC_CC[] option to support OpenMP], [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp], - [AC_LINK_IFELSE([_LOC_LANG_OPENMP], - [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='none needed'], - [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='unsupported' - dnl Try these flags: - dnl GCC >= 4.2 -fopenmp - dnl SunPRO C -xopenmp - dnl Intel C -openmp - dnl SGI C, PGI C -mp - dnl Tru64 Compaq C -omp - dnl IBM C (AIX, Linux) -qsmp=omp - dnl Cray CCE -homp - dnl NEC SX -Popenmp - dnl Lahey Fortran (Linux) --openmp - dnl Clang (Apple) -Xclang -fopenmp - dnl If in this loop a compiler is passed an option that it doesn't - dnl understand or that it misinterprets, the AC_LINK_IFELSE test - dnl will fail (since we know that it failed without the option), - dnl therefore the loop will continue searching for an option, and - dnl no output file called 'penmp' or 'mp' is created. - for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp -homp \ - -Popenmp --openmp '-Xclang -fopenmp'; do - ac_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS - _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $ac_option" - AC_LINK_IFELSE([_LOC_LANG_OPENMP], - [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp=$ac_option]) - _AC_LANG_PREFIX[]FLAGS=$ac_save_[]_AC_LANG_PREFIX[]FLAGS - if test "$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp" != unsupported; then - break - fi - done])]) - case $ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp in #( - "none needed" | unsupported) - ;; #( - *) - OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp ;; - esac + [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='not found' + dnl Try these flags: + dnl (on by default) '' + dnl GCC >= 4.2 -fopenmp + dnl SunPRO C -xopenmp + dnl Intel C -openmp + dnl SGI C, PGI C -mp + dnl Tru64 Compaq C -omp + dnl IBM XL C (AIX, Linux) -qsmp=omp + dnl Cray CCE -homp + dnl NEC SX -Popenmp + dnl Lahey Fortran (Linux) --openmp + dnl Clang (Apple) -Xclang -fopenmp + for ac_option in '' -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp -homp \ + -Popenmp --openmp '-Xclang -fopenmp'; do + + ac_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $ac_option" + AC_COMPILE_IFELSE([_LOC_LANG_OPENMP], + [AC_LINK_IFELSE([_LOC_LANG_OPENMP], + [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp=$ac_option], + [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='unsupported'])]) + _AC_LANG_PREFIX[]FLAGS=$ac_save_[]_AC_LANG_PREFIX[]FLAGS + + if test "$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp" != 'not found'; then + break + fi + done + if test "$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp" = 'not found'; then + ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='unsupported' + elif test "$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp" = ''; then + ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='none needed' + fi + dnl _AC_OPENMP_SAFE_WD checked that these files did not exist before we + dnl started probing for OpenMP support, so if they exist now, they were + dnl created by the probe loop and it's safe to delete them. + rm -f penmp mp]) + if test "$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp" != 'unsupported' && \ + test "$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp" != 'none needed'; then + OPENMP_[]_AC_LANG_PREFIX[]FLAGS="$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp" + fi fi AC_SUBST([OPENMP_]_AC_LANG_PREFIX[FLAGS]) ]) +# _AC_OPENMP_SAFE_WD +# ------------------ +# AC_REQUIREd by AC_OPENMP. Checks both at autoconf time and at +# configure time for files that AC_OPENMP clobbers. +AC_DEFUN([_LOC_OPENMP_SAFE_WD], +[m4_syscmd([test ! -e penmp && test ! -e mp])]dnl +[m4_if(sysval, [0], [], [m4_fatal(m4_normalize( + [LOC_OPENMP clobbers files named 'mp' and 'penmp'. + To use LOC_OPENMP you must not have either of these files + at the top level of your source tree.]))])]dnl +[if test -e penmp || test -e mp; then + AC_MSG_ERROR(m4_normalize( + [AC@&t@_OPENMP clobbers files named 'mp' and 'penmp'. + Aborting configure because one of these files already exists.])) +fi]) + dnl -------------------- / OpenMP --------------------------------------------- diff --git a/configure b/configure index a3f611ecb36..8f3a589cf9e 100755 --- a/configure +++ b/configure @@ -1,9 +1,10 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69. +# Generated by GNU Autoconf 2.71. # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -14,14 +15,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -31,46 +34,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -79,13 +82,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -94,8 +90,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -107,30 +107,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -152,20 +132,22 @@ 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'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +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="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -185,42 +167,53 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -228,14 +221,21 @@ fi esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + 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 - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -253,18 +253,19 @@ 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'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." @@ -291,6 +292,7 @@ as_fn_unset () } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -308,6 +310,14 @@ 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 # ------------- @@ -322,7 +332,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -331,7 +341,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -370,12 +380,13 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -387,18 +398,27 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } 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] # ---------------------------------------- @@ -410,9 +430,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -439,7 +459,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -483,7 +503,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -497,6 +517,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -510,6 +534,13 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +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 @@ -575,50 +606,46 @@ MFLAGS= MAKEFLAGS= # Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= -PACKAGE_URL= +PACKAGE_NAME='' +PACKAGE_TARNAME='' +PACKAGE_VERSION='' +PACKAGE_STRING='' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' ac_unique_file="configure.ac" # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" +ac_header_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS GRASS_HOME @@ -837,6 +864,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -995,6 +1023,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -1024,8 +1053,6 @@ do *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -1066,9 +1093,9 @@ 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=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1092,9 +1119,9 @@ 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=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1247,6 +1274,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1296,9 +1332,9 @@ 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=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1312,9 +1348,9 @@ 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=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1358,9 +1394,9 @@ Try \`$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1376,7 +1412,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1384,7 +1420,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1440,7 +1476,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1537,6 +1573,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1742,9 +1779,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1772,7 +1809,8 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1780,7 +1818,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1790,9 +1828,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1809,14 +1847,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1824,14 +1862,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1847,14 +1886,14 @@ fi ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1862,14 +1901,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1881,8 +1921,8 @@ fi # ac_fn_c_try_run LINENO # ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack @@ -1892,25 +1932,26 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + 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 @@ -1927,14 +1968,14 @@ fi ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1942,17 +1983,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1967,126 +2009,6 @@ fi } # ac_fn_c_try_link -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } - - -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } - -eval "$3=\$ac_header_compiler" -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in @@ -2094,23 +2016,24 @@ fi ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { 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_header_compile @@ -2122,15 +2045,15 @@ $as_echo "$ac_res" >&6; } ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -2138,12 +2061,13 @@ if (sizeof ($2)) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -2151,29 +2075,68 @@ if (sizeof (($2))) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { 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_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -2182,16 +2145,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -2209,23 +2165,24 @@ choke me #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { 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_func @@ -2236,14 +2193,14 @@ $as_echo "$ac_res" >&6; } ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2251,17 +2208,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -2282,8 +2240,8 @@ fi ac_fn_cxx_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -2292,16 +2250,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -2319,34 +2270,55 @@ choke me #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { 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_cxx_check_func +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF 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.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -2379,8 +2351,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2415,7 +2391,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2450,11 +2426,13 @@ done # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2465,8 +2443,8 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2490,7 +2468,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2498,14 +2476,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2513,15 +2491,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2529,8 +2507,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2544,187 +2522,778 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } fi done -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - 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 - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +#include +#include +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; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +/* 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 + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' -ac_config_headers="$ac_config_headers include/grass/config.h" +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +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) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="install-sh config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" break fi + ac_first_candidate=false + + as_found=false done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +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 fi + # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + 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;} + 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;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + 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;} + 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;} + 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;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + 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: 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' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +ac_config_headers="$ac_config_headers include/grass/config.h" + + -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + 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 +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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -2743,18 +3312,18 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } 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 + 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -2773,6 +3342,15 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2781,8 +3359,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2791,11 +3369,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2805,11 +3387,11 @@ IFS=$as_save_IFS fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2818,8 +3400,8 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2828,11 +3410,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2842,11 +3428,11 @@ IFS=$as_save_IFS fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2854,8 +3440,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2868,8 +3454,8 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2878,11 +3464,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2892,11 +3482,11 @@ IFS=$as_save_IFS fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2905,8 +3495,8 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2916,15 +3506,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2940,17 +3534,17 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2961,8 +3555,8 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2971,11 +3565,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2985,11 +3583,11 @@ IFS=$as_save_IFS fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3002,8 +3600,8 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -3012,11 +3610,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3026,11 +3628,11 @@ IFS=$as_save_IFS fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3042,34 +3644,130 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } + +if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } + +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 +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3079,7 +3777,7 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -3087,7 +3785,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3099,9 +3797,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -3122,11 +3820,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + 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' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -3143,7 +3842,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -3159,44 +3858,46 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +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; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + 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 @@ -3210,15 +3911,15 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +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;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -3227,7 +3928,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -3239,8 +3940,8 @@ _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -3248,10 +3949,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -3259,37 +3960,37 @@ $as_echo "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { 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; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ 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 ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3303,11 +4004,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -3316,28 +4018,28 @@ $as_echo "$ac_try_echo"; } >&5 break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -3347,25 +4049,28 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -3375,56 +4080,59 @@ ac_save_c_werror_flag=$ac_c_werror_flag /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -3439,91 +4147,132 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } -ac_cv_prog_cc_c89=no +ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +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 -/* 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 don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +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 +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 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } + +ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +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 -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +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 +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 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +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 -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - +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 +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 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -3538,19 +4287,20 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Check whether --with-cxx was given. -if test "${with_cxx+set}" = set; then : +if test ${with_cxx+y} +then : withval=$with_cxx; -else +else $as_nop with_cxx=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use C++" >&5 -$as_echo_n "checking whether to use C++... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_cxx\"" >&5 -$as_echo "\"$with_cxx\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use C++" >&5 +printf %s "checking whether to use C++... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_cxx\"" >&5 +printf "%s\n" "\"$with_cxx\"" >&6; } case "$with_cxx" in "no") USE_CXX= ;; "yes") USE_CXX="1" ;; @@ -3560,7 +4310,13 @@ esac if test -n "$USE_CXX"; then - ac_ext=cpp + + + + + + +ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -3570,12 +4326,12 @@ if test -z "$CXX"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -3584,11 +4340,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3598,11 +4358,11 @@ IFS=$as_save_IFS fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3611,12 +4371,12 @@ fi fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. @@ -3625,11 +4385,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3639,11 +4403,11 @@ IFS=$as_save_IFS fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3655,8 +4419,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -3666,7 +4430,7 @@ fi fi fi # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -3676,7 +4440,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3686,18 +4450,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -3707,25 +4471,28 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi -ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes @@ -3735,56 +4502,59 @@ ac_save_cxx_werror_flag=$ac_cxx_werror_flag /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes -else +else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : -else +else $as_nop ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then @@ -3799,6 +4569,92 @@ else CXXFLAGS= fi fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } + +ac_cv_prog_cxx_11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX + +if test "x$ac_cv_prog_cxx_cxx11" = 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_cxx_cxx11" = 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_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } + +ac_cv_prog_cxx_98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX + +if test "x$ac_cv_prog_cxx_cxx98" = 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_cxx_cxx98" = 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_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3824,8 +4680,8 @@ case $host_os in *mingw32* ) MINGW32=yes;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for executable suffix" >&5 -$as_echo_n "checking for executable suffix... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for executable suffix" >&5 +printf %s "checking for executable suffix... " >&6; } if test "$CYGWIN" = yes || test "$MINGW32" = yes; then ac_cv_exeext=.exe @@ -3835,8 +4691,8 @@ fi EXEEXT="" test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_exeext}" >&5 -$as_echo "${ac_cv_exeext}" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_exeext}" >&5 +printf "%s\n" "${ac_cv_exeext}" >&6; } ac_exeext=$EXEEXT @@ -3858,40 +4714,42 @@ PKG_CONFIG=${PKG_CONFIG-pkg-config} IEEEFLAG= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for full floating-point support" >&5 -$as_echo_n "checking for full floating-point support... " >&6; } -if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 -$as_echo "unknown (cross-compiling)" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for full floating-point support" >&5 +printf %s "checking for full floating-point support... " >&6; } +if test "$cross_compiling" = yes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 +printf "%s\n" "unknown (cross-compiling)" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \"cc -mieee\" works" >&5 -$as_echo_n "checking whether \"cc -mieee\" works... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether \"cc -mieee\" works" >&5 +printf %s "checking whether \"cc -mieee\" works... " >&6; } ac_save_cflags=${CFLAGS} CFLAGS="$CFLAGS -mieee" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } IEEEFLAG="-mieee" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=${ac_save_cflags} -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3906,24 +4764,26 @@ int main(void) { } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ac_save_cflags=${CFLAGS} CFLAGS=-mieee -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for full floating-point support with -mieee" >&5 -$as_echo_n "checking for full floating-point support with -mieee... " >&6; } -if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 -$as_echo "unknown (cross-compiling)" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for full floating-point support with -mieee" >&5 +printf %s "checking for full floating-point support with -mieee... " >&6; } +if test "$cross_compiling" = yes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 +printf "%s\n" "unknown (cross-compiling)" >&6; } as_fn_error $? "*** INTERNAL CONFIGURE ERROR" "$LINENO" 5 -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3938,15 +4798,16 @@ int main(void) { } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } IEEEFLAG="-mieee" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Incomplete floating-point support." >&5 -$as_echo "$as_me: WARNING: *** Incomplete floating-point support." >&2;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** Incomplete floating-point support." >&5 +printf "%s\n" "$as_me: WARNING: *** Incomplete floating-point support." >&2;} fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -3975,8 +4836,8 @@ fi # Extract the first word of "pwd", so it can be a program name with args. set dummy pwd; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } case $pwd in [\\/]* | ?:[\\/]*) @@ -3987,11 +4848,15 @@ case $pwd in for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_pwd="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_pwd="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4003,11 +4868,11 @@ IFS=$as_save_IFS esac pwd=$ac_cv_path_pwd if test -n "$pwd"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pwd" >&5 -$as_echo "$pwd" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $pwd" >&5 +printf "%s\n" "$pwd" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4018,8 +4883,8 @@ else winpwd="$pwd" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for source directory" >&5 -$as_echo_n "checking for source directory... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for source directory" >&5 +printf %s "checking for source directory... " >&6; } if test -z "$srcdir" ; then SRCDIR=`$pwd` @@ -4027,17 +4892,17 @@ else SRCDIR=`(cd "$srcdir" ; $pwd)` fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$SRCDIR\"" >&5 -$as_echo "\"$SRCDIR\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$SRCDIR\"" >&5 +printf "%s\n" "\"$SRCDIR\"" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for build directory" >&5 -$as_echo_n "checking for build directory... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build directory" >&5 +printf %s "checking for build directory... " >&6; } DSTDIR=`$pwd` WINDSTDIR=`$winpwd` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$DSTDIR\"" >&5 -$as_echo "\"$DSTDIR\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$DSTDIR\"" >&5 +printf "%s\n" "\"$DSTDIR\"" >&6; } @@ -4081,8 +4946,8 @@ GRASS_HEADERS_GIT_HASH="${GRASS_VERSION_NUMBER}" GRASS_HEADERS_GIT_DATE=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'` # Extract the first word of "git", so it can be a program name with args. set dummy git; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } case $GIT in [\\/]* | ?:[\\/]*) @@ -4093,11 +4958,15 @@ case $GIT in for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GIT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GIT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4109,11 +4978,11 @@ IFS=$as_save_IFS esac GIT=$ac_cv_path_GIT if test -n "$GIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5 -$as_echo "$GIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5 +printf "%s\n" "$GIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4147,34 +5016,35 @@ fi # Check for MacOSX App # Check whether --enable-macosx-app was given. -if test "${enable_macosx_app+set}" = set; then : +if test ${enable_macosx_app+y} +then : enableval=$enable_macosx_app; -else +else $as_nop enable_macosx_app=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MacOSX App" >&5 -$as_echo_n "checking for MacOSX App... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MacOSX App" >&5 +printf %s "checking for MacOSX App... " >&6; } case "$enable_macosx_app" in yes) MACOSX_APP=1 ;; no) MACOSX_APP= ;; *) as_fn_error $? "*** You must answer yes or no." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$enable_macosx_app\"" >&5 -$as_echo "\"$enable_macosx_app\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$enable_macosx_app\"" >&5 +printf "%s\n" "\"$enable_macosx_app\"" >&6; } # Check for MacOSX archs -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MacOSX architectures" >&5 -$as_echo_n "checking for MacOSX architectures... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MacOSX architectures" >&5 +printf %s "checking for MacOSX architectures... " >&6; } MACOSX_ARCHS= if test -z "$with_macosx_archs" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else for a in $with_macosx_archs do @@ -4185,8 +5055,8 @@ else ;; esac done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACOSX_ARCHS" >&5 -$as_echo "$MACOSX_ARCHS" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MACOSX_ARCHS" >&5 +printf "%s\n" "$MACOSX_ARCHS" >&6; } LDFLAGS="$LDFLAGS $MACOSX_ARCHS" CFLAGS="$CFLAGS $MACOSX_ARCHS" CXXFLAGS="$CXXFLAGS $MACOSX_ARCHS" @@ -4198,18 +5068,18 @@ fi # Check for MacOSX SDK -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MacOSX SDK" >&5 -$as_echo_n "checking for MacOSX SDK... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MacOSX SDK" >&5 +printf %s "checking for MacOSX SDK... " >&6; } MACOSX_SDK= if test -z "$with_macosx_sdk" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else - as_ac_File=`$as_echo "ac_cv_file_$with_macosx_sdk/SDKSettings.plist" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_macosx_sdk/SDKSettings.plist" >&5 -$as_echo_n "checking for $with_macosx_sdk/SDKSettings.plist... " >&6; } + as_ac_File=`printf "%s\n" "ac_cv_file_$with_macosx_sdk/SDKSettings.plist" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $with_macosx_sdk/SDKSettings.plist" >&5 +printf %s "checking for $with_macosx_sdk/SDKSettings.plist... " >&6; } test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 @@ -4219,12 +5089,13 @@ else eval "$as_ac_File=no" fi eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : MACOSX_SDK="-isysroot $with_macosx_sdk" -else +else $as_nop as_fn_error $? "*** specified SDK does not exist or is not a SDK" "$LINENO" 5 fi @@ -4251,12 +5122,13 @@ fi # Get flags for building shared libraries - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5 -$as_echo_n "checking how to build libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5 +printf %s "checking how to build libraries... " >&6; } # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : +if test ${enable_shared+y} +then : enableval=$enable_shared; shared_ok=$enableval -else +else $as_nop shared_ok=yes fi @@ -4269,16 +5141,16 @@ fi fi if test "$shared_ok" = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5 -$as_echo "shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5 +printf "%s\n" "shared" >&6; } SHARED_BUILD=1 GRASS_LIBRARY_TYPE='shlib' else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5 -$as_echo "static" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5 +printf "%s\n" "static" >&6; } SHARED_BUILD=0 -$as_echo "#define STATIC_BUILD 1" >>confdefs.h +printf "%s\n" "#define STATIC_BUILD 1" >>confdefs.h GRASS_LIBRARY_TYPE='stlib' fi @@ -4336,10 +5208,10 @@ ac_save_ldflags="$LDFLAGS" # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. -$as_echo "#define _REENTRANT 1" >>confdefs.h +printf "%s\n" "#define _REENTRANT 1" >>confdefs.h -$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h +printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. @@ -4363,10 +5235,10 @@ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. -$as_echo "#define _REENTRANT 1" >>confdefs.h +printf "%s\n" "#define _REENTRANT 1" >>confdefs.h -$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h +printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. @@ -4397,8 +5269,8 @@ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h # TODO: add optional pthread support with any combination of: # CFLAGS="$CFLAGS -pthread" # LDFLAGS="$LDFLAGS -lpthread" - # AC_DEFINE(_REENTRANT, 1, [define _REENTRANT flag (for SunOS)]) - # AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [enable threading extensions on Solaris]) + # AC_DEFINE(_REENTRANT, 1, [Define to 1 for _REENTRANT flag (for SunOS).]) + # AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to 1 to enable threading extensions on Solaris.]) ;; *-netbsd*) # NetBSD has ELF. @@ -4419,8 +5291,8 @@ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h # TODO: add optional pthread support with any combination of: # CFLAGS="$CFLAGS -pthread" # LDFLAGS="$LDFLAGS -lpthread" - # AC_DEFINE(_REENTRANT, 1, [define _REENTRANT flag (for SunOS)]) - # AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [enable threading extensions on Solaris]) + # AC_DEFINE(_REENTRANT, 1, [Define to 1 for _REENTRANT flag (for SunOS).]) + # AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to 1 to enable threading extensions on Solaris.]) ;; *aix*) # NOTE: do we need to support aix < 6 ? @@ -4465,9 +5337,10 @@ LDFLAGS="${ac_save_ldflags} $LDFLAGS" # Enable options # Check whether --enable-w11 was given. -if test "${enable_w11+set}" = set; then : +if test ${enable_w11+y} +then : enableval=$enable_w11; -else +else $as_nop enable_w11=no fi @@ -4478,26 +5351,29 @@ fi # Check whether --with-macosx-archs was given. -if test "${with_macosx_archs+set}" = set; then : +if test ${with_macosx_archs+y} +then : withval=$with_macosx_archs; -else +else $as_nop with_macosx_archs="no" fi # Check whether --with-macosx-sdk was given. -if test "${with_macosx_sdk+set}" = set; then : +if test ${with_macosx_sdk+y} +then : withval=$with_macosx_sdk; -else +else $as_nop with_macosx_sdk="no" fi # Check whether --with-tiff was given. -if test "${with_tiff+set}" = set; then : +if test ${with_tiff+y} +then : withval=$with_tiff; -else +else $as_nop with_tiff=yes fi @@ -4505,9 +5381,10 @@ fi # Check whether --with-postgres was given. -if test "${with_postgres+set}" = set; then : +if test ${with_postgres+y} +then : withval=$with_postgres; -else +else $as_nop with_postgres=no fi @@ -4515,9 +5392,10 @@ fi # Check whether --with-mysql was given. -if test "${with_mysql+set}" = set; then : +if test ${with_mysql+y} +then : withval=$with_mysql; -else +else $as_nop with_mysql=no fi @@ -4525,9 +5403,10 @@ fi # Check whether --with-sqlite was given. -if test "${with_sqlite+set}" = set; then : +if test ${with_sqlite+y} +then : withval=$with_sqlite; -else +else $as_nop with_sqlite=yes fi @@ -4535,9 +5414,10 @@ fi # Check whether --with-opengl was given. -if test "${with_opengl+set}" = set; then : +if test ${with_opengl+y} +then : withval=$with_opengl; -else +else $as_nop with_opengl=yes fi @@ -4545,9 +5425,10 @@ fi # Check whether --with-odbc was given. -if test "${with_odbc+set}" = set; then : +if test ${with_odbc+y} +then : withval=$with_odbc; -else +else $as_nop with_odbc=no fi @@ -4555,9 +5436,10 @@ fi # Check whether --with-fftw was given. -if test "${with_fftw+set}" = set; then : +if test ${with_fftw+y} +then : withval=$with_fftw; -else +else $as_nop with_fftw=yes fi @@ -4565,9 +5447,10 @@ fi # Check whether --with-blas was given. -if test "${with_blas+set}" = set; then : +if test ${with_blas+y} +then : withval=$with_blas; -else +else $as_nop with_blas=no fi @@ -4575,9 +5458,10 @@ fi # Check whether --with-lapack was given. -if test "${with_lapack+set}" = set; then : +if test ${with_lapack+y} +then : withval=$with_lapack; -else +else $as_nop with_lapack=no fi @@ -4585,9 +5469,10 @@ fi # Check whether --with-cairo was given. -if test "${with_cairo+set}" = set; then : +if test ${with_cairo+y} +then : withval=$with_cairo; -else +else $as_nop with_cairo=yes fi @@ -4595,9 +5480,10 @@ fi # Check whether --with-freetype was given. -if test "${with_freetype+set}" = set; then : +if test ${with_freetype+y} +then : withval=$with_freetype; -else +else $as_nop with_freetype=yes fi @@ -4605,9 +5491,10 @@ fi # Check whether --with-nls was given. -if test "${with_nls+set}" = set; then : +if test ${with_nls+y} +then : withval=$with_nls; -else +else $as_nop with_nls=no fi @@ -4615,9 +5502,10 @@ fi # Check whether --with-readline was given. -if test "${with_readline+set}" = set; then : +if test ${with_readline+y} +then : withval=$with_readline; -else +else $as_nop with_readline=no fi @@ -4625,9 +5513,10 @@ fi # Check whether --with-opendwg was given. -if test "${with_opendwg+set}" = set; then : +if test ${with_opendwg+y} +then : withval=$with_opendwg; -else +else $as_nop with_opendwg=no fi @@ -4635,9 +5524,10 @@ fi # Check whether --with-regex was given. -if test "${with_regex+set}" = set; then : +if test ${with_regex+y} +then : withval=$with_regex; -else +else $as_nop with_regex=yes fi @@ -4645,9 +5535,10 @@ fi # Check whether --with-pthread was given. -if test "${with_pthread+set}" = set; then : +if test ${with_pthread+y} +then : withval=$with_pthread; -else +else $as_nop with_pthread=no fi @@ -4655,9 +5546,10 @@ fi # Check whether --with-openmp was given. -if test "${with_openmp+set}" = set; then : +if test ${with_openmp+y} +then : withval=$with_openmp; -else +else $as_nop with_openmp=no fi @@ -4665,9 +5557,10 @@ fi # Check whether --with-opencl was given. -if test "${with_opencl+set}" = set; then : +if test ${with_opencl+y} +then : withval=$with_opencl; -else +else $as_nop with_opencl=no fi @@ -4675,9 +5568,10 @@ fi # Check whether --with-bzlib was given. -if test "${with_bzlib+set}" = set; then : +if test ${with_bzlib+y} +then : withval=$with_bzlib; -else +else $as_nop with_bzlib=no fi @@ -4685,9 +5579,10 @@ fi # Check whether --with-zstd was given. -if test "${with_zstd+set}" = set; then : +if test ${with_zstd+y} +then : withval=$with_zstd; -else +else $as_nop with_zstd=yes fi @@ -4695,9 +5590,10 @@ fi # Check whether --with-pdal was given. -if test "${with_pdal+set}" = set; then : +if test ${with_pdal+y} +then : withval=$with_pdal; -else +else $as_nop with_pdal=yes fi @@ -4705,32 +5601,36 @@ fi # Check whether --with-libpng was given. -if test "${with_libpng+set}" = set; then : +if test ${with_libpng+y} +then : withval=$with_libpng; fi # Check whether --with-gdal was given. -if test "${with_gdal+set}" = set; then : +if test ${with_gdal+y} +then : withval=$with_gdal; fi # Check whether --with-liblas was given. -if test "${with_liblas+set}" = set; then : +if test ${with_liblas+y} +then : withval=$with_liblas; -else +else $as_nop with_liblas="no" fi # Check whether --with-netcdf was given. -if test "${with_netcdf+set}" = set; then : +if test ${with_netcdf+y} +then : withval=$with_netcdf; -else +else $as_nop with_netcdf="no" fi @@ -4739,23 +5639,26 @@ fi # Check whether --with-geos was given. -if test "${with_geos+set}" = set; then : +if test ${with_geos+y} +then : withval=$with_geos; -else +else $as_nop with_geos="no" fi # Check whether --with-includes was given. -if test "${with_includes+set}" = set; then : +if test ${with_includes+y} +then : withval=$with_includes; fi # Check whether --with-libs was given. -if test "${with_libs+set}" = set; then : +if test ${with_libs+y} +then : withval=$with_libs; fi @@ -4763,7 +5666,8 @@ fi # Check whether --with-zlib-includes was given. -if test "${with_zlib_includes+set}" = set; then : +if test ${with_zlib_includes+y} +then : withval=$with_zlib_includes; fi @@ -4771,7 +5675,8 @@ fi # Check whether --with-zlib-libs was given. -if test "${with_zlib_libs+set}" = set; then : +if test ${with_zlib_libs+y} +then : withval=$with_zlib_libs; fi @@ -4780,7 +5685,8 @@ fi # Check whether --with-bzlib-includes was given. -if test "${with_bzlib_includes+set}" = set; then : +if test ${with_bzlib_includes+y} +then : withval=$with_bzlib_includes; fi @@ -4788,7 +5694,8 @@ fi # Check whether --with-bzlib-libs was given. -if test "${with_bzlib_libs+set}" = set; then : +if test ${with_bzlib_libs+y} +then : withval=$with_bzlib_libs; fi @@ -4797,7 +5704,8 @@ fi # Check whether --with-zstd-includes was given. -if test "${with_zstd_includes+set}" = set; then : +if test ${with_zstd_includes+y} +then : withval=$with_zstd_includes; fi @@ -4805,7 +5713,8 @@ fi # Check whether --with-zstd-libs was given. -if test "${with_zstd_libs+set}" = set; then : +if test ${with_zstd_libs+y} +then : withval=$with_zstd_libs; fi @@ -4814,7 +5723,8 @@ fi # Check whether --with-readline-includes was given. -if test "${with_readline_includes+set}" = set; then : +if test ${with_readline_includes+y} +then : withval=$with_readline_includes; fi @@ -4822,7 +5732,8 @@ fi # Check whether --with-readline-libs was given. -if test "${with_readline_libs+set}" = set; then : +if test ${with_readline_libs+y} +then : withval=$with_readline_libs; fi @@ -4831,7 +5742,8 @@ fi # Check whether --with-tiff-includes was given. -if test "${with_tiff_includes+set}" = set; then : +if test ${with_tiff_includes+y} +then : withval=$with_tiff_includes; fi @@ -4839,7 +5751,8 @@ fi # Check whether --with-tiff-libs was given. -if test "${with_tiff_libs+set}" = set; then : +if test ${with_tiff_libs+y} +then : withval=$with_tiff_libs; fi @@ -4848,7 +5761,8 @@ fi # Check whether --with-postgres-includes was given. -if test "${with_postgres_includes+set}" = set; then : +if test ${with_postgres_includes+y} +then : withval=$with_postgres_includes; fi @@ -4856,7 +5770,8 @@ fi # Check whether --with-postgres-libs was given. -if test "${with_postgres_libs+set}" = set; then : +if test ${with_postgres_libs+y} +then : withval=$with_postgres_libs; fi @@ -4865,7 +5780,8 @@ fi # Check whether --with-mysql-includes was given. -if test "${with_mysql_includes+set}" = set; then : +if test ${with_mysql_includes+y} +then : withval=$with_mysql_includes; fi @@ -4873,7 +5789,8 @@ fi # Check whether --with-mysql-libs was given. -if test "${with_mysql_libs+set}" = set; then : +if test ${with_mysql_libs+y} +then : withval=$with_mysql_libs; fi @@ -4882,7 +5799,8 @@ fi # Check whether --with-sqlite-includes was given. -if test "${with_sqlite_includes+set}" = set; then : +if test ${with_sqlite_includes+y} +then : withval=$with_sqlite_includes; fi @@ -4890,7 +5808,8 @@ fi # Check whether --with-sqlite-libs was given. -if test "${with_sqlite_libs+set}" = set; then : +if test ${with_sqlite_libs+y} +then : withval=$with_sqlite_libs; fi @@ -4899,7 +5818,8 @@ fi # Check whether --with-opengl-includes was given. -if test "${with_opengl_includes+set}" = set; then : +if test ${with_opengl_includes+y} +then : withval=$with_opengl_includes; fi @@ -4907,7 +5827,8 @@ fi # Check whether --with-opengl-libs was given. -if test "${with_opengl_libs+set}" = set; then : +if test ${with_opengl_libs+y} +then : withval=$with_opengl_libs; fi @@ -4915,7 +5836,8 @@ fi # Check whether --with-opengl-framework was given. -if test "${with_opengl_framework+set}" = set; then : +if test ${with_opengl_framework+y} +then : withval=$with_opengl_framework; fi @@ -4924,7 +5846,8 @@ fi # Check whether --with-odbc-includes was given. -if test "${with_odbc_includes+set}" = set; then : +if test ${with_odbc_includes+y} +then : withval=$with_odbc_includes; fi @@ -4932,7 +5855,8 @@ fi # Check whether --with-odbc-libs was given. -if test "${with_odbc_libs+set}" = set; then : +if test ${with_odbc_libs+y} +then : withval=$with_odbc_libs; fi @@ -4941,7 +5865,8 @@ fi # Check whether --with-fftw-includes was given. -if test "${with_fftw_includes+set}" = set; then : +if test ${with_fftw_includes+y} +then : withval=$with_fftw_includes; fi @@ -4949,7 +5874,8 @@ fi # Check whether --with-fftw-libs was given. -if test "${with_fftw_libs+set}" = set; then : +if test ${with_fftw_libs+y} +then : withval=$with_fftw_libs; fi @@ -4958,7 +5884,8 @@ fi # Check whether --with-blas-includes was given. -if test "${with_blas_includes+set}" = set; then : +if test ${with_blas_includes+y} +then : withval=$with_blas_includes; fi @@ -4966,7 +5893,8 @@ fi # Check whether --with-blas-libs was given. -if test "${with_blas_libs+set}" = set; then : +if test ${with_blas_libs+y} +then : withval=$with_blas_libs; fi @@ -4975,7 +5903,8 @@ fi # Check whether --with-lapack-includes was given. -if test "${with_lapack_includes+set}" = set; then : +if test ${with_lapack_includes+y} +then : withval=$with_lapack_includes; fi @@ -4983,7 +5912,8 @@ fi # Check whether --with-lapack-libs was given. -if test "${with_lapack_libs+set}" = set; then : +if test ${with_lapack_libs+y} +then : withval=$with_lapack_libs; fi @@ -4992,7 +5922,8 @@ fi # Check whether --with-cairo-includes was given. -if test "${with_cairo_includes+set}" = set; then : +if test ${with_cairo_includes+y} +then : withval=$with_cairo_includes; fi @@ -5000,7 +5931,8 @@ fi # Check whether --with-cairo-libs was given. -if test "${with_cairo_libs+set}" = set; then : +if test ${with_cairo_libs+y} +then : withval=$with_cairo_libs; fi @@ -5008,7 +5940,8 @@ fi # Check whether --with-cairo-ldflags was given. -if test "${with_cairo_ldflags+set}" = set; then : +if test ${with_cairo_ldflags+y} +then : withval=$with_cairo_ldflags; fi @@ -5017,7 +5950,8 @@ fi # Check whether --with-freetype-includes was given. -if test "${with_freetype_includes+set}" = set; then : +if test ${with_freetype_includes+y} +then : withval=$with_freetype_includes; fi @@ -5025,7 +5959,8 @@ fi # Check whether --with-freetype-libs was given. -if test "${with_freetype_libs+set}" = set; then : +if test ${with_freetype_libs+y} +then : withval=$with_freetype_libs; fi @@ -5034,7 +5969,8 @@ fi # Check whether --with-proj-includes was given. -if test "${with_proj_includes+set}" = set; then : +if test ${with_proj_includes+y} +then : withval=$with_proj_includes; fi @@ -5042,7 +5978,8 @@ fi # Check whether --with-proj-libs was given. -if test "${with_proj_libs+set}" = set; then : +if test ${with_proj_libs+y} +then : withval=$with_proj_libs; fi @@ -5050,7 +5987,8 @@ fi # Check whether --with-proj-share was given. -if test "${with_proj_share+set}" = set; then : +if test ${with_proj_share+y} +then : withval=$with_proj_share; fi @@ -5059,7 +5997,8 @@ fi # Check whether --with-opendwg-includes was given. -if test "${with_opendwg_includes+set}" = set; then : +if test ${with_opendwg_includes+y} +then : withval=$with_opendwg_includes; fi @@ -5067,7 +6006,8 @@ fi # Check whether --with-opendwg-libs was given. -if test "${with_opendwg_libs+set}" = set; then : +if test ${with_opendwg_libs+y} +then : withval=$with_opendwg_libs; fi @@ -5076,7 +6016,8 @@ fi # Check whether --with-regex-includes was given. -if test "${with_regex_includes+set}" = set; then : +if test ${with_regex_includes+y} +then : withval=$with_regex_includes; fi @@ -5084,7 +6025,8 @@ fi # Check whether --with-regex-libs was given. -if test "${with_regex_libs+set}" = set; then : +if test ${with_regex_libs+y} +then : withval=$with_regex_libs; fi @@ -5093,7 +6035,8 @@ fi # Check whether --with-pthread-includes was given. -if test "${with_pthread_includes+set}" = set; then : +if test ${with_pthread_includes+y} +then : withval=$with_pthread_includes; fi @@ -5101,7 +6044,8 @@ fi # Check whether --with-pthread-libs was given. -if test "${with_pthread_libs+set}" = set; then : +if test ${with_pthread_libs+y} +then : withval=$with_pthread_libs; fi @@ -5110,7 +6054,8 @@ fi # Check whether --with-openmp-includes was given. -if test "${with_openmp_includes+set}" = set; then : +if test ${with_openmp_includes+y} +then : withval=$with_openmp_includes; fi @@ -5118,7 +6063,8 @@ fi # Check whether --with-openmp-libs was given. -if test "${with_openmp_libs+set}" = set; then : +if test ${with_openmp_libs+y} +then : withval=$with_openmp_libs; fi @@ -5127,7 +6073,8 @@ fi # Check whether --with-opencl-includes was given. -if test "${with_opencl_includes+set}" = set; then : +if test ${with_opencl_includes+y} +then : withval=$with_opencl_includes; fi @@ -5135,7 +6082,8 @@ fi # Check whether --with-opencl-libs was given. -if test "${with_opencl_libs+set}" = set; then : +if test ${with_opencl_libs+y} +then : withval=$with_opencl_libs; fi @@ -5150,15 +6098,15 @@ fi #LOC_CHECK_USE(g77, GNU Fortran 77, USE_G77) # Done checking fortran -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for additional include dirs" >&5 -$as_echo_n "checking for additional include dirs... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for additional include dirs" >&5 +printf %s "checking for additional include dirs... " >&6; } case "$with_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to list --with-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_includes" >&5 -$as_echo "$with_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_includes" >&5 +printf "%s\n" "$with_includes" >&6; } if test -n "$with_includes"; then for dir in $with_includes; do @@ -5174,15 +6122,15 @@ fi # With libs option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for additional library dirs" >&5 -$as_echo_n "checking for additional library dirs... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for additional library dirs" >&5 +printf %s "checking for additional library dirs... " >&6; } case "$with_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory list to --with-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_libs" >&5 -$as_echo "$with_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_libs" >&5 +printf "%s\n" "$with_libs" >&6; } if test -n "$with_libs"; then for dir in $with_libs; do @@ -5198,7 +6146,8 @@ fi # Programs and standard headers, libraries, functions -# Find a good install program. We prefer a C program (faster), + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -5212,18 +6161,22 @@ fi # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -5233,13 +6186,13 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -5247,12 +6200,12 @@ case $as_dir/ in #(( echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -5267,7 +6220,7 @@ IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -5277,8 +6230,8 @@ rm -rf conftest.one conftest.two conftest.dir INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -5293,8 +6246,8 @@ for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. @@ -5303,11 +6256,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5317,11 +6274,11 @@ IFS=$as_save_IFS fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 -$as_echo "$LEX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 +printf "%s\n" "$LEX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5329,15 +6286,26 @@ fi done test -n "$LEX" || LEX=":" -if test "x$LEX" != "x:"; then - cat >conftest.l <<_ACEOF + if test "x$LEX" != "x:"; then + cat >conftest.l <<_ACEOF +%{ +#ifdef __cplusplus +extern "C" +#endif +int yywrap(void); +%} %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ - yyless ((input () != 0)); } +#ifdef __cplusplus + yyless ((yyinput () != 0)); +#else + yyless ((input () != 0)); +#endif + } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% @@ -5345,92 +6313,132 @@ f { unput (yytext[0]); } extern char *yytext; #endif int +yywrap (void) +{ + return 1; +} +int main (void) { - return ! yylex () + ! yywrap (); + return ! yylex (); } _ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex output file root" >&5 +printf %s "checking for lex output file root... " >&6; } + + +ac_cv_prog_lex_root=unknown { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 -$as_echo_n "checking lex output file root... " >&6; } - - + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy -else - as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 -$as_echo "$ac_cv_prog_lex_root" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 +printf "%s\n" "$ac_cv_prog_lex_root" >&6; } +if test "$ac_cv_prog_lex_root" = unknown +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find output from $LEX; giving up on $LEX" >&5 +printf "%s\n" "$as_me: WARNING: cannot find output from $LEX; giving up on $LEX" >&2;} + LEX=: LEXLIB= +fi LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root -if test -z "${LEXLIB+set}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 -$as_echo_n "checking lex library... " >&6; } +if test ${LEXLIB+y} +then : +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex library" >&5 +printf %s "checking for lex library... " >&6; } + + + ac_save_LIBS="$LIBS" + ac_found=false + for ac_cv_lib_lex in 'none needed' -lfl -ll 'not found'; do + case $ac_cv_lib_lex in #( + 'none needed') : + ;; #( + 'not found') : + break ;; #( + *) : + LIBS="$ac_cv_lib_lex $ac_save_LIBS" ;; #( + *) : + ;; +esac - ac_save_LIBS=$LIBS - ac_cv_lib_lex='none needed' - for ac_lib in '' -lfl -ll; do - LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_lex=$ac_lib +if ac_fn_c_try_link "$LINENO" +then : + ac_found=: fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - test "$ac_cv_lib_lex" != 'none needed' && break + if $ac_found; then + break + fi done - LIBS=$ac_save_LIBS + LIBS="$ac_save_LIBS" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 +printf "%s\n" "$ac_cv_lib_lex" >&6; } + if test "$ac_cv_lib_lex" = 'not found' +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: required lex library not found; giving up on $LEX" >&5 +printf "%s\n" "$as_me: WARNING: required lex library not found; giving up on $LEX" >&2;} + LEX=: LEXLIB= +elif test "$ac_cv_lib_lex" = 'none needed' +then : + LEXLIB='' +else $as_nop + LEXLIB=$ac_cv_lib_lex +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 -$as_echo "$ac_cv_lib_lex" >&6; } - test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 -$as_echo_n "checking whether yytext is a pointer... " >&6; } +if test "$LEX" != : +then : + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 +printf %s "checking whether yytext is a pointer... " >&6; } # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no -ac_save_LIBS=$LIBS -LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_lex_yytext_pointer=yes fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_save_LIBS +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 -$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 +printf "%s\n" "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then -$as_echo "#define YYTEXT_POINTER 1" >>confdefs.h +printf "%s\n" "#define YYTEXT_POINTER 1" >>confdefs.h + +fi fi rm -f conftest.l $LEX_OUTPUT_ROOT.c @@ -5439,8 +6447,8 @@ fi if test "$LEX" = "lex"; then # Extract the first word of "lex", so it can be a program name with args. set dummy lex; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } case $LEXPATH in [\\/]* | ?:[\\/]*) @@ -5451,11 +6459,15 @@ case $LEXPATH in for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LEXPATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_LEXPATH="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5467,11 +6479,11 @@ IFS=$as_save_IFS esac LEXPATH=$ac_cv_path_LEXPATH if test -n "$LEXPATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEXPATH" >&5 -$as_echo "$LEXPATH" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LEXPATH" >&5 +printf "%s\n" "$LEXPATH" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5484,8 +6496,8 @@ for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -5494,11 +6506,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5508,11 +6524,11 @@ IFS=$as_save_IFS fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 -$as_echo "$YACC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 +printf "%s\n" "$YACC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5523,8 +6539,8 @@ test -n "$YACC" || YACC="yacc" if test "$YACC" = "yacc"; then # Extract the first word of "yacc", so it can be a program name with args. set dummy yacc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } case $YACCPATH in [\\/]* | ?:[\\/]*) @@ -5535,11 +6551,15 @@ case $YACCPATH in for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_YACCPATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_YACCPATH="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5551,11 +6571,11 @@ IFS=$as_save_IFS esac YACCPATH=$ac_cv_path_YACCPATH if test -n "$YACCPATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACCPATH" >&5 -$as_echo "$YACCPATH" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YACCPATH" >&5 +printf "%s\n" "$YACCPATH" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5567,8 +6587,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -5577,11 +6597,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5591,11 +6615,11 @@ IFS=$as_save_IFS fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5604,8 +6628,8 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -5614,11 +6638,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5628,11 +6656,11 @@ IFS=$as_save_IFS fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -5640,8 +6668,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -5654,8 +6682,8 @@ for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -5664,145 +6692,301 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AR" && break +done + +for ac_prog in env +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } + +if test -n "$ENV"; then + ac_cv_prog_ENV="$ENV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ENV="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +ENV=$ac_cv_prog_ENV +if test -n "$ENV"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ENV" >&5 +printf "%s\n" "$ENV" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ENV" && break +done + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } + +case $PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PERL="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS + test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no" + ;; +esac +PERL=$ac_cv_path_PERL +if test -n "$PERL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +printf "%s\n" "$PERL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +#AC_CHECK_HEADERS(curses.h limits.h termio.h termios.h unistd.h values.h) +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" +if test "x$ac_cv_header_limits_h" = xyes +then : + printf "%s\n" "#define HAVE_LIMITS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "termio.h" "ac_cv_header_termio_h" "$ac_includes_default" +if test "x$ac_cv_header_termio_h" = xyes +then : + printf "%s\n" "#define HAVE_TERMIO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" +if test "x$ac_cv_header_termios_h" = xyes +then : + printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "values.h" "ac_cv_header_values_h" "$ac_includes_default" +if test "x$ac_cv_header_values_h" = xyes +then : + printf "%s\n" "#define HAVE_VALUES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "f2c.h" "ac_cv_header_f2c_h" "$ac_includes_default" +if test "x$ac_cv_header_f2c_h" = xyes +then : + printf "%s\n" "#define HAVE_F2C_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "g2c.h" "ac_cv_header_g2c_h" "$ac_includes_default" +if test "x$ac_cv_header_g2c_h" = xyes +then : + printf "%s\n" "#define HAVE_G2C_H 1" >>confdefs.h + +fi + +ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/mtio.h" "ac_cv_header_sys_mtio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mtio_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MTIO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_resource_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_RESOURCE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h + +fi + +ac_fn_c_check_header_compile "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_timeb_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIMEB_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +ac_fn_c_check_header_compile "$LINENO" "sys/utsname.h" "ac_cv_header_sys_utsname_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_utsname_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_UTSNAME_H 1" >>confdefs.h + fi +ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h - test -n "$AR" && break -done +fi +ac_fn_c_check_header_compile "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" +if test "x$ac_cv_header_iconv_h" = xyes +then : + printf "%s\n" "#define HAVE_ICONV_H 1" >>confdefs.h -for ac_prog in env -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +fi -if test -n "$ENV"; then - ac_cv_prog_ENV="$ENV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ENV="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +ac_fn_c_check_header_compile "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" +if test "x$ac_cv_header_langinfo_h" = xyes +then : + printf "%s\n" "#define HAVE_LANGINFO_H 1" >>confdefs.h -fi -ENV=$ac_cv_prog_ENV -if test -n "$ENV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENV" >&5 -$as_echo "$ENV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi - test -n "$ENV" && break -done +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 : -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +else $as_nop -case $PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +printf "%s\n" "#define off_t long int" >>confdefs.h - test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no" - ;; -esac -PERL=$ac_cv_path_PERL -if test -n "$PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 -$as_echo "$PERL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi - 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' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + # 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 for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -5814,10 +6998,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -5827,7 +7012,8 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # 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 : +if $ac_preproc_ok +then : break fi @@ -5838,29 +7024,24 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -5872,10 +7053,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -5885,11 +7067,12 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # 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 : +if $ac_preproc_ok +then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +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;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -5901,8 +7084,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } if test -z "$GREP"; then ac_path_GREP_found=false @@ -5911,10 +7094,15 @@ if test -z "$GREP"; then for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + 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_GREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" 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 @@ -5923,13 +7111,13 @@ case `"$ac_path_GREP" --version 2>&1` in ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "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 @@ -5956,13 +7144,13 @@ else ac_cv_path_GREP=$GREP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" @@ -5974,10 +7162,15 @@ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + 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="$as_dir/$ac_prog$ac_exec_ext" + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" 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 @@ -5986,13 +7179,13 @@ case `"$ac_path_EGREP" --version 2>&1` in ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "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 @@ -6020,372 +7213,170 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } +{ 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" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } +{ 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; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include +#include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - + $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* -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : +{ 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 - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +printf "%s\n" "#define uid_t int" >>confdefs.h -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h +printf "%s\n" "#define gid_t int" >>confdefs.h fi -#AC_CHECK_HEADERS(curses.h limits.h termio.h termios.h unistd.h values.h) -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_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 `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi -done +case $host_os in + *cygwin* ) CYGWIN=yes;; + * ) CYGWIN=no;; +esac -for ac_header in limits.h termio.h termios.h unistd.h values.h f2c.h g2c.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "ftime" "ac_cv_func_ftime" +if test "x$ac_cv_func_ftime" = xyes +then : + printf "%s\n" "#define HAVE_FTIME 1" >>confdefs.h fi - -done - -for ac_header in sys/ioctl.h sys/mtio.h sys/resource.h sys/time.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname" +if test "x$ac_cv_func_gethostname" = xyes +then : + printf "%s\n" "#define HAVE_GETHOSTNAME 1" >>confdefs.h fi - -done - -for ac_header in sys/timeb.h sys/types.h sys/utsname.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" +if test "x$ac_cv_func_gettimeofday" = xyes +then : + printf "%s\n" "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h fi - -done - -for ac_header in libintl.h iconv.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "lseek" "ac_cv_func_lseek" +if test "x$ac_cv_func_lseek" = xyes +then : + printf "%s\n" "#define HAVE_LSEEK 1" >>confdefs.h fi - -done - -for ac_header in langinfo.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" -if test "x$ac_cv_header_langinfo_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LANGINFO_H 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "nice" "ac_cv_func_nice" +if test "x$ac_cv_func_nice" = xyes +then : + printf "%s\n" "#define HAVE_NICE 1" >>confdefs.h fi +ac_fn_c_check_func "$LINENO" "time" "ac_cv_func_time" +if test "x$ac_cv_func_time" = xyes +then : + printf "%s\n" "#define HAVE_TIME 1" >>confdefs.h -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h +ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname" +if test "x$ac_cv_func_uname" = xyes +then : + printf "%s\n" "#define HAVE_UNAME 1" >>confdefs.h fi -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 - -cat >>confdefs.h <<_ACEOF -#define off_t long int -_ACEOF +ac_fn_c_check_func "$LINENO" "seteuid" "ac_cv_func_seteuid" +if test "x$ac_cv_func_seteuid" = xyes +then : + printf "%s\n" "#define HAVE_SETEUID 1" >>confdefs.h fi +ac_fn_c_check_func "$LINENO" "setpriority" "ac_cv_func_setpriority" +if test "x$ac_cv_func_setpriority" = xyes +then : + printf "%s\n" "#define HAVE_SETPRIORITY 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -$as_echo_n "checking for uid_t in sys/types.h... " >&6; } - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_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 - ac_cv_type_uid_t=no fi -rm -f conftest* - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -$as_echo "$ac_cv_type_uid_t" >&6; } -if test $ac_cv_type_uid_t = no; then - -$as_echo "#define uid_t int" >>confdefs.h - - -$as_echo "#define gid_t int" >>confdefs.h +ac_fn_c_check_func "$LINENO" "setreuid" "ac_cv_func_setreuid" +if test "x$ac_cv_func_setreuid" = xyes +then : + printf "%s\n" "#define HAVE_SETREUID 1" >>confdefs.h fi - - - -case $host_os in - *cygwin* ) CYGWIN=yes;; - * ) CYGWIN=no;; -esac - -for ac_func in ftime gethostname gettimeofday lseek nice time uname -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_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 `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "setruid" "ac_cv_func_setruid" +if test "x$ac_cv_func_setruid" = xyes +then : + printf "%s\n" "#define HAVE_SETRUID 1" >>confdefs.h fi -done -for ac_func in seteuid setpriority setreuid setruid -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_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 `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "drand48" "ac_cv_func_drand48" +if test "x$ac_cv_func_drand48" = xyes +then : + printf "%s\n" "#define HAVE_DRAND48 1" >>confdefs.h fi -done -for ac_func in drand48 -do : - ac_fn_c_check_func "$LINENO" "drand48" "ac_cv_func_drand48" -if test "x$ac_cv_func_drand48" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DRAND48 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "putenv" "ac_cv_func_putenv" +if test "x$ac_cv_func_putenv" = xyes +then : + printf "%s\n" "#define HAVE_PUTENV 1" >>confdefs.h fi -done - -for ac_func in putenv setenv -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_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 `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv" +if test "x$ac_cv_func_setenv" = xyes +then : + printf "%s\n" "#define HAVE_SETENV 1" >>confdefs.h fi -done -for ac_func in nanosleep -do : - ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" -if test "x$ac_cv_func_nanosleep" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NANOSLEEP 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" +if test "x$ac_cv_func_nanosleep" = xyes +then : + printf "%s\n" "#define HAVE_NANOSLEEP 1" >>confdefs.h fi -done if test "$cross_compiling" != "yes" ; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 -$as_echo_n "checking whether setpgrp takes no argument... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setpgrp requires zero arguments" >&5 +printf %s "checking whether setpgrp requires zero arguments... " >&6; } -if test "$cross_compiling" = yes; then : - as_fn_error $? "cannot check setpgrp when cross compiling" "$LINENO" 5 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +# Call it with two arguments. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { -/* If this system has a BSD-style setpgrp which takes arguments, - setpgrp(1, 1) will fail with ESRCH and return -1, in that case - exit successfully. */ - return setpgrp (1,1) != -1; +setpgrp(0, 0); ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_func_setpgrp_void=no -else +else $as_nop ac_cv_func_setpgrp_void=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 -$as_echo "$ac_cv_func_setpgrp_void" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 +printf "%s\n" "$ac_cv_func_setpgrp_void" >&6; } if test $ac_cv_func_setpgrp_void = yes; then -$as_echo "#define SETPGRP_VOID 1" >>confdefs.h +printf "%s\n" "#define SETPGRP_VOID 1" >>confdefs.h fi @@ -6394,69 +7385,71 @@ CROSS_COMPILING=1 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 -$as_echo_n "checking for long long int... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +printf %s "checking for long long int... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { long long int x; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h +printf "%s\n" "#define HAVE_LONG_LONG_INT 1" >>confdefs.h -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for int64_t" >&5 -$as_echo_n "checking for int64_t... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for int64_t" >&5 +printf %s "checking for int64_t... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int64_t x; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_INT64_T 1" >>confdefs.h +printf "%s\n" "#define HAVE_INT64_T 1" >>confdefs.h -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for W11" >&5 -$as_echo_n "checking for W11... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for W11" >&5 +printf %s "checking for W11... " >&6; } case "$enable_w11" in - yes|no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$enable_w11\"" >&5 -$as_echo "\"$enable_w11\"" >&6; } ;; + yes|no) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$enable_w11\"" >&5 +printf "%s\n" "\"$enable_w11\"" >&6; } ;; *) as_fn_error $? "*** You must answer yes or no." "$LINENO" 5 ;; esac @@ -6477,26 +7470,55 @@ if test "$enable_w11" = "yes" ; then CFLAGS="$CFLAGS -D__W98__" else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 -$as_echo_n "checking for X... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for X" >&5 +printf %s "checking for X... " >&6; } # Check whether --with-x was given. -if test "${with_x+set}" = set; then : +if test ${with_x+y} +then : withval=$with_x; fi - -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. -if test "x$with_x" = xno; then - # The user explicitly disabled X. - have_x=disabled -else - case $x_includes,$x_libraries in #( - *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( - *,NONE | NONE,*) -# One or both of the vars are not set, and there is no cached value. -ac_x_includes=no ac_x_libraries=no -rm -f -r conftest.dir + +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + case $x_includes,$x_libraries in #( + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( + *,NONE | NONE,*) +# One or both of the vars are not set, and there is no cached value. +ac_x_includes=no +ac_x_libraries=no +# Do we need to do anything special at all? +ac_save_LIBS=$LIBS +LIBS="-lX11 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +XrmInitialize () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + # We can compile and link X programs with no special options. + ac_x_includes= + ac_x_libraries= +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS="$ac_save_LIBS" +# If that didn't work, only try xmkmf and file system searches +# for native compilation. +if test x"$ac_x_includes" = xno && test "$cross_compiling" = no +then : + rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' @@ -6535,7 +7557,7 @@ _ACEOF rm -f -r conftest.dir fi -# Standard set of common directories for X headers. + # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include @@ -6562,6 +7584,8 @@ ac_x_header_dirs=' /usr/local/include/X11R5 /usr/local/include/X11R4 +/opt/X11/include + /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 @@ -6583,10 +7607,11 @@ if test "$ac_x_includes" = no; then /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # We can compile using X headers with no special include directory. ac_x_includes= -else +else $as_nop for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir @@ -6607,20 +7632,21 @@ if test "$ac_x_libraries" = no; then /* end confdefs.h. */ #include int -main () +main (void) { XrmInitialize () ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= -else +else $as_nop LIBS=$ac_save_LIBS -for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +for ac_dir in `printf "%s\n" "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do @@ -6631,19 +7657,21 @@ do done done fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no +fi +# Record the results. case $ac_x_includes,$ac_x_libraries in #( - no,* | *,no | *\'*) + no,* | *,no | *\'*) : # Didn't find X, or a directory has "'" in its name. - ac_cv_have_x="have_x=no";; #( - *) + ac_cv_have_x="have_x=no" ;; #( + *) : # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ - ac_x_libraries='$ac_x_libraries'" + ac_x_libraries='$ac_x_libraries'" ;; esac ;; #( *) have_x=yes;; @@ -6652,8 +7680,8 @@ esac fi # $with_x != no if test "$have_x" != yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 -$as_echo "$have_x" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 +printf "%s\n" "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. @@ -6663,14 +7691,14 @@ else ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 -$as_echo "libraries $x_libraries, headers $x_includes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 +printf "%s\n" "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. -$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h +printf "%s\n" "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else @@ -6683,8 +7711,8 @@ else X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 -$as_echo_n "checking whether -R must be followed by a space... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 +printf %s "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -6692,42 +7720,44 @@ $as_echo_n "checking whether -R must be followed by a space... " >&6; } /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" -else +else $as_nop LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 -$as_echo "neither works" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 +printf "%s\n" "neither works" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS @@ -6750,23 +7780,21 @@ rm -f core conftest.err conftest.$ac_objext \ /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char XOpenDisplay (); int -main () +main (void) { return XOpenDisplay (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 -$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 +printf %s "checking for dnet_ntoa in -ldnet... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" @@ -6776,35 +7804,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char dnet_ntoa (); int -main () +main (void) { return dnet_ntoa (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dnet_dnet_ntoa=yes -else +else $as_nop ac_cv_lib_dnet_dnet_ntoa=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 -$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } -if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +printf "%s\n" "$ac_cv_lib_dnet_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes +then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 -$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 +printf %s "checking for dnet_ntoa in -ldnet_stub... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" @@ -6814,35 +7841,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char dnet_ntoa (); int -main () +main (void) { return dnet_ntoa (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dnet_stub_dnet_ntoa=yes -else +else $as_nop ac_cv_lib_dnet_stub_dnet_ntoa=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 -$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } -if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +printf "%s\n" "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes +then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" @@ -6855,13 +7881,14 @@ rm -f core conftest.err conftest.$ac_objext \ # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" -if test "x$ac_cv_func_gethostbyname" = xyes; then : +if test "x$ac_cv_func_gethostbyname" = xyes +then : fi if test $ac_cv_func_gethostbyname = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 -$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +printf %s "checking for gethostbyname in -lnsl... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" @@ -6871,35 +7898,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char gethostbyname (); int -main () +main (void) { return gethostbyname (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_nsl_gethostbyname=yes -else +else $as_nop ac_cv_lib_nsl_gethostbyname=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 -$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } -if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes +then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 -$as_echo_n "checking for gethostbyname in -lbsd... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 +printf %s "checking for gethostbyname in -lbsd... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" @@ -6909,29 +7935,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char gethostbyname (); int -main () +main (void) { return gethostbyname (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bsd_gethostbyname=yes -else +else $as_nop ac_cv_lib_bsd_gethostbyname=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 -$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } -if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 +printf "%s\n" "$ac_cv_lib_bsd_gethostbyname" >&6; } +if test "x$ac_cv_lib_bsd_gethostbyname" = xyes +then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi @@ -6946,13 +7971,14 @@ fi # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" -if test "x$ac_cv_func_connect" = xyes; then : +if test "x$ac_cv_func_connect" = xyes +then : fi if test $ac_cv_func_connect = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 -$as_echo_n "checking for connect in -lsocket... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 +printf %s "checking for connect in -lsocket... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" @@ -6962,29 +7988,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char connect (); int -main () +main (void) { return connect (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_socket_connect=yes -else +else $as_nop ac_cv_lib_socket_connect=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 -$as_echo "$ac_cv_lib_socket_connect" >&6; } -if test "x$ac_cv_lib_socket_connect" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 +printf "%s\n" "$ac_cv_lib_socket_connect" >&6; } +if test "x$ac_cv_lib_socket_connect" = xyes +then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi @@ -6992,13 +8017,14 @@ fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" -if test "x$ac_cv_func_remove" = xyes; then : +if test "x$ac_cv_func_remove" = xyes +then : fi if test $ac_cv_func_remove = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 -$as_echo_n "checking for remove in -lposix... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 +printf %s "checking for remove in -lposix... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" @@ -7008,29 +8034,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char remove (); int -main () +main (void) { return remove (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_posix_remove=yes -else +else $as_nop ac_cv_lib_posix_remove=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 -$as_echo "$ac_cv_lib_posix_remove" >&6; } -if test "x$ac_cv_lib_posix_remove" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 +printf "%s\n" "$ac_cv_lib_posix_remove" >&6; } +if test "x$ac_cv_lib_posix_remove" = xyes +then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi @@ -7038,13 +8063,14 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" -if test "x$ac_cv_func_shmat" = xyes; then : +if test "x$ac_cv_func_shmat" = xyes +then : fi if test $ac_cv_func_shmat = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 -$as_echo_n "checking for shmat in -lipc... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 +printf %s "checking for shmat in -lipc... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" @@ -7054,29 +8080,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char shmat (); int -main () +main (void) { return shmat (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ipc_shmat=yes -else +else $as_nop ac_cv_lib_ipc_shmat=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 -$as_echo "$ac_cv_lib_ipc_shmat" >&6; } -if test "x$ac_cv_lib_ipc_shmat" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 +printf "%s\n" "$ac_cv_lib_ipc_shmat" >&6; } +if test "x$ac_cv_lib_ipc_shmat" = xyes +then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi @@ -7092,8 +8117,8 @@ fi # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 -$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 +printf %s "checking for IceConnectionNumber in -lICE... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" @@ -7103,29 +8128,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char IceConnectionNumber (); int -main () +main (void) { return IceConnectionNumber (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ICE_IceConnectionNumber=yes -else +else $as_nop ac_cv_lib_ICE_IceConnectionNumber=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 -$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } -if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +printf "%s\n" "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } +if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes +then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi @@ -7148,8 +8172,8 @@ fi # cuserid ac_save_libs="$LIBS" LIBS="" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cuserid" >&5 -$as_echo_n "checking for library containing cuserid... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing cuserid" >&5 +printf %s "checking for library containing cuserid... " >&6; } ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7158,45 +8182,47 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char cuserid (); int -main () +main (void) { return cuserid (); ; return 0; } _ACEOF -for ac_lib in '' compat; do +for ac_lib in '' compat +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_cuserid=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_cuserid+:} false; then : + if test ${ac_cv_search_cuserid+y} +then : break fi done -if ${ac_cv_search_cuserid+:} false; then : +if test ${ac_cv_search_cuserid+y} +then : -else +else $as_nop ac_cv_search_cuserid=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cuserid" >&5 -$as_echo "$ac_cv_search_cuserid" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cuserid" >&5 +printf "%s\n" "$ac_cv_search_cuserid" >&6; } ac_res=$ac_cv_search_cuserid -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -7205,27 +8231,24 @@ DBMIEXTRALIB="$LIBS" LIBS="$ac_save_libs" -for ac_func in asprintf -do : - ac_fn_c_check_func "$LINENO" "asprintf" "ac_cv_func_asprintf" -if test "x$ac_cv_func_asprintf" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ASPRINTF 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "asprintf" "ac_cv_func_asprintf" +if test "x$ac_cv_func_asprintf" = xyes +then : + printf "%s\n" "#define HAVE_ASPRINTF 1" >>confdefs.h fi -done # Test if mathlib needs -lm flag or is included with libc ac_fn_c_check_func "$LINENO" "atan" "ac_cv_func_atan" -if test "x$ac_cv_func_atan" = xyes; then : +if test "x$ac_cv_func_atan" = xyes +then : MATHLIB= -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan in -lm" >&5 -$as_echo_n "checking for atan in -lm... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for atan in -lm" >&5 +printf %s "checking for atan in -lm... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" @@ -7235,31 +8258,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char atan (); int -main () +main (void) { return atan (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_m_atan=yes -else +else $as_nop ac_cv_lib_m_atan=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atan" >&5 -$as_echo "$ac_cv_lib_m_atan" >&6; } -if test "x$ac_cv_lib_m_atan" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_atan" >&5 +printf "%s\n" "$ac_cv_lib_m_atan" >&6; } +if test "x$ac_cv_lib_m_atan" = xyes +then : MATHLIB=-lm -else +else $as_nop as_fn_error $? "*** Failed check for math library." "$LINENO" 5 @@ -7270,12 +8292,13 @@ fi ac_fn_c_check_func "$LINENO" "dlsym" "ac_cv_func_dlsym" -if test "x$ac_cv_func_dlsym" = xyes; then : +if test "x$ac_cv_func_dlsym" = xyes +then : DLLIB= -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5 -$as_echo_n "checking for dlsym in -ldl... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5 +printf %s "checking for dlsym in -ldl... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -7285,31 +8308,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char dlsym (); int -main () +main (void) { return dlsym (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlsym=yes -else +else $as_nop ac_cv_lib_dl_dlsym=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5 -$as_echo "$ac_cv_lib_dl_dlsym" >&6; } -if test "x$ac_cv_lib_dl_dlsym" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlsym" >&6; } +if test "x$ac_cv_lib_dl_dlsym" = xyes +then : DLLIB=-ldl -else +else $as_nop DLLIB= @@ -7320,12 +8342,13 @@ fi ac_fn_c_check_func "$LINENO" "iconv" "ac_cv_func_iconv" -if test "x$ac_cv_func_iconv" = xyes; then : +if test "x$ac_cv_func_iconv" = xyes +then : ICONVLIB= -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -liconv" >&5 -$as_echo_n "checking for iconv in -liconv... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv in -liconv" >&5 +printf %s "checking for iconv in -liconv... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" @@ -7335,34 +8358,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char iconv (); int -main () +main (void) { return iconv (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_iconv_iconv=yes -else +else $as_nop ac_cv_lib_iconv_iconv=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv" >&5 -$as_echo "$ac_cv_lib_iconv_iconv" >&6; } -if test "x$ac_cv_lib_iconv_iconv" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv" >&5 +printf "%s\n" "$ac_cv_lib_iconv_iconv" >&6; } +if test "x$ac_cv_lib_iconv_iconv" = xyes +then : ICONVLIB=-liconv -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -lgiconv" >&5 -$as_echo_n "checking for iconv in -lgiconv... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv in -lgiconv" >&5 +printf %s "checking for iconv in -lgiconv... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lgiconv $LIBS" @@ -7372,39 +8394,39 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char iconv (); int -main () +main (void) { return iconv (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_giconv_iconv=yes -else +else $as_nop ac_cv_lib_giconv_iconv=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_giconv_iconv" >&5 -$as_echo "$ac_cv_lib_giconv_iconv" >&6; } -if test "x$ac_cv_lib_giconv_iconv" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_giconv_iconv" >&5 +printf "%s\n" "$ac_cv_lib_giconv_iconv" >&6; } +if test "x$ac_cv_lib_giconv_iconv" = xyes +then : ICONVLIB=-lgiconv -else +else $as_nop ac_fn_c_check_func "$LINENO" "libiconv" "ac_cv_func_libiconv" -if test "x$ac_cv_func_libiconv" = xyes; then : +if test "x$ac_cv_func_libiconv" = xyes +then : ICONVLIB= -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv in -liconv" >&5 -$as_echo_n "checking for libiconv in -liconv... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libiconv in -liconv" >&5 +printf %s "checking for libiconv in -liconv... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" @@ -7414,34 +8436,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char libiconv (); int -main () +main (void) { return libiconv (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_iconv_libiconv=yes -else +else $as_nop ac_cv_lib_iconv_libiconv=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv" >&5 -$as_echo "$ac_cv_lib_iconv_libiconv" >&6; } -if test "x$ac_cv_lib_iconv_libiconv" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv" >&5 +printf "%s\n" "$ac_cv_lib_iconv_libiconv" >&6; } +if test "x$ac_cv_lib_iconv_libiconv" = xyes +then : ICONVLIB=-liconv -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv in -lgiconv" >&5 -$as_echo_n "checking for libiconv in -lgiconv... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libiconv in -lgiconv" >&5 +printf %s "checking for libiconv in -lgiconv... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lgiconv $LIBS" @@ -7451,34 +8472,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char libiconv (); int -main () +main (void) { return libiconv (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_giconv_libiconv=yes -else +else $as_nop ac_cv_lib_giconv_libiconv=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_giconv_libiconv" >&5 -$as_echo "$ac_cv_lib_giconv_libiconv" >&6; } -if test "x$ac_cv_lib_giconv_libiconv" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_giconv_libiconv" >&5 +printf "%s\n" "$ac_cv_lib_giconv_libiconv" >&6; } +if test "x$ac_cv_lib_giconv_libiconv" = xyes +then : ICONVLIB=-lgiconv -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to locate iconv() function." >&5 -$as_echo "$as_me: WARNING: *** Unable to locate iconv() function." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to locate iconv() function." >&5 +printf "%s\n" "$as_me: WARNING: *** Unable to locate iconv() function." >&2;} ICONVLIB= fi @@ -7497,12 +8517,13 @@ fi have_socket=1 ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" -if test "x$ac_cv_func_socket" = xyes; then : +if test "x$ac_cv_func_socket" = xyes +then : SOCKLIB= -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 -$as_echo_n "checking for socket in -lsocket... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 +printf %s "checking for socket in -lsocket... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" @@ -7512,35 +8533,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char socket (); int -main () +main (void) { return socket (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_socket_socket=yes -else +else $as_nop ac_cv_lib_socket_socket=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 -$as_echo "$ac_cv_lib_socket_socket" >&6; } -if test "x$ac_cv_lib_socket_socket" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 +printf "%s\n" "$ac_cv_lib_socket_socket" >&6; } +if test "x$ac_cv_lib_socket_socket" = xyes +then : SOCKLIB=-lsocket -else +else $as_nop have_socket=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to locate socket() function." >&5 -$as_echo "$as_me: WARNING: *** Unable to locate socket() function." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to locate socket() function." >&5 +printf "%s\n" "$as_me: WARNING: *** Unable to locate socket() function." >&2;} fi @@ -7550,7 +8570,7 @@ fi if test "$have_socket" = 1 ; then HAVE_SOCKET=1 -$as_echo "#define HAVE_SOCKET 1" >>confdefs.h +printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h else HAVE_SOCKET= @@ -7567,15 +8587,15 @@ ZLIB= # With zlib includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of zlib includes" >&5 -$as_echo_n "checking for location of zlib includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of zlib includes" >&5 +printf %s "checking for location of zlib includes... " >&6; } case "$with_zlib_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-zlib-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_zlib_includes" >&5 -$as_echo "$with_zlib_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_zlib_includes" >&5 +printf "%s\n" "$with_zlib_includes" >&6; } if test -n "$with_zlib_includes" ; then for dir in $with_zlib_includes; do @@ -7591,37 +8611,35 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$ZLIBINCPATH $CPPFLAGS" -for ac_header in zlib.h + for ac_header in zlib.h do : - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ZLIB_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = xyes +then : + printf "%s\n" "#define HAVE_ZLIB_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate zlib includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags # With zlib library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of zlib library" >&5 -$as_echo_n "checking for location of zlib library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of zlib library" >&5 +printf %s "checking for location of zlib library... " >&6; } case "$with_zlib_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-zlib-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_zlib_libs" >&5 -$as_echo "$with_zlib_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_zlib_libs" >&5 +printf "%s\n" "$with_zlib_libs" >&6; } if test -n "$with_zlib_libs"; then for dir in $with_zlib_libs; do @@ -7639,8 +8657,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$ZLIBLIBPATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 -$as_echo_n "checking for deflate in -lz... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 +printf %s "checking for deflate in -lz... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" @@ -7650,31 +8668,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char deflate (); int -main () +main (void) { return deflate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_z_deflate=yes -else +else $as_nop ac_cv_lib_z_deflate=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5 -$as_echo "$ac_cv_lib_z_deflate" >&6; } -if test "x$ac_cv_lib_z_deflate" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5 +printf "%s\n" "$ac_cv_lib_z_deflate" >&6; } +if test "x$ac_cv_lib_z_deflate" = xyes +then : ZLIB="$ZLIB -lz " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -7703,10 +8720,10 @@ BZIP2INCPATH= BZIP2LIB= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use bzlib" >&5 -$as_echo_n "checking whether to use bzlib... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_bzlib\"" >&5 -$as_echo "\"$with_bzlib\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use bzlib" >&5 +printf %s "checking whether to use bzlib... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_bzlib\"" >&5 +printf "%s\n" "\"$with_bzlib\"" >&6; } case "$with_bzlib" in "no") USE_BZIP2= ;; "yes") USE_BZIP2="1" ;; @@ -7720,15 +8737,15 @@ if test -n "$USE_BZIP2"; then # With bzip2 includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of bzlib includes" >&5 -$as_echo_n "checking for location of bzlib includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of bzlib includes" >&5 +printf %s "checking for location of bzlib includes... " >&6; } case "$with_bzlib_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-bzlib-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_bzlib_includes" >&5 -$as_echo "$with_bzlib_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_bzlib_includes" >&5 +printf "%s\n" "$with_bzlib_includes" >&6; } if test -n "$with_bzlib_includes" ; then for dir in $with_bzlib_includes; do @@ -7744,37 +8761,35 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$BZIP2INCPATH $CPPFLAGS" -for ac_header in bzlib.h + for ac_header in bzlib.h do : - ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default" -if test "x$ac_cv_header_bzlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_BZLIB_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default" +if test "x$ac_cv_header_bzlib_h" = xyes +then : + printf "%s\n" "#define HAVE_BZLIB_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate bzlib includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags # With bzip2 library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of bzlib library" >&5 -$as_echo_n "checking for location of bzlib library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of bzlib library" >&5 +printf %s "checking for location of bzlib library... " >&6; } case "$with_bzlib_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-bzlib-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_bzlib_libs" >&5 -$as_echo "$with_bzlib_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_bzlib_libs" >&5 +printf "%s\n" "$with_bzlib_libs" >&6; } if test -n "$with_bzlib_libs"; then for dir in $with_bzlib_libs; do @@ -7792,8 +8807,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$BZIP2LIBPATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzBuffToBuffCompress in -lbz2" >&5 -$as_echo_n "checking for BZ2_bzBuffToBuffCompress in -lbz2... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzBuffToBuffCompress in -lbz2" >&5 +printf %s "checking for BZ2_bzBuffToBuffCompress in -lbz2... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $LIBS" @@ -7803,31 +8818,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char BZ2_bzBuffToBuffCompress (); int -main () +main (void) { return BZ2_bzBuffToBuffCompress (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bz2_BZ2_bzBuffToBuffCompress=yes -else +else $as_nop ac_cv_lib_bz2_BZ2_bzBuffToBuffCompress=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzBuffToBuffCompress" >&5 -$as_echo "$ac_cv_lib_bz2_BZ2_bzBuffToBuffCompress" >&6; } -if test "x$ac_cv_lib_bz2_BZ2_bzBuffToBuffCompress" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzBuffToBuffCompress" >&5 +printf "%s\n" "$ac_cv_lib_bz2_BZ2_bzBuffToBuffCompress" >&6; } +if test "x$ac_cv_lib_bz2_BZ2_bzBuffToBuffCompress" = xyes +then : BZIP2LIB="$BZIP2LIB -lbz2 " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -7858,10 +8872,10 @@ ZSTDINCPATH= ZSTDLIB= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use zstd" >&5 -$as_echo_n "checking whether to use zstd... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_zstd\"" >&5 -$as_echo "\"$with_zstd\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use zstd" >&5 +printf %s "checking whether to use zstd... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_zstd\"" >&5 +printf "%s\n" "\"$with_zstd\"" >&6; } case "$with_zstd" in "no") USE_ZSTD= ;; "yes") USE_ZSTD="1" ;; @@ -7875,15 +8889,15 @@ if test -n "$USE_ZSTD"; then # With zstd includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of zstd includes" >&5 -$as_echo_n "checking for location of zstd includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of zstd includes" >&5 +printf %s "checking for location of zstd includes... " >&6; } case "$with_zstd_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-zstd-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_zstd_includes" >&5 -$as_echo "$with_zstd_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_zstd_includes" >&5 +printf "%s\n" "$with_zstd_includes" >&6; } if test -n "$with_zstd_includes" ; then for dir in $with_zstd_includes; do @@ -7898,37 +8912,35 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$ZSTDINCPATH $CPPFLAGS" -for ac_header in zstd.h + for ac_header in zstd.h do : - ac_fn_c_check_header_mongrel "$LINENO" "zstd.h" "ac_cv_header_zstd_h" "$ac_includes_default" -if test "x$ac_cv_header_zstd_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ZSTD_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "zstd.h" "ac_cv_header_zstd_h" "$ac_includes_default" +if test "x$ac_cv_header_zstd_h" = xyes +then : + printf "%s\n" "#define HAVE_ZSTD_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate zstd includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags # With zstd library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of zstd library" >&5 -$as_echo_n "checking for location of zstd library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of zstd library" >&5 +printf %s "checking for location of zstd library... " >&6; } case "$with_zstd_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-zstd-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_zstd_libs" >&5 -$as_echo "$with_zstd_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_zstd_libs" >&5 +printf "%s\n" "$with_zstd_libs" >&6; } if test -n "$with_zstd_libs"; then for dir in $with_zstd_libs; do @@ -7946,8 +8958,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$ZSTDLIBPATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZSTD_compress in -lzstd" >&5 -$as_echo_n "checking for ZSTD_compress in -lzstd... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ZSTD_compress in -lzstd" >&5 +printf %s "checking for ZSTD_compress in -lzstd... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lzstd $LIBS" @@ -7957,31 +8969,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char ZSTD_compress (); int -main () +main (void) { return ZSTD_compress (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_zstd_ZSTD_compress=yes -else +else $as_nop ac_cv_lib_zstd_ZSTD_compress=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zstd_ZSTD_compress" >&5 -$as_echo "$ac_cv_lib_zstd_ZSTD_compress" >&6; } -if test "x$ac_cv_lib_zstd_ZSTD_compress" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zstd_ZSTD_compress" >&5 +printf "%s\n" "$ac_cv_lib_zstd_ZSTD_compress" >&6; } +if test "x$ac_cv_lib_zstd_ZSTD_compress" = xyes +then : ZSTDLIB="$ZSTDLIB -lzstd " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -8016,15 +9027,15 @@ PROJMAJOR=4 # With PROJ includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of External PROJ includes" >&5 -$as_echo_n "checking for location of External PROJ includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of External PROJ includes" >&5 +printf %s "checking for location of External PROJ includes... " >&6; } case "$with_proj_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-proj-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_proj_includes" >&5 -$as_echo "$with_proj_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_proj_includes" >&5 +printf "%s\n" "$with_proj_includes" >&6; } if test -n "$with_proj_includes" ; then for dir in $with_proj_includes; do @@ -8041,34 +9052,33 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$PROJINC $CPPFLAGS" -for ac_header in proj.h + for ac_header in proj.h do : - ac_fn_c_check_header_mongrel "$LINENO" "proj.h" "ac_cv_header_proj_h" "$ac_includes_default" -if test "x$ac_cv_header_proj_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PROJ_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "proj.h" "ac_cv_header_proj_h" "$ac_includes_default" +if test "x$ac_cv_header_proj_h" = xyes +then : + printf "%s\n" "#define HAVE_PROJ_H 1" >>confdefs.h -else +else $as_nop PROJ4API=1 fi done - CPPFLAGS=$ac_save_cppflags if test $PROJ4API = 0 ; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking External PROJ major version" >&5 -$as_echo_n "checking External PROJ major version... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking External PROJ major version" >&5 +printf %s "checking External PROJ major version... " >&6; } ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$PROJINC $CPPFLAGS" -if test "$cross_compiling" = yes; then : +if test "$cross_compiling" = yes +then : proj_ver_major=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 -$as_echo "unknown (cross-compiling)" >&6; } -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 +printf "%s\n" "unknown (cross-compiling)" >&6; } +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8081,11 +9091,12 @@ int main(void) { } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : proj_ver_major=`cat conftestdata` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $proj_ver_major" >&5 -$as_echo "$proj_ver_major" >&6; } -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $proj_ver_major" >&5 +printf "%s\n" "$proj_ver_major" >&6; } +else $as_nop as_fn_error $? "*** Could not determine External PROJ major version." "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -8095,15 +9106,16 @@ fi CPPFLAGS=$ac_save_cppflags -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking External PROJ minor version" >&5 -$as_echo_n "checking External PROJ minor version... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking External PROJ minor version" >&5 +printf %s "checking External PROJ minor version... " >&6; } ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$PROJINC $CPPFLAGS" -if test "$cross_compiling" = yes; then : +if test "$cross_compiling" = yes +then : proj_ver_minor=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 -$as_echo "unknown (cross-compiling)" >&6; } -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 +printf "%s\n" "unknown (cross-compiling)" >&6; } +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8116,11 +9128,12 @@ int main(void) { } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : proj_ver_minor=`cat conftestdata` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $proj_ver_minor" >&5 -$as_echo "$proj_ver_minor" >&6; } -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $proj_ver_minor" >&5 +printf "%s\n" "$proj_ver_minor" >&6; } +else $as_nop as_fn_error $? "*** Could not determine External PROJ minor version." "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -8130,15 +9143,16 @@ fi CPPFLAGS=$ac_save_cppflags -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking External PROJ patch version" >&5 -$as_echo_n "checking External PROJ patch version... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking External PROJ patch version" >&5 +printf %s "checking External PROJ patch version... " >&6; } ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$PROJINC $CPPFLAGS" -if test "$cross_compiling" = yes; then : +if test "$cross_compiling" = yes +then : proj_ver_patch=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 -$as_echo "unknown (cross-compiling)" >&6; } -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 +printf "%s\n" "unknown (cross-compiling)" >&6; } +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8151,11 +9165,12 @@ int main(void) { } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : proj_ver_patch=`cat conftestdata` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $proj_ver_patch" >&5 -$as_echo "$proj_ver_patch" >&6; } -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $proj_ver_patch" >&5 +printf "%s\n" "$proj_ver_patch" >&6; } +else $as_nop as_fn_error $? "*** Could not determine External PROJ patch version." "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -8164,26 +9179,27 @@ fi CPPFLAGS=$ac_save_cppflags - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found PROJ version \"${proj_ver_major}.${proj_ver_minor}.${proj_ver_patch}\"" >&5 -$as_echo "found PROJ version \"${proj_ver_major}.${proj_ver_minor}.${proj_ver_patch}\"" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found PROJ version \"${proj_ver_major}.${proj_ver_minor}.${proj_ver_patch}\"" >&5 +printf "%s\n" "found PROJ version \"${proj_ver_major}.${proj_ver_minor}.${proj_ver_patch}\"" >&6; } PROJMAJOR=${proj_ver_major} # minimum required PROJ 5+ version to use the new PROJ API: 5.1.0 if test ${proj_ver_major} = 5 && test `expr ${proj_ver_minor} \< 1` = 1 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: At least PROJ version \"5.1.0\" is required for the new API " >&5 -$as_echo "$as_me: WARNING: At least PROJ version \"5.1.0\" is required for the new API " >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: At least PROJ version \"5.1.0\" is required for the new API " >&5 +printf "%s\n" "$as_me: WARNING: At least PROJ version \"5.1.0\" is required for the new API " >&2;} PROJ4API=1 fi else -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking External PROJ.4 version" >&5 -$as_echo_n "checking External PROJ.4 version... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking External PROJ.4 version" >&5 +printf %s "checking External PROJ.4 version... " >&6; } ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$PROJINC $CPPFLAGS" -if test "$cross_compiling" = yes; then : +if test "$cross_compiling" = yes +then : proj_ver=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 -$as_echo "unknown (cross-compiling)" >&6; } -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 +printf "%s\n" "unknown (cross-compiling)" >&6; } +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8196,11 +9212,12 @@ int main(void) { } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : proj_ver=`cat conftestdata` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $proj_ver" >&5 -$as_echo "$proj_ver" >&6; } -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $proj_ver" >&5 +printf "%s\n" "$proj_ver" >&6; } +else $as_nop as_fn_error $? "*** Could not determine External PROJ.4 version." "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -8216,26 +9233,26 @@ CPPFLAGS=$ac_save_cppflags elif test `expr ${proj_ver} \>= 400` = 1 ; then PROJMAJOR=4 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found PROJ version \"${proj_ver}\"" >&5 -$as_echo "found PROJ version \"${proj_ver}\"" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found PROJ version \"${proj_ver}\"" >&5 +printf "%s\n" "found PROJ version \"${proj_ver}\"" >&6; } fi if test $PROJ4API = 0 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using new PROJ version 5+ API" >&5 -$as_echo "using new PROJ version 5+ API" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: using new PROJ version 5+ API" >&5 +printf "%s\n" "using new PROJ version 5+ API" >&6; } # With PROJ library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of External PROJ library" >&5 -$as_echo_n "checking for location of External PROJ library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of External PROJ library" >&5 +printf %s "checking for location of External PROJ library... " >&6; } case "$with_proj_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-proj-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_proj_libs" >&5 -$as_echo "$with_proj_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_proj_libs" >&5 +printf "%s\n" "$with_proj_libs" >&6; } if test -n "$with_proj_libs"; then for dir in $with_proj_libs; do @@ -8252,8 +9269,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$PROJLIB $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for proj_pj_info in -lproj" >&5 -$as_echo_n "checking for proj_pj_info in -lproj... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for proj_pj_info in -lproj" >&5 +printf %s "checking for proj_pj_info in -lproj... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lproj $LIBS" @@ -8263,31 +9280,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char proj_pj_info (); int -main () +main (void) { return proj_pj_info (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_proj_proj_pj_info=yes -else +else $as_nop ac_cv_lib_proj_proj_pj_info=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_proj_proj_pj_info" >&5 -$as_echo "$ac_cv_lib_proj_proj_pj_info" >&6; } -if test "x$ac_cv_lib_proj_proj_pj_info" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_proj_proj_pj_info" >&5 +printf "%s\n" "$ac_cv_lib_proj_proj_pj_info" >&6; } +if test "x$ac_cv_lib_proj_proj_pj_info" = xyes +then : PROJLIB="$PROJLIB -lproj " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -8301,49 +9317,48 @@ fi LDFLAGS=${ac_save_ldflags} else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using old PROJ version 4 API" >&5 -$as_echo "using old PROJ version 4 API" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: using old PROJ version 4 API" >&5 +printf "%s\n" "using old PROJ version 4 API" >&6; } -$as_echo "#define USE_PROJ4API 1" >>confdefs.h +printf "%s\n" "#define USE_PROJ4API 1" >>confdefs.h ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$PROJINC $CPPFLAGS" -for ac_header in proj_api.h + for ac_header in proj_api.h do : - ac_fn_c_check_header_mongrel "$LINENO" "proj_api.h" "ac_cv_header_proj_api_h" "$ac_includes_default" -if test "x$ac_cv_header_proj_api_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PROJ_API_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "proj_api.h" "ac_cv_header_proj_api_h" "$ac_includes_default" +if test "x$ac_cv_header_proj_api_h" = xyes +then : + printf "%s\n" "#define HAVE_PROJ_API_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate External PROJ includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags # PROJ version check for v4.x if test "$cross_compiling" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Cannot check PROJ.4 version (cross-compiling)." >&5 -$as_echo "$as_me: WARNING: *** Cannot check PROJ.4 version (cross-compiling)." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** Cannot check PROJ.4 version (cross-compiling)." >&5 +printf "%s\n" "$as_me: WARNING: *** Cannot check PROJ.4 version (cross-compiling)." >&2;} else -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking External PROJ.4 version" >&5 -$as_echo_n "checking External PROJ.4 version... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking External PROJ.4 version" >&5 +printf %s "checking External PROJ.4 version... " >&6; } ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$PROJINC $CPPFLAGS" -if test "$cross_compiling" = yes; then : +if test "$cross_compiling" = yes +then : proj_ver=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 -$as_echo "unknown (cross-compiling)" >&6; } -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 +printf "%s\n" "unknown (cross-compiling)" >&6; } +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8356,11 +9371,12 @@ int main(void) { } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : proj_ver=`cat conftestdata` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $proj_ver" >&5 -$as_echo "$proj_ver" >&6; } -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $proj_ver" >&5 +printf "%s\n" "$proj_ver" >&6; } +else $as_nop as_fn_error $? "*** Could not determine External PROJ.4 version." "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -8378,15 +9394,15 @@ CPPFLAGS=$ac_save_cppflags # With PROJ library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of External PROJ.4 library" >&5 -$as_echo_n "checking for location of External PROJ.4 library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of External PROJ.4 library" >&5 +printf %s "checking for location of External PROJ.4 library... " >&6; } case "$with_proj_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-proj-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_proj_libs" >&5 -$as_echo "$with_proj_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_proj_libs" >&5 +printf "%s\n" "$with_proj_libs" >&6; } if test -n "$with_proj_libs"; then for dir in $with_proj_libs; do @@ -8403,8 +9419,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$PROJLIB $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pj_get_def in -lproj" >&5 -$as_echo_n "checking for pj_get_def in -lproj... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pj_get_def in -lproj" >&5 +printf %s "checking for pj_get_def in -lproj... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lproj $LIBS" @@ -8414,31 +9430,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char pj_get_def (); int -main () +main (void) { return pj_get_def (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_proj_pj_get_def=yes -else +else $as_nop ac_cv_lib_proj_pj_get_def=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_proj_pj_get_def" >&5 -$as_echo "$ac_cv_lib_proj_pj_get_def" >&6; } -if test "x$ac_cv_lib_proj_pj_get_def" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_proj_pj_get_def" >&5 +printf "%s\n" "$ac_cv_lib_proj_pj_get_def" >&6; } +if test "x$ac_cv_lib_proj_pj_get_def" = xyes +then : PROJLIB="$PROJLIB -lproj " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -8456,15 +9471,15 @@ fi # With PROJ share directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of External PROJ data files" >&5 -$as_echo_n "checking for location of External PROJ data files... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of External PROJ data files" >&5 +printf %s "checking for location of External PROJ data files... " >&6; } case "$with_proj_share" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-proj-share." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_proj_share" >&5 -$as_echo "$with_proj_share" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_proj_share" >&5 +printf "%s\n" "$with_proj_share" >&6; } if test -n "$with_proj_share" ; then if test -d "$with_proj_share"; then @@ -8475,8 +9490,8 @@ if test -n "$with_proj_share" ; then fi if test -z "$PROJSHARE" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** External PROJ directory not specified; default will be used" >&5 -$as_echo "$as_me: WARNING: *** External PROJ directory not specified; default will be used" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** External PROJ directory not specified; default will be used" >&5 +printf "%s\n" "$as_me: WARNING: *** External PROJ directory not specified; default will be used" >&2;} PROJSHARE=/usr/share/proj fi @@ -8484,15 +9499,15 @@ fi if test `expr ${PROJMAJOR} \< 6` = 1 ; then # LOC_CHECK_SHARE does not work when cross compiling if test "$cross_compiling" = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for epsg" >&5 -$as_echo_n "checking for epsg... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 -$as_echo "unknown (cross-compiling)" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for epsg" >&5 +printf %s "checking for epsg... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 +printf "%s\n" "unknown (cross-compiling)" >&6; } else -as_ac_File=`$as_echo "ac_cv_file_$PROJSHARE/epsg" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $PROJSHARE/epsg" >&5 -$as_echo_n "checking for $PROJSHARE/epsg... " >&6; } +as_ac_File=`printf "%s\n" "ac_cv_file_$PROJSHARE/epsg" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $PROJSHARE/epsg" >&5 +printf %s "checking for $PROJSHARE/epsg... " >&6; } test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 @@ -8502,13 +9517,14 @@ else eval "$as_ac_File=no" fi eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to locate PROJ data files." >&5 -$as_echo "$as_me: WARNING: *** Unable to locate PROJ data files." >&2;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to locate PROJ data files." >&5 +printf "%s\n" "$as_me: WARNING: *** Unable to locate PROJ data files." >&2;} fi @@ -8525,10 +9541,10 @@ fi # Enable regex option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use regex" >&5 -$as_echo_n "checking whether to use regex... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_regex\"" >&5 -$as_echo "\"$with_regex\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use regex" >&5 +printf %s "checking whether to use regex... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_regex\"" >&5 +printf "%s\n" "\"$with_regex\"" >&6; } case "$with_regex" in "no") USE_REGEX= ;; "yes") USE_REGEX="1" ;; @@ -8546,15 +9562,15 @@ if test -n "$USE_REGEX"; then # With regex includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of regex includes" >&5 -$as_echo_n "checking for location of regex includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of regex includes" >&5 +printf %s "checking for location of regex includes... " >&6; } case "$with_regex_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-regex-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_regex_includes" >&5 -$as_echo "$with_regex_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_regex_includes" >&5 +printf "%s\n" "$with_regex_includes" >&6; } if test -n "$with_regex_includes" ; then for dir in $with_regex_includes; do @@ -8570,37 +9586,35 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$REGEXINCPATH $CPPFLAGS" -for ac_header in regex.h + for ac_header in regex.h do : - ac_fn_c_check_header_mongrel "$LINENO" "regex.h" "ac_cv_header_regex_h" "$ac_includes_default" -if test "x$ac_cv_header_regex_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_REGEX_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "regex.h" "ac_cv_header_regex_h" "$ac_includes_default" +if test "x$ac_cv_header_regex_h" = xyes +then : + printf "%s\n" "#define HAVE_REGEX_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate regex includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags # With regex library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of regex library" >&5 -$as_echo_n "checking for location of regex library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of regex library" >&5 +printf %s "checking for location of regex library... " >&6; } case "$with_regex_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-regex-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_regex_libs" >&5 -$as_echo "$with_regex_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_regex_libs" >&5 +printf "%s\n" "$with_regex_libs" >&6; } if test -n "$with_regex_libs"; then for dir in $with_regex_libs; do @@ -8619,21 +9633,22 @@ ac_save_ldflags="$LDFLAGS" LIBS=" $LIBS" LDFLAGS=" $LDFLAGS" ac_fn_c_check_func "$LINENO" "regcomp" "ac_cv_func_regcomp" -if test "x$ac_cv_func_regcomp" = xyes; then : +if test "x$ac_cv_func_regcomp" = xyes +then : REGEXLIB="$REGEXLIB " -else +else $as_nop ac_save_ldflags="$LDFLAGS" LDFLAGS="$REGEXLIBPATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for regcomp in -lregex" >&5 -$as_echo_n "checking for regcomp in -lregex... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for regcomp in -lregex" >&5 +printf %s "checking for regcomp in -lregex... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lregex $LIBS" @@ -8643,31 +9658,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char regcomp (); int -main () +main (void) { return regcomp (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_regex_regcomp=yes -else +else $as_nop ac_cv_lib_regex_regcomp=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_regex_regcomp" >&5 -$as_echo "$ac_cv_lib_regex_regcomp" >&6; } -if test "x$ac_cv_lib_regex_regcomp" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_regex_regcomp" >&5 +printf "%s\n" "$ac_cv_lib_regex_regcomp" >&6; } +if test "x$ac_cv_lib_regex_regcomp" = xyes +then : REGEXLIB="$REGEXLIB -lregex " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -8700,10 +9714,10 @@ fi # $USE_REGEX # Enable Readline option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use Readline" >&5 -$as_echo_n "checking whether to use Readline... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_readline\"" >&5 -$as_echo "\"$with_readline\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use Readline" >&5 +printf %s "checking whether to use Readline... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_readline\"" >&5 +printf "%s\n" "\"$with_readline\"" >&6; } case "$with_readline" in "no") USE_READLINE= ;; "yes") USE_READLINE="1" ;; @@ -8722,15 +9736,15 @@ if test -n "$USE_READLINE"; then # With Readline includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of Readline includes" >&5 -$as_echo_n "checking for location of Readline includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of Readline includes" >&5 +printf %s "checking for location of Readline includes... " >&6; } case "$with_readline_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-readline-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_readline_includes" >&5 -$as_echo "$with_readline_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_readline_includes" >&5 +printf "%s\n" "$with_readline_includes" >&6; } if test -n "$with_readline_includes" ; then for dir in $with_readline_includes; do @@ -8746,58 +9760,54 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$READLINEINCPATH $CPPFLAGS" -for ac_header in readline/readline.h + for ac_header in readline/readline.h do : - ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" -if test "x$ac_cv_header_readline_readline_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_READLINE_READLINE_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" +if test "x$ac_cv_header_readline_readline_h" = xyes +then : + printf "%s\n" "#define HAVE_READLINE_READLINE_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate Readline includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$READLINEINCPATH $CPPFLAGS" -for ac_header in readline/history.h + for ac_header in readline/history.h do : - ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" -if test "x$ac_cv_header_readline_history_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_READLINE_HISTORY_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" +if test "x$ac_cv_header_readline_history_h" = xyes +then : + printf "%s\n" "#define HAVE_READLINE_HISTORY_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate Readline includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags # With Readline library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of Readline library" >&5 -$as_echo_n "checking for location of Readline library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of Readline library" >&5 +printf %s "checking for location of Readline library... " >&6; } case "$with_readline_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-readline-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_readline_libs" >&5 -$as_echo "$with_readline_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_readline_libs" >&5 +printf "%s\n" "$with_readline_libs" >&6; } if test -n "$with_readline_libs"; then for dir in $with_readline_libs; do @@ -8815,8 +9825,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$READLINELIBPATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 -$as_echo_n "checking for readline in -lreadline... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 +printf %s "checking for readline in -lreadline... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" @@ -8826,31 +9836,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char readline (); int -main () +main (void) { return readline (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_readline_readline=yes -else +else $as_nop ac_cv_lib_readline_readline=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 -$as_echo "$ac_cv_lib_readline_readline" >&6; } -if test "x$ac_cv_lib_readline_readline" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 +printf "%s\n" "$ac_cv_lib_readline_readline" >&6; } +if test "x$ac_cv_lib_readline_readline" = xyes +then : READLINELIB="$READLINELIB -lreadline " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -8868,8 +9877,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$READLINELIBPATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for add_history in -lhistory" >&5 -$as_echo_n "checking for add_history in -lhistory... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for add_history in -lhistory" >&5 +printf %s "checking for add_history in -lhistory... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lhistory $LIBS" @@ -8879,31 +9888,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char add_history (); int -main () +main (void) { return add_history (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_history_add_history=yes -else +else $as_nop ac_cv_lib_history_add_history=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_history_add_history" >&5 -$as_echo "$ac_cv_lib_history_add_history" >&6; } -if test "x$ac_cv_lib_history_add_history" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_history_add_history" >&5 +printf "%s\n" "$ac_cv_lib_history_add_history" >&6; } +if test "x$ac_cv_lib_history_add_history" = xyes +then : HISTORYLIB="$HISTORYLIB -lhistory " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -8928,8 +9936,8 @@ fi # $USE_READLINE # PNG option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use PNG" >&5 -$as_echo_n "checking whether to use PNG... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use PNG" >&5 +printf %s "checking whether to use PNG... " >&6; } PNGLIB= PNGINC= @@ -8940,15 +9948,15 @@ if test "`basename xx/$with_libpng`" = "libpng-config" ; then fi if test "$with_libpng" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } # Extract the first word of "libpng-config", so it can be a program name with args. set dummy libpng-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } case $LIBPNG_CONFIG in [\\/]* | ?:[\\/]*) @@ -8959,11 +9967,15 @@ case $LIBPNG_CONFIG in for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LIBPNG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_LIBPNG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8975,11 +9987,11 @@ IFS=$as_save_IFS esac LIBPNG_CONFIG=$ac_cv_path_LIBPNG_CONFIG if test -n "$LIBPNG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBPNG_CONFIG" >&5 -$as_echo "$LIBPNG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBPNG_CONFIG" >&5 +printf "%s\n" "$LIBPNG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9004,46 +10016,48 @@ fi /* end confdefs.h. */ #include int -main () +main (void) { png_read_image(NULL, NULL); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { png_read_image(NULL, NULL); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : PNGLIB="$PNGLIB" -else +else $as_nop as_fn_error $? "*** Unable to locate libpng library." "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=${ac_save_libs} CFLAGS=${ac_save_cflags} -$as_echo "#define HAVE_PNG_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_PNG_H 1" >>confdefs.h fi @@ -9053,8 +10067,8 @@ fi # GDAL option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use GDAL" >&5 -$as_echo_n "checking whether to use GDAL... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use GDAL" >&5 +printf %s "checking whether to use GDAL... " >&6; } GDAL_LIBS= GDAL_CFLAGS= @@ -9066,15 +10080,15 @@ if test "`basename xx/$with_gdal`" = "gdal-config" ; then fi if test "$with_gdal" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } # Extract the first word of "gdal-config", so it can be a program name with args. set dummy gdal-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } case $GDAL_CONFIG in [\\/]* | ?:[\\/]*) @@ -9085,11 +10099,15 @@ case $GDAL_CONFIG in for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GDAL_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GDAL_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9101,11 +10119,11 @@ IFS=$as_save_IFS esac GDAL_CONFIG=$ac_cv_path_GDAL_CONFIG if test -n "$GDAL_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GDAL_CONFIG" >&5 -$as_echo "$GDAL_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GDAL_CONFIG" >&5 +printf "%s\n" "$GDAL_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9121,7 +10139,7 @@ fi USE_GDAL=1 if test `"$GDAL_CONFIG" --ogr-enabled` = "yes" ; then -$as_echo "#define HAVE_OGR 1" >>confdefs.h +printf "%s\n" "#define HAVE_OGR 1" >>confdefs.h USE_OGR=1 fi @@ -9136,47 +10154,49 @@ $as_echo "#define HAVE_OGR 1" >>confdefs.h /* end confdefs.h. */ #include int -main () +main (void) { GDALOpen("foo", GA_ReadOnly); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -else +else $as_nop LIBS="$LIBS $GDAL_DEP_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { GDALOpen("foo", GA_ReadOnly); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : GDAL_LIBS="$GDAL_LIBS $GDAL_DEP_LIBS" -else +else $as_nop as_fn_error $? "*** Unable to locate GDAL library." "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=${ac_save_libs} CFLAGS=${ac_save_cflags} -$as_echo "#define HAVE_GDAL 1" >>confdefs.h +printf "%s\n" "#define HAVE_GDAL 1" >>confdefs.h fi @@ -9187,8 +10207,8 @@ fi # libLAS option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use libLAS" >&5 -$as_echo_n "checking whether to use libLAS... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use libLAS" >&5 +printf %s "checking whether to use libLAS... " >&6; } LIBLAS_LIBS= LIBLAS_CFLAGS= @@ -9199,15 +10219,15 @@ if test "`basename xx/$with_liblas`" = "liblas-config" ; then fi if test "$with_liblas" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } # Extract the first word of "liblas-config", so it can be a program name with args. set dummy liblas-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } case $LIBLAS_CONFIG in [\\/]* | ?:[\\/]*) @@ -9218,11 +10238,15 @@ case $LIBLAS_CONFIG in for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LIBLAS_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_LIBLAS_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9234,11 +10258,11 @@ IFS=$as_save_IFS esac LIBLAS_CONFIG=$ac_cv_path_LIBLAS_CONFIG if test -n "$LIBLAS_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBLAS_CONFIG" >&5 -$as_echo "$LIBLAS_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBLAS_CONFIG" >&5 +printf "%s\n" "$LIBLAS_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9261,63 +10285,60 @@ fi LIBS="$LIBS $LIBLAS_LIBS" CFLAGS="$CFLAGS $LIBLAS_CFLAGS" CPPFLAGS="$CPPFLAGS $LIBLAS_INC" - for ac_header in liblas/capi/liblas.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "liblas/capi/liblas.h" "ac_cv_header_liblas_capi_liblas_h" "$ac_includes_default" -if test "x$ac_cv_header_liblas_capi_liblas_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBLAS_CAPI_LIBLAS_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "liblas/capi/liblas.h" "ac_cv_header_liblas_capi_liblas_h" "$ac_includes_default" +if test "x$ac_cv_header_liblas_capi_liblas_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBLAS_CAPI_LIBLAS_H 1" >>confdefs.h fi -done - cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { LASReader_Create("foo"); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { LASReader_Create("foo"); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : LAS_LIBS="$LAS_LIBS" -else +else $as_nop as_fn_error $? "*** Unable to locate libLAS library." "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=${ac_save_libs} CFLAGS=${ac_save_cflags} CPPFLAGS=${ac_save_cppflags} -$as_echo "#define HAVE_LIBLAS 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBLAS 1" >>confdefs.h fi @@ -9328,8 +10349,8 @@ fi # PDAL option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use PDAL" >&5 -$as_echo_n "checking whether to use PDAL... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use PDAL" >&5 +printf %s "checking whether to use PDAL... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -9344,11 +10365,11 @@ USE_PDAL= pdal="pdal" if test "$with_pdal" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } if test -s "${PKG_CONFIG} --exists ${pdal}" ; then as_fn_error $? "*** Unable to locate PDAL package." "$LINENO" 5 @@ -9370,16 +10391,17 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #include class St:public pdal::Streamable {}; int -main () +main (void) { pdal::PointTable table; ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9387,31 +10409,32 @@ else #include class St:public pdal::Streamable {}; int -main () +main (void) { pdal::PointTable table; ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : PDAL_LIBS="$PDAL_LIBS" -else +else $as_nop as_fn_error $? "*** Unable to locate suitable (>=1.7.1) PDAL library." "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=${ac_save_libs} CFLAGS=${ac_save_cflags} -$as_echo "#define HAVE_PDAL 1" >>confdefs.h +printf "%s\n" "#define HAVE_PDAL 1" >>confdefs.h fi @@ -9429,8 +10452,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # NetCDF option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NetCDF" >&5 -$as_echo_n "checking whether to use NetCDF... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NetCDF" >&5 +printf %s "checking whether to use NetCDF... " >&6; } NETCDF_LIBS= NETCDF_CFLAGS= @@ -9441,15 +10464,15 @@ if test "`basename xx/$with_netcdf`" = "nc-config" ; then fi if test "$with_netcdf" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } # Extract the first word of "nc-config", so it can be a program name with args. set dummy nc-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } case $NETCDF_CONFIG in [\\/]* | ?:[\\/]*) @@ -9460,11 +10483,15 @@ case $NETCDF_CONFIG in for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NETCDF_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_NETCDF_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9476,11 +10503,11 @@ IFS=$as_save_IFS esac NETCDF_CONFIG=$ac_cv_path_NETCDF_CONFIG if test -n "$NETCDF_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NETCDF_CONFIG" >&5 -$as_echo "$NETCDF_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NETCDF_CONFIG" >&5 +printf "%s\n" "$NETCDF_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9504,46 +10531,48 @@ fi /* end confdefs.h. */ #include int -main () +main (void) { nc_create("foo", NC_CLOBBER, NULL); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { nc_create("foo", NC_CLOBBER, NULL); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : NETCDF_LIBS="$NETCDF_LIBS" -else +else $as_nop as_fn_error $? "*** Unable to locate NetCDF library." "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=${ac_save_libs} CFLAGS=${ac_save_cflags} -$as_echo "#define HAVE_NETCDF 1" >>confdefs.h +printf "%s\n" "#define HAVE_NETCDF 1" >>confdefs.h fi @@ -9553,8 +10582,8 @@ fi # GEOS option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use GEOS" >&5 -$as_echo_n "checking whether to use GEOS... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use GEOS" >&5 +printf %s "checking whether to use GEOS... " >&6; } GEOS_LIBS= GEOS_CFLAGS= @@ -9566,15 +10595,15 @@ if test "`basename xx/$with_geos`" = "geos-config" ; then fi if test "$with_geos" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } # Extract the first word of "geos-config", so it can be a program name with args. set dummy geos-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } case $GEOS_CONFIG in [\\/]* | ?:[\\/]*) @@ -9585,11 +10614,15 @@ case $GEOS_CONFIG in for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GEOS_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GEOS_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9601,11 +10634,11 @@ IFS=$as_save_IFS esac GEOS_CONFIG=$ac_cv_path_GEOS_CONFIG if test -n "$GEOS_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GEOS_CONFIG" >&5 -$as_echo "$GEOS_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GEOS_CONFIG" >&5 +printf "%s\n" "$GEOS_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9623,22 +10656,20 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$GEOS_CFLAGS $CPPFLAGS" -for ac_header in geos_c.h + for ac_header in geos_c.h do : - ac_fn_c_check_header_mongrel "$LINENO" "geos_c.h" "ac_cv_header_geos_c_h" "$ac_includes_default" -if test "x$ac_cv_header_geos_c_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GEOS_C_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "geos_c.h" "ac_cv_header_geos_c_h" "$ac_includes_default" +if test "x$ac_cv_header_geos_c_h" = xyes +then : + printf "%s\n" "#define HAVE_GEOS_C_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate GEOS includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags ### geos 3.3.6 installs geos_c.lib, see http://osgeo-org.1560.n6.nabble.com/osgeo4w-329-update-geos-to-3-3-6-td5024605.html @@ -9650,8 +10681,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$GEOS_LIBS $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for initGEOS in -lgeos_c" >&5 -$as_echo_n "checking for initGEOS in -lgeos_c... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for initGEOS in -lgeos_c" >&5 +printf %s "checking for initGEOS in -lgeos_c... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lgeos_c $LIBS" @@ -9660,32 +10691,31 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif + builtin and then its argument prototype would still apply. */ char initGEOS (); int -main () +main (void) { return initGEOS (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_geos_c_initGEOS=yes -else +else $as_nop ac_cv_lib_geos_c_initGEOS=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_geos_c_initGEOS" >&5 -$as_echo "$ac_cv_lib_geos_c_initGEOS" >&6; } -if test "x$ac_cv_lib_geos_c_initGEOS" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_geos_c_initGEOS" >&5 +printf "%s\n" "$ac_cv_lib_geos_c_initGEOS" >&6; } +if test "x$ac_cv_lib_geos_c_initGEOS" = xyes +then : GEOS_LIBS="$GEOS_LIBS -lgeos_c " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -9700,7 +10730,7 @@ LDFLAGS=${ac_save_ldflags} # fi -$as_echo "#define HAVE_GEOS 1" >>confdefs.h +printf "%s\n" "#define HAVE_GEOS 1" >>confdefs.h fi @@ -9711,10 +10741,10 @@ fi # Enable TIFF option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use TIFF" >&5 -$as_echo_n "checking whether to use TIFF... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_tiff\"" >&5 -$as_echo "\"$with_tiff\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use TIFF" >&5 +printf %s "checking whether to use TIFF... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_tiff\"" >&5 +printf "%s\n" "\"$with_tiff\"" >&6; } case "$with_tiff" in "no") USE_TIFF= ;; "yes") USE_TIFF="1" ;; @@ -9732,15 +10762,15 @@ if test -n "$USE_TIFF"; then # With TIFF includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of TIFF includes" >&5 -$as_echo_n "checking for location of TIFF includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of TIFF includes" >&5 +printf %s "checking for location of TIFF includes... " >&6; } case "$with_tiff_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-tiff-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_tiff_includes" >&5 -$as_echo "$with_tiff_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_tiff_includes" >&5 +printf "%s\n" "$with_tiff_includes" >&6; } if test -n "$with_tiff_includes" ; then for dir in $with_tiff_includes; do @@ -9756,37 +10786,35 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$TIFF_INCLUDE_DIRS $CPPFLAGS" -for ac_header in tiffio.h + for ac_header in tiffio.h do : - ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" -if test "x$ac_cv_header_tiffio_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_TIFFIO_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" +if test "x$ac_cv_header_tiffio_h" = xyes +then : + printf "%s\n" "#define HAVE_TIFFIO_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate TIFF includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags # With TIFF library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of TIFF library" >&5 -$as_echo_n "checking for location of TIFF library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of TIFF library" >&5 +printf %s "checking for location of TIFF library... " >&6; } case "$with_tiff_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-tiff-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_tiff_libs" >&5 -$as_echo "$with_tiff_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_tiff_libs" >&5 +printf "%s\n" "$with_tiff_libs" >&6; } if test -n "$with_tiff_libs"; then for dir in $with_tiff_libs; do @@ -9810,8 +10838,8 @@ LDFLAGS="$TIFF_LIBRARY_DIRS $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 -$as_echo_n "checking for TIFFOpen in -ltiff... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 +printf %s "checking for TIFFOpen in -ltiff... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff $LIBS" @@ -9821,34 +10849,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char TIFFOpen (); int -main () +main (void) { return TIFFOpen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_tiff_TIFFOpen=yes -else +else $as_nop ac_cv_lib_tiff_TIFFOpen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 -$as_echo "$ac_cv_lib_tiff_TIFFOpen" >&6; } -if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 +printf "%s\n" "$ac_cv_lib_tiff_TIFFOpen" >&6; } +if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes +then : TIFFLIB="$TIFFLIB -ltiff " -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 -$as_echo_n "checking for TIFFOpen in -ltiff... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 +printf %s "checking for TIFFOpen in -ltiff... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff $MATHLIB $LIBS" @@ -9858,34 +10885,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char TIFFOpen (); int -main () +main (void) { return TIFFOpen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_tiff_TIFFOpen=yes -else +else $as_nop ac_cv_lib_tiff_TIFFOpen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 -$as_echo "$ac_cv_lib_tiff_TIFFOpen" >&6; } -if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 +printf "%s\n" "$ac_cv_lib_tiff_TIFFOpen" >&6; } +if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes +then : TIFFLIB="$TIFFLIB -ltiff $MATHLIB" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 -$as_echo_n "checking for TIFFOpen in -ltiff... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 +printf %s "checking for TIFFOpen in -ltiff... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff $ZLIB $LIBS" @@ -9895,34 +10921,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char TIFFOpen (); int -main () +main (void) { return TIFFOpen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_tiff_TIFFOpen=yes -else +else $as_nop ac_cv_lib_tiff_TIFFOpen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 -$as_echo "$ac_cv_lib_tiff_TIFFOpen" >&6; } -if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 +printf "%s\n" "$ac_cv_lib_tiff_TIFFOpen" >&6; } +if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes +then : TIFFLIB="$TIFFLIB -ltiff $ZLIB" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 -$as_echo_n "checking for TIFFOpen in -ltiff... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 +printf %s "checking for TIFFOpen in -ltiff... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff $ZLIB $MATHLIB $LIBS" @@ -9932,34 +10957,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char TIFFOpen (); int -main () +main (void) { return TIFFOpen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_tiff_TIFFOpen=yes -else +else $as_nop ac_cv_lib_tiff_TIFFOpen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 -$as_echo "$ac_cv_lib_tiff_TIFFOpen" >&6; } -if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 +printf "%s\n" "$ac_cv_lib_tiff_TIFFOpen" >&6; } +if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes +then : TIFFLIB="$TIFFLIB -ltiff $ZLIB $MATHLIB" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 -$as_echo_n "checking for TIFFOpen in -ltiff... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 +printf %s "checking for TIFFOpen in -ltiff... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff -ljpeg $LIBS" @@ -9969,34 +10993,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char TIFFOpen (); int -main () +main (void) { return TIFFOpen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_tiff_TIFFOpen=yes -else +else $as_nop ac_cv_lib_tiff_TIFFOpen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 -$as_echo "$ac_cv_lib_tiff_TIFFOpen" >&6; } -if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 +printf "%s\n" "$ac_cv_lib_tiff_TIFFOpen" >&6; } +if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes +then : TIFFLIB="$TIFFLIB -ltiff -ljpeg" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 -$as_echo_n "checking for TIFFOpen in -ltiff... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 +printf %s "checking for TIFFOpen in -ltiff... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff -ljpeg $MATHLIB $LIBS" @@ -10006,34 +11029,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char TIFFOpen (); int -main () +main (void) { return TIFFOpen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_tiff_TIFFOpen=yes -else +else $as_nop ac_cv_lib_tiff_TIFFOpen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 -$as_echo "$ac_cv_lib_tiff_TIFFOpen" >&6; } -if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 +printf "%s\n" "$ac_cv_lib_tiff_TIFFOpen" >&6; } +if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes +then : TIFFLIB="$TIFFLIB -ltiff -ljpeg $MATHLIB" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 -$as_echo_n "checking for TIFFOpen in -ltiff... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 +printf %s "checking for TIFFOpen in -ltiff... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff -ljpeg $ZLIB $LIBS" @@ -10043,34 +11065,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char TIFFOpen (); int -main () +main (void) { return TIFFOpen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_tiff_TIFFOpen=yes -else +else $as_nop ac_cv_lib_tiff_TIFFOpen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 -$as_echo "$ac_cv_lib_tiff_TIFFOpen" >&6; } -if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 +printf "%s\n" "$ac_cv_lib_tiff_TIFFOpen" >&6; } +if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes +then : TIFFLIB="$TIFFLIB -ltiff -ljpeg $ZLIB" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 -$as_echo_n "checking for TIFFOpen in -ltiff... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 +printf %s "checking for TIFFOpen in -ltiff... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff -ljpeg $ZLIB $MATHLIB $LIBS" @@ -10080,31 +11101,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char TIFFOpen (); int -main () +main (void) { return TIFFOpen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_tiff_TIFFOpen=yes -else +else $as_nop ac_cv_lib_tiff_TIFFOpen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 -$as_echo "$ac_cv_lib_tiff_TIFFOpen" >&6; } -if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 +printf "%s\n" "$ac_cv_lib_tiff_TIFFOpen" >&6; } +if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes +then : TIFFLIB="$TIFFLIB -ltiff -ljpeg $ZLIB $MATHLIB" -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -10185,10 +11205,10 @@ fi # $USE_TIFF # Enable PostgreSQL option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use PostgreSQL" >&5 -$as_echo_n "checking whether to use PostgreSQL... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_postgres\"" >&5 -$as_echo "\"$with_postgres\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use PostgreSQL" >&5 +printf %s "checking whether to use PostgreSQL... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_postgres\"" >&5 +printf "%s\n" "\"$with_postgres\"" >&6; } case "$with_postgres" in "no") USE_POSTGRES= ;; "yes") USE_POSTGRES="1" ;; @@ -10199,7 +11219,7 @@ esac if test -n "$USE_POSTGRES"; then -$as_echo "#define HAVE_POSTGRES 1" >>confdefs.h +printf "%s\n" "#define HAVE_POSTGRES 1" >>confdefs.h fi # $USE_POSTGRES @@ -10212,15 +11232,15 @@ if test -n "$USE_POSTGRES"; then # With PostgreSQL includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of PostgreSQL includes" >&5 -$as_echo_n "checking for location of PostgreSQL includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of PostgreSQL includes" >&5 +printf %s "checking for location of PostgreSQL includes... " >&6; } case "$with_postgres_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-postgres-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_postgres_includes" >&5 -$as_echo "$with_postgres_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_postgres_includes" >&5 +printf "%s\n" "$with_postgres_includes" >&6; } if test -n "$with_postgres_includes" ; then for dir in $with_postgres_includes; do @@ -10236,22 +11256,20 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$PQINCPATH $CPPFLAGS" -for ac_header in libpq-fe.h + for ac_header in libpq-fe.h do : - ac_fn_c_check_header_mongrel "$LINENO" "libpq-fe.h" "ac_cv_header_libpq_fe_h" "$ac_includes_default" -if test "x$ac_cv_header_libpq_fe_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPQ_FE_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "libpq-fe.h" "ac_cv_header_libpq_fe_h" "$ac_includes_default" +if test "x$ac_cv_header_libpq_fe_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBPQ_FE_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate PostgreSQL includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags @@ -10262,15 +11280,15 @@ if test -n "$USE_POSTGRES"; then # With PostgreSQL library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of PostgreSQL library" >&5 -$as_echo_n "checking for location of PostgreSQL library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of PostgreSQL library" >&5 +printf %s "checking for location of PostgreSQL library... " >&6; } case "$with_postgres_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-postgres-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_postgres_libs" >&5 -$as_echo "$with_postgres_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_postgres_libs" >&5 +printf "%s\n" "$with_postgres_libs" >&6; } if test -n "$with_postgres_libs"; then for dir in $with_postgres_libs; do @@ -10292,8 +11310,8 @@ LDFLAGS="$PQLIBPATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQsetdbLogin in -lpq" >&5 -$as_echo_n "checking for PQsetdbLogin in -lpq... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PQsetdbLogin in -lpq" >&5 +printf %s "checking for PQsetdbLogin in -lpq... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lpq $LIBS" @@ -10303,34 +11321,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char PQsetdbLogin (); int -main () +main (void) { return PQsetdbLogin (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pq_PQsetdbLogin=yes -else +else $as_nop ac_cv_lib_pq_PQsetdbLogin=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQsetdbLogin" >&5 -$as_echo "$ac_cv_lib_pq_PQsetdbLogin" >&6; } -if test "x$ac_cv_lib_pq_PQsetdbLogin" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQsetdbLogin" >&5 +printf "%s\n" "$ac_cv_lib_pq_PQsetdbLogin" >&6; } +if test "x$ac_cv_lib_pq_PQsetdbLogin" = xyes +then : PQLIB="$PQLIB -lpq " -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQsetdbLogin in -lpq" >&5 -$as_echo_n "checking for PQsetdbLogin in -lpq... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PQsetdbLogin in -lpq" >&5 +printf %s "checking for PQsetdbLogin in -lpq... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lpq -lssl -lcrypto $LIBS" @@ -10340,34 +11357,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char PQsetdbLogin (); int -main () +main (void) { return PQsetdbLogin (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pq_PQsetdbLogin=yes -else +else $as_nop ac_cv_lib_pq_PQsetdbLogin=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQsetdbLogin" >&5 -$as_echo "$ac_cv_lib_pq_PQsetdbLogin" >&6; } -if test "x$ac_cv_lib_pq_PQsetdbLogin" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQsetdbLogin" >&5 +printf "%s\n" "$ac_cv_lib_pq_PQsetdbLogin" >&6; } +if test "x$ac_cv_lib_pq_PQsetdbLogin" = xyes +then : PQLIB="$PQLIB -lpq -lssl -lcrypto" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQsetdbLogin in -lpq" >&5 -$as_echo_n "checking for PQsetdbLogin in -lpq... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PQsetdbLogin in -lpq" >&5 +printf %s "checking for PQsetdbLogin in -lpq... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lpq -lcrypt $LIBS" @@ -10377,34 +11393,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char PQsetdbLogin (); int -main () +main (void) { return PQsetdbLogin (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pq_PQsetdbLogin=yes -else +else $as_nop ac_cv_lib_pq_PQsetdbLogin=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQsetdbLogin" >&5 -$as_echo "$ac_cv_lib_pq_PQsetdbLogin" >&6; } -if test "x$ac_cv_lib_pq_PQsetdbLogin" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQsetdbLogin" >&5 +printf "%s\n" "$ac_cv_lib_pq_PQsetdbLogin" >&6; } +if test "x$ac_cv_lib_pq_PQsetdbLogin" = xyes +then : PQLIB="$PQLIB -lpq -lcrypt" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQsetdbLogin in -lpq" >&5 -$as_echo_n "checking for PQsetdbLogin in -lpq... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PQsetdbLogin in -lpq" >&5 +printf %s "checking for PQsetdbLogin in -lpq... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lpq -lcrypt -lssl -lcrypto $LIBS" @@ -10414,31 +11429,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char PQsetdbLogin (); int -main () +main (void) { return PQsetdbLogin (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pq_PQsetdbLogin=yes -else +else $as_nop ac_cv_lib_pq_PQsetdbLogin=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQsetdbLogin" >&5 -$as_echo "$ac_cv_lib_pq_PQsetdbLogin" >&6; } -if test "x$ac_cv_lib_pq_PQsetdbLogin" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQsetdbLogin" >&5 +printf "%s\n" "$ac_cv_lib_pq_PQsetdbLogin" >&6; } +if test "x$ac_cv_lib_pq_PQsetdbLogin" = xyes +then : PQLIB="$PQLIB -lpq -lcrypt -lssl -lcrypto" -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -10478,8 +11492,8 @@ LDFLAGS=${ac_save_ldflags} ac_save_ldflags="$LDFLAGS" LDFLAGS="$LDFLAGS $PQLIBPATH" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQcmdTuples in -lpq" >&5 -$as_echo_n "checking for PQcmdTuples in -lpq... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PQcmdTuples in -lpq" >&5 +printf %s "checking for PQcmdTuples in -lpq... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lpq $LIBS" @@ -10489,36 +11503,35 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char PQcmdTuples (); int -main () +main (void) { return PQcmdTuples (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pq_PQcmdTuples=yes -else +else $as_nop ac_cv_lib_pq_PQcmdTuples=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQcmdTuples" >&5 -$as_echo "$ac_cv_lib_pq_PQcmdTuples" >&6; } -if test "x$ac_cv_lib_pq_PQcmdTuples" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQcmdTuples" >&5 +printf "%s\n" "$ac_cv_lib_pq_PQcmdTuples" >&6; } +if test "x$ac_cv_lib_pq_PQcmdTuples" = xyes +then : -$as_echo "#define HAVE_PQCMDTUPLES 1" >>confdefs.h +printf "%s\n" "#define HAVE_PQCMDTUPLES 1" >>confdefs.h -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQcmdTuples in -lpq" >&5 -$as_echo_n "checking for PQcmdTuples in -lpq... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PQcmdTuples in -lpq" >&5 +printf %s "checking for PQcmdTuples in -lpq... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lpq -lcrypt $LIBS" @@ -10528,31 +11541,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char PQcmdTuples (); int -main () +main (void) { return PQcmdTuples (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pq_PQcmdTuples=yes -else +else $as_nop ac_cv_lib_pq_PQcmdTuples=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQcmdTuples" >&5 -$as_echo "$ac_cv_lib_pq_PQcmdTuples" >&6; } -if test "x$ac_cv_lib_pq_PQcmdTuples" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQcmdTuples" >&5 +printf "%s\n" "$ac_cv_lib_pq_PQcmdTuples" >&6; } +if test "x$ac_cv_lib_pq_PQcmdTuples" = xyes +then : -$as_echo "#define HAVE_PQCMDTUPLES 1" >>confdefs.h +printf "%s\n" "#define HAVE_PQCMDTUPLES 1" >>confdefs.h fi @@ -10574,10 +11586,10 @@ fi # $USE_POSTGRES # Enable MySQL option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use MySQL" >&5 -$as_echo_n "checking whether to use MySQL... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_mysql\"" >&5 -$as_echo "\"$with_mysql\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use MySQL" >&5 +printf %s "checking whether to use MySQL... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_mysql\"" >&5 +printf "%s\n" "\"$with_mysql\"" >&6; } case "$with_mysql" in "no") USE_MYSQL= ;; "yes") USE_MYSQL="1" ;; @@ -10595,15 +11607,15 @@ if test -n "$USE_MYSQL"; then # With MySQL includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of MySQL includes" >&5 -$as_echo_n "checking for location of MySQL includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of MySQL includes" >&5 +printf %s "checking for location of MySQL includes... " >&6; } case "$with_mysql_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-mysql-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_mysql_includes" >&5 -$as_echo "$with_mysql_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_mysql_includes" >&5 +printf "%s\n" "$with_mysql_includes" >&6; } if test -n "$with_mysql_includes" ; then for dir in $with_mysql_includes; do @@ -10619,22 +11631,20 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$MYSQLINCPATH $CPPFLAGS" -for ac_header in mysql.h + for ac_header in mysql.h do : - ac_fn_c_check_header_mongrel "$LINENO" "mysql.h" "ac_cv_header_mysql_h" "$ac_includes_default" -if test "x$ac_cv_header_mysql_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MYSQL_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "mysql.h" "ac_cv_header_mysql_h" "$ac_includes_default" +if test "x$ac_cv_header_mysql_h" = xyes +then : + printf "%s\n" "#define HAVE_MYSQL_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate MySQL includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags @@ -10644,15 +11654,15 @@ if test -n "$USE_MYSQL"; then # With MySQL library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of MySQL library" >&5 -$as_echo_n "checking for location of MySQL library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of MySQL library" >&5 +printf %s "checking for location of MySQL library... " >&6; } case "$with_mysql_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-mysql-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_mysql_libs" >&5 -$as_echo "$with_mysql_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_mysql_libs" >&5 +printf "%s\n" "$with_mysql_libs" >&6; } if test -n "$with_mysql_libs"; then for dir in $with_mysql_libs; do @@ -10676,8 +11686,8 @@ LDFLAGS="$MYSQLLIBPATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 -$as_echo_n "checking for mysql_query in -lmysqlclient... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 +printf %s "checking for mysql_query in -lmysqlclient... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lmysqlclient $LIBS" @@ -10687,34 +11697,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char mysql_query (); int -main () +main (void) { return mysql_query (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_mysqlclient_mysql_query=yes -else +else $as_nop ac_cv_lib_mysqlclient_mysql_query=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 -$as_echo "$ac_cv_lib_mysqlclient_mysql_query" >&6; } -if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 +printf "%s\n" "$ac_cv_lib_mysqlclient_mysql_query" >&6; } +if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes +then : MYSQLLIB="$MYSQLLIB -lmysqlclient " -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 -$as_echo_n "checking for mysql_query in -lmysqlclient... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 +printf %s "checking for mysql_query in -lmysqlclient... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lmysqlclient $MATHLIB $LIBS" @@ -10724,34 +11733,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char mysql_query (); int -main () +main (void) { return mysql_query (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_mysqlclient_mysql_query=yes -else +else $as_nop ac_cv_lib_mysqlclient_mysql_query=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 -$as_echo "$ac_cv_lib_mysqlclient_mysql_query" >&6; } -if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 +printf "%s\n" "$ac_cv_lib_mysqlclient_mysql_query" >&6; } +if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes +then : MYSQLLIB="$MYSQLLIB -lmysqlclient $MATHLIB" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 -$as_echo_n "checking for mysql_query in -lmysqlclient... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 +printf %s "checking for mysql_query in -lmysqlclient... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lmysqlclient $SOCKLIB $LIBS" @@ -10761,34 +11769,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char mysql_query (); int -main () +main (void) { return mysql_query (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_mysqlclient_mysql_query=yes -else +else $as_nop ac_cv_lib_mysqlclient_mysql_query=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 -$as_echo "$ac_cv_lib_mysqlclient_mysql_query" >&6; } -if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 +printf "%s\n" "$ac_cv_lib_mysqlclient_mysql_query" >&6; } +if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes +then : MYSQLLIB="$MYSQLLIB -lmysqlclient $SOCKLIB" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 -$as_echo_n "checking for mysql_query in -lmysqlclient... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 +printf %s "checking for mysql_query in -lmysqlclient... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lmysqlclient $SOCKLIB $MATHLIB $LIBS" @@ -10798,34 +11805,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char mysql_query (); int -main () +main (void) { return mysql_query (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_mysqlclient_mysql_query=yes -else +else $as_nop ac_cv_lib_mysqlclient_mysql_query=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 -$as_echo "$ac_cv_lib_mysqlclient_mysql_query" >&6; } -if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 +printf "%s\n" "$ac_cv_lib_mysqlclient_mysql_query" >&6; } +if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes +then : MYSQLLIB="$MYSQLLIB -lmysqlclient $SOCKLIB $MATHLIB" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 -$as_echo_n "checking for mysql_query in -lmysqlclient... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 +printf %s "checking for mysql_query in -lmysqlclient... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lmysqlclient $ZLIB $LIBS" @@ -10835,34 +11841,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char mysql_query (); int -main () +main (void) { return mysql_query (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_mysqlclient_mysql_query=yes -else +else $as_nop ac_cv_lib_mysqlclient_mysql_query=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 -$as_echo "$ac_cv_lib_mysqlclient_mysql_query" >&6; } -if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 +printf "%s\n" "$ac_cv_lib_mysqlclient_mysql_query" >&6; } +if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes +then : MYSQLLIB="$MYSQLLIB -lmysqlclient $ZLIB" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 -$as_echo_n "checking for mysql_query in -lmysqlclient... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 +printf %s "checking for mysql_query in -lmysqlclient... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lmysqlclient $ZLIB $MATHLIB $LIBS" @@ -10872,34 +11877,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char mysql_query (); int -main () +main (void) { return mysql_query (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_mysqlclient_mysql_query=yes -else +else $as_nop ac_cv_lib_mysqlclient_mysql_query=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 -$as_echo "$ac_cv_lib_mysqlclient_mysql_query" >&6; } -if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 +printf "%s\n" "$ac_cv_lib_mysqlclient_mysql_query" >&6; } +if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes +then : MYSQLLIB="$MYSQLLIB -lmysqlclient $ZLIB $MATHLIB" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 -$as_echo_n "checking for mysql_query in -lmysqlclient... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 +printf %s "checking for mysql_query in -lmysqlclient... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lmysqlclient $ZLIB $SOCKLIB $LIBS" @@ -10909,34 +11913,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char mysql_query (); int -main () +main (void) { return mysql_query (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_mysqlclient_mysql_query=yes -else +else $as_nop ac_cv_lib_mysqlclient_mysql_query=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 -$as_echo "$ac_cv_lib_mysqlclient_mysql_query" >&6; } -if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 +printf "%s\n" "$ac_cv_lib_mysqlclient_mysql_query" >&6; } +if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes +then : MYSQLLIB="$MYSQLLIB -lmysqlclient $ZLIB $SOCKLIB" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 -$as_echo_n "checking for mysql_query in -lmysqlclient... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_query in -lmysqlclient" >&5 +printf %s "checking for mysql_query in -lmysqlclient... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lmysqlclient $ZLIB $SOCKLIB $MATHLIB $LIBS" @@ -10946,31 +11949,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char mysql_query (); int -main () +main (void) { return mysql_query (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_mysqlclient_mysql_query=yes -else +else $as_nop ac_cv_lib_mysqlclient_mysql_query=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 -$as_echo "$ac_cv_lib_mysqlclient_mysql_query" >&6; } -if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 +printf "%s\n" "$ac_cv_lib_mysqlclient_mysql_query" >&6; } +if test "x$ac_cv_lib_mysqlclient_mysql_query" = xyes +then : MYSQLLIB="$MYSQLLIB -lmysqlclient $ZLIB $SOCKLIB $MATHLIB" -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -11043,8 +12045,8 @@ LDFLAGS=${ac_save_ldflags} # Check for libmysqld (for embedded version of the driver) # Extract the first word of "mysql_config", so it can be a program name with args. set dummy mysql_config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } case $MYSQLD_CONFIG in [\\/]* | ?:[\\/]*) @@ -11055,11 +12057,15 @@ case $MYSQLD_CONFIG in for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MYSQLD_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_MYSQLD_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11071,11 +12077,11 @@ IFS=$as_save_IFS esac MYSQLD_CONFIG=$ac_cv_path_MYSQLD_CONFIG if test -n "$MYSQLD_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQLD_CONFIG" >&5 -$as_echo "$MYSQLD_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MYSQLD_CONFIG" >&5 +printf "%s\n" "$MYSQLD_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -11096,12 +12102,13 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu LIBS="$MYSQLDLIB $LIBS" ac_fn_cxx_check_func "$LINENO" "mysql_server_init" "ac_cv_func_mysql_server_init" -if test "x$ac_cv_func_mysql_server_init" = xyes; then : +if test "x$ac_cv_func_mysql_server_init" = xyes +then : -else +else $as_nop MYSQLDLIB=""; - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libmysqld not found" >&5 -$as_echo "$as_me: WARNING: libmysqld not found" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libmysqld not found" >&5 +printf "%s\n" "$as_me: WARNING: libmysqld not found" >&2;} fi LIBS=$ac_save_libs @@ -11127,10 +12134,10 @@ fi # $USE_MYSQL # Enable SQLite option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use SQLite" >&5 -$as_echo_n "checking whether to use SQLite... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_sqlite\"" >&5 -$as_echo "\"$with_sqlite\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use SQLite" >&5 +printf %s "checking whether to use SQLite... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_sqlite\"" >&5 +printf "%s\n" "\"$with_sqlite\"" >&6; } case "$with_sqlite" in "no") USE_SQLITE= ;; "yes") USE_SQLITE="1" ;; @@ -11148,15 +12155,15 @@ if test -n "$USE_SQLITE"; then # With SQLite includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of SQLite includes" >&5 -$as_echo_n "checking for location of SQLite includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of SQLite includes" >&5 +printf %s "checking for location of SQLite includes... " >&6; } case "$with_sqlite_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-sqlite-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sqlite_includes" >&5 -$as_echo "$with_sqlite_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sqlite_includes" >&5 +printf "%s\n" "$with_sqlite_includes" >&6; } if test -n "$with_sqlite_includes" ; then for dir in $with_sqlite_includes; do @@ -11172,27 +12179,25 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$SQLITEINCPATH $CPPFLAGS" -for ac_header in sqlite3.h + for ac_header in sqlite3.h do : - ac_fn_c_check_header_mongrel "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default" -if test "x$ac_cv_header_sqlite3_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SQLITE3_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default" +if test "x$ac_cv_header_sqlite3_h" = xyes +then : + printf "%s\n" "#define HAVE_SQLITE3_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate SQLite includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags -$as_echo "#define HAVE_SQLITE 1" >>confdefs.h +printf "%s\n" "#define HAVE_SQLITE 1" >>confdefs.h fi # $USE_SQLITE @@ -11202,15 +12207,15 @@ if test -n "$USE_SQLITE"; then # With SQLite library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of SQLite library" >&5 -$as_echo_n "checking for location of SQLite library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of SQLite library" >&5 +printf %s "checking for location of SQLite library... " >&6; } case "$with_sqlite_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-sqlite-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sqlite_libs" >&5 -$as_echo "$with_sqlite_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sqlite_libs" >&5 +printf "%s\n" "$with_sqlite_libs" >&6; } if test -n "$with_sqlite_libs"; then for dir in $with_sqlite_libs; do @@ -11232,8 +12237,8 @@ LDFLAGS="$SQLITELIBPATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 -$as_echo_n "checking for sqlite3_open in -lsqlite3... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 +printf %s "checking for sqlite3_open in -lsqlite3... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lsqlite3 $LIBS" @@ -11243,34 +12248,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char sqlite3_open (); int -main () +main (void) { return sqlite3_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_sqlite3_sqlite3_open=yes -else +else $as_nop ac_cv_lib_sqlite3_sqlite3_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 -$as_echo "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } -if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 +printf "%s\n" "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } +if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes +then : SQLITELIB="$SQLITELIB -lsqlite3 " -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 -$as_echo_n "checking for sqlite3_open in -lsqlite3... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 +printf %s "checking for sqlite3_open in -lsqlite3... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lsqlite3 $DLLIB $LIBS" @@ -11280,34 +12284,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char sqlite3_open (); int -main () +main (void) { return sqlite3_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_sqlite3_sqlite3_open=yes -else +else $as_nop ac_cv_lib_sqlite3_sqlite3_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 -$as_echo "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } -if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 +printf "%s\n" "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } +if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes +then : SQLITELIB="$SQLITELIB -lsqlite3 $DLLIB" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 -$as_echo_n "checking for sqlite3_open in -lsqlite3... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 +printf %s "checking for sqlite3_open in -lsqlite3... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lsqlite3 $MATHLIB $LIBS" @@ -11317,34 +12320,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char sqlite3_open (); int -main () +main (void) { return sqlite3_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_sqlite3_sqlite3_open=yes -else +else $as_nop ac_cv_lib_sqlite3_sqlite3_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 -$as_echo "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } -if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 +printf "%s\n" "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } +if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes +then : SQLITELIB="$SQLITELIB -lsqlite3 $MATHLIB" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 -$as_echo_n "checking for sqlite3_open in -lsqlite3... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 +printf %s "checking for sqlite3_open in -lsqlite3... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lsqlite3 $MATHLIB $DLLIB $LIBS" @@ -11354,31 +12356,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char sqlite3_open (); int -main () +main (void) { return sqlite3_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_sqlite3_sqlite3_open=yes -else +else $as_nop ac_cv_lib_sqlite3_sqlite3_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 -$as_echo "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } -if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 +printf "%s\n" "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } +if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes +then : SQLITELIB="$SQLITELIB -lsqlite3 $MATHLIB $DLLIB" -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -11436,10 +12437,10 @@ OPENGL_X11= OPENGL_AQUA= OPENGL_WINDOWS= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use OpenGL" >&5 -$as_echo_n "checking whether to use OpenGL... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_opengl\"" >&5 -$as_echo "\"$with_opengl\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use OpenGL" >&5 +printf %s "checking whether to use OpenGL... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_opengl\"" >&5 +printf "%s\n" "\"$with_opengl\"" >&6; } case "$with_opengl" in n|no) OPENGL_TYPE=none @@ -11471,15 +12472,15 @@ if test "$OPENGL_X11" = 1 ; then # With OpenGL includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of OpenGL includes" >&5 -$as_echo_n "checking for location of OpenGL includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of OpenGL includes" >&5 +printf %s "checking for location of OpenGL includes... " >&6; } case "$with_opengl_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-opengl-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_opengl_includes" >&5 -$as_echo "$with_opengl_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_opengl_includes" >&5 +printf "%s\n" "$with_opengl_includes" >&6; } if test -n "$with_opengl_includes" ; then for dir in $with_opengl_includes; do @@ -11495,38 +12496,38 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$OPENGLINC $X_CFLAGS $CPPFLAGS" -for ac_header in GL/gl.h GL/glu.h + for ac_header in GL/gl.h GL/glu.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_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 `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -else +else $as_nop as_fn_error $? "*** Unable to locate OpenGL includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags # With OpenGL library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of OpenGL library" >&5 -$as_echo_n "checking for location of OpenGL library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of OpenGL library" >&5 +printf %s "checking for location of OpenGL library... " >&6; } case "$with_opengl_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-opengl-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_opengl_libs" >&5 -$as_echo "$with_opengl_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_opengl_libs" >&5 +printf "%s\n" "$with_opengl_libs" >&6; } if test -n "$with_opengl_libs"; then for dir in $with_opengl_libs; do @@ -11548,8 +12549,8 @@ LDFLAGS="$OPENGL_LIB_PATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glBegin in -lGL" >&5 -$as_echo_n "checking for glBegin in -lGL... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for glBegin in -lGL" >&5 +printf %s "checking for glBegin in -lGL... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lGL $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB $LIBS" @@ -11559,34 +12560,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char glBegin (); int -main () +main (void) { return glBegin (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_GL_glBegin=yes -else +else $as_nop ac_cv_lib_GL_glBegin=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glBegin" >&5 -$as_echo "$ac_cv_lib_GL_glBegin" >&6; } -if test "x$ac_cv_lib_GL_glBegin" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glBegin" >&5 +printf "%s\n" "$ac_cv_lib_GL_glBegin" >&6; } +if test "x$ac_cv_lib_GL_glBegin" = xyes +then : OPENGLLIB="$OPENGLLIB -lGL " -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glBegin in -lGL" >&5 -$as_echo_n "checking for glBegin in -lGL... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for glBegin in -lGL" >&5 +printf %s "checking for glBegin in -lGL... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lGL $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB -lXext $LIBS" @@ -11596,34 +12596,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char glBegin (); int -main () +main (void) { return glBegin (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_GL_glBegin=yes -else +else $as_nop ac_cv_lib_GL_glBegin=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glBegin" >&5 -$as_echo "$ac_cv_lib_GL_glBegin" >&6; } -if test "x$ac_cv_lib_GL_glBegin" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glBegin" >&5 +printf "%s\n" "$ac_cv_lib_GL_glBegin" >&6; } +if test "x$ac_cv_lib_GL_glBegin" = xyes +then : OPENGLLIB="$OPENGLLIB -lGL -lXext" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glBegin in -lGL" >&5 -$as_echo_n "checking for glBegin in -lGL... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for glBegin in -lGL" >&5 +printf %s "checking for glBegin in -lGL... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lGL $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB -lpthread $LIBS" @@ -11633,34 +12632,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char glBegin (); int -main () +main (void) { return glBegin (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_GL_glBegin=yes -else +else $as_nop ac_cv_lib_GL_glBegin=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glBegin" >&5 -$as_echo "$ac_cv_lib_GL_glBegin" >&6; } -if test "x$ac_cv_lib_GL_glBegin" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glBegin" >&5 +printf "%s\n" "$ac_cv_lib_GL_glBegin" >&6; } +if test "x$ac_cv_lib_GL_glBegin" = xyes +then : OPENGLLIB="$OPENGLLIB -lGL -lpthread" -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glBegin in -lGL" >&5 -$as_echo_n "checking for glBegin in -lGL... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for glBegin in -lGL" >&5 +printf %s "checking for glBegin in -lGL... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lGL $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB -lpthread -lXext $LIBS" @@ -11670,31 +12668,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char glBegin (); int -main () +main (void) { return glBegin (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_GL_glBegin=yes -else +else $as_nop ac_cv_lib_GL_glBegin=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glBegin" >&5 -$as_echo "$ac_cv_lib_GL_glBegin" >&6; } -if test "x$ac_cv_lib_GL_glBegin" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glBegin" >&5 +printf "%s\n" "$ac_cv_lib_GL_glBegin" >&6; } +if test "x$ac_cv_lib_GL_glBegin" = xyes +then : OPENGLLIB="$OPENGLLIB -lGL -lpthread -lXext" -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -11739,8 +12736,8 @@ LDFLAGS="$OPENGL_LIB_PATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gluBeginCurve in -lGLU" >&5 -$as_echo_n "checking for gluBeginCurve in -lGLU... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gluBeginCurve in -lGLU" >&5 +printf %s "checking for gluBeginCurve in -lGLU... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lGLU $OPENGLLIB $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB $LIBS" @@ -11750,34 +12747,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char gluBeginCurve (); int -main () +main (void) { return gluBeginCurve (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_GLU_gluBeginCurve=yes -else +else $as_nop ac_cv_lib_GLU_gluBeginCurve=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_gluBeginCurve" >&5 -$as_echo "$ac_cv_lib_GLU_gluBeginCurve" >&6; } -if test "x$ac_cv_lib_GLU_gluBeginCurve" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_gluBeginCurve" >&5 +printf "%s\n" "$ac_cv_lib_GLU_gluBeginCurve" >&6; } +if test "x$ac_cv_lib_GLU_gluBeginCurve" = xyes +then : OPENGLULIB="$OPENGLULIB -lGLU " -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gluBeginCurve in -lGLU" >&5 -$as_echo_n "checking for gluBeginCurve in -lGLU... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gluBeginCurve in -lGLU" >&5 +printf %s "checking for gluBeginCurve in -lGLU... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lGLU $OPENGLLIB $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB -lstdc++ $LIBS" @@ -11787,31 +12783,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char gluBeginCurve (); int -main () +main (void) { return gluBeginCurve (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_GLU_gluBeginCurve=yes -else +else $as_nop ac_cv_lib_GLU_gluBeginCurve=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_gluBeginCurve" >&5 -$as_echo "$ac_cv_lib_GLU_gluBeginCurve" >&6; } -if test "x$ac_cv_lib_GLU_gluBeginCurve" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_gluBeginCurve" >&5 +printf "%s\n" "$ac_cv_lib_GLU_gluBeginCurve" >&6; } +if test "x$ac_cv_lib_GLU_gluBeginCurve" = xyes +then : OPENGLULIB="$OPENGLULIB -lGLU -lstdc++" -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -11842,13 +12837,14 @@ ac_save_ldflags="$LDFLAGS" LIBS=" $OPENGLLIB $LIBS" LDFLAGS=" $LDFLAGS" ac_fn_c_check_func "$LINENO" "glXCreatePbuffer" "ac_cv_func_glXCreatePbuffer" -if test "x$ac_cv_func_glXCreatePbuffer" = xyes; then : +if test "x$ac_cv_func_glXCreatePbuffer" = xyes +then : -$as_echo "#define HAVE_PBUFFERS 1" >>confdefs.h +printf "%s\n" "#define HAVE_PBUFFERS 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate glXCreatePbuffer." "$LINENO" 5 @@ -11865,13 +12861,14 @@ ac_save_ldflags="$LDFLAGS" LIBS=" $OPENGLLIB $LIBS" LDFLAGS=" $LDFLAGS" ac_fn_c_check_func "$LINENO" "glXCreateGLXPixmap" "ac_cv_func_glXCreateGLXPixmap" -if test "x$ac_cv_func_glXCreateGLXPixmap" = xyes; then : +if test "x$ac_cv_func_glXCreateGLXPixmap" = xyes +then : -$as_echo "#define HAVE_PIXMAPS 1" >>confdefs.h +printf "%s\n" "#define HAVE_PIXMAPS 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate glXCreateGLXPixmap." "$LINENO" 5 @@ -11884,7 +12881,7 @@ LDFLAGS=${ac_save_ldflags} -$as_echo "#define OPENGL_X11 1" >>confdefs.h +printf "%s\n" "#define OPENGL_X11 1" >>confdefs.h fi # $OPENGL_X11 @@ -11892,15 +12889,15 @@ fi # $OPENGL_X11 if test "$OPENGL_AQUA" = 1 ; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of OpenGL framework" >&5 -$as_echo_n "checking for location of OpenGL framework... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of OpenGL framework" >&5 +printf %s "checking for location of OpenGL framework... " >&6; } case "$with_opengl_framework" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-opengl-framework." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_opengl_framework" >&5 -$as_echo "$with_opengl_framework" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_opengl_framework" >&5 +printf "%s\n" "$with_opengl_framework" >&6; } if test -n "$with_opengl_framework"; then if test -d $with_opengl_framework; then @@ -11914,23 +12911,23 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$OPENGLPATH $CPPFLAGS" -for ac_header in OpenGL/gl.h OpenGL/glu.h + for ac_header in OpenGL/gl.h OpenGL/glu.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_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 `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -else +else $as_nop as_fn_error $? "*** Unable to locate OpenGL includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags @@ -11940,13 +12937,14 @@ ac_save_ldflags="$LDFLAGS" LIBS="-framework OpenGL -framework AGL -framework ApplicationServices $LIBS" LDFLAGS="$OPENGLPATH $LDFLAGS" ac_fn_c_check_func "$LINENO" "glBegin" "ac_cv_func_glBegin" -if test "x$ac_cv_func_glBegin" = xyes; then : +if test "x$ac_cv_func_glBegin" = xyes +then : OPENGLLIB="$OPENGLLIB -framework OpenGL -framework AGL -framework ApplicationServices" -else +else $as_nop as_fn_error $? "*** Unable to locate OpenGL library." "$LINENO" 5 @@ -11964,13 +12962,14 @@ ac_save_ldflags="$LDFLAGS" LIBS=" $OPENGLLIB $LIBS" LDFLAGS="$OPENGLPATH $LDFLAGS" ac_fn_c_check_func "$LINENO" "gluBeginCurve" "ac_cv_func_gluBeginCurve" -if test "x$ac_cv_func_gluBeginCurve" = xyes; then : +if test "x$ac_cv_func_gluBeginCurve" = xyes +then : OPENGLLIB="$OPENGLLIB " -else +else $as_nop as_fn_error $? "*** Unable to locate GLU library." "$LINENO" 5 @@ -11987,7 +12986,7 @@ OPENGLINC="$OPENGLPATH" OPENGLLIBPATH="$OPENGLPATH" -$as_echo "#define OPENGL_AQUA 1" >>confdefs.h +printf "%s\n" "#define OPENGL_AQUA 1" >>confdefs.h fi # $OPENGL_AQUA @@ -11997,15 +12996,15 @@ if test "$OPENGL_WINDOWS" = 1 ; then # With OpenGL includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of OpenGL includes" >&5 -$as_echo_n "checking for location of OpenGL includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of OpenGL includes" >&5 +printf %s "checking for location of OpenGL includes... " >&6; } case "$with_opengl_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-opengl-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_opengl_includes" >&5 -$as_echo "$with_opengl_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_opengl_includes" >&5 +printf "%s\n" "$with_opengl_includes" >&6; } if test -n "$with_opengl_includes" ; then for dir in $with_opengl_includes; do @@ -12021,38 +13020,38 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$OPENGLINC $CPPFLAGS" -for ac_header in GL/gl.h GL/glu.h + for ac_header in GL/gl.h GL/glu.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_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 `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -else +else $as_nop as_fn_error $? "*** Unable to locate OpenGL includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags # With OpenGL library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of OpenGL library" >&5 -$as_echo_n "checking for location of OpenGL library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of OpenGL library" >&5 +printf %s "checking for location of OpenGL library... " >&6; } case "$with_opengl_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-opengl-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_opengl_libs" >&5 -$as_echo "$with_opengl_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_opengl_libs" >&5 +printf "%s\n" "$with_opengl_libs" >&6; } if test -n "$with_opengl_libs"; then for dir in $with_opengl_libs; do @@ -12070,35 +13069,36 @@ CFLAGS="$CFLAGS $OPENGLINC" ac_save_ldflags="$LDFLAGS" ac_save_libs="$LIBS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL library" >&5 -$as_echo_n "checking for OpenGL library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenGL library" >&5 +printf %s "checking for OpenGL library... " >&6; } LDFLAGS="$OPENGL_LIB_PATH $LDFLAGS" LIBS="-lopengl32 " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { glEnd(); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } OPENGLLIB="$OPENGLLIB -lopengl32 " -else +else $as_nop as_fn_error $? "*** Unable to locate OpenGL library." "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=${ac_save_libs} LDFLAGS=${ac_save_ldflags} @@ -12106,35 +13106,36 @@ LDFLAGS=${ac_save_ldflags} ac_save_ldflags="$LDFLAGS" ac_save_libs="$LIBS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLU library" >&5 -$as_echo_n "checking for GLU library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GLU library" >&5 +printf %s "checking for GLU library... " >&6; } LDFLAGS="$OPENGL_LIB_PATH $LDFLAGS" LIBS="-lglu32 $OPENGLLIB " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { gluNewQuadric(); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } OPENGLULIB="$OPENGLULIB -lglu32 " -else +else $as_nop as_fn_error $? "*** Unable to locate GLU library." "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=${ac_save_libs} LDFLAGS=${ac_save_ldflags} @@ -12145,7 +13146,7 @@ OPENGLLIB="$OPENGL_LIB_PATH $OPENGLLIB" OPENGLULIB="$OPENGL_LIB_PATH $OPENGLULIB" -$as_echo "#define OPENGL_WINDOWS 1" >>confdefs.h +printf "%s\n" "#define OPENGL_WINDOWS 1" >>confdefs.h fi # $OPENGL_WINDOWS @@ -12166,10 +13167,10 @@ fi # $USE_OPENGL # Enable ODBC option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use ODBC" >&5 -$as_echo_n "checking whether to use ODBC... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_odbc\"" >&5 -$as_echo "\"$with_odbc\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use ODBC" >&5 +printf %s "checking whether to use ODBC... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_odbc\"" >&5 +printf "%s\n" "\"$with_odbc\"" >&6; } case "$with_odbc" in "no") USE_ODBC= ;; "yes") USE_ODBC="1" ;; @@ -12186,15 +13187,15 @@ if test -n "$USE_ODBC"; then # With ODBC includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of ODBC includes" >&5 -$as_echo_n "checking for location of ODBC includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of ODBC includes" >&5 +printf %s "checking for location of ODBC includes... " >&6; } case "$with_odbc_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-odbc-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_odbc_includes" >&5 -$as_echo "$with_odbc_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_odbc_includes" >&5 +printf "%s\n" "$with_odbc_includes" >&6; } if test -n "$with_odbc_includes" ; then for dir in $with_odbc_includes; do @@ -12207,15 +13208,15 @@ if test -n "$with_odbc_includes" ; then fi -ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" -if test "x$ac_cv_header_windows_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = xyes +then : -$as_echo "#define HAVE_WINDOWS_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_WINDOWS_H 1" >>confdefs.h fi - ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$ODBCINC $CPPFLAGS" ac_fn_c_check_header_compile "$LINENO" "sql.h" "ac_cv_header_sql_h" "#if defined(HAVE_WINDOWS_H) @@ -12223,29 +13224,29 @@ ac_fn_c_check_header_compile "$LINENO" "sql.h" "ac_cv_header_sql_h" "#if defined #endif " -if test "x$ac_cv_header_sql_h" = xyes; then : +if test "x$ac_cv_header_sql_h" = xyes +then : -$as_echo "#define HAVE_SQL_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_SQL_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate ." "$LINENO" 5 fi - CPPFLAGS=$ac_save_cppflags # With ODBC library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of ODBC library" >&5 -$as_echo_n "checking for location of ODBC library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of ODBC library" >&5 +printf %s "checking for location of ODBC library... " >&6; } case "$with_odbc_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-odbc-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_odbc_libs" >&5 -$as_echo "$with_odbc_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_odbc_libs" >&5 +printf "%s\n" "$with_odbc_libs" >&6; } if test -n "$with_odbc_libs"; then for dir in $with_odbc_libs; do @@ -12263,8 +13264,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$ODBCLIB $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLConnect in -lodbc" >&5 -$as_echo_n "checking for SQLConnect in -lodbc... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SQLConnect in -lodbc" >&5 +printf %s "checking for SQLConnect in -lodbc... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lodbc $ICONVLIB $LIBS" @@ -12274,31 +13275,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char SQLConnect (); int -main () +main (void) { return SQLConnect (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_odbc_SQLConnect=yes -else +else $as_nop ac_cv_lib_odbc_SQLConnect=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odbc_SQLConnect" >&5 -$as_echo "$ac_cv_lib_odbc_SQLConnect" >&6; } -if test "x$ac_cv_lib_odbc_SQLConnect" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odbc_SQLConnect" >&5 +printf "%s\n" "$ac_cv_lib_odbc_SQLConnect" >&6; } +if test "x$ac_cv_lib_odbc_SQLConnect" = xyes +then : ODBCLIB="$ODBCLIB -lodbc " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -12306,8 +13306,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$ODBCLIB $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLConnect in -liodbc" >&5 -$as_echo_n "checking for SQLConnect in -liodbc... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SQLConnect in -liodbc" >&5 +printf %s "checking for SQLConnect in -liodbc... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-liodbc $LIBS" @@ -12317,31 +13317,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char SQLConnect (); int -main () +main (void) { return SQLConnect (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_iodbc_SQLConnect=yes -else +else $as_nop ac_cv_lib_iodbc_SQLConnect=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iodbc_SQLConnect" >&5 -$as_echo "$ac_cv_lib_iodbc_SQLConnect" >&6; } -if test "x$ac_cv_lib_iodbc_SQLConnect" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iodbc_SQLConnect" >&5 +printf "%s\n" "$ac_cv_lib_iodbc_SQLConnect" >&6; } +if test "x$ac_cv_lib_iodbc_SQLConnect" = xyes +then : ODBCLIB="$ODBCLIB -liodbc " -else +else $as_nop LDFLAGS=${ac_save_ldflags} ac_save_cflags="$CFLAGS" @@ -12349,8 +13348,8 @@ CFLAGS="$CFLAGS $ODBCINC" ac_save_ldflags="$LDFLAGS" ac_save_libs="$LIBS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ODBC library" >&5 -$as_echo_n "checking for ODBC library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ODBC library" >&5 +printf %s "checking for ODBC library... " >&6; } LDFLAGS="$ODBCLIB $LDFLAGS" LIBS="-lodbc32 " cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12358,27 +13357,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #include #include int -main () +main (void) { SQLAllocEnv((SQLHENV *)0); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } ODBCLIB="$ODBCLIB -lodbc32 " -else +else $as_nop as_fn_error $? "*** Unable to locate ODBC library." "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=${ac_save_libs} LDFLAGS=${ac_save_ldflags} @@ -12411,10 +13411,10 @@ fi # $USE_ODBC # Enable FFTW option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use FFTW" >&5 -$as_echo_n "checking whether to use FFTW... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_fftw\"" >&5 -$as_echo "\"$with_fftw\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use FFTW" >&5 +printf %s "checking whether to use FFTW... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_fftw\"" >&5 +printf "%s\n" "\"$with_fftw\"" >&6; } case "$with_fftw" in "no") USE_FFTW= ;; "yes") USE_FFTW="1" ;; @@ -12431,15 +13431,15 @@ if test -n "$USE_FFTW"; then # With FFTW includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of FFTW includes" >&5 -$as_echo_n "checking for location of FFTW includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of FFTW includes" >&5 +printf %s "checking for location of FFTW includes... " >&6; } case "$with_fftw_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-fftw-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_fftw_includes" >&5 -$as_echo "$with_fftw_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_fftw_includes" >&5 +printf "%s\n" "$with_fftw_includes" >&6; } if test -n "$with_fftw_includes" ; then for dir in $with_fftw_includes; do @@ -12455,75 +13455,69 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$FFTWINC $CPPFLAGS" -for ac_header in fftw3.h + for ac_header in fftw3.h do : - ac_fn_c_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default" -if test "x$ac_cv_header_fftw3_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FFTW3_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default" +if test "x$ac_cv_header_fftw3_h" = xyes +then : + printf "%s\n" "#define HAVE_FFTW3_H 1" >>confdefs.h -else +else $as_nop ac_save_cppflags="$CPPFLAGS" CPPFLAGS=" $CPPFLAGS" -for ac_header in fftw.h + for ac_header in fftw.h do : - ac_fn_c_check_header_mongrel "$LINENO" "fftw.h" "ac_cv_header_fftw_h" "$ac_includes_default" -if test "x$ac_cv_header_fftw_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FFTW_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "fftw.h" "ac_cv_header_fftw_h" "$ac_includes_default" +if test "x$ac_cv_header_fftw_h" = xyes +then : + printf "%s\n" "#define HAVE_FFTW_H 1" >>confdefs.h -else +else $as_nop ac_save_cppflags="$CPPFLAGS" CPPFLAGS=" $CPPFLAGS" -for ac_header in dfftw.h + for ac_header in dfftw.h do : - ac_fn_c_check_header_mongrel "$LINENO" "dfftw.h" "ac_cv_header_dfftw_h" "$ac_includes_default" -if test "x$ac_cv_header_dfftw_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DFFTW_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "dfftw.h" "ac_cv_header_dfftw_h" "$ac_includes_default" +if test "x$ac_cv_header_dfftw_h" = xyes +then : + printf "%s\n" "#define HAVE_DFFTW_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate FFTW includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags fi done - CPPFLAGS=$ac_save_cppflags fi done - CPPFLAGS=$ac_save_cppflags # With FFTW library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of FFTW library" >&5 -$as_echo_n "checking for location of FFTW library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of FFTW library" >&5 +printf %s "checking for location of FFTW library... " >&6; } case "$with_fftw_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-fftw-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_fftw_libs" >&5 -$as_echo "$with_fftw_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_fftw_libs" >&5 +printf "%s\n" "$with_fftw_libs" >&6; } if test -n "$with_fftw_libs"; then for dir in $with_fftw_libs; do @@ -12541,8 +13535,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$FFTWLIB $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_execute in -lfftw3" >&5 -$as_echo_n "checking for fftw_execute in -lfftw3... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fftw_execute in -lfftw3" >&5 +printf %s "checking for fftw_execute in -lfftw3... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lfftw3 $MATHLIB $LIBS" @@ -12552,31 +13546,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char fftw_execute (); int -main () +main (void) { return fftw_execute (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fftw3_fftw_execute=yes -else +else $as_nop ac_cv_lib_fftw3_fftw_execute=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3_fftw_execute" >&5 -$as_echo "$ac_cv_lib_fftw3_fftw_execute" >&6; } -if test "x$ac_cv_lib_fftw3_fftw_execute" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3_fftw_execute" >&5 +printf "%s\n" "$ac_cv_lib_fftw3_fftw_execute" >&6; } +if test "x$ac_cv_lib_fftw3_fftw_execute" = xyes +then : FFTWLIB="$FFTWLIB -lfftw3 $MATHLIB" -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -12584,8 +13577,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$FFTWLIB $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftwnd_one in -lfftw" >&5 -$as_echo_n "checking for fftwnd_one in -lfftw... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fftwnd_one in -lfftw" >&5 +printf %s "checking for fftwnd_one in -lfftw... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lfftw $MATHLIB $LIBS" @@ -12595,31 +13588,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char fftwnd_one (); int -main () +main (void) { return fftwnd_one (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fftw_fftwnd_one=yes -else +else $as_nop ac_cv_lib_fftw_fftwnd_one=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw_fftwnd_one" >&5 -$as_echo "$ac_cv_lib_fftw_fftwnd_one" >&6; } -if test "x$ac_cv_lib_fftw_fftwnd_one" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw_fftwnd_one" >&5 +printf "%s\n" "$ac_cv_lib_fftw_fftwnd_one" >&6; } +if test "x$ac_cv_lib_fftw_fftwnd_one" = xyes +then : FFTWLIB="$FFTWLIB -lfftw $MATHLIB" -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -12627,8 +13619,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$FFTWLIB $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftwnd_one in -ldfftw" >&5 -$as_echo_n "checking for fftwnd_one in -ldfftw... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fftwnd_one in -ldfftw" >&5 +printf %s "checking for fftwnd_one in -ldfftw... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-ldfftw $MATHLIB $LIBS" @@ -12638,31 +13630,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char fftwnd_one (); int -main () +main (void) { return fftwnd_one (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dfftw_fftwnd_one=yes -else +else $as_nop ac_cv_lib_dfftw_fftwnd_one=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dfftw_fftwnd_one" >&5 -$as_echo "$ac_cv_lib_dfftw_fftwnd_one" >&6; } -if test "x$ac_cv_lib_dfftw_fftwnd_one" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dfftw_fftwnd_one" >&5 +printf "%s\n" "$ac_cv_lib_dfftw_fftwnd_one" >&6; } +if test "x$ac_cv_lib_dfftw_fftwnd_one" = xyes +then : FFTWLIB="$FFTWLIB -ldfftw $MATHLIB" -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -12702,10 +13693,10 @@ fi # $USE_FFTW # Enable BLAS option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use BLAS" >&5 -$as_echo_n "checking whether to use BLAS... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_blas\"" >&5 -$as_echo "\"$with_blas\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use BLAS" >&5 +printf %s "checking whether to use BLAS... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_blas\"" >&5 +printf "%s\n" "\"$with_blas\"" >&6; } case "$with_blas" in "no") USE_BLAS= ;; "yes") USE_BLAS="1" ;; @@ -12724,15 +13715,15 @@ if test -n "$USE_BLAS"; then # With BLAS library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of BLAS includes" >&5 -$as_echo_n "checking for location of BLAS includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of BLAS includes" >&5 +printf %s "checking for location of BLAS includes... " >&6; } case "$with_blas_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-blas-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_blas_includes" >&5 -$as_echo "$with_blas_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_blas_includes" >&5 +printf "%s\n" "$with_blas_includes" >&6; } if test -n "$with_blas_includes" ; then for dir in $with_blas_includes; do @@ -12745,15 +13736,15 @@ if test -n "$with_blas_includes" ; then fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of BLAS library" >&5 -$as_echo_n "checking for location of BLAS library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of BLAS library" >&5 +printf %s "checking for location of BLAS library... " >&6; } case "$with_blas_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-blas-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_blas_libs" >&5 -$as_echo "$with_blas_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_blas_libs" >&5 +printf "%s\n" "$with_blas_libs" >&6; } if test -n "$with_blas_libs"; then for dir in $with_blas_libs; do @@ -12769,18 +13760,13 @@ fi # See if cblas.h exists (CBLAS,ATLAS,others) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$BLASINC $CPPFLAGS" -for ac_header in cblas.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "cblas.h" "ac_cv_header_cblas_h" "$ac_includes_default" -if test "x$ac_cv_header_cblas_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CBLAS_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "cblas.h" "ac_cv_header_cblas_h" "$ac_includes_default" +if test "x$ac_cv_header_cblas_h" = xyes +then : + printf "%s\n" "#define HAVE_CBLAS_H 1" >>confdefs.h fi -done - CPPFLAGS="$save_CPPFLAGS" @@ -12790,8 +13776,8 @@ LDFLAGS="$BLASLIB $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnrm2_ in -lblas" >&5 -$as_echo_n "checking for dnrm2_ in -lblas... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnrm2_ in -lblas" >&5 +printf %s "checking for dnrm2_ in -lblas... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lblas $MATHLIB $LIBS" @@ -12801,34 +13787,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char dnrm2_ (); int -main () +main (void) { return dnrm2_ (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_blas_dnrm2_=yes -else +else $as_nop ac_cv_lib_blas_dnrm2_=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blas_dnrm2_" >&5 -$as_echo "$ac_cv_lib_blas_dnrm2_" >&6; } -if test "x$ac_cv_lib_blas_dnrm2_" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blas_dnrm2_" >&5 +printf "%s\n" "$ac_cv_lib_blas_dnrm2_" >&6; } +if test "x$ac_cv_lib_blas_dnrm2_" = xyes +then : BLASLIB="$BLASLIB -lblas " -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnrm2_ in -lblas" >&5 -$as_echo_n "checking for dnrm2_ in -lblas... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnrm2_ in -lblas" >&5 +printf %s "checking for dnrm2_ in -lblas... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lblas $MATHLIB -lg2c $LIBS" @@ -12838,31 +13823,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char dnrm2_ (); int -main () +main (void) { return dnrm2_ (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_blas_dnrm2_=yes -else +else $as_nop ac_cv_lib_blas_dnrm2_=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blas_dnrm2_" >&5 -$as_echo "$ac_cv_lib_blas_dnrm2_" >&6; } -if test "x$ac_cv_lib_blas_dnrm2_" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blas_dnrm2_" >&5 +printf "%s\n" "$ac_cv_lib_blas_dnrm2_" >&6; } +if test "x$ac_cv_lib_blas_dnrm2_" = xyes +then : BLASLIB="$BLASLIB -lblas -lg2c" -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -12889,8 +13873,8 @@ blas_ok=no # Check for ATLAS save_LDFLAGS="$LDFLAGS" LDFLAGS="$BLASLIB $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ATL_xerbla in -latlas" >&5 -$as_echo_n "checking for ATL_xerbla in -latlas... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ATL_xerbla in -latlas" >&5 +printf %s "checking for ATL_xerbla in -latlas... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-latlas $LIBS" @@ -12900,31 +13884,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char ATL_xerbla (); int -main () +main (void) { return ATL_xerbla (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_atlas_ATL_xerbla=yes -else +else $as_nop ac_cv_lib_atlas_ATL_xerbla=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_atlas_ATL_xerbla" >&5 -$as_echo "$ac_cv_lib_atlas_ATL_xerbla" >&6; } -if test "x$ac_cv_lib_atlas_ATL_xerbla" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sgemm_ in -lf77blas" >&5 -$as_echo_n "checking for sgemm_ in -lf77blas... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_atlas_ATL_xerbla" >&5 +printf "%s\n" "$ac_cv_lib_atlas_ATL_xerbla" >&6; } +if test "x$ac_cv_lib_atlas_ATL_xerbla" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sgemm_ in -lf77blas" >&5 +printf %s "checking for sgemm_ in -lf77blas... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lf77blas -latlas $LIBS" @@ -12934,31 +13917,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char sgemm_ (); int -main () +main (void) { return sgemm_ (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_f77blas_sgemm_=yes -else +else $as_nop ac_cv_lib_f77blas_sgemm_=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_f77blas_sgemm_" >&5 -$as_echo "$ac_cv_lib_f77blas_sgemm_" >&6; } -if test "x$ac_cv_lib_f77blas_sgemm_" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cblas_dgemm in -lcblas" >&5 -$as_echo_n "checking for cblas_dgemm in -lcblas... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_f77blas_sgemm_" >&5 +printf "%s\n" "$ac_cv_lib_f77blas_sgemm_" >&6; } +if test "x$ac_cv_lib_f77blas_sgemm_" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cblas_dgemm in -lcblas" >&5 +printf %s "checking for cblas_dgemm in -lcblas... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lcblas -lf77blas -latlas $LIBS" @@ -12968,29 +13950,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char cblas_dgemm (); int -main () +main (void) { return cblas_dgemm (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cblas_cblas_dgemm=yes -else +else $as_nop ac_cv_lib_cblas_cblas_dgemm=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cblas_cblas_dgemm" >&5 -$as_echo "$ac_cv_lib_cblas_cblas_dgemm" >&6; } -if test "x$ac_cv_lib_cblas_cblas_dgemm" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cblas_cblas_dgemm" >&5 +printf "%s\n" "$ac_cv_lib_cblas_cblas_dgemm" >&6; } +if test "x$ac_cv_lib_cblas_cblas_dgemm" = xyes +then : blas_ok=yes; BLASLIB="-lcblas -lf77blas -latlas" fi @@ -13004,7 +13985,7 @@ LDFLAGS="$save_LDFLAGS" # Do we have ATLAS? if test $blas_ok = yes; then -$as_echo "#define HAVE_LIBATLAS 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBATLAS 1" >>confdefs.h fi @@ -13015,36 +13996,37 @@ if test $blas_ok = no; then vlib_flags="-framework vecLib" save_LIBS="$LIBS" LIBS="$vlib_flags $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sgemm in $vlib_flags" >&5 -$as_echo_n "checking for sgemm in $vlib_flags... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sgemm in $vlib_flags" >&5 +printf %s "checking for sgemm in $vlib_flags... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { sgemm ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : blas_ok=yes; BLASLIB="$vlib_flags" -else +else $as_nop BLASLIB="" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $blas_ok" >&5 -$as_echo "$blas_ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $blas_ok" >&5 +printf "%s\n" "$blas_ok" >&6; } LIBS="$save_LIBS" fi #fi # $MACOSX_APP # BLAS in PhiPACK libraries? (requires generic BLAS, too) if test $blas_ok = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sgemm_ in -lblas" >&5 -$as_echo_n "checking for sgemm_ in -lblas... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sgemm_ in -lblas" >&5 +printf %s "checking for sgemm_ in -lblas... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lblas $LIBS" @@ -13054,31 +14036,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char sgemm_ (); int -main () +main (void) { return sgemm_ (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_blas_sgemm_=yes -else +else $as_nop ac_cv_lib_blas_sgemm_=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blas_sgemm_" >&5 -$as_echo "$ac_cv_lib_blas_sgemm_" >&6; } -if test "x$ac_cv_lib_blas_sgemm_" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgemm_ in -ldgemm" >&5 -$as_echo_n "checking for dgemm_ in -ldgemm... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blas_sgemm_" >&5 +printf "%s\n" "$ac_cv_lib_blas_sgemm_" >&6; } +if test "x$ac_cv_lib_blas_sgemm_" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dgemm_ in -ldgemm" >&5 +printf %s "checking for dgemm_ in -ldgemm... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-ldgemm -lblas $LIBS" @@ -13088,31 +14069,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char dgemm_ (); int -main () +main (void) { return dgemm_ (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dgemm_dgemm_=yes -else +else $as_nop ac_cv_lib_dgemm_dgemm_=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dgemm_dgemm_" >&5 -$as_echo "$ac_cv_lib_dgemm_dgemm_" >&6; } -if test "x$ac_cv_lib_dgemm_dgemm_" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sgemm_ in -lsgemm" >&5 -$as_echo_n "checking for sgemm_ in -lsgemm... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dgemm_dgemm_" >&5 +printf "%s\n" "$ac_cv_lib_dgemm_dgemm_" >&6; } +if test "x$ac_cv_lib_dgemm_dgemm_" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sgemm_ in -lsgemm" >&5 +printf %s "checking for sgemm_ in -lsgemm... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lsgemm -lblas $LIBS" @@ -13122,29 +14102,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char sgemm_ (); int -main () +main (void) { return sgemm_ (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_sgemm_sgemm_=yes -else +else $as_nop ac_cv_lib_sgemm_sgemm_=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sgemm_sgemm_" >&5 -$as_echo "$ac_cv_lib_sgemm_sgemm_" >&6; } -if test "x$ac_cv_lib_sgemm_sgemm_" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sgemm_sgemm_" >&5 +printf "%s\n" "$ac_cv_lib_sgemm_sgemm_" >&6; } +if test "x$ac_cv_lib_sgemm_sgemm_" = xyes +then : blas_ok=yes; BLASLIB="-lsgemm -ldgemm -lblas" fi @@ -13158,8 +14137,8 @@ fi # BLAS in Sun Performance library? if test $blas_ok = no; then if test "x$GCC" != xyes; then # only works with Sun CC - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acosp in -lsunmath" >&5 -$as_echo_n "checking for acosp in -lsunmath... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for acosp in -lsunmath" >&5 +printf %s "checking for acosp in -lsunmath... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lsunmath $LIBS" @@ -13169,31 +14148,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char acosp (); int -main () +main (void) { return acosp (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_sunmath_acosp=yes -else +else $as_nop ac_cv_lib_sunmath_acosp=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sunmath_acosp" >&5 -$as_echo "$ac_cv_lib_sunmath_acosp" >&6; } -if test "x$ac_cv_lib_sunmath_acosp" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sgemm_ in -lsunperf" >&5 -$as_echo_n "checking for sgemm_ in -lsunperf... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sunmath_acosp" >&5 +printf "%s\n" "$ac_cv_lib_sunmath_acosp" >&6; } +if test "x$ac_cv_lib_sunmath_acosp" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sgemm_ in -lsunperf" >&5 +printf %s "checking for sgemm_ in -lsunperf... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lsunperf -lsunmath $LIBS" @@ -13203,29 +14181,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char sgemm_ (); int -main () +main (void) { return sgemm_ (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_sunperf_sgemm_=yes -else +else $as_nop ac_cv_lib_sunperf_sgemm_=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sunperf_sgemm_" >&5 -$as_echo "$ac_cv_lib_sunperf_sgemm_" >&6; } -if test "x$ac_cv_lib_sunperf_sgemm_" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sunperf_sgemm_" >&5 +printf "%s\n" "$ac_cv_lib_sunperf_sgemm_" >&6; } +if test "x$ac_cv_lib_sunperf_sgemm_" = xyes +then : blas_ok=yes; BLASLIB="-xlic_lib=sunperf -lsunmath" fi @@ -13237,8 +14214,8 @@ fi # Generic BLAS library if test $blas_ok = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sgemm_ in -lblas" >&5 -$as_echo_n "checking for sgemm_ in -lblas... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sgemm_ in -lblas" >&5 +printf %s "checking for sgemm_ in -lblas... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lblas $LIBS" @@ -13248,29 +14225,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char sgemm_ (); int -main () +main (void) { return sgemm_ (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_blas_sgemm_=yes -else +else $as_nop ac_cv_lib_blas_sgemm_=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blas_sgemm_" >&5 -$as_echo "$ac_cv_lib_blas_sgemm_" >&6; } -if test "x$ac_cv_lib_blas_sgemm_" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blas_sgemm_" >&5 +printf "%s\n" "$ac_cv_lib_blas_sgemm_" >&6; } +if test "x$ac_cv_lib_blas_sgemm_" = xyes +then : blas_ok=yes; BLASLIB="-lblas" fi @@ -13278,7 +14254,7 @@ fi if test $blas_ok = yes; then -$as_echo "#define HAVE_LIBBLAS 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBBLAS 1" >>confdefs.h fi @@ -13292,10 +14268,10 @@ fi # $USE_BLAS # Enable LAPACK option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use LAPACK" >&5 -$as_echo_n "checking whether to use LAPACK... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_lapack\"" >&5 -$as_echo "\"$with_lapack\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use LAPACK" >&5 +printf %s "checking whether to use LAPACK... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_lapack\"" >&5 +printf "%s\n" "\"$with_lapack\"" >&6; } case "$with_lapack" in "no") USE_LAPACK= ;; "yes") USE_LAPACK="1" ;; @@ -13318,15 +14294,15 @@ if test -n "$USE_LAPACK"; then lapack_ok=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of LAPACK includes" >&5 -$as_echo_n "checking for location of LAPACK includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of LAPACK includes" >&5 +printf %s "checking for location of LAPACK includes... " >&6; } case "$with_lapack_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-lapack-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_lapack_includes" >&5 -$as_echo "$with_lapack_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_lapack_includes" >&5 +printf "%s\n" "$with_lapack_includes" >&6; } if test -n "$with_lapack_includes" ; then for dir in $with_lapack_includes; do @@ -13339,15 +14315,15 @@ if test -n "$with_lapack_includes" ; then fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of LAPACK library" >&5 -$as_echo_n "checking for location of LAPACK library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of LAPACK library" >&5 +printf %s "checking for location of LAPACK library... " >&6; } case "$with_lapack_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-lapack-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_lapack_libs" >&5 -$as_echo "$with_lapack_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_lapack_libs" >&5 +printf "%s\n" "$with_lapack_libs" >&6; } if test -n "$with_lapack_libs"; then for dir in $with_lapack_libs; do @@ -13363,18 +14339,13 @@ fi # See if clapack.h exists (ATLAS) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$LAPACKINC $CPPFLAGS" -for ac_header in clapack.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "clapack.h" "ac_cv_header_clapack_h" "$ac_includes_default" -if test "x$ac_cv_header_clapack_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CLAPACK_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "clapack.h" "ac_cv_header_clapack_h" "$ac_includes_default" +if test "x$ac_cv_header_clapack_h" = xyes +then : + printf "%s\n" "#define HAVE_CLAPACK_H 1" >>confdefs.h fi -done - CPPFLAGS="$save_CPPFLAGS" # LAPACK linked to by default? @@ -13382,7 +14353,8 @@ if test lapack_ok=no; then save_LIBS="$LIBS"; LIBS="$LIBS $BLASLIB $MATHLIB $FLIBS" save_LDFLAGS="$LDFLAGS"; LDFLAGS="$LAPACKLIB $LDFLAGS" ac_fn_c_check_func "$LINENO" "dsegv_" "ac_cv_func_dsegv_" -if test "x$ac_cv_func_dsegv_" = xyes; then : +if test "x$ac_cv_func_dsegv_" = xyes +then : lapack_ok=yes fi @@ -13394,8 +14366,8 @@ fi if test $lapack_ok = no; then save_libs="$LIBS"; LIBS="$BLASLIB $MATHLIB $LIBS" save_LDFLAGS="$LDFLAGS"; LDFLAGS="$LAPACKLIB $LDFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for desgv_ in -llapack" >&5 -$as_echo_n "checking for desgv_ in -llapack... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for desgv_ in -llapack" >&5 +printf %s "checking for desgv_ in -llapack... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-llapack $FLIBS $LIBS" @@ -13405,29 +14377,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char desgv_ (); int -main () +main (void) { return desgv_ (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_lapack_desgv_=yes -else +else $as_nop ac_cv_lib_lapack_desgv_=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lapack_desgv_" >&5 -$as_echo "$ac_cv_lib_lapack_desgv_" >&6; } -if test "x$ac_cv_lib_lapack_desgv_" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lapack_desgv_" >&5 +printf "%s\n" "$ac_cv_lib_lapack_desgv_" >&6; } +if test "x$ac_cv_lib_lapack_desgv_" = xyes +then : lapack_ok=yes; LAPACKLIB="-llapack" fi @@ -13443,8 +14414,8 @@ LDFLAGS="$LAPACKLIB $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgesv_ in -llapack" >&5 -$as_echo_n "checking for dgesv_ in -llapack... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dgesv_ in -llapack" >&5 +printf %s "checking for dgesv_ in -llapack... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-llapack $BLASLIB $MATHLIB $LIBS" @@ -13454,34 +14425,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char dgesv_ (); int -main () +main (void) { return dgesv_ (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_lapack_dgesv_=yes -else +else $as_nop ac_cv_lib_lapack_dgesv_=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lapack_dgesv_" >&5 -$as_echo "$ac_cv_lib_lapack_dgesv_" >&6; } -if test "x$ac_cv_lib_lapack_dgesv_" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lapack_dgesv_" >&5 +printf "%s\n" "$ac_cv_lib_lapack_dgesv_" >&6; } +if test "x$ac_cv_lib_lapack_dgesv_" = xyes +then : LAPACKLIB="$LAPACKLIB -llapack " -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgesv_ in -llapack" >&5 -$as_echo_n "checking for dgesv_ in -llapack... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dgesv_ in -llapack" >&5 +printf %s "checking for dgesv_ in -llapack... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-llapack $BLASLIB $MATHLIB -lg2c $LIBS" @@ -13491,31 +14461,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char dgesv_ (); int -main () +main (void) { return dgesv_ (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_lapack_dgesv_=yes -else +else $as_nop ac_cv_lib_lapack_dgesv_=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lapack_dgesv_" >&5 -$as_echo "$ac_cv_lib_lapack_dgesv_" >&6; } -if test "x$ac_cv_lib_lapack_dgesv_" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lapack_dgesv_" >&5 +printf "%s\n" "$ac_cv_lib_lapack_dgesv_" >&6; } +if test "x$ac_cv_lib_lapack_dgesv_" = xyes +then : LAPACKLIB="$LAPACKLIB -llapack -lg2c" -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -13539,7 +14508,7 @@ LDFLAGS=${ac_save_ldflags} fi -$as_echo "#define HAVE_LIBLAPACK 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBLAPACK 1" >>confdefs.h fi # $USE_LAPACK @@ -13553,10 +14522,10 @@ fi # $USE_BLAS # Enable Cairo display driver option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use Cairo" >&5 -$as_echo_n "checking whether to use Cairo... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_cairo\"" >&5 -$as_echo "\"$with_cairo\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use Cairo" >&5 +printf %s "checking whether to use Cairo... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_cairo\"" >&5 +printf "%s\n" "\"$with_cairo\"" >&6; } case "$with_cairo" in "no") USE_CAIRO= ;; "yes") USE_CAIRO="1" ;; @@ -13586,15 +14555,15 @@ done CAIROINC=`$PKG_CONFIG --cflags $cairo` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of cairo includes" >&5 -$as_echo_n "checking for location of cairo includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of cairo includes" >&5 +printf %s "checking for location of cairo includes... " >&6; } case "$with_cairo_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-cairo-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_cairo_includes" >&5 -$as_echo "$with_cairo_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_cairo_includes" >&5 +printf "%s\n" "$with_cairo_includes" >&6; } if test -n "$with_cairo_includes" ; then for dir in $with_cairo_includes; do @@ -13610,22 +14579,20 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$CAIROINC $CPPFLAGS" -for ac_header in cairo.h + for ac_header in cairo.h do : - ac_fn_c_check_header_mongrel "$LINENO" "cairo.h" "ac_cv_header_cairo_h" "$ac_includes_default" -if test "x$ac_cv_header_cairo_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CAIRO_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "cairo.h" "ac_cv_header_cairo_h" "$ac_includes_default" +if test "x$ac_cv_header_cairo_h" = xyes +then : + printf "%s\n" "#define HAVE_CAIRO_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate Cairo includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags @@ -13634,15 +14601,15 @@ CPPFLAGS=$ac_save_cppflags CAIROLIB=`$PKG_CONFIG --libs $cairo` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of cairo library" >&5 -$as_echo_n "checking for location of cairo library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of cairo library" >&5 +printf %s "checking for location of cairo library... " >&6; } case "$with_cairo_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-cairo-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_cairo_libs" >&5 -$as_echo "$with_cairo_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_cairo_libs" >&5 +printf "%s\n" "$with_cairo_libs" >&6; } if test -n "$with_cairo_libs"; then for dir in $with_cairo_libs; do @@ -13655,15 +14622,15 @@ if test -n "$with_cairo_libs"; then fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo linking flags" >&5 -$as_echo_n "checking for cairo linking flags... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cairo linking flags" >&5 +printf %s "checking for cairo linking flags... " >&6; } case "$with_cairo_ldflags" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-cairo-ldflags." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_cairo_ldflags" >&5 -$as_echo "$with_cairo_ldflags" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_cairo_ldflags" >&5 +printf "%s\n" "$with_cairo_ldflags" >&6; } CAIROLIB="$CAIROLIB $with_cairo_ldflags" @@ -13673,11 +14640,12 @@ ac_save_ldflags="$LDFLAGS" LIBS=" $CAIROLIB $LIBS" LDFLAGS=" $LDFLAGS" ac_fn_c_check_func "$LINENO" "cairo_create" "ac_cv_func_cairo_create" -if test "x$ac_cv_func_cairo_create" = xyes; then : +if test "x$ac_cv_func_cairo_create" = xyes +then : : -else +else $as_nop as_fn_error $? "*** Unable to locate cairo_create." "$LINENO" 5 @@ -13694,11 +14662,12 @@ ac_save_ldflags="$LDFLAGS" LIBS=" $CAIROLIB $LIBS" LDFLAGS=" $LDFLAGS" ac_fn_c_check_func "$LINENO" "cairo_xlib_surface_create_with_xrender_format" "ac_cv_func_cairo_xlib_surface_create_with_xrender_format" -if test "x$ac_cv_func_cairo_xlib_surface_create_with_xrender_format" = xyes; then : +if test "x$ac_cv_func_cairo_xlib_surface_create_with_xrender_format" = xyes +then : CAIRO_HAS_XRENDER=1 -else +else $as_nop CAIRO_HAS_XRENDER= @@ -13714,11 +14683,12 @@ ac_save_ldflags="$LDFLAGS" LIBS=" $CAIROLIB $LIBS" LDFLAGS=" $LDFLAGS" ac_fn_c_check_func "$LINENO" "cairo_xlib_surface_get_xrender_format" "ac_cv_func_cairo_xlib_surface_get_xrender_format" -if test "x$ac_cv_func_cairo_xlib_surface_get_xrender_format" = xyes; then : +if test "x$ac_cv_func_cairo_xlib_surface_get_xrender_format" = xyes +then : CAIRO_HAS_XRENDER_SURFACE=1 -else +else $as_nop CAIRO_HAS_XRENDER_SURFACE= @@ -13742,10 +14712,10 @@ fi # $USE_CAIRO # Enable FreeType option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use FreeType" >&5 -$as_echo_n "checking whether to use FreeType... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_freetype\"" >&5 -$as_echo "\"$with_freetype\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use FreeType" >&5 +printf %s "checking whether to use FreeType... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_freetype\"" >&5 +printf "%s\n" "\"$with_freetype\"" >&6; } case "$with_freetype" in "no") USE_FREETYPE= ;; "yes") USE_FREETYPE="1" ;; @@ -13764,15 +14734,15 @@ if test -n "$USE_FREETYPE"; then FTINC=`$PKG_CONFIG --cflags freetype2` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of FreeType includes" >&5 -$as_echo_n "checking for location of FreeType includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of FreeType includes" >&5 +printf %s "checking for location of FreeType includes... " >&6; } case "$with_freetype_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-freetype-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_freetype_includes" >&5 -$as_echo "$with_freetype_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_freetype_includes" >&5 +printf "%s\n" "$with_freetype_includes" >&6; } if test -n "$with_freetype_includes" ; then for dir in $with_freetype_includes; do @@ -13788,22 +14758,20 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$FTINC $CPPFLAGS" -for ac_header in ft2build.h + for ac_header in ft2build.h do : - ac_fn_c_check_header_mongrel "$LINENO" "ft2build.h" "ac_cv_header_ft2build_h" "$ac_includes_default" -if test "x$ac_cv_header_ft2build_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FT2BUILD_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "ft2build.h" "ac_cv_header_ft2build_h" "$ac_includes_default" +if test "x$ac_cv_header_ft2build_h" = xyes +then : + printf "%s\n" "#define HAVE_FT2BUILD_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate FreeType includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags @@ -13812,15 +14780,15 @@ CPPFLAGS=$ac_save_cppflags FTLIB=`$PKG_CONFIG --libs freetype2` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of FreeType library" >&5 -$as_echo_n "checking for location of FreeType library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of FreeType library" >&5 +printf %s "checking for location of FreeType library... " >&6; } case "$with_freetype_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-freetype-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_freetype_libs" >&5 -$as_echo "$with_freetype_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_freetype_libs" >&5 +printf "%s\n" "$with_freetype_libs" >&6; } if test -n "$with_freetype_libs"; then for dir in $with_freetype_libs; do @@ -13838,8 +14806,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$FTLIB $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_Init_FreeType in -lfreetype" >&5 -$as_echo_n "checking for FT_Init_FreeType in -lfreetype... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FT_Init_FreeType in -lfreetype" >&5 +printf %s "checking for FT_Init_FreeType in -lfreetype... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lfreetype $LIBS" @@ -13849,31 +14817,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char FT_Init_FreeType (); int -main () +main (void) { return FT_Init_FreeType (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_freetype_FT_Init_FreeType=yes -else +else $as_nop ac_cv_lib_freetype_FT_Init_FreeType=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5 -$as_echo "$ac_cv_lib_freetype_FT_Init_FreeType" >&6; } -if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5 +printf "%s\n" "$ac_cv_lib_freetype_FT_Init_FreeType" >&6; } +if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = xyes +then : FTLIB="$FTLIB -lfreetype " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -13897,10 +14864,10 @@ fi # $USE_FREETYPE # Enable NLS option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 -$as_echo_n "checking whether to use NLS... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_nls\"" >&5 -$as_echo "\"$with_nls\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +printf %s "checking whether to use NLS... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_nls\"" >&5 +printf "%s\n" "\"$with_nls\"" >&6; } case "$with_nls" in "no") USE_NLS= ;; "yes") USE_NLS="1" ;; @@ -13914,16 +14881,17 @@ HAVE_NLS= if test -n "${USE_NLS}" ; then -$as_echo "#define USE_NLS 1" >>confdefs.h +printf "%s\n" "#define USE_NLS 1" >>confdefs.h ac_fn_c_check_func "$LINENO" "gettext" "ac_cv_func_gettext" -if test "x$ac_cv_func_gettext" = xyes; then : +if test "x$ac_cv_func_gettext" = xyes +then : INTLLIB= -else +else $as_nop -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5 -$as_echo_n "checking for gettext in -lintl... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5 +printf %s "checking for gettext in -lintl... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" @@ -13933,31 +14901,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char gettext (); int -main () +main (void) { return gettext (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_intl_gettext=yes -else +else $as_nop ac_cv_lib_intl_gettext=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_gettext" >&5 -$as_echo "$ac_cv_lib_intl_gettext" >&6; } -if test "x$ac_cv_lib_intl_gettext" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_gettext" >&5 +printf "%s\n" "$ac_cv_lib_intl_gettext" >&6; } +if test "x$ac_cv_lib_intl_gettext" = xyes +then : INTLLIB=-lintl -else +else $as_nop as_fn_error $? "*** Unable to locate gettext() function." "$LINENO" 5 @@ -13975,10 +14942,10 @@ fi # Enable openDWG option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use openDWG" >&5 -$as_echo_n "checking whether to use openDWG... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_opendwg\"" >&5 -$as_echo "\"$with_opendwg\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use openDWG" >&5 +printf %s "checking whether to use openDWG... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_opendwg\"" >&5 +printf "%s\n" "\"$with_opendwg\"" >&6; } case "$with_opendwg" in "no") USE_OPENDWG= ;; "yes") USE_OPENDWG="1" ;; @@ -13996,15 +14963,15 @@ if test -n "${USE_OPENDWG}"; then # With OPENDWG includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of openDGW includes" >&5 -$as_echo_n "checking for location of openDGW includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of openDGW includes" >&5 +printf %s "checking for location of openDGW includes... " >&6; } case "$with_opendwg_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-opendwg-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_opendwg_includes" >&5 -$as_echo "$with_opendwg_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_opendwg_includes" >&5 +printf "%s\n" "$with_opendwg_includes" >&6; } if test -n "$with_opendwg_includes" ; then for dir in $with_opendwg_includes; do @@ -14020,37 +14987,35 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$OPENDWGINCPATH $CPPFLAGS" -for ac_header in ad2.h + for ac_header in ad2.h do : - ac_fn_c_check_header_mongrel "$LINENO" "ad2.h" "ac_cv_header_ad2_h" "$ac_includes_default" -if test "x$ac_cv_header_ad2_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_AD2_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "ad2.h" "ac_cv_header_ad2_h" "$ac_includes_default" +if test "x$ac_cv_header_ad2_h" = xyes +then : + printf "%s\n" "#define HAVE_AD2_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate openDWG includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags # With OPENDWG library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of openDWG library" >&5 -$as_echo_n "checking for location of openDWG library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of openDWG library" >&5 +printf %s "checking for location of openDWG library... " >&6; } case "$with_opendwg_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-opendwg-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_opendwg_libs" >&5 -$as_echo "$with_opendwg_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_opendwg_libs" >&5 +printf "%s\n" "$with_opendwg_libs" >&6; } if test -n "$with_opendwg_libs"; then for dir in $with_opendwg_libs; do @@ -14084,10 +15049,10 @@ fi # $USE_OPENDWG # Enable pthread option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use POSIX threads" >&5 -$as_echo_n "checking whether to use POSIX threads... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_pthread\"" >&5 -$as_echo "\"$with_pthread\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use POSIX threads" >&5 +printf %s "checking whether to use POSIX threads... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_pthread\"" >&5 +printf "%s\n" "\"$with_pthread\"" >&6; } case "$with_pthread" in "no") USE_PTHREAD= ;; "yes") USE_PTHREAD="1" ;; @@ -14105,15 +15070,15 @@ if test -n "$USE_PTHREAD"; then # With pthread includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of POSIX threads includes" >&5 -$as_echo_n "checking for location of POSIX threads includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of POSIX threads includes" >&5 +printf %s "checking for location of POSIX threads includes... " >&6; } case "$with_pthread_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-pthread-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pthread_includes" >&5 -$as_echo "$with_pthread_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_pthread_includes" >&5 +printf "%s\n" "$with_pthread_includes" >&6; } if test -n "$with_pthread_includes" ; then for dir in $with_pthread_includes; do @@ -14129,37 +15094,35 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$PTHREADINCPATH $CPPFLAGS" -for ac_header in pthread.h + for ac_header in pthread.h do : - ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate POSIX threads includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags # With pthread library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of POSIX threads library" >&5 -$as_echo_n "checking for location of POSIX threads library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of POSIX threads library" >&5 +printf %s "checking for location of POSIX threads library... " >&6; } case "$with_pthread_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-pthread-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pthread_libs" >&5 -$as_echo "$with_pthread_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_pthread_libs" >&5 +printf "%s\n" "$with_pthread_libs" >&6; } if test -n "$with_pthread_libs"; then for dir in $with_pthread_libs; do @@ -14178,21 +15141,22 @@ ac_save_ldflags="$LDFLAGS" LIBS=" $LIBS" LDFLAGS=" $LDFLAGS" ac_fn_c_check_func "$LINENO" "pthread_create" "ac_cv_func_pthread_create" -if test "x$ac_cv_func_pthread_create" = xyes; then : +if test "x$ac_cv_func_pthread_create" = xyes +then : PTHREADLIB="$PTHREADLIB " -else +else $as_nop ac_save_ldflags="$LDFLAGS" LDFLAGS="$PTHREADLIBPATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 +printf %s "checking for pthread_create in -lpthread... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" @@ -14202,31 +15166,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_create (); int -main () +main (void) { return pthread_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_create=yes -else +else $as_nop ac_cv_lib_pthread_pthread_create=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_create" = xyes +then : PTHREADLIB="$PTHREADLIB -lpthread " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -14259,10 +15222,10 @@ fi # $USE_PTHREAD # Enable OpenMP option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use OpenMP" >&5 -$as_echo_n "checking whether to use OpenMP... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_openmp\"" >&5 -$as_echo "\"$with_openmp\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use OpenMP" >&5 +printf %s "checking whether to use OpenMP... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_openmp\"" >&5 +printf "%s\n" "\"$with_openmp\"" >&6; } case "$with_openmp" in "no") USE_OPENMP= ;; "yes") USE_OPENMP="1" ;; @@ -14281,15 +15244,15 @@ OPENMP_LIB= OPENMP_CFLAGS= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of OpenMP includes" >&5 -$as_echo_n "checking for location of OpenMP includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of OpenMP includes" >&5 +printf %s "checking for location of OpenMP includes... " >&6; } case "$with_openmp_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-openmp-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_openmp_includes" >&5 -$as_echo "$with_openmp_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_openmp_includes" >&5 +printf "%s\n" "$with_openmp_includes" >&6; } if test -n "$with_openmp_includes" ; then for dir in $with_openmp_includes; do @@ -14302,15 +15265,15 @@ if test -n "$with_openmp_includes" ; then fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of OpenMP library" >&5 -$as_echo_n "checking for location of OpenMP library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of OpenMP library" >&5 +printf %s "checking for location of OpenMP library... " >&6; } case "$with_openmp_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-openmp-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_openmp_libs" >&5 -$as_echo "$with_openmp_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_openmp_libs" >&5 +printf "%s\n" "$with_openmp_libs" >&6; } if test -n "$with_openmp_libs"; then for dir in $with_openmp_libs; do @@ -14325,22 +15288,20 @@ fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$OPENMP_INCPATH $CPPFLAGS" -for ac_header in omp.h + for ac_header in omp.h do : - ac_fn_c_check_header_mongrel "$LINENO" "omp.h" "ac_cv_header_omp_h" "$ac_includes_default" -if test "x$ac_cv_header_omp_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OMP_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "omp.h" "ac_cv_header_omp_h" "$ac_includes_default" +if test "x$ac_cv_header_omp_h" = xyes +then : + printf "%s\n" "#define HAVE_OMP_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate OpenMP includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags @@ -14349,8 +15310,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$OPENMP_LIBPATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for omp_get_num_threads in -lomp" >&5 -$as_echo_n "checking for omp_get_num_threads in -lomp... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for omp_get_num_threads in -lomp" >&5 +printf %s "checking for omp_get_num_threads in -lomp... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lomp $LIBS" @@ -14360,31 +15321,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char omp_get_num_threads (); int -main () +main (void) { return omp_get_num_threads (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_omp_omp_get_num_threads=yes -else +else $as_nop ac_cv_lib_omp_omp_get_num_threads=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_omp_omp_get_num_threads" >&5 -$as_echo "$ac_cv_lib_omp_omp_get_num_threads" >&6; } -if test "x$ac_cv_lib_omp_omp_get_num_threads" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_omp_omp_get_num_threads" >&5 +printf "%s\n" "$ac_cv_lib_omp_omp_get_num_threads" >&6; } +if test "x$ac_cv_lib_omp_omp_get_num_threads" = xyes +then : OPENMP_LIB="$OPENMP_LIB -lomp " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -14392,8 +15352,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$OPENMP_LIBPATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GOMP_parallel_start in -lgomp" >&5 -$as_echo_n "checking for GOMP_parallel_start in -lgomp... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GOMP_parallel_start in -lgomp" >&5 +printf %s "checking for GOMP_parallel_start in -lgomp... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lgomp $LIBS" @@ -14403,31 +15363,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char GOMP_parallel_start (); int -main () +main (void) { return GOMP_parallel_start (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_gomp_GOMP_parallel_start=yes -else +else $as_nop ac_cv_lib_gomp_GOMP_parallel_start=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gomp_GOMP_parallel_start" >&5 -$as_echo "$ac_cv_lib_gomp_GOMP_parallel_start" >&6; } -if test "x$ac_cv_lib_gomp_GOMP_parallel_start" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gomp_GOMP_parallel_start" >&5 +printf "%s\n" "$ac_cv_lib_gomp_GOMP_parallel_start" >&6; } +if test "x$ac_cv_lib_gomp_GOMP_parallel_start" = xyes +then : OPENMP_LIB="$OPENMP_LIB -lgomp " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -14450,66 +15409,76 @@ LDFLAGS=${ac_save_ldflags} loc_save_cflags="$CFLAGS" CFLAGS="${CFLAGS} ${OPENMP_INCPATH} ${OPENMP_LIBPATH} ${OPENMP_LIB}" - - OPENMP_CFLAGS= - # Check whether --enable-openmp was given. -if test "${enable_openmp+set}" = set; then : +if test -e penmp || test -e mp; then + as_fn_error $? "AC_OPENMP clobbers files named 'mp' and 'penmp'. Aborting configure because one of these files already exists." "$LINENO" 5 +fi +# Check whether --enable-openmp was given. +if test ${enable_openmp+y} +then : enableval=$enable_openmp; fi + OPENMP_CFLAGS= if test "$enable_openmp" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to support OpenMP" >&5 -$as_echo_n "checking for $CC option to support OpenMP... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to support OpenMP" >&5 +printf %s "checking for $CC option to support OpenMP... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +ac_cv_prog_c_openmp='not found' + for ac_option in '' -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp -homp \ + -Popenmp --openmp '-Xclang -fopenmp'; do + + ac_save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $ac_option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef _OPENMP - choke me +#error "OpenMP not supported" #endif #include -int main () { return omp_get_num_threads (); } +int main (void) { return omp_get_num_threads (); } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_prog_c_openmp='none needed' -else - ac_cv_prog_c_openmp='unsupported' - for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp -homp \ - -Popenmp --openmp '-Xclang -fopenmp'; do - ac_save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS $ac_option" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef _OPENMP - choke me +#error "OpenMP not supported" #endif #include -int main () { return omp_get_num_threads (); } +int main (void) { return omp_get_num_threads (); } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_prog_c_openmp=$ac_option +else $as_nop + ac_cv_prog_c_openmp='unsupported' fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ac_save_CFLAGS - if test "$ac_cv_prog_c_openmp" != unsupported; then - break - fi - done fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_c_openmp" >&5 -$as_echo "$ac_cv_prog_c_openmp" >&6; } - case $ac_cv_prog_c_openmp in #( - "none needed" | unsupported) - ;; #( - *) - OPENMP_CFLAGS=$ac_cv_prog_c_openmp ;; - esac +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ac_save_CFLAGS + + if test "$ac_cv_prog_c_openmp" != 'not found'; then + break + fi + done + if test "$ac_cv_prog_c_openmp" = 'not found'; then + ac_cv_prog_c_openmp='unsupported' + elif test "$ac_cv_prog_c_openmp" = ''; then + ac_cv_prog_c_openmp='none needed' + fi + rm -f penmp mp +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_c_openmp" >&5 +printf "%s\n" "$ac_cv_prog_c_openmp" >&6; } + if test "$ac_cv_prog_c_openmp" != 'unsupported' && \ + test "$ac_cv_prog_c_openmp" != 'none needed'; then + OPENMP_CFLAGS="$ac_cv_prog_c_openmp" + fi fi @@ -14540,10 +15509,10 @@ fi # enable_openmp # Enable OpenCL option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use OpenCL" >&5 -$as_echo_n "checking whether to use OpenCL... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_opencl\"" >&5 -$as_echo "\"$with_opencl\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use OpenCL" >&5 +printf %s "checking whether to use OpenCL... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$with_opencl\"" >&5 +printf "%s\n" "\"$with_opencl\"" >&6; } case "$with_opencl" in "no") USE_OPENCL= ;; "yes") USE_OPENCL="1" ;; @@ -14561,15 +15530,15 @@ if test -n "$USE_OPENCL"; then # With OpenCL includes directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of OpenCL includes" >&5 -$as_echo_n "checking for location of OpenCL includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of OpenCL includes" >&5 +printf %s "checking for location of OpenCL includes... " >&6; } case "$with_opencl_includes" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-opencl-includes." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_opencl_includes" >&5 -$as_echo "$with_opencl_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_opencl_includes" >&5 +printf "%s\n" "$with_opencl_includes" >&6; } if test -n "$with_opencl_includes" ; then for dir in $with_opencl_includes; do @@ -14586,22 +15555,20 @@ if test -n "$MACOSX_APP" ; then ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$OCLINCPATH $CPPFLAGS" -for ac_header in OpenCL/opencl.h + for ac_header in OpenCL/opencl.h do : - ac_fn_c_check_header_mongrel "$LINENO" "OpenCL/opencl.h" "ac_cv_header_OpenCL_opencl_h" "$ac_includes_default" -if test "x$ac_cv_header_OpenCL_opencl_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENCL_OPENCL_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "OpenCL/opencl.h" "ac_cv_header_OpenCL_opencl_h" "$ac_includes_default" +if test "x$ac_cv_header_OpenCL_opencl_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENCL_OPENCL_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate OpenCL includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags @@ -14615,13 +15582,14 @@ ac_save_ldflags="$LDFLAGS" LIBS="-framework OpenCL $LIBS" LDFLAGS=" $LDFLAGS" ac_fn_c_check_func "$LINENO" "clGetPlatformInfo" "ac_cv_func_clGetPlatformInfo" -if test "x$ac_cv_func_clGetPlatformInfo" = xyes; then : +if test "x$ac_cv_func_clGetPlatformInfo" = xyes +then : OCLLIB="$OCLLIB -framework OpenCL" -else +else $as_nop as_fn_error $? "*** Unable to locate OpenCL library." "$LINENO" 5 @@ -14637,36 +15605,34 @@ else ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$OCLINCPATH $CPPFLAGS" -for ac_header in CL/cl.h + for ac_header in CL/cl.h do : - ac_fn_c_check_header_mongrel "$LINENO" "CL/cl.h" "ac_cv_header_CL_cl_h" "$ac_includes_default" -if test "x$ac_cv_header_CL_cl_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CL_CL_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "CL/cl.h" "ac_cv_header_CL_cl_h" "$ac_includes_default" +if test "x$ac_cv_header_CL_cl_h" = xyes +then : + printf "%s\n" "#define HAVE_CL_CL_H 1" >>confdefs.h -else +else $as_nop as_fn_error $? "*** Unable to locate OpenCL includes." "$LINENO" 5 fi done - CPPFLAGS=$ac_save_cppflags # With OpenCL library directory -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of OpenCL library" >&5 -$as_echo_n "checking for location of OpenCL library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for location of OpenCL library" >&5 +printf %s "checking for location of OpenCL library... " >&6; } case "$with_opencl_libs" in y | ye | yes | n | no) as_fn_error $? "*** You must supply a directory to --with-opencl-libs." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_opencl_libs" >&5 -$as_echo "$with_opencl_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_opencl_libs" >&5 +printf "%s\n" "$with_opencl_libs" >&6; } if test -n "$with_opencl_libs"; then for dir in $with_opencl_libs; do @@ -14683,8 +15649,8 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$OCLLIBPATH $LDFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clGetPlatformInfo in -lOpenCL" >&5 -$as_echo_n "checking for clGetPlatformInfo in -lOpenCL... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clGetPlatformInfo in -lOpenCL" >&5 +printf %s "checking for clGetPlatformInfo in -lOpenCL... " >&6; } ac_check_lib_save_LIBS=$LIBS LIBS="-lOpenCL $LIBS" @@ -14694,31 +15660,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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. */ -#ifdef __cplusplus -extern "C" -#endif char clGetPlatformInfo (); int -main () +main (void) { return clGetPlatformInfo (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_OpenCL_clGetPlatformInfo=yes -else +else $as_nop ac_cv_lib_OpenCL_clGetPlatformInfo=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_OpenCL_clGetPlatformInfo" >&5 -$as_echo "$ac_cv_lib_OpenCL_clGetPlatformInfo" >&6; } -if test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_OpenCL_clGetPlatformInfo" >&5 +printf "%s\n" "$ac_cv_lib_OpenCL_clGetPlatformInfo" >&6; } +if test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" = xyes +then : OCLLIB="$OCLLIB -lOpenCL " -else +else $as_nop LDFLAGS=${ac_save_ldflags} @@ -14748,7 +15713,8 @@ fi # $USE_OPENCL # Enable LFS (from cdr-tools, tar, and autoconf 2.68) # Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then : +if test ${enable_largefile+y} +then : enableval=$enable_largefile; fi @@ -14760,8 +15726,8 @@ fi CFLAGS="$LFS_CFLAGS $ac_save_cflags" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } ac_cv_sys_largefile_CC=no largefile_cc_opt="" @@ -14781,16 +15747,17 @@ ac_cv_sys_largefile_CC=no ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_save_CC="${CC-cc}" CC="$CC -n32" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14806,23 +15773,24 @@ else ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_largefile_CC=' -n32' fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CC="$ac_save_CC" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC="$CC$ac_cv_sys_largefile_CC" largefile_cc_opt="$ac_cv_sys_largefile_CC" @@ -14835,8 +15803,8 @@ $as_echo "$ac_cv_sys_largefile_CC" >&6; } fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } ac_cv_sys_file_offset_bits=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14852,16 +15820,17 @@ ac_cv_sys_file_offset_bits=no ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 @@ -14877,26 +15846,25 @@ else int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_file_offset_bits=64 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } if test "$ac_cv_sys_file_offset_bits" != no; then -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h if test "$LFS_CFLAGS" ; then @@ -14906,8 +15874,8 @@ _ACEOF fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } ac_cv_sys_large_files=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14923,16 +15891,17 @@ ac_cv_sys_large_files=no ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 @@ -14948,26 +15917,25 @@ else int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_large_files=1 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } if test "$ac_cv_sys_large_files" != no; then -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h if test "$LFS_CFLAGS" ; then @@ -14977,50 +15945,50 @@ _ACEOF fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 -$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +printf %s "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } ac_cv_sys_largefile_source=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { return !fseeko; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 #include int -main () +main (void) { return !fseeko; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_largefile_source=1 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 -$as_echo "$ac_cv_sys_largefile_source" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 +printf "%s\n" "$ac_cv_sys_largefile_source" >&6; } if test "$ac_cv_sys_largefile_source" != no; then -cat >>confdefs.h <<_ACEOF -#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source -_ACEOF +printf "%s\n" "#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source" >>confdefs.h if test "$LFS_CFLAGS" ; then @@ -15036,50 +16004,50 @@ _ACEOF ac_save_cflags=${CFLAGS} CFLAGS="$LFS_CFLAGS ${ac_save_cflags}" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 -$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +printf %s "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } ac_cv_sys_largefile_source=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { return !fseeko; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 #include int -main () +main (void) { return !fseeko; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_largefile_source=1 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 -$as_echo "$ac_cv_sys_largefile_source" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 +printf "%s\n" "$ac_cv_sys_largefile_source" >&6; } if test "$ac_cv_sys_largefile_source" != no; then -cat >>confdefs.h <<_ACEOF -#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source -_ACEOF +printf "%s\n" "#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source" >>confdefs.h if test "$LFS_CFLAGS" ; then @@ -15093,42 +16061,43 @@ _ACEOF # in glibc 2.1.3, but that breaks too many other things. # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fseeko" >&5 -$as_echo_n "checking for fseeko... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fseeko" >&5 +printf %s "checking for fseeko... " >&6; } ac_cv_func_fseeko=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { return fseeko && fseeko (stdin, 0, 0); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_func_fseeko=yes fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fseeko" >&5 -$as_echo "$ac_cv_func_fseeko" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fseeko" >&5 +printf "%s\n" "$ac_cv_func_fseeko" >&6; } if test $ac_cv_func_fseeko != no; then -$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h +printf "%s\n" "#define HAVE_FSEEKO 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if system supports Large Files at all" >&5 -$as_echo_n "checking if system supports Large Files at all... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if system supports Large Files at all" >&5 +printf %s "checking if system supports Large Files at all... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { /* @@ -15159,17 +16128,18 @@ return !ftello; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_largefiles=yes -else +else $as_nop ac_cv_largefiles=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_largefiles" >&5 -$as_echo "$ac_cv_largefiles" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_largefiles" >&5 +printf "%s\n" "$ac_cv_largefiles" >&6; } if test $ac_cv_largefiles = yes; then -$as_echo "#define HAVE_LARGEFILES 1" >>confdefs.h +printf "%s\n" "#define HAVE_LARGEFILES 1" >>confdefs.h USE_LARGEFILES=1 else @@ -15207,7 +16177,7 @@ U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -15223,8 +16193,8 @@ LTLIBOBJS=$ac_ltlibobjs ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -15247,14 +16217,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -15264,46 +16236,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -15312,13 +16284,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -15327,8 +16292,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -15340,30 +16309,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -15376,13 +16325,14 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -15409,18 +16359,20 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -15432,12 +16384,13 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -15468,7 +16421,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -15490,6 +16443,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -15503,6 +16460,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +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 @@ -15544,7 +16507,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -15553,7 +16516,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -15616,7 +16579,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.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -15674,14 +16637,16 @@ $config_headers Report bugs to the package provider." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.69, +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -15719,15 +16684,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -15735,7 +16700,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -15744,7 +16709,7 @@ do as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -15772,7 +16737,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -15786,7 +16751,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -15816,8 +16781,8 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree @@ -16153,7 +17118,7 @@ do esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; 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 @@ -16161,17 +17126,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -16188,7 +17153,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -16212,9 +17177,9 @@ $as_echo X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -16271,8 +17236,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -16315,9 +17280,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"; } && - { $as_echo "$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 -$as_echo "$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" @@ -16333,20 +17298,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -16387,8 +17352,8 @@ if test "$no_create" != yes; then $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi @@ -16511,12 +17476,13 @@ echo "" # remove when the new PROJ API is stable if test $PROJ4API = 0 ; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using new PROJ 5+ API" >&5 -$as_echo " using new PROJ 5+ API" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: using new PROJ 5+ API" >&5 +printf "%s\n" " using new PROJ 5+ API" >&6; } else -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using old PROJ 4 API" >&5 -$as_echo " using old PROJ 4 API" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: using old PROJ 4 API" >&5 +printf "%s\n" " using old PROJ 4 API" >&6; } fi echo "" + diff --git a/configure.ac b/configure.ac old mode 100755 new mode 100644 index 4df82d7b6f6..2f1bfc69218 --- a/configure.ac +++ b/configure.ac @@ -31,8 +31,8 @@ $2 AC_INIT AC_CONFIG_SRCDIR([configure.ac]) -AC_PREREQ([2.69]) -AC_CONFIG_HEADER(include/grass/config.h) +AC_PREREQ([2.71]) +AC_CONFIG_HEADERS([include/grass/config.h]) AC_CANONICAL_HOST AC_PROG_CC @@ -466,7 +466,7 @@ AC_SUBST(LIBRARY_DIRS) AC_PROG_INSTALL -AC_PROG_LEX +AC_PROG_LEX(noyywrap) if test "$LEX" = "lex"; then AC_PATH_PROG(LEXPATH, lex, no) if test "$LEXPATH" = "no"; then @@ -486,14 +486,14 @@ AC_PROG_RANLIB AC_CHECK_PROGS(AR, ar) AC_CHECK_PROGS(ENV, env) AC_PATH_PROG(PERL, perl, no) -AC_HEADER_STDC + #AC_CHECK_HEADERS(curses.h limits.h termio.h termios.h unistd.h values.h) AC_CHECK_HEADERS(limits.h termio.h termios.h unistd.h values.h f2c.h g2c.h) AC_CHECK_HEADERS(sys/ioctl.h sys/mtio.h sys/resource.h sys/time.h) AC_CHECK_HEADERS(sys/timeb.h sys/types.h sys/utsname.h) AC_CHECK_HEADERS(libintl.h iconv.h) AC_CHECK_HEADERS(langinfo.h) -AC_HEADER_TIME + AC_TYPE_OFF_T AC_TYPE_UID_T @@ -518,7 +518,7 @@ fi AC_MSG_CHECKING(for long long int) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long long int x;]])],[ AC_MSG_RESULT(yes) -AC_DEFINE(HAVE_LONG_LONG_INT, 1, [define if "long long int" is available]) +AC_DEFINE(HAVE_LONG_LONG_INT, 1, [Define to 1 if "long long int" is available.]) ],[ AC_MSG_RESULT(no) ]) @@ -526,7 +526,7 @@ AC_MSG_RESULT(no) AC_MSG_CHECKING(for int64_t) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int64_t x;]])],[ AC_MSG_RESULT(yes) -AC_DEFINE(HAVE_INT64_T, 1, [define if "int64_t" is available]) +AC_DEFINE(HAVE_INT64_T, 1, [Define to 1 if "int64_t" is available.]) ],[ AC_MSG_RESULT(no) ]) @@ -754,7 +754,7 @@ if test $PROJ4API = 0 ; then LOC_CHECK_LIBS(proj,proj_pj_info,External PROJ,$PROJLIB,PROJLIB,,,) else AC_MSG_RESULT([using old PROJ version 4 API]) - AC_DEFINE(USE_PROJ4API, 1, [define if using old PROJ version 4 API]) + AC_DEFINE(USE_PROJ4API, 1, [Define to 1 if using old PROJ version 4 API.]) LOC_CHECK_INCLUDES(proj_api.h,External PROJ,$PROJINC) # PROJ version check for v4.x @@ -904,7 +904,7 @@ else CFLAGS="$CFLAGS $PNGINC" AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[png_read_image(NULL, NULL);]])],[],[ - AC_TRY_LINK([#include ],[png_read_image(NULL, NULL);],PNGLIB="$PNGLIB",[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[png_read_image(NULL, NULL);]])],[PNGLIB="$PNGLIB"],[ AC_MSG_ERROR([*** Unable to locate libpng library.]) ]) ]) @@ -947,7 +947,7 @@ else GDAL_CFLAGS=`"$GDAL_CONFIG" --cflags` USE_GDAL=1 if test `"$GDAL_CONFIG" --ogr-enabled` = "yes" ; then - AC_DEFINE(HAVE_OGR, 1, [define if OGR is to be used]) + AC_DEFINE(HAVE_OGR, 1, [Define to 1 if OGR is to be used.]) USE_OGR=1 fi fi @@ -959,14 +959,14 @@ else CFLAGS="$CFLAGS $GDAL_CFLAGS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[GDALOpen("foo", GA_ReadOnly);]])],[],[ LIBS="$LIBS $GDAL_DEP_LIBS" - AC_TRY_LINK([#include ],[GDALOpen("foo", GA_ReadOnly);],GDAL_LIBS="$GDAL_LIBS $GDAL_DEP_LIBS",[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[GDALOpen("foo", GA_ReadOnly);]])],[GDAL_LIBS="$GDAL_LIBS $GDAL_DEP_LIBS"],[ AC_MSG_ERROR([*** Unable to locate GDAL library.]) ]) ]) LIBS=${ac_save_libs} CFLAGS=${ac_save_cflags} - AC_DEFINE(HAVE_GDAL, 1, [define if GDAL is to be used]) + AC_DEFINE(HAVE_GDAL, 1, [Define to 1 if GDAL is to be used.]) fi AC_SUBST(GDAL_LIBS) @@ -1012,7 +1012,7 @@ else CPPFLAGS="$CPPFLAGS $LIBLAS_INC" AC_CHECK_HEADERS(liblas/capi/liblas.h) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[LASReader_Create("foo");]])],[],[ - AC_TRY_LINK([#include ],[LASReader_Create("foo");],LAS_LIBS="$LAS_LIBS",[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[LASReader_Create("foo");]])],[LAS_LIBS="$LAS_LIBS"],[ AC_MSG_ERROR([*** Unable to locate libLAS library.]) ]) ]) @@ -1020,7 +1020,7 @@ else CFLAGS=${ac_save_cflags} CPPFLAGS=${ac_save_cppflags} - AC_DEFINE(HAVE_LIBLAS, 1, [define if liblas exists]) + AC_DEFINE(HAVE_LIBLAS, 1, [Define to 1 if liblas exists.]) fi AC_SUBST(LIBLAS_LIBS) @@ -1060,16 +1060,16 @@ else AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include class St:public pdal::Streamable {};]], [[pdal::PointTable table;]])],[],[ - AC_TRY_LINK([#include + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include - class St:public pdal::Streamable {};],[pdal::PointTable table;],PDAL_LIBS="$PDAL_LIBS",[ + class St:public pdal::Streamable {};]], [[pdal::PointTable table;]])],[PDAL_LIBS="$PDAL_LIBS"],[ AC_MSG_ERROR([*** Unable to locate suitable (>=1.7.1) PDAL library.]) ]) ]) LIBS=${ac_save_libs} CFLAGS=${ac_save_cflags} - AC_DEFINE(HAVE_PDAL, 1, [Define to 1 if PDAL is to be used.]) + AC_DEFINE(HAVE_PDAL, 1, [Define to 1 if PDAL exists.]) fi AC_SUBST(PDAL_LIBS) @@ -1113,14 +1113,14 @@ else LIBS="$LIBS $NETCDF_LIBS" CFLAGS="$CFLAGS $NETCDF_CFLAGS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[nc_create("foo", NC_CLOBBER, NULL);]])],[],[ - AC_TRY_LINK([#include ],[nc_create("foo", NC_CLOBBER, NULL);],NETCDF_LIBS="$NETCDF_LIBS",[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[nc_create("foo", NC_CLOBBER, NULL);]])],[NETCDF_LIBS="$NETCDF_LIBS"],[ AC_MSG_ERROR([*** Unable to locate NetCDF library.]) ]) ]) LIBS=${ac_save_libs} CFLAGS=${ac_save_cflags} - AC_DEFINE(HAVE_NETCDF, 1, [define if NetCDF exists]) + AC_DEFINE(HAVE_NETCDF, 1, [Define to 1 if NetCDF exists.]) fi AC_SUBST(NETCDF_LIBS) @@ -1163,7 +1163,7 @@ else # else LOC_CHECK_LIBS(geos_c,initGEOS,GEOS,$GEOS_LIBS,GEOS_LIBS) # fi - AC_DEFINE(HAVE_GEOS, 1, [define if GEOS is to be used]) + AC_DEFINE(HAVE_GEOS, 1, [Define to 1 if GEOS is to be used.]) fi AC_SUBST(GEOS_LIBS) @@ -1205,7 +1205,7 @@ AC_SUBST(TIFFLIB) LOC_CHECK_USE(postgres,PostgreSQL,USE_POSTGRES) if test -n "$USE_POSTGRES"; then -AC_DEFINE(HAVE_POSTGRES, 1, [define if PostgreSQL is to be used]) +AC_DEFINE(HAVE_POSTGRES, 1, [Define to 1 if PostgreSQL is to be used.]) fi # $USE_POSTGRES PQINCPATH= @@ -1232,8 +1232,8 @@ LOC_CHECK_LIBS(pq,PQsetdbLogin,PostgreSQL,$PQLIBPATH,PQLIB,,,,-lcrypt,-lssl -lcr ac_save_ldflags="$LDFLAGS" LDFLAGS="$LDFLAGS $PQLIBPATH" -AC_CHECK_LIB(pq,PQcmdTuples, [AC_DEFINE(HAVE_PQCMDTUPLES, 1, [define if PQcmdTuples in lpq])], [ -AC_CHECK_LIB(pq,PQcmdTuples, [AC_DEFINE(HAVE_PQCMDTUPLES, 1, [define if PQcmdTuples in lpq])], [ +AC_CHECK_LIB(pq,PQcmdTuples, [AC_DEFINE(HAVE_PQCMDTUPLES, 1, [Define to 1 if PQcmdTuples in lpq.])], [ +AC_CHECK_LIB(pq,PQcmdTuples, [AC_DEFINE(HAVE_PQCMDTUPLES, 1, [Define to 1 if PQcmdTuples in lpq.])], [ ], -lcrypt) ]) LDFLAGS="${ac_save_ldflags}" @@ -1319,7 +1319,7 @@ LOC_CHECK_INC_PATH(sqlite,SQLite,SQLITEINCPATH) LOC_CHECK_INCLUDES(sqlite3.h,SQLite,$SQLITEINCPATH) -AC_DEFINE(HAVE_SQLITE, 1, [define if SQLite is to be used]) +AC_DEFINE(HAVE_SQLITE, 1, [Define to 1 if SQLite is to be used.]) fi # $USE_SQLITE @@ -1398,10 +1398,10 @@ LOC_CHECK_LIBS(GLU,gluBeginCurve,GLU,$OPENGL_LIB_PATH,OPENGLULIB,$OPENGLLIB $X_L OPENGLLIB="$OPENGL_LIB_PATH $OPENGLLIB" OPENGLULIB="$OPENGL_LIB_PATH $OPENGLULIB" -LOC_CHECK_FUNC(glXCreatePbuffer,,,,,$OPENGLLIB,[AC_DEFINE(HAVE_PBUFFERS, 1, [define if glXCreatePbuffer exists])]) -LOC_CHECK_FUNC(glXCreateGLXPixmap,,,,,$OPENGLLIB,[AC_DEFINE(HAVE_PIXMAPS, 1, [define if glXCreateGLXPixmap exists])]) +LOC_CHECK_FUNC(glXCreatePbuffer,,,,,$OPENGLLIB,[AC_DEFINE(HAVE_PBUFFERS, 1, [Define to 1 if glXCreatePbuffer exists.])]) +LOC_CHECK_FUNC(glXCreateGLXPixmap,,,,,$OPENGLLIB,[AC_DEFINE(HAVE_PIXMAPS, 1, [Define to 1 if glXCreateGLXPixmap exists.])]) -AC_DEFINE(OPENGL_X11, 1, [define if OpenGL uses X11]) +AC_DEFINE(OPENGL_X11, 1, [Define to 1 if OpenGL uses X11.]) fi # $OPENGL_X11 @@ -1417,7 +1417,7 @@ LOC_CHECK_FUNC(gluBeginCurve,GLU library,OPENGLLIB,,$OPENGLPATH,$OPENGLLIB) OPENGLINC="$OPENGLPATH" OPENGLLIBPATH="$OPENGLPATH" -AC_DEFINE(OPENGL_AQUA, 1, [define if OpenGL uses Aqua (MacOS X)]) +AC_DEFINE(OPENGL_AQUA, 1, [Define to 1 if OpenGL uses Aqua (MacOS X).]) fi # $OPENGL_AQUA @@ -1442,7 +1442,7 @@ CFLAGS="${ac_save_cflags}" OPENGLLIB="$OPENGL_LIB_PATH $OPENGLLIB" OPENGLULIB="$OPENGL_LIB_PATH $OPENGLULIB" -AC_DEFINE(OPENGL_WINDOWS, 1, [define if OpenGL uses Windows]) +AC_DEFINE(OPENGL_WINDOWS, 1, [Define to 1 if OpenGL uses Windows.]) fi # $OPENGL_WINDOWS @@ -1582,7 +1582,7 @@ LDFLAGS="$save_LDFLAGS" # Do we have ATLAS? if test $blas_ok = yes; then - AC_DEFINE(HAVE_LIBATLAS, 1, [define if ATLAS exists]) + AC_DEFINE(HAVE_LIBATLAS, 1, [Define to 1 if ATLAS exists.]) fi # BLAS in Apple vecLib framework? (Mac OS-X) @@ -1627,7 +1627,7 @@ if test $blas_ok = no; then fi if test $blas_ok = yes; then -AC_DEFINE(HAVE_LIBBLAS, 1, [define if BLAS exists]) +AC_DEFINE(HAVE_LIBBLAS, 1, [Define to 1 if BLAS exists.]) fi fi # $USE_BLAS @@ -1686,7 +1686,7 @@ if test $lapack_ok = no; then LOC_CHECK_LIBS(lapack,dgesv_,LAPACK,$LAPACKLIB,LAPACKLIB,$BLASLIB $MATHLIB,,,-lg2c) fi -AC_DEFINE(HAVE_LIBLAPACK, 1, [define if LAPACK exists]) +AC_DEFINE(HAVE_LIBLAPACK, 1, [Define to 1 if LAPACK exists.]) fi # $USE_LAPACK fi # $USE_BLAS @@ -1789,7 +1789,7 @@ INTLLIB= HAVE_NLS= if test -n "${USE_NLS}" ; then - AC_DEFINE(USE_NLS, 1, [define if NLS requested]) + AC_DEFINE(USE_NLS, 1, [Define to 1 if NLS requested.]) AC_CHECK_FUNC(gettext, INTLLIB=, [ AC_CHECK_LIB(intl, gettext, INTLLIB=-lintl, [ diff --git a/db/drivers/mysql/db.c b/db/drivers/mysql/db.c index 5e5748c11f5..16a7ec5600b 100644 --- a/db/drivers/mysql/db.c +++ b/db/drivers/mysql/db.c @@ -53,8 +53,9 @@ int db__driver_open_database(dbHandle *handle) db_get_login2("mysql", name, &user, &password, &host, &port); connection = mysql_init(NULL); - res = mysql_real_connect(connection, host, user, password, - connpar.dbname, port, NULL, 0); + res = + mysql_real_connect(connection, host, user, password, connpar.dbname, + port != NULL ? atoi(port) : 0, NULL, 0); if (res == NULL) { db_d_append_error("%s\n%s", _("Connection failed."), diff --git a/db/drivers/ogr/describe.c b/db/drivers/ogr/describe.c index ba8aa9f848f..ad93339659e 100644 --- a/db/drivers/ogr/describe.c +++ b/db/drivers/ogr/describe.c @@ -105,10 +105,7 @@ int describe_table(OGRLayerH hLayer, dbTable **table, cursor *c) ogrType = OGR_Fld_GetType(hFieldDefn); fieldName = OGR_Fld_GetNameRef(hFieldDefn); - if (ogrType != OFTInteger && -#if GDAL_VERSION_NUM >= 2000000 - ogrType != OFTInteger64 && -#endif + if (ogrType != OFTInteger && ogrType != OFTInteger64 && ogrType != OFTReal && ogrType != OFTString && ogrType != OFTDate && ogrType != OFTTime && ogrType != OFTDateTime) { G_warning( @@ -174,19 +171,15 @@ int describe_table(OGRLayerH hLayer, dbTable **table, cursor *c) switch (ogrType) { case OFTInteger: -#if GDAL_VERSION_NUM >= 2000000 case OFTInteger64: -#endif sqlType = DB_SQL_TYPE_INTEGER; size = OGR_Fld_GetWidth(hFieldDefn); /* OK ? */ precision = 0; -#if GDAL_VERSION_NUM >= 2000000 if (ogrType == OFTInteger64) G_warning(_("Column '%s' : type int8 (bigint) is stored as " "integer (4 bytes) " "some data may be damaged"), fieldName); -#endif break; case OFTReal: diff --git a/db/drivers/ogr/execute.c b/db/drivers/ogr/execute.c index b47d18eb93a..71379aea8e9 100644 --- a/db/drivers/ogr/execute.c +++ b/db/drivers/ogr/execute.c @@ -98,10 +98,7 @@ int db__driver_execute_immediate(dbString *sql) } else { if ((cols[i].type != OFTInteger || -#if GDAL_VERSION_NUM >= 2000000 - cols[i].type != OFTInteger64 || -#endif - cols[i].type != OFTReal) && + cols[i].type != OFTInteger64 || cols[i].type != OFTReal) && *(cols[i].value) == '\'') { value = G_strchg(cols[i].value, '\'', ' '); G_strip(value); diff --git a/db/drivers/ogr/fetch.c b/db/drivers/ogr/fetch.c index caf9e9063af..5fb954fbafd 100644 --- a/db/drivers/ogr/fetch.c +++ b/db/drivers/ogr/fetch.c @@ -143,12 +143,10 @@ int db__driver_fetch(dbCursor *cn, int position, int *more) value->i = OGR_F_GetFieldAsInteger(c->hFeature, i); break; -#if GDAL_VERSION_NUM >= 2000000 case OFTInteger64: /* test for integer overflow ? */ value->i = OGR_F_GetFieldAsInteger64(c->hFeature, i); break; -#endif case OFTReal: value->d = OGR_F_GetFieldAsDouble(c->hFeature, i); diff --git a/display/d.text/test.py b/display/d.text/test.py index d1b476990dc..ffc50cfc8aa 100755 --- a/display/d.text/test.py +++ b/display/d.text/test.py @@ -51,7 +51,7 @@ def text(in_text): for i in range(36): font(fonts[int(i % len(fonts))]) - size(((36 - i if (i >= 9 and i <= 18 or i > 27) else i) % 9)) + size((36 - i if (i >= 9 and i <= 18 or i > 27) else i) % 9) rotate(i * 10) color(colors[i % len(colors)]) xy( diff --git a/doc/development/submitting/general.md b/doc/development/submitting/general.md index 1105de3b7fd..d0537ac930e 100644 --- a/doc/development/submitting/general.md +++ b/doc/development/submitting/general.md @@ -193,7 +193,7 @@ If you are unsure, please ask on the GRASS Developers list. If you need to add support for a different library in the 'configure' script, you should first seek consent in the grass-dev mailing list (see below), then you need -to expand 'configure.in' and run subsequently `autoconf-2.69` (later versions +to expand 'configure.ac' and subsequently run `autoconf-2.71` (later versions will not work) to re-generate 'configure'. ## Naming Conventions diff --git a/doc/git/investigating_history.md b/doc/git/investigating_history.md index 0e62f731958..306b4fe819c 100644 --- a/doc/git/investigating_history.md +++ b/doc/git/investigating_history.md @@ -27,9 +27,3 @@ In some cases, ignoring formatting changes may not be appropriate, for example when investigating automated checks of formatting. If you think the _ignore-revs_ file contains commits which should be never ignored with `git blame`, please open an issue. - -## On GitHub - -GitHub interface does not allow to use the ignore-revs file. However, it is -easy to move over a revision by pressing "View blame prior to this change" -which is the icon between commit info and line numbers. diff --git a/doc/gui/wxpython/example/frame.py b/doc/gui/wxpython/example/frame.py index 3c5f27e0231..01a5442789f 100644 --- a/doc/gui/wxpython/example/frame.py +++ b/doc/gui/wxpython/example/frame.py @@ -222,7 +222,7 @@ def AddToolbar(self, name): .CloseButton(False) .Layer(1) .Row(1) - .BestSize((self.toolbars[name].GetBestSize())), + .BestSize(self.toolbars[name].GetBestSize()), ) if name == "MiscToolbar": @@ -243,7 +243,7 @@ def AddToolbar(self, name): .CloseButton(False) .Layer(1) .Row(1) - .BestSize((self.toolbars[name].GetBestSize())), + .BestSize(self.toolbars[name].GetBestSize()), ) if name == "MainToolbar": @@ -264,7 +264,7 @@ def AddToolbar(self, name): .CloseButton(False) .Layer(1) .Row(1) - .BestSize((self.toolbars[name].GetBestSize())), + .BestSize(self.toolbars[name].GetBestSize()), ) def GetMapToolbar(self): diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile index 2ec9a0a09e1..4cd5947cf38 100644 --- a/docker/alpine/Dockerfile +++ b/docker/alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.18 as common +FROM alpine:3.19 as common # Based on: # https://github.com/mundialis/docker-grass-gis/blob/master/Dockerfile diff --git a/general/g.proj/output.c b/general/g.proj/output.c index 365578ab527..33b7b6042d9 100644 --- a/general/g.proj/output.c +++ b/general/g.proj/output.c @@ -22,6 +22,10 @@ #include #include +#ifdef HAVE_OGR +#include +#endif + #include "local_proto.h" static int check_xy(int shell); @@ -274,7 +278,7 @@ void print_wkt(int esristyle, int dontprettify) if (outwkt != NULL) { fprintf(stdout, "%s\n", outwkt); - G_free(outwkt); + CPLFree(outwkt); } else G_warning(_("Unable to convert to WKT")); diff --git a/general/g.proj/testsuite/test_g_proj.py b/general/g.proj/testsuite/test_g_proj.py new file mode 100644 index 00000000000..4ef67e5781b --- /dev/null +++ b/general/g.proj/testsuite/test_g_proj.py @@ -0,0 +1,27 @@ +"""g.proj tests + +(C) 2023 by the GRASS Development Team +This program is free software under the GNU General Public +License (>=v2). Read the file COPYING that comes with GRASS +for details. + +:author: Anna Petrasova +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + + +class GProjWKTTestCase(TestCase): + """Test g.proj with WKT output""" + + def test_wkt_output(self): + """Test if g.proj returns WKT""" + module = SimpleModule("g.proj", flags="w") + self.assertModule(module) + self.assertIn("PROJCRS", module.outputs.stdout) + + +if __name__ == "__main__": + test() diff --git a/grasslib.dox b/grasslib.dox index ee2323ddb30..25d6ee9179d 100644 --- a/grasslib.dox +++ b/grasslib.dox @@ -122,7 +122,7 @@ href="https://grass.osgeo.org">https://grass.osgeo.org \subsection misclibs Miscellaneous Libraries - datetime: \ref datetime (DateTime library) - - external: \ref external (External libraries from other projects such as shapelib and \ref ccmathlib) + - external: \ref external (External libraries from other projects such as shapelib, parson and \ref ccmathlib) - fonts: \ref fonts (GRASS fonts library) - init: \ref init (GRASS initialization code + scripts) - iostream: \ref iostream (fast I/O library) @@ -131,6 +131,22 @@ href="https://grass.osgeo.org">https://grass.osgeo.org - manage: \ref managelib - symbol: \ref symbol (Drawing symbols for %point %vector data library) +\subsection external Adding External Libraries + + The following files must be added or updated when including a new external library. + + - add: lib/external/newlib + - add: lib/external/newlib/*.c + - add: lib/external/newlib/*.h + - add: lib/external/newlib/LICENSE + - add: lib/external/newlib/Makefile + - update: lib/external/Makefile + - update: lib/external/README.license + - update: lib/README.md + - update: include/Make/Install.make + - update: include/Make/Grass.make + - update: Makefile + \section location File structure of GRASS Location A GRASS raster map consists of several files in several subdirectories in a mapset, diff --git a/gui/wxpython/animation/frame.py b/gui/wxpython/animation/frame.py index 1f46e827c1b..38f07866264 100644 --- a/gui/wxpython/animation/frame.py +++ b/gui/wxpython/animation/frame.py @@ -181,7 +181,7 @@ def _addToolbars(self): .Layer(2) .Row(1) .Position(0) - .BestSize((self.toolbars["mainToolbar"].GetBestSize())), + .BestSize(self.toolbars["mainToolbar"].GetBestSize()), ) self.toolbars["animationToolbar"] = AnimationToolbar(self) @@ -200,7 +200,7 @@ def _addToolbars(self): .Layer(2) .Row(1) .Position(1) - .BestSize((self.toolbars["animationToolbar"].GetBestSize())), + .BestSize(self.toolbars["animationToolbar"].GetBestSize()), ) self.controller.SetAnimationToolbar(self.toolbars["animationToolbar"]) @@ -220,7 +220,7 @@ def _addToolbars(self): .Layer(2) .Row(1) .Position(2) - .BestSize((self.toolbars["miscToolbar"].GetBestSize())), + .BestSize(self.toolbars["miscToolbar"].GetBestSize()), ) def SetAnimations(self, layerLists): diff --git a/gui/wxpython/core/gcmd.py b/gui/wxpython/core/gcmd.py index ebb3694d80a..eca7ef05898 100644 --- a/gui/wxpython/core/gcmd.py +++ b/gui/wxpython/core/gcmd.py @@ -402,7 +402,7 @@ def __init__( Debug.msg( 3, "Command(): cmd='%s', wait=%s, returncode=%d, alive=%s" - % (" ".join(cmd), wait, self.returncode, self.cmdThread.isAlive()), + % (" ".join(cmd), wait, self.returncode, self.cmdThread.is_alive()), ) if rerr is not None and self.returncode != 0: if rerr is False: # GUI dialog @@ -430,7 +430,7 @@ def __init__( Debug.msg( 3, "Command(): cmd='%s', wait=%s, returncode=?, alive=%s" - % (" ".join(cmd), wait, self.cmdThread.isAlive()), + % (" ".join(cmd), wait, self.cmdThread.is_alive()), ) if verbose_orig: diff --git a/gui/wxpython/core/globalvar.py b/gui/wxpython/core/globalvar.py index 4c73431f5fe..08d61b6b3d7 100644 --- a/gui/wxpython/core/globalvar.py +++ b/gui/wxpython/core/globalvar.py @@ -255,3 +255,10 @@ def UpdateGRASSAddOnCommands(eList=None): """@Add GUIDIR/scripts into path""" os.environ["PATH"] = os.path.join(GUIDIR, "scripts") + os.pathsep + os.environ["PATH"] + +ignoredCmdPattern = ( + r"^d\..*|^r[3]?\.mapcalc$|^i.group$|^r.import$|" + r"^r.external$|^r.external.out$|" + r"^v.import$|^v.external$|^v.external.out$|" + r"^cd$|^cd .*" +) diff --git a/gui/wxpython/core/layerlist.py b/gui/wxpython/core/layerlist.py index 886abf2d5f5..b1a9448227d 100644 --- a/gui/wxpython/core/layerlist.py +++ b/gui/wxpython/core/layerlist.py @@ -146,8 +146,7 @@ def MoveLayerDown(self, layer): self._list.insert(idx + 1, lr) def __iter__(self): - for layer in self._list: - yield layer + yield from self._list def __getitem__(self, index): return self._list[index] diff --git a/gui/wxpython/core/render.py b/gui/wxpython/core/render.py index 6be32c34c61..2bab7806bab 100644 --- a/gui/wxpython/core/render.py +++ b/gui/wxpython/core/render.py @@ -816,7 +816,7 @@ def RenderingFailed(self, cmd, error): self.renderingFailed.emit(cmd=cmd, error=error) -class Map(object): +class Map: def __init__(self, gisrc=None): """Map composition (stack of map layers and overlays) diff --git a/gui/wxpython/core/utils.py b/gui/wxpython/core/utils.py index 2d291e03dfc..67a8f17c62d 100644 --- a/gui/wxpython/core/utils.py +++ b/gui/wxpython/core/utils.py @@ -1198,5 +1198,168 @@ def is_shell_running(): return True +def parse_mapcalc_cmd(command): + """Parse r.mapcalc/r3.mapcalc module command + + >>> parse_mapcalc_cmd(command="r.mapcalc map = 1") + "r.mapcalc expression='map = 1'" + + >>> parse_mapcalc_cmd(command="r.mapcalc map = 1") + "r.mapcalc expression='map = 1'" + + >>> parse_mapcalc_cmd(command="r.mapcalc map=1") + "r.mapcalc expression='map=1'" + + >>> parse_mapcalc_cmd(command="r.mapcalc map = a - b") + "r.mapcalc expression='map = a - b'" + + >>> parse_mapcalc_cmd(command="r.mapcalc expression=map = a - b") + "r.mapcalc expression='map = a - b'" + + >>> parse_mapcalc_cmd(command="r.mapcalc expression=map = a - b") + "r.mapcalc expression='map = a - b'" + + >>> cmd = "r.mapcalc expr='map = a - b' region=clip --overwrite" + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc --overwrite expr='map = a - b' region=clip" + + >>> cmd = 'r.mapcalc expr="map = a - b" region=clip --overwrite' + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc --overwrite expr='map = a - b' region=clip" + + >>> cmd = "r.mapcalc -s map = (a - b) / c region=clip --overwrite --verbose" + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc -s --overwrite --verbose expression='map = (a - b) / c' region=clip" + + >>> cmd = 'r.mapcalc e="map = 1" region=clip --overwrite' + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc --overwrite e='map = 1' region=clip" + + >>> cmd = 'r.mapcalc ex="map = 1" region=clip --overwrite' + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc --overwrite ex='map = 1' region=clip" + + >>> cmd = 'r.mapcalc exp="map = 1" region=clip --overwrite' + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc --overwrite exp='map = 1' region=clip" + + >>> cmd = 'r.mapcalc expr="map = 1" region=clip --overwrite' + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc --overwrite expr='map = 1' region=clip" + + >>> cmd = 'r.mapcalc expre="map = 1" region=clip --overwrite' + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc --overwrite expre='map = 1' region=clip" + + >>> cmd = 'r.mapcalc expres="map = 1" region=clip --overwrite' + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc --overwrite expres='map = 1' region=clip" + + >>> cmd = 'r.mapcalc express="map = 1" region=clip --overwrite' + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc --overwrite express='map = 1' region=clip" + + >>> cmd = 'r.mapcalc expressi="map = 1" region=clip --overwrite' + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc --overwrite expressi='map = 1' region=clip" + + >>> cmd = 'r.mapcalc expressio="map = 1" region=clip --overwrite' + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc --overwrite expressio='map = 1' region=clip" + + >>> cmd = 'r.mapcalc expression="map = 1" region=clip --overwrite' + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc --overwrite expression='map = 1' region=clip" + + >>> cmd = 'r.mapcalc exp="map = a + e" region=clip --overwrite' + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc --overwrite exp='map = a + e' region=clip" + + >>> cmd = 'r.mapcalc exp="map = a + exp(5)" region=clip --overwrite' + >>> parse_mapcalc_cmd(command=cmd) + "r.mapcalc --overwrite exp='map = a + exp(5)' region=clip" + + :param str command: r.mapcalc command string + + :return str: parsed r.mapcalc command string + """ + flags = [] + others_params_args = [] + expr_param_regex = re.compile(r"e.*?=") + flag_regex = re.compile( + r"^-[a-z]|^--overwrite|^--quiet|^--verbose|^--help|^--o|^--q|^--v|^--h", + ) + + command = split(command) + module = command.pop(0) + + for arg in command[:]: + flag = flag_regex.search(arg) + if flag: + flags.append(command.pop(command.index(flag.group()))) + elif "region=" in arg or "file=" in arg or "seed=" in arg: + others_params_args.append(command.pop(command.index(arg))) + + cmd = " ".join(command) + expr_param = expr_param_regex.search(cmd) + if not expr_param: + expr_param_name = "expression=" + else: + # Remove expression param + command = split(cmd.replace(expr_param.group(), "")) + expr_param_name = expr_param.group() + # Add quotes + if "'" not in cmd or '"' not in cmd: + cmd = f"'{' '.join(command)}'" + expression_param_arg = f"{expr_param_name}{cmd}" + + return " ".join( + [ + module, + *flags, + expression_param_arg, + *others_params_args, + ] + ) + + +def replace_module_cmd_special_flags(command): + """Replace module command special flags short version with + full version + + Flags: + + --o -> --overwrite + --q -> --quiet + --v -> --verbose + --h -> --help + + >>> cmd = "r.mapcalc -s --o --v expression='map = 1' region=clip" + >>> replace_module_cmd_special_flags(command=cmd) + "r.mapcalc -s --overwrite --verbose expression='map = 1' region=clip" + + >>> cmd = "r.mapcalc -s --o --q expression='map = 1' region=clip" + >>> replace_module_cmd_special_flags(command=cmd) + "r.mapcalc -s --overwrite --quiet expression='map = 1' region=clip" + + :param str command: module command string + + :return str: module command string with replaced flags + """ + flags_regex = re.compile( + r"(--o(\s+|$))|(--q(\s+|$))|(--v(\s+|$))|(--h(\s+|$))", + ) + replace = { + "--o": "--overwrite ", + "--q": "--quiet ", + "--v": "--verbose ", + "--h": "--help ", + } + return flags_regex.sub( + lambda flag: replace[flag.group().strip()], + command, + ) + + if __name__ == "__main__": sys.exit(doc_test()) diff --git a/gui/wxpython/gcp/mapdisplay.py b/gui/wxpython/gcp/mapdisplay.py index 31c501bdd64..318100ee1cd 100644 --- a/gui/wxpython/gcp/mapdisplay.py +++ b/gui/wxpython/gcp/mapdisplay.py @@ -253,7 +253,7 @@ def AddToolbar(self, name): .TopDockable(True) .CloseButton(False) .Layer(2) - .BestSize((self.toolbars["map"].GetSize())), + .BestSize(self.toolbars["map"].GetSize()), ) # GCP display diff --git a/gui/wxpython/gui_core/dialogs.py b/gui/wxpython/gui_core/dialogs.py index d3caa8422c6..387b7ca30c0 100644 --- a/gui/wxpython/gui_core/dialogs.py +++ b/gui/wxpython/gui_core/dialogs.py @@ -1933,6 +1933,7 @@ def __init__( style=wx.DEFAULT_DIALOG_STYLE, **kwargs, ): + img_size = kwargs.pop("img_size", None) self.parent = parent wx.Dialog.__init__(self, parent, id=id, style=style, title=title, **kwargs) @@ -1946,11 +1947,11 @@ def __init__( size = self.parent.GetWindow().GetClientSize() self.width = SpinCtrl(parent=self.panel, id=wx.ID_ANY, style=wx.SP_ARROW_KEYS) self.width.SetRange(20, 1e6) - self.width.SetValue(size.width) + self.width.SetValue(img_size[0] if img_size else size.width) wx.CallAfter(self.width.SetFocus) self.height = SpinCtrl(parent=self.panel, id=wx.ID_ANY, style=wx.SP_ARROW_KEYS) self.height.SetRange(20, 1e6) - self.height.SetValue(size.height) + self.height.SetValue(img_size[1] if img_size else size.height) self.template = wx.Choice( parent=self.panel, id=wx.ID_ANY, diff --git a/gui/wxpython/gui_core/forms.py b/gui/wxpython/gui_core/forms.py index fb69c3db66d..87d10c81815 100644 --- a/gui/wxpython/gui_core/forms.py +++ b/gui/wxpython/gui_core/forms.py @@ -875,7 +875,7 @@ def OnRun(self, event): ) print("parent window is: %s" % (str(self.parent)), file=sys.stderr) else: - gcmd.Command(cmd) + gcmd.Command(cmd, rerr=sys.stderr, stderr=sys.stderr) if ret != 0: self.notebookpanel.notebook.SetSelection(0) diff --git a/gui/wxpython/gui_core/menu.py b/gui/wxpython/gui_core/menu.py index 8070e49feeb..d616b73235c 100644 --- a/gui/wxpython/gui_core/menu.py +++ b/gui/wxpython/gui_core/menu.py @@ -105,7 +105,7 @@ def _createMenuItem( try: cmd = utils.split(str(command)) except UnicodeError: - cmd = utils.split(EncodeString((command))) + cmd = utils.split(EncodeString(command)) # disable only grass commands which are not present (e.g. # r.in.lidar) if ( diff --git a/gui/wxpython/gui_core/preferences.py b/gui/wxpython/gui_core/preferences.py index c9f74cb25af..2b2dc5ab781 100644 --- a/gui/wxpython/gui_core/preferences.py +++ b/gui/wxpython/gui_core/preferences.py @@ -202,6 +202,33 @@ def OnSave(self, event): group="language", key="locale", subkey="lc_all", value=None ) lang = None + env = grass.gisenv() + nprocs_gisenv = "NPROCS" + memorydb_gisenv = "MEMORYMB" + # Set gisenv MEMORYMB var value + memorymb = self.memorymb.GetValue() + if memorymb: + grass.run_command( + "g.gisenv", + set=f"{memorydb_gisenv}={memorymb}", + ) + elif env.get(memorydb_gisenv): + grass.run_command( + "g.gisenv", + unset=memorydb_gisenv, + ) + # Set gisenv NPROCS var value + nprocs = self.nprocs.GetValue() + if nprocs: + grass.run_command( + "g.gisenv", + set=f"{nprocs_gisenv}={nprocs}", + ) + elif env.get(nprocs_gisenv): + grass.run_command( + "g.gisenv", + unset=nprocs_gisenv, + ) self.settings.SaveToFile() Debug.msg(1, "Settings saved to file '%s'" % self.settings.filePath) self.settingsChanged.emit() @@ -1245,6 +1272,56 @@ def _createCmdPage(self, notebook): gridSizer.Add(verbosity, pos=(row, 1), flag=wx.ALIGN_RIGHT) + row += 1 + # nprocs + gridSizer.Add( + StaticText( + parent=panel, + id=wx.ID_ANY, + label=_( + "Number of threads for parallel computing (supported tools only):" + ), + ), + flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, + pos=(row, 0), + ) + self.nprocs = TextCtrl( + parent=panel, + id=wx.ID_ANY, + value=grass.gisenv().get("NPROCS", ""), + validator=IntegerValidator(), + name="NumberOfProcs", + ) + gridSizer.Add( + self.nprocs, + flag=wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, + pos=(row, 1), + ) + + row += 1 + # memorymb + gridSizer.Add( + StaticText( + parent=panel, + id=wx.ID_ANY, + label=_("Maximum memory in MB to be used (supported tools only):"), + ), + flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, + pos=(row, 0), + ) + self.memorymb = TextCtrl( + parent=panel, + id=wx.ID_ANY, + value=grass.gisenv().get("MEMORYMB", ""), + validator=IntegerValidator(), + name="MemorySizeMB", + ) + gridSizer.Add( + self.memorymb, + flag=wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, + pos=(row, 1), + ) + gridSizer.AddGrowableCol(0) sizer.Add(gridSizer, proportion=1, flag=wx.ALL | wx.EXPAND, border=5) border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=3) @@ -1930,7 +2007,7 @@ def OnLoadEpsgCodes(self, event): ) return - if isinstance(self.epsgCodeDict, type("")): + if isinstance(self.epsgCodeDict, str): wx.MessageBox( parent=self, message=_("Unable to read EPSG codes: %s") % self.epsgCodeDict, diff --git a/gui/wxpython/gui_core/prompt.py b/gui/wxpython/gui_core/prompt.py index 714b5a7ac1a..92b478f842f 100644 --- a/gui/wxpython/gui_core/prompt.py +++ b/gui/wxpython/gui_core/prompt.py @@ -93,7 +93,7 @@ def _runCmd(self, cmdString): try: cmd = utils.split(str(cmdString)) except UnicodeError: - cmd = utils.split(EncodeString((cmdString))) + cmd = utils.split(EncodeString(cmdString)) cmd = list(map(DecodeString, cmd)) self.promptRunCmd.emit(cmd={"cmd": cmd, "cmdString": str(cmdString)}) diff --git a/gui/wxpython/gui_core/simplelmgr.py b/gui/wxpython/gui_core/simplelmgr.py index 1b321a812f0..d59a443c9b0 100644 --- a/gui/wxpython/gui_core/simplelmgr.py +++ b/gui/wxpython/gui_core/simplelmgr.py @@ -104,7 +104,7 @@ def _layout(self): .Name("checklist") .CenterPane() .CloseButton(False) - .BestSize((self._checkList.GetBestSize())), + .BestSize(self._checkList.GetBestSize()), ) paneInfo = ( wx.aui.AuiPaneInfo() @@ -114,7 +114,7 @@ def _layout(self): .CloseButton(False) .Layer(1) .Gripper(False) - .BestSize((self._toolbar.GetBestSize())) + .BestSize(self._toolbar.GetBestSize()) ) if self._style & SIMPLE_LMGR_TB_LEFT: paneInfo.Left() diff --git a/gui/wxpython/history/browser.py b/gui/wxpython/history/browser.py index c586b2cb777..dd2f12b74a7 100644 --- a/gui/wxpython/history/browser.py +++ b/gui/wxpython/history/browser.py @@ -18,9 +18,16 @@ import wx import re +from core import globalvar from core.gcmd import GError, GException +from core.utils import ( + parse_mapcalc_cmd, + replace_module_cmd_special_flags, + split, +) from gui_core.forms import GUI from gui_core.treeview import CTreeView +from gui_core.wrap import SearchCtrl from history.tree import HistoryBrowserTree from grass.pydispatch.signal import Signal @@ -46,6 +53,7 @@ def __init__( self._giface = giface self.showNotification = Signal("HistoryBrowser.showNotification") + self.runIgnoredCmdPattern = Signal("HistoryBrowser.runIgnoredCmdPattern") wx.Panel.__init__(self, parent=parent, id=id, **kwargs) self._createTree() @@ -55,11 +63,23 @@ def __init__( lambda cmd: self.UpdateHistoryModelByCommand(cmd) ) + self.search = SearchCtrl(self) + self.search.SetDescriptiveText(_("Search")) + self.search.ShowCancelButton(True) + self.search.Bind(wx.EVT_TEXT, lambda evt: self.Filter(evt.GetString())) + self.search.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN, lambda evt: self.Filter("")) + self._layout() def _layout(self): """Dialog layout""" sizer = wx.BoxSizer(wx.VERTICAL) + sizer.Add( + self.search, + proportion=0, + flag=wx.ALL | wx.EXPAND, + border=5, + ) sizer.Add( self._tree, proportion=1, flag=wx.EXPAND | wx.LEFT | wx.RIGHT, border=5 ) @@ -88,6 +108,18 @@ def _getSelectedNode(self): def _refreshTree(self): self._tree.SetModel(self._model.GetModel()) + def Filter(self, text): + """Filter history + + :param str text: text string + """ + model = self._model.GetModel() + if text: + model = self._model.model.Filtered(key=["command"], value=text) + self._tree.SetModel(model) + else: + self._tree.SetModel(model) + def UpdateHistoryModelFromScratch(self): """Update the model from scratch and refresh the tree""" self._model.CreateModel() @@ -108,7 +140,18 @@ def Run(self, node=None): node = node or self._getSelectedNode() if node: command = node.data["command"] - lst = re.split(r"\s+", command) + if ( + globalvar.ignoredCmdPattern + and re.compile(globalvar.ignoredCmdPattern).search(command) + and "--help" not in command + and "--ui" not in command + ): + self.runIgnoredCmdPattern.emit(cmd=split(command)) + return + if re.compile(r"^r[3]?\.mapcalc").search(command): + command = parse_mapcalc_cmd(command) + command = replace_module_cmd_special_flags(command) + lst = split(command) try: GUI(parent=self, giface=self._giface).ParseCommand(lst) except GException as e: diff --git a/gui/wxpython/iclass/frame.py b/gui/wxpython/iclass/frame.py index 846d60e3d4b..9a53317694c 100644 --- a/gui/wxpython/iclass/frame.py +++ b/gui/wxpython/iclass/frame.py @@ -313,7 +313,7 @@ def AddToolbar(self, name): .Layer(2) .Row(1) .Position(0) - .BestSize((self.toolbars[name].GetBestSize())), + .BestSize(self.toolbars[name].GetBestSize()), ) if name == "iClass": @@ -335,7 +335,7 @@ def AddToolbar(self, name): .Layer(2) .Row(2) .Position(0) - .BestSize((self.toolbars[name].GetBestSize())), + .BestSize(self.toolbars[name].GetBestSize()), ) if name == "iClassMisc": @@ -357,7 +357,7 @@ def AddToolbar(self, name): .Layer(2) .Row(1) .Position(1) - .BestSize((self.toolbars[name].GetBestSize())), + .BestSize(self.toolbars[name].GetBestSize()), ) if name == "vdigit": @@ -397,7 +397,7 @@ def AddToolbar(self, name): .Layer(2) .Row(2) .Position(1) - .BestSize((self.toolbars[name].GetBestSize())), + .BestSize(self.toolbars[name].GetBestSize()), ) self._mgr.Update() @@ -445,7 +445,7 @@ def _addPaneToolbar(self, name, position): .Center() .Layer(0) .Position(position) - .BestSize((self.toolbars[name].GetBestSize())), + .BestSize(self.toolbars[name].GetBestSize()), ) def _addPaneMapWindow(self, name, position): @@ -496,7 +496,7 @@ def UpdateActive(self, win): mapTb.Enable("zoomBack", enable=(len(self.MapWindow.zoomhistory) > 1)) if mapTb.GetActiveMap() != (win == self.secondMapWindow): - mapTb.SetActiveMap((win == self.secondMapWindow)) + mapTb.SetActiveMap(win == self.secondMapWindow) self.StatusbarUpdate() def ActivateFirstMap(self, event=None): diff --git a/gui/wxpython/image2target/ii2t_mapdisplay.py b/gui/wxpython/image2target/ii2t_mapdisplay.py index b0f0cd5fa94..2543309cbf3 100644 --- a/gui/wxpython/image2target/ii2t_mapdisplay.py +++ b/gui/wxpython/image2target/ii2t_mapdisplay.py @@ -257,7 +257,7 @@ def AddToolbar(self, name): .TopDockable(True) .CloseButton(False) .Layer(2) - .BestSize((self.toolbars["map"].GetSize())), + .BestSize(self.toolbars["map"].GetSize()), ) # GCP display diff --git a/gui/wxpython/iscatt/iscatt_core.py b/gui/wxpython/iscatt/iscatt_core.py index e0fe7bad182..d97cdb84a56 100644 --- a/gui/wxpython/iscatt/iscatt_core.py +++ b/gui/wxpython/iscatt/iscatt_core.py @@ -764,7 +764,7 @@ def idScattToidBands(scatt_id, n_bands): n_b1 = n_bands - 1 band_1 = (int)( - (2 * n_b1 + 1 - sqrt(((2 * n_b1 + 1) * (2 * n_b1 + 1) - 8 * scatt_id))) / 2 + (2 * n_b1 + 1 - sqrt((2 * n_b1 + 1) * (2 * n_b1 + 1) - 8 * scatt_id)) / 2 ) band_2 = int( diff --git a/gui/wxpython/lmgr/frame.py b/gui/wxpython/lmgr/frame.py index 9156039dda1..b30b30c25fa 100644 --- a/gui/wxpython/lmgr/frame.py +++ b/gui/wxpython/lmgr/frame.py @@ -203,7 +203,7 @@ def show_menu_errors(messages): .TopDockable(True) .CloseButton(False) .Layer(2) - .BestSize((self.toolbars[toolbar].GetBestSize())), + .BestSize(self.toolbars[toolbar].GetBestSize()), ) self._auimgr.GetPane("toolbarNviz").Hide() @@ -423,10 +423,7 @@ def _createConsole(self, parent): self._gconsole = GConsole( guiparent=self, giface=self._giface, - ignoredCmdPattern="^d\..*|^r[3]?\.mapcalc$|^i.group$|^r.import$|" - "^r.external$|^r.external.out$|" - "^v.import$|^v.external$|^v.external.out$|" - "^cd$|^cd .*", + ignoredCmdPattern=globalvar.ignoredCmdPattern, ) # create 'console' widget self.goutput = GConsoleWindow( @@ -454,6 +451,9 @@ def _createHistoryBrowser(self, parent): self.history.showNotification.connect( lambda message: self.SetStatusText(message) ) + self.history.runIgnoredCmdPattern.connect( + lambda cmd: self.RunSpecialCmd(command=cmd), + ) else: self.history = None @@ -947,9 +947,9 @@ def _switchPage(self, notification): def RunSpecialCmd(self, command): """Run command from command line, check for GUI wrappers""" - if re.compile("^d\..*").search(command[0]): + if re.compile(r"^d\..*").search(command[0]): self.RunDisplayCmd(command) - elif re.compile("r[3]?\.mapcalc").search(command[0]): + elif re.compile(r"r[3]?\.mapcalc").search(command[0]): self.OnMapCalculator(event=None, cmd=command) elif command[0] == "i.group": self.OnEditImageryGroups(event=None, cmd=command) diff --git a/gui/wxpython/location_wizard/wizard.py b/gui/wxpython/location_wizard/wizard.py index c25e09b5ab6..9d83af72f04 100644 --- a/gui/wxpython/location_wizard/wizard.py +++ b/gui/wxpython/location_wizard/wizard.py @@ -763,7 +763,7 @@ def Sorter(self, key1, key2): item1 = self.itemDataMap[key1][self._col] item2 = self.itemDataMap[key2][self._col] - if isinstance(item1, type("")) or isinstance(item2, type("")): + if isinstance(item1, str) or isinstance(item2, str): cmpVal = locale.strcoll(str(item1), str(item2)) else: cmpVal = cmp(item1, item2) @@ -1700,7 +1700,7 @@ def EnableNext(self, enable=True): def OnTextChange(self, event): value = self.searchb.GetValue() if value == "": - self.tlink.SetURL(str("https://epsg.io/")) + self.tlink.SetURL("https://epsg.io/") self.epsgcode = None self.epsgdesc = self.epsgparams = "" self.searchb.ChangeValue("") @@ -2392,9 +2392,7 @@ def OnEnterPage(self, event): self.parent.custompage.customstring + self.parent.custompage.custom_dtrans_string ) - self.lproj4string.SetLabel( - ("%s" % combo_str.replace(" +", os.linesep + "+")) - ) + self.lproj4string.SetLabel("%s" % combo_str.replace(" +", os.linesep + "+")) self.lprojection.SetLabel(label) diff --git a/gui/wxpython/main_window/frame.py b/gui/wxpython/main_window/frame.py index e42f4db901a..5e8ce4213b8 100644 --- a/gui/wxpython/main_window/frame.py +++ b/gui/wxpython/main_window/frame.py @@ -367,10 +367,7 @@ def _createConsole(self, parent): self._gconsole = GConsole( guiparent=self, giface=self._giface, - ignoredCmdPattern=r"^d\..*|^r[3]?\.mapcalc$|^i.group$|^r.import$|" - "^r.external$|^r.external.out$|" - "^v.import$|^v.external$|^v.external.out$|" - "^cd$|^cd .*", + ignoredCmdPattern=globalvar.ignoredCmdPattern, ) # create 'console' widget self.goutput = GConsoleWindow( @@ -401,6 +398,9 @@ def _createHistoryBrowser(self, parent): self.history.showNotification.connect( lambda message: self.SetStatusText(message) ) + self.history.runIgnoredCmdPattern.connect( + lambda cmd: self.RunSpecialCmd(command=cmd), + ) else: self.history = None @@ -616,7 +616,7 @@ def BuildPanes(self): .TopDockable(True) .CloseButton(False) .Layer(2) - .BestSize((self.toolbars[toolbar].GetBestSize())), + .BestSize(self.toolbars[toolbar].GetBestSize()), ) self._auimgr.AddPane( diff --git a/gui/wxpython/mapdisp/frame.py b/gui/wxpython/mapdisp/frame.py index bcb59f74994..65a7f358b52 100644 --- a/gui/wxpython/mapdisp/frame.py +++ b/gui/wxpython/mapdisp/frame.py @@ -123,6 +123,9 @@ def __init__( # undock/dock bound method self._docking_callback = None + # Saved Map Display output img size + self._saved_output_img_size = None + # Emitted when switching map notebook tabs (Single-Window) self.onFocus = Signal("MapPanel.onFocus") @@ -398,7 +401,7 @@ def openATM(selection): .TopDockable(True) .CloseButton(False) .Layer(2) - .BestSize((self.toolbars["vdigit"].GetBestSize())), + .BestSize(self.toolbars["vdigit"].GetBestSize()), ) # change mouse to draw digitized line self.MapWindow.mouse["box"] = "point" @@ -628,7 +631,7 @@ def AddToolbar(self, name, fixed=False): .TopDockable(True) .CloseButton(False) .Layer(2) - .BestSize((self.toolbars["map"].GetBestSize())), + .BestSize(self.toolbars["map"].GetBestSize()), ) # nviz @@ -757,12 +760,12 @@ def SaveToFile(self, event): return # get size - dlg = ImageSizeDialog(self) + dlg = ImageSizeDialog(self, img_size=self._saved_output_img_size) dlg.CentreOnParent() if dlg.ShowModal() != wx.ID_OK: dlg.Destroy() return - width, height = dlg.GetValues() + self._saved_output_img_size = dlg.GetValues() dlg.Destroy() # get filename @@ -787,7 +790,7 @@ def SaveToFile(self, event): if ext != extType: path = base + "." + extType - self.MapWindow.SaveToFile(path, fileType, width, height) + self.MapWindow.SaveToFile(path, fileType, *self._saved_output_img_size) dlg.Destroy() @@ -1683,7 +1686,7 @@ def AddRDigit(self): .CloseButton(False) .Layer(2) .DestroyOnClose() - .BestSize((self.toolbars["rdigit"].GetBestSize())), + .BestSize(self.toolbars["rdigit"].GetBestSize()), ) self._mgr.Update() diff --git a/gui/wxpython/mapswipe/frame.py b/gui/wxpython/mapswipe/frame.py index 27d6c2280ba..908da5fc6a1 100644 --- a/gui/wxpython/mapswipe/frame.py +++ b/gui/wxpython/mapswipe/frame.py @@ -273,7 +273,7 @@ def AddToolbar(self, name): .Layer(2) .Row(1) .Position(0) - .BestSize((self.toolbars["swipeMain"].GetBestSize())), + .BestSize(self.toolbars["swipeMain"].GetBestSize()), ) if name == "swipeMap": @@ -295,7 +295,7 @@ def AddToolbar(self, name): .Layer(2) .Row(1) .Position(1) - .BestSize((self.toolbars["swipeMap"].GetBestSize())), + .BestSize(self.toolbars["swipeMap"].GetBestSize()), ) if name == "swipeMisc": @@ -317,7 +317,7 @@ def AddToolbar(self, name): .Layer(2) .Row(1) .Position(2) - .BestSize((self.toolbars["swipeMisc"].GetBestSize())), + .BestSize(self.toolbars["swipeMisc"].GetBestSize()), ) def _addPanes(self): @@ -334,7 +334,7 @@ def _addPanes(self): .CloseButton(False) .Center() .Layer(1) - .BestSize((self.splitter.GetBestSize())), + .BestSize(self.splitter.GetBestSize()), ) # sliders @@ -353,7 +353,7 @@ def _addPanes(self): .RightDockable(False) .Bottom() .Layer(1) - .BestSize((self.sliderH.GetBestSize())), + .BestSize(self.sliderH.GetBestSize()), ) self._mgr.AddPane( @@ -371,7 +371,7 @@ def _addPanes(self): .RightDockable(True) .Right() .Layer(1) - .BestSize((self.sliderV.GetBestSize())), + .BestSize(self.sliderV.GetBestSize()), ) # statusbar diff --git a/gui/wxpython/mapwin/decorations.py b/gui/wxpython/mapwin/decorations.py index ef8824f185b..5ead9c5f0e7 100644 --- a/gui/wxpython/mapwin/decorations.py +++ b/gui/wxpython/mapwin/decorations.py @@ -190,7 +190,7 @@ def GetPlacement(self, screensize): for param in self._cmd: if not param.startswith("at"): continue - x, y = [float(number) for number in param.split("=")[1].split(",")] + x, y = (float(number) for number in param.split("=")[1].split(",")) x = int((x / 100.0) * screensize[0]) y = int((1 - y / 100.0) * screensize[1]) @@ -304,9 +304,9 @@ def GetPlacement(self, screensize): if param == self._defaultAt: b, t, l, r = 5, 50, 7, 10 else: - b, t, l, r = [ + b, t, l, r = ( float(number) for number in param.split("=")[1].split(",") - ] # pylint: disable-msg=W0612 + ) # pylint: disable-msg=W0612 x = int((l / 100.0) * screensize[0]) y = int((1 - t / 100.0) * screensize[1]) diff --git a/gui/wxpython/photo2image/ip2i_mapdisplay.py b/gui/wxpython/photo2image/ip2i_mapdisplay.py index 2a86274a9f7..90499a94277 100644 --- a/gui/wxpython/photo2image/ip2i_mapdisplay.py +++ b/gui/wxpython/photo2image/ip2i_mapdisplay.py @@ -249,7 +249,7 @@ def AddToolbar(self, name): .TopDockable(True) .CloseButton(False) .Layer(2) - .BestSize((self.toolbars["map"].GetSize())), + .BestSize(self.toolbars["map"].GetSize()), ) # GCP display diff --git a/gui/wxpython/psmap/instructions.py b/gui/wxpython/psmap/instructions.py index 28efb8970c6..0b36a2ae7ab 100644 --- a/gui/wxpython/psmap/instructions.py +++ b/gui/wxpython/psmap/instructions.py @@ -36,7 +36,6 @@ import string from math import ceil from time import strftime, localtime -from io import open import wx import grass.script as grass @@ -179,7 +178,7 @@ def Read(self, filename): toM = float(proj["meters"]) units = UnitConversion(self.parent) w = units.convert(value=mapRect.Get()[2], fromUnit="inch", toUnit="meter") / toM - map["scale"] = w / abs((region["w"] - region["e"])) + map["scale"] = w / abs(region["w"] - region["e"]) SetResolution( dpi=300, width=map["rect"].width, height=map["rect"].height, env=self.env diff --git a/gui/wxpython/rlisetup/sampling_frame.py b/gui/wxpython/rlisetup/sampling_frame.py index c69adcb26e8..0fa7c5242df 100644 --- a/gui/wxpython/rlisetup/sampling_frame.py +++ b/gui/wxpython/rlisetup/sampling_frame.py @@ -107,7 +107,7 @@ def __init__(self, parent, samplingType, icon=None, map_=None): .CloseButton(False) .Layer(1) .Gripper(False) - .BestSize((self.toolbar.GetBestSize())), + .BestSize(self.toolbar.GetBestSize()), ) self._mgr.Update() diff --git a/gui/wxpython/web_services/cap_interface.py b/gui/wxpython/web_services/cap_interface.py index 9b484ea2a1e..44de7b6056a 100644 --- a/gui/wxpython/web_services/cap_interface.py +++ b/gui/wxpython/web_services/cap_interface.py @@ -92,7 +92,7 @@ def _initializeLayerTree(self, parent_layer, id=0): self.layers_by_id[id] = parent_layer id += 1 - layer_nodes = parent_layer.GetLayerNode().findall((self.xml_ns.Ns("Layer"))) + layer_nodes = parent_layer.GetLayerNode().findall(self.xml_ns.Ns("Layer")) for node in layer_nodes: layer = WMSLayer(node, id, self) diff --git a/imagery/i.cluster/global.h b/imagery/i.cluster/global.h index 8b6afa99f72..bf8988c8299 100644 --- a/imagery/i.cluster/global.h +++ b/imagery/i.cluster/global.h @@ -1,17 +1,4 @@ -#include - -#ifndef TIME_WITH_SYS_TIME -#ifdef HAVE_TIME -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#else #include -#include -#endif - #include #include diff --git a/imagery/i.evapo.time/i.evapo.time.html b/imagery/i.evapo.time/i.evapo.time.html index 790ffd35766..b1e01dc6281 100644 --- a/imagery/i.evapo.time/i.evapo.time.html +++ b/imagery/i.evapo.time/i.evapo.time.html @@ -50,6 +50,21 @@

NOTES

For multi-year calculations, just continue incrementing DOY values above 366, it will continue working, up to maximum input of 400 satellite images. +

+Temporal integration from a weather station
+This is an example of a temporal integration from a weather station as done by +Chemin and Alexandridis (2004) +

+ +

References

+ +

+Chemin and Alexandridis, 2004. Spatial Resolution Improvement of Seasonal +Evapotranspiration for Irrigated Rice, Zhanghe Irrigation District, Hubei Province, China. +Asian Journal of Geoinformatics, Vol. 5, No. 1, September 2004 +(PDF) + +

SEE ALSO

diff --git a/imagery/i.evapo.time/i_evapo_time.png b/imagery/i.evapo.time/i_evapo_time.png new file mode 100644 index 00000000000..7ea3722ed8e Binary files /dev/null and b/imagery/i.evapo.time/i_evapo_time.png differ diff --git a/include/Make/Grass.make b/include/Make/Grass.make index 09657591479..137a45d1955 100644 --- a/include/Make/Grass.make +++ b/include/Make/Grass.make @@ -152,6 +152,7 @@ libs = \ NVIZ:nviz \ OGSF:ogsf \ OPTRI:optri \ + PARSON:parson \ PNGDRIVER:pngdriver \ PSDRIVER:psdriver \ QTREE:qtree \ diff --git a/include/Make/Install.make b/include/Make/Install.make index cef4f810ffe..b9a5e45e0fc 100644 --- a/include/Make/Install.make +++ b/include/Make/Install.make @@ -212,6 +212,7 @@ srclibsdist: distclean -cp -rL utils ./grass-lib-$(GRASS_VERSION_NUMBER) -cp -rL demolocation ./grass-lib-$(GRASS_VERSION_NUMBER) -cp -rL include ./grass-lib-$(GRASS_VERSION_NUMBER) + -cp -rL --parents lib/external/parson ./grass-lib-$(GRASS_VERSION_NUMBER) -cp -rL --parents lib/external/shapelib ./grass-lib-$(GRASS_VERSION_NUMBER) -cp -rL --parents lib/external/bwidget ./grass-lib-$(GRASS_VERSION_NUMBER) -cp -rL --parents lib/datetime ./grass-lib-$(GRASS_VERSION_NUMBER) diff --git a/include/grass/config.h.in b/include/grass/config.h.in index 906eafa8733..9b1d8cafd44 100644 --- a/include/grass/config.h.in +++ b/include/grass/config.h.in @@ -56,10 +56,10 @@ /* Define to 1 if you have the header file. */ #undef HAVE_G2C_H -/* define if GDAL is to be used */ +/* Define to 1 if GDAL is to be used. */ #undef HAVE_GDAL -/* define if GEOS is to be used */ +/* Define to 1 if GEOS is to be used. */ #undef HAVE_GEOS /* Define to 1 if you have the header file. */ @@ -80,7 +80,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ICONV_H -/* define if "int64_t" is available */ +/* Define to 1 if "int64_t" is available. */ #undef HAVE_INT64_T /* Define to 1 if you have the header file. */ @@ -89,19 +89,19 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H -/* define if ATLAS exists */ +/* Define to 1 if ATLAS exists. */ #undef HAVE_LIBATLAS -/* define if BLAS exists */ +/* Define to 1 if BLAS exists. */ #undef HAVE_LIBBLAS /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H -/* define if LAPACK exists */ +/* Define to 1 if LAPACK exists. */ #undef HAVE_LIBLAPACK -/* define if liblas exists */ +/* Define to 1 if liblas exists. */ #undef HAVE_LIBLAS /* Define to 1 if you have the header file. */ @@ -113,28 +113,25 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H -/* define if "long long int" is available */ +/* Define to 1 if "long long int" is available. */ #undef HAVE_LONG_LONG_INT /* Define to 1 if you have the `lseek' function. */ #undef HAVE_LSEEK -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - /* Define to 1 if you have the header file. */ #undef HAVE_MYSQL_H /* Define to 1 if you have the `nanosleep' function. */ #undef HAVE_NANOSLEEP -/* define if NetCDF exists */ +/* Define to 1 if NetCDF exists. */ #undef HAVE_NETCDF /* Define to 1 if you have the `nice' function. */ #undef HAVE_NICE -/* define if OGR is to be used */ +/* Define to 1 if OGR is to be used. */ #undef HAVE_OGR /* Define to 1 if you have the header file. */ @@ -149,22 +146,22 @@ /* Define to 1 if you have the header file. */ #undef HAVE_OPENGL_GL_H -/* define if glXCreatePbuffer exists */ +/* Define to 1 if glXCreatePbuffer exists. */ #undef HAVE_PBUFFERS -/* Define to 1 if PDAL is to be used. */ +/* Define to 1 if PDAL exists. */ #undef HAVE_PDAL -/* define if glXCreateGLXPixmap exists */ +/* Define to 1 if glXCreateGLXPixmap exists. */ #undef HAVE_PIXMAPS /* Define to 1 if you have the header file. */ #undef HAVE_PNG_H -/* define if PostgreSQL is to be used */ +/* Define to 1 if PostgreSQL is to be used. */ #undef HAVE_POSTGRES -/* define if PQcmdTuples in lpq */ +/* Define to 1 if PQcmdTuples in lpq. */ #undef HAVE_PQCMDTUPLES /* Define to 1 if you have the header file. */ @@ -206,7 +203,7 @@ /* define if socket() exists */ #undef HAVE_SOCKET -/* define if SQLite is to be used */ +/* Define to 1 if SQLite is to be used. */ #undef HAVE_SQLITE /* Define to 1 if you have the header file. */ @@ -218,6 +215,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -281,13 +281,13 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ZSTD_H -/* define if OpenGL uses Aqua (MacOS X) */ +/* Define to 1 if OpenGL uses Aqua (MacOS X). */ #undef OPENGL_AQUA -/* define if OpenGL uses Windows */ +/* Define to 1 if OpenGL uses Windows. */ #undef OPENGL_WINDOWS -/* define if OpenGL uses X11 */ +/* Define to 1 if OpenGL uses X11. */ #undef OPENGL_X11 /* Define to the address where bug reports for this package should be sent. */ @@ -308,22 +308,21 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if the `setpgrp' function takes no argument. */ +/* Define to 1 if the `setpgrp' function requires zero arguments. */ #undef SETPGRP_VOID -/* define for Windows static build */ +/* Define to 1 for Windows static build. */ #undef STATIC_BUILD -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 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 -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* define if NLS requested */ +/* Define to 1 if NLS requested. */ #undef USE_NLS -/* define if using old PROJ version 4 API */ +/* Define to 1 if using old PROJ version 4 API. */ #undef USE_PROJ4API /* Define to 1 if the X Window System is missing or not being used. */ @@ -342,10 +341,10 @@ /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES -/* enable threading extensions on Solaris */ +/* Define to 1 to enable threading extensions on Solaris. */ #undef _POSIX_PTHREAD_SEMANTICS -/* define _REENTRANT flag (for SunOS) */ +/* Define to 1 for _REENTRANT flag (for SunOS). */ #undef _REENTRANT /* Define to `int' if doesn't define. */ diff --git a/include/grass/defs/gis.h b/include/grass/defs/gis.h index 341a4f9a1a7..4339fad72d1 100644 --- a/include/grass/defs/gis.h +++ b/include/grass/defs/gis.h @@ -72,25 +72,6 @@ #define RELDIR "?" #endif -/* GDAL < 2.3 does not define HAVE_LONG_LONG when compiled with - * Visual Studio as for OSGeo4W, even though long long is available, - * and GIntBig falls back to long which is on Windows always 4 bytes. - * This patch ensures that GIntBig is defined as long long (8 bytes) - * if GDAL is compiled with Visual Studio and GRASS is compiled with - * MinGW. This patch must be applied before other GDAL/OGR headers are - * included, as done by gprojects.h and vector.h */ -#if defined(__MINGW32__) && HAVE_GDAL -#include -#if GDAL_VERSION_NUM < 2030000 -#include -/* HAVE_LONG_LONG_INT comes from GRASS - * HAVE_LONG_LONG comes from GDAL */ -#if HAVE_LONG_LONG_INT && !defined(HAVE_LONG_LONG) -#define HAVE_LONG_LONG 1 -#endif -#endif -#endif - /* adj_cellhd.c */ void G_adjust_Cell_head(struct Cell_head *, int, int); void G_adjust_Cell_head3(struct Cell_head *, int, int, int); diff --git a/lib/README b/lib/README index e5f72ec1f74..f694dd267ab 100644 --- a/lib/README +++ b/lib/README @@ -11,6 +11,7 @@ Current directory layout - display: library for CELL driver - edit: curses library - external: external libraries + - external/parson: JSON serialization and deserialization functions - external/shapelib: SHAPE file management functions - fonts: fonts - fonts/fonts diff --git a/lib/cdhc/doc/chd_statlib.md b/lib/cdhc/doc/chd_statlib.md new file mode 100644 index 00000000000..a1eec0e938b --- /dev/null +++ b/lib/cdhc/doc/chd_statlib.md @@ -0,0 +1,1977 @@ +# CDH statlib Source + +Released in 1994 by Paul Johnson. + +Retrieved from the Internet Archive for +[http://sunsite.univie.ac.at/statlib/general/cdh](https://web.archive.org/web/20001006232323/http://sunsite.univie.ac.at/statlib/general/cdh) -- 2000-10-06 + + +```txt + TESTS OF COMPOSITE DISTRIBUTIONAL HYPOTHESES FOR + THE ANALYSIS OF BIOLOGICAL & ENVIRONMENTAL DATA + +This library contains FORTRAN subroutines for testing the hypothesis +of normality or the hypothesis of exponentiality. Lognormality can be +tested by carrying out the tests of normality on the log transformed +data. Some tests are general goodness-of-fit tests that allow any +distribution to be tested simply by basing the distributional +components of the test statistic on the hypothesized distribution. The +set of subroutines consist of 24 separate tests. All tests or a subset +of tests can be called from the main program. The following step may be +used to access the subroutines. Create a FORTRAN main program +including one or more call statements,such as: + + CALL TEST#(X,Y,N) + + where # is the test number (see Table) + X is the input vector of length N = n sample points + Y is the output vector - test statistic(s), df's + N is an integer value,number of sample points. + + + TEST TEST + # TEST NAME OUTPUT + 1 Omnibus Moments Test for Normality + 2 Geary's Test of Normality + 3 Studentized Range for Testing Normality + 4 D'Agostino's D-Statistic Test of Normality + 5 Kuiper V-Statistic Modified to Test Normality + 6 Watson U^2-Statistic Modified to Test Normality + 7 Durbin's Exact Test (Normal Distribution + 8 Anderson-Darling Statistic Modified to Test Normality + 9 Cramer-Von Mises W^2-Statistic to Test Normality * + 10 Kolmogorov-Smirnov D-Statistic to Test Normality * + 11 Kolmogorov-Smirnov D-Statistic ( Lilliefors Critical Values) + 12 Chi-Square Test of Normality (Equal Probability Classes) + 13 Shapiro-Wilk W Test of Normality for Small Samples + 14 Shapiro-Francia W' Test of Normality for Large Samples + 15 Shapiro-Wilk W Test of Exponentiality + 16 Cramer-Von Mises W^2-Statistic to Test Exponentiality * + 17 Kolmogorov-Smirnov D-Statistic to Test Exponentiality * + 18 Kuiper V-Statistic Modified to Test Exponentiality + 19 Watson U^2-Statistic Modified to Test Exponentiality + 20 Anderson-Darling Statistic Modified to Test Exponentiality + 21 Chi-Square Test for Exponentiality(with E.P.C.) + 22 Modified Maximum Likelihood Ratio Test ** + 23 Coefficient of Variation Test + 24 Kotz Separate-Families Test for Lognormality vs. Normality + +* indicates the test statistic is modified +** indicates the test is for normality vs. lognormality +E.P.C. --- Equal Probability Classes + + These subroutines can be freely distributed and can be freely used for + non-commercial purposes. +``` +```fortran + +C +C FORTRAN SUBROUTINES TO TEST FOR NORMALITY,LOGNORMALITY,EXPONENTIALITY AND +C GENERAL GOODNESS-OF-FIT TESTS THAT ALLOW ANY DISTRIBUTION TO BE TESTED +C**************************************************************************** +C +C TESTS OF COMPOSITE DISTRIBUTIONAL HYPOTHESES +C -------------------------------------------- +C +C INPUT: X [The vector of observed values] +C N [The number of input observations] +C +C OUTPUT: Y [The Composite Distributional Test Statistics] +C +C SUBROUTINES: +C ------------ +C +C ID TEST NAME +C +C TEST1 Omnibus Moments Test for Normality +C TEST2 Geary's Test of Normality +C TEST3 Studentized Range for Testing Normality +C TEST4 D'Agostino's D-Statistic Test of Normality +C TEST5 Kuiper V-Statistic Modified to Test Normality +C TEST6 Watson U^2-Statistic Modified to Test Normality +C TEST7 Durbin's Exact Test (Normal Distribution,Simple Hypothesis) +C TEST8 Anderson-Darling Statistic Modified to Test Normality +C TEST9 Cramer-Von Mises W^2-Statistic Modified to Test Normality +C TEST10 Kolmogorov-Smirnov D-Statistic Modified to Test Normality +C TEST11 Kolmogorov-Smirnov D-Statistic with Lilliefors Critical Values +C TEST12 Chi-Square Test of Normality (with Equal Probability Classes) +C TEST13 Shapiro-Wilk W Test of Normality for Small Samples +C TEST14 Shapiro-Francia W' Test of Normality for Large Samples +C TEST15 Shapiro-Wilk W Test of Exponentiality +C TEST16 Cramer-Von Mises W^2-Statistic Modified to Test Exponentiality +C TEST17 Kolmogorov-Smirnov D-Statistic Modified to Test Exponentiality +C TEST18 Kuiper V-Statistic Modified to Test Exponentiality +C TEST19 Watson U^2-Statistic Modified to Test Exponentiality +C TEST20 Anderson-Darling Statistic Modified to Test Exponentiality +C TEST21 Chi-Square Test of Exponentiality (with Equal Probability Classes) +C TEST22 Modified Maximum Likelihood Ratio Test for Normality vs. Lognormality +C TEST23 Coefficient of Variation Test +C TEST24 Kotz Separate-Families Test for Lognormality vs. Normality +C +C +C USAGE: CALL TEST#(X,Y,N) with # = 1,2,3...........,24 +C +C EXAMPLE: CALL TEST20(X,Y,10) for an input vector X consisting of +C 10 observations results in the output vector Y where +C Y(1) = AD(E).[The Shapiro-Wilk W Test of Exponentiality]. +C +C REFERENCES: +C +C Anderson ,T.W. and D.A. Darling.1954.A Test of Goodness of Fit. +C JASA 49:765-69. +C D'Agostino,R.B. and E.S. Pearson.1973.Tests for Departure from Normality. +C Biometrika 60(3):613-22. +C D'Agostino,R.B. and B. Rosman.1974.The Power of Geary's Test of +C Normality.Biometrika 61(1):181-84. +C Durbin,J.1961.Some Methods of Constructing Exact Tests. +C Biometrika 48(1&2):41-55. +C Durbin,J.1973.Distribution Theory Based on the Sample Distribution +C Function.SIAM.Philadelphia. +C Geary,R.C.1947.Testing for Normality.Biometrika 36:68-97. +C Kotz,S. 1973. Normality vs. Lognormality with Applications. +C Communications in Statistics 1(2):113-32. +C Lehmann,E.L.1986.Testing Statistical Hypotheses.John Wiley & Sons. +C New York. +C Linnet,K.1988.Testing Normality of Transformed Data. +C Applied Statistics 32(2):180-186. +C SAS [Statistical Analysis System] User's Guide:Basics.Version 5.1985. +C SAS User's Guide:Statistics.Version 6.Volumes 1 and 2.1993. +C Shapiro,S.S. and R.S.Francia.1972.An Approximate Analysis of Variance +C Test for Normality.JASA 67(337):215-216. +C Shapiro,S.S.,M.B.Wilk and H.J.Chen.1968.A Comparative Study of Various +C Tests for Normality.JASA 63:1343-72. +C Weiss,M.S. 1978.Modification of the Kolmogorov-Smirnov Statistic for Use +C with Correlated Data.JASA 73(364):872-75. +C +C +C**************************************************************************** +C +C Note if the sample size N >= 150 then increase the DIMENSION statement +C for the TESTS of interest in each subroutine. +C The subroutines can be run as a group or individually e.g., as a group: +C suppose TESTS 4,12 and 21 are required and the input vector consists of +C 20 observations; then in the MAIN program write: +C +C CALL TEST4(X,Y,20) +C CALL TEST12(X,Y,20) +C CALL TEST21(X,Y,20) +C +C**************************************************************************** +C +C +C**************************************************************************** +C +C Subroutines By: Paul Johnson +C 1420 Lake Blvd #29 +C Davis,California 95616 +C EZ006244@ALCOR.UCDAVIS.EDU +C +C These subroutines can be freely used for non-commercial purposes and can +C be freely distributed. +C +C Copyright 1994, Paul Johnson +C +C**************************************************************************** +C +C + SUBROUTINE TEST1(X,Y,N) + DIMENSION X(150),Y(2),Z(150) + REAL MEAN + SUM1=0 + SUM2=0 + SUM3=0 + SUM4=0 + SUM5=0 + DO 10 I = 1,N + 10 SUM1=SUM1+X(I) + MEAN=SUM1/N + DO 20 I = 1,N + 20 SUM2=SUM2+(X(I)-MEAN)**3 + DO 30 I = 1,N + 30 Z(I)=(X(I)-MEAN)**2 + DO 40 I = 1,N + 40 SUM3=SUM3+Z(I) + SUM5=SUM3 + SUM3=SUM3**1.5 + TSSM=(N**0.5)*SUM2/SUM3 + DO 50 I = 1,N + 50 SUM4=SUM4+(X(I)-MEAN)**4 + FSSM=(N*SUM4)/(SUM5*SUM5) + Y(1) = TSSM + Y(2) = FSSM + WRITE(6,300) + 300 FORMAT(1X,' ') + WRITE(6,301) + 301 FORMAT(10X,'TESTS OF COMPOSITE DISTRIBUTIONAL HYPOTHESES') + WRITE(6,302) + 302 FORMAT(1X,' ') + + WRITE(6,100) Y(1),Y(2) + 100 FORMAT(/,2X,'TEST1 TSM =',F10.4,' FSM =',F10.4) + RETURN + END + SUBROUTINE TEST2(X,Y,N) + DIMENSION X(150),Y(2),Z(150) + REAL MEAN + SUM1=0 + SUM2=0 + SUM3=0 + DO 10 I = 1,N + 10 SUM1=SUM1+X(I) + MEAN=SUM1/N + DO 20 I = 1,N + 20 Z(I)=ABS(X(I)-MEAN) + DO 30 I = 1,N + 30 SUM2=SUM2+Z(I) + DO 40 I = 1,N + 40 SUM3=SUM3+(X(I)-MEAN)**2 + S=N*SUM3 + S1=SQRT(S) + Y(1)=SUM2/S1 + Y(2)=(Y(1)-0.7979)*SQRT(N*1.0)/0.2123 + WRITE(6,100) Y(1),Y(2) + 100 FORMAT(/,2X,'TEST2 GTN =',F10.4,' Z(GTN) =',F10.4) + RETURN + END + SUBROUTINE TEST3(X,Y,N) + DIMENSION X(150),Y(2),X1(150) + DO 10 I=1,N + 10 X1(I)=X(I) + CALL SORT(N,X) + XS=X(1) + XM=X(N) + DO 15 I = 1,N + 15 IF (XS .GE. X(I)) XS=X(I) + DO 20 I = 1,N + 20 IF (XM .LE. X(I)) XM=X(I) + SUM1=0 + SUM2=0 + DO 30 I = 1,N + SUM1=SUM1+X(I) + SUM2=SUM2+(X(I)*X(I)) + 30 CONTINUE + XBAR=SUM1/N + S1 =SUM2-((SUM1*SUM1)/N) + S2=S1/(N-1) + S3=SQRT(S2) + Y(1)=(XM-XS)/S3 + DO 40 I=1,N + 40 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST3 U =',F10.4) + RETURN + END + SUBROUTINE TEST4(A,B,K) + DIMENSION A(150),B(2),A1(150) + REAL M2 + REAL MN + S1=0 + T=0 + MN=0 + E=1 + DO 10 I=1,K + 10 A1(I) = A(I) + CALL SORT(K,A1) + DO 20 I =1,K + T = T + (I - .5*(K+1))*A1(I) + 20 CONTINUE + DO 30 I = 1,K + MN=MN+A1(I) + 30 CONTINUE + M2=MN/K + DO 40 I=1,K + S1=S1+(A1(I)-M2)**2 + 40 CONTINUE + S2=S1/K + S =SQRT(S2) + D = T/(K**2*S) + B(1)=(D-1.0/(2*SQRT(3.141592654)))*SQRT(K*1.0)/0.02998598 + WRITE(6,100) B(1) + 100 FORMAT(/,2X,'TEST4 DAGN =',F10.4) + RETURN + END + SUBROUTINE TEST5(X,Y,N) + DIMENSION X(150),Y(2),FX(150),FN1(150),FN2(150) + DIMENSION T(150),Z(150),D(2),FN3(150),X1(150) + REAL MEAN + SUM1=0 + SUM2=0 + SUM3=0 + SUM4=0 + SUM5=0 + DO 10 I = 1,N + 10 X1(I)=X(I) + DO 15 I =1,N + 15 SUM1=SUM1+X(I) + MEAN=SUM1/N + XBAR=MEAN + DO 20 I = 1,N + 20 SUM2=SUM2+(X(I)*X(I)) + S1=((N*SUM2)-(SUM1*SUM1))/(N*(N-1)) + SDX=SQRT(S1) + R=FLOAT(N) + CALL SORT(N,X) + DO 30 I=1,N + X(I)=(X(I)-XBAR)/SDX + FN1(I)=FLOAT(I)/R + FN2(I)=FLOAT((2*I)-1)/FLOAT(2*N) + FN3(I)=FLOAT(I)/R + FX(I)=.5+(ENORMP(X(I)/SQRT(2.0))/2.0) + IF (FX(I) .LE. 0.0) FX(I) = 0.00001 + 30 IF (FX(I) .GE. 1.0) FX(I) = 0.99999 + DO 40 J=1,N + 40 Z(J) = (FN3(J) - FX(J)) + CALL SORT(N,Z) + D1=Z(N) + DO 50 J=1,N + 50 T(J) = FX(J)-((J-1)/R) + CALL SORT(N,T) + D2=T(N) + D(1)=D1 + D(2)=D2 + CALL SORT(2,D) + V=D(1)+D(2) + V=V*(SQRT(R)+(.82/SQRT(R))+0.05) + Y(1)=V + DO 60 I=1,N + 60 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST5 KV(N) =',F10.4) + RETURN + END + SUBROUTINE TEST6(X,Y,N) + DIMENSION X(150),Y(2),FX(150),FN1(150),FN2(150) + DIMENSION X1(150) + REAL MEAN + SUM1=0 + SUM2=0 + SUM3=0 + SUM4=0 + SUM5=0 + DO 10 I = 1,N + 10 X1(I)=X(I) + DO 15 I =1,N + 15 SUM1=SUM1+X(I) + MEAN=SUM1/N + XBAR=MEAN + DO 20 I = 1,N + 20 SUM2=SUM2+(X(I)*X(I)) + S1=((N*SUM2)-(SUM1*SUM1))/(N*(N-1)) + SDX=SQRT(S1) + R=FLOAT(N) + CALL SORT(N,X) + DO 30 I=1,N + X(I)=(X(I)-XBAR)/SDX + FN1(I)=FLOAT(I)/R + FN2(I)=FLOAT((2*I)-1)/FLOAT(2*N) + FX(I)=.5+(ENORMP(X(I)/SQRT(2.0))/2.0) + IF (FX(I) .LE. 0.0) FX(I) = 0.00001 + 30 IF (FX(I) .GE. 1.0) FX(I) = 0.99999 + DO 40 I=1,N + A=((2*I)-1)*ALOG(FX(I)) + B=((2*I)-1)*ALOG(1.0-FX(N+1-I)) + SUM3=SUM3+A+B + SUM4=SUM4+((-FN2(I)+FX(I))**2) + FN1(I)=ABS(FN1(I)-FX(I)) + 40 CONTINUE + CVM=1./FLOAT(12*N)+SUM4 + DO 50 I=1,N + SUM5=SUM5+FX(I) + 50 CONTINUE + ZBAR=SUM5/R + W=CVM-R*(ZBAR-0.5)*(ZBAR-0.5) + W=W*(1.0+0.5/R) + Y(1)=W + DO 60 I=1,N + 60 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST6 WU2(N) =',F10.4) + RETURN + END + SUBROUTINE TEST7(X,Y,N) + DIMENSION X(150),C(150),X1(150),G(150),Z(150),B(150),Y(2) + R=FLOAT(N) + SUMX=0 + SUMX2=0 + DO 10 I=1,N + SUMX=SUMX+X(I) + SUMX2=SUMX2+X(I)**2 + 10 X1(I)=X(I) + S2=(SUMX2-SUMX**2/N)/(N-1) + DO 15 I=1,N + X(I)=(X(I)-SUMX/N)/SQRT(S2) + B(I)=0.5+(ENORMP(X(I)/SQRT(2.0))/2.0) + 15 CONTINUE + CALL SORT(N,B) + DO 20 I=2,N + C(I)=B(I)-B(I-1) + 20 CONTINUE + C(1)=B(1) + C(N+1)=1-B(N) + CALL SORT(N+1,C) + DO 30 J=2,N + G(J)=(N+2-J)*(C(J)-C(J-1)) + 30 CONTINUE + G(1)=(N+1)*C(1) + G(N+1)=C(N+1)-C(N) + DO 60 I=1,N + SUM1=0 + DO 50 J=1,I + SUM1=SUM1+G(J) + 50 CONTINUE + Z(I)=(I/R)-SUM1 + 60 CONTINUE + CALL SORT(N,Z) + R=Z(N) + Y(1)=R + DO 70 I=1,N + 70 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST7 DRB(N) =',F10.4) + RETURN + END + SUBROUTINE TEST8(X,Y,N) + DIMENSION X(150),Y(2),FX(150),FN1(150),FN2(150) + DIMENSION X1(150) + EXTERNAL enormp + REAL MEAN + SUM1=0 + SUM2=0 + SUM3=0 + SUM4=0 + SUM5=0 + DO 10 I = 1,N + 10 X1(I)=X(I) + DO 15 I =1,N + 15 SUM1=SUM1+X(I) + MEAN=SUM1/N + XBAR=MEAN + DO 20 I = 1,N + 20 SUM2=SUM2+(X(I)*X(I)) + S1=((N*SUM2)-(SUM1*SUM1))/(N*(N-1)) + SDX=SQRT(S1) + R=FLOAT(N) + CALL SORT(N,X) + DO 30 I=1,N + X(I)=(X(I)-XBAR)/SDX + FN1(I)=FLOAT(I)/R + FN2(I)=FLOAT((2*I)-1)/FLOAT(2*N) + FX(I)=.5+(enormp(X(I)/SQRT(2.0))/2.0) + IF (FX(I) .LE. 0.0) FX(I) = 0.00001 + 30 IF (FX(I) .GE. 1.0) FX(I) = 0.99999 + DO 40 I=1,N + A=((2*I)-1)*ALOG(FX(I)) + B=((2*I)-1)*ALOG(1.0-FX(N+1-I)) + SUM3=SUM3+A+B + SUM4=SUM4+((-FN2(I)+FX(I))**2) + FN1(I)=ABS(FN1(I)-FX(I)) + 40 CONTINUE + ADB=SUM3/R + ADSTAT=-R-ADB + ADMOD=ADSTAT*(1.0+(.75/R)+(2.25/FLOAT(N**2))) + Y(1)=ADMOD + DO 50 I=1,N + 50 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST8 AD(N) =',F10.4) + RETURN + END + SUBROUTINE TEST9(X,Y,N) + DIMENSION X(150),Y(2),FX(150),FN1(150),FN2(150) + DIMENSION X1(150) + REAL MEAN + SUM1=0 + SUM2=0 + SUM3=0 + SUM4=0 + SUM5=0 + DO 10 I = 1,N + 10 X1(I)=X(I) + DO 15 I =1,N + 15 SUM1=SUM1+X(I) + MEAN=SUM1/N + XBAR=MEAN + DO 20 I = 1,N + 20 SUM2=SUM2+(X(I)*X(I)) + S1=((N*SUM2)-(SUM1*SUM1))/(N*(N-1)) + SDX=SQRT(S1) + R=FLOAT(N) + CALL SORT(N,X) + DO 30 I=1,N + X(I)=(X(I)-XBAR)/SDX + FN1(I)=FLOAT(I)/R + FN2(I)=FLOAT((2*I)-1)/FLOAT(2*N) + FX(I)=.5+(ENORMP(X(I)/SQRT(2.0))/2.0) + IF (FX(I) .LE. 0.0) FX(I) = 0.00001 + 30 IF (FX(I) .GE. 1.0) FX(I) = 0.99999 + DO 40 I=1,N + A=((2*I)-1)*ALOG(FX(I)) + B=((2*I)-1)*ALOG(1.0-FX(N+1-I)) + SUM3=SUM3+A+B + SUM4=SUM4+((-FN2(I)+FX(I))**2) + FN1(I)=ABS(FN1(I)-FX(I)) + 40 CONTINUE + CVM=1./FLOAT(12*N)+SUM4 + CVMOD=CVM*(1.+(.5/R)) + Y(1)=CVMOD + DO 50 I=1,N + 50 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST9 CVM(N) =',F10.4) + RETURN + END + SUBROUTINE TEST10(X,Y,N) + DIMENSION X(150),Y(2),FX(150),FN1(150),FN2(150) + DIMENSION T(150),Z(150),D(2),FN3(150),X1(150) + REAL MEAN + REAL KS + SUM1=0 + SUM2=0 + SUM3=0 + SUM4=0 + SUM5=0 + DO 10 I = 1,N + 10 X1(I)=X(I) + DO 15 I =1,N + 15 SUM1=SUM1+X(I) + MEAN=SUM1/N + XBAR=MEAN + DO 20 I = 1,N + 20 SUM2=SUM2+(X(I)*X(I)) + S1=((N*SUM2)-(SUM1*SUM1))/(N*(N-1)) + SDX=SQRT(S1) + R=FLOAT(N) + CALL SORT(N,X) + DO 30 I=1,N + X(I)=(X(I)-XBAR)/SDX + FN1(I)=FLOAT(I)/R + FN2(I)=FLOAT((2*I)-1)/FLOAT(2*N) + FN3(I)=FLOAT(I)/R + FX(I)=.5+(ENORMP(X(I)/SQRT(2.0))/2.0) + IF (FX(I) .LE. 0.0) FX(I) = 0.00001 + 30 IF (FX(I) .GE. 1.0) FX(I) = 0.99999 + DO 40 J=1,N + 40 Z(J)=(FN3(J)-FX(J)) + CALL SORT(N,Z) + D1=Z(N) + DO 50 J=1,N + 50 T(J)=FX(J)-((J-1)/R) + CALL SORT(N,T) + D2=T(N) + D(1)=D1 + D(2)=D2 + CALL SORT(2,D) + DMAX=D(2) + KS=DMAX*(SQRT(R)+(.85/SQRT(R))-.01) + Y(1)=KS + DO 60 I=1,N + 60 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST10 KSD(N) =',F10.4) + RETURN + END + SUBROUTINE TEST11(X,Y,N) + DIMENSION X(150),Y(2),FX(150),FN1(150),FN2(150) + DIMENSION T(150),Z(150),D(2),FN3(150),X1(150) + REAL MEAN + SUM1=0 + SUM2=0 + DO 10 I = 1,N + 10 X1(I)=X(I) + DO 15 I =1,N + 15 SUM1=SUM1+X(I) + MEAN=SUM1/N + XBAR=MEAN + DO 20 I = 1,N + 20 SUM2=SUM2+(X(I)*X(I)) + S1=((N*SUM2)-(SUM1*SUM1))/(N*(N-1)) + SDX=SQRT(S1) + R=FLOAT(N) + CALL SORT(N,X) + DO 30 I=1,N + X(I)=(X(I)-XBAR)/SDX + FN1(I)=FLOAT(I)/R + FN2(I)=FLOAT((2*I)-1)/FLOAT(2*N) + FN3(I)=FLOAT(I)/R + FX(I)=.5+(ENORMP(X(I)/SQRT(2.0))/2.0) + IF (FX(I) .LE. 0.0) FX(I) = 0.00001 + 30 IF (FX(I) .GE. 1.0) FX(I) = 0.99999 + DO 40 J=1,N + 40 Z(J)=(FN3(J)-FX(J)) + CALL SORT(N,Z) + D1=Z(N) + DO 50 J=1,N + 50 T(J)=FX(J)-((J-1)/R) + CALL SORT(N,T) + D2=T(N) + D(1)=D1 + D(2)=D2 + CALL SORT(2,D) + Y(1)=D(2) + DO 60 I=1,N + 60 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST11 KSD =',F10.4) + RETURN + END + SUBROUTINE TEST12(X,Y,N) + DIMENSION X(150),Y(2),V(150),V2(150),F(150) + DIMENSION P(150),Z(150) + EXTERNAL xinormal + EXTERNAL dl + REAL MEAN + SUM1=0 + SUM2=0 + SUM3=0 + A=4*((0.75*(N-1)*(N-1))**0.2) + K1=A + C=A-K1 + IF(C .GT. 0.5) K1=K1+1 + 10 R=N/K1 + IF(R .LT. 5) K1=K1-1 + IF(R .LT.5) GOTO 10 + K2=K1-1 + DO 15 I=1,K1 + 15 F(I)=0 + DO 20 I=1,N + 20 SUM1=SUM1+X(I) + MEAN=SUM1/N + DO 25 I = 1,N + 25 SUM2=SUM2+(X(I)-MEAN)*(X(I)-MEAN) + S1=SQRT(SUM2/(N-1)) + DO 30 I=1,K2 + 30 P(I)=FLOAT(I)/K1 + DO 40 I=1,K2 + 40 Z(I)=XINORMAL(P(I)) + DO 50 I=1,K2 + 50 V(I)=MEAN+(Z(I)*S1) + DO 51 I=1,K2 + 51 V2(I+1)=V(I)+0.0001 + DO 55 I=1,N + DO 45 J=2,K2 + IF(X(I) .GE. V2(J) .AND. X(I) .LE. V(J)) F(J)=1+F(J) + 45 CONTINUE + IF(X(I) .GE. V2(K2+1)) F(K2+1)=F(K2+1)+1 + IF(X(I) .LE. V(1)) F(1)=F(1)+1 + 55 CONTINUE + DO 65 I=1,K1 + 65 SUM3=SUM3+F(I)*F(I) + Y(1)=SUM3*K1/N-N + Y(2)=FLOAT(K1)-3 + WRITE(6,100) Y(1),Y(2) + 100 FORMAT(/,2X,'TEST12 CS(N) =',F10.4,' DOF =',F10.4) + RETURN + END + SUBROUTINE TEST13(X,Y,N) + DIMENSION X(150),X1(150),Y(2),A(25) + SUMB=0 + SUMX=0 + SUMX2=0 + K=N/2 + IF (N .GT. 50) GO TO 115 + DO 15 I =1,N + SUMX=SUMX+X(I) + SUMX2=SUMX2+X(I)**2 + A(I) = 0.0 + 15 X1(I)=X(I) + S2=SUMX2-SUMX**2/N + CALL SORT(N,X) + IF (N .GE. 20) GO TO 53 + IF (N .GE. 10) GO TO 33 + IF (N .NE. 3) GO TO 21 + A(1)=0.7071 + GO TO 115 + 21 IF (N .NE. 4) GO TO 23 + A(1)=0.6872 + A(2)=0.1677 + GO TO 115 + 23 IF (N .NE. 5) GO TO 25 + A(1)=0.6646 + A(2)=0.2413 + GO TO 115 + 25 IF (N .NE. 6) GO TO 27 + A(1)=0.6431 + A(2)=0.2806 + A(3)=0.0875 + GO TO 115 + 27 IF (N .NE. 7) GO TO 29 + A(1)=0.6233 + A(2)=0.3031 + A(3)=0.1401 + GO TO 115 + 29 IF (N .NE. 8) GO TO 31 + A(1)=0.6052 + A(2)=0.3164 + A(3)=0.1743 + A(4)=0.0561 + GO TO 115 + 31 IF (N .NE. 9) GO TO 33 + A(1)=0.5888 + A(2)=0.3244 + A(3)=0.1976 + A(4)=0.0947 + GO TO 115 + 33 IF (N .NE. 10) GO TO 35 + A(1)=0.5739 + A(2)=0.3291 + A(3)=0.2141 + A(4)=0.1224 + A(5)=0.0399 + GO TO 115 + 35 IF (N .NE. 11) GO TO 37 + A(1)=0.5601 + A(2)=0.3315 + A(3)=0.2260 + A(4)=0.1429 + A(5)=0.0695 + GO TO 115 + 37 IF (N .NE. 12) GO TO 39 + A(1)=0.5475 + A(2)=0.3325 + A(3)=0.2347 + A(4)=0.1586 + A(5)=0.0922 + A(6)=0.0303 + GO TO 115 + 39 IF (N .NE. 13) GO TO 41 + A(1)=0.5359 + A(2)=0.3325 + A(3)=0.2412 + A(4)=0.1707 + A(5)=0.1099 + A(6)=0.0539 + GO TO 115 + 41 IF (N .NE. 14) GO TO 43 + A(1)=0.5251 + A(2)=0.3318 + A(3)=0.2460 + A(4)=0.1802 + A(5)=0.1240 + A(6)=0.0727 + A(7)=0.0240 + GO TO 115 + 43 IF (N .NE. 15) GO TO 45 + A(1)=0.5150 + A(2)=0.3306 + A(3)=0.2495 + A(4)=0.1878 + A(5)=0.1353 + A(6)=0.0880 + A(7)=0.0433 + GO TO 115 + 45 IF (N .NE. 16) GO TO 47 + A(1)=0.5056 + A(2)=0.3290 + A(3)=0.2521 + A(4)=0.1939 + A(5)=0.1447 + A(6)=0.1005 + A(7)=0.0593 + A(8)=0.0196 + GO TO 115 + 47 IF (N .NE. 17) GO TO 49 + A(1)=0.4968 + A(2)=0.3273 + A(3)=0.2540 + A(4)=0.1988 + A(5)=0.1524 + A(6)=0.1109 + A(7)=0.0725 + A(8)=0.0359 + GO TO 115 + 49 IF (N .NE. 18) GO TO 51 + A(1)=0.4886 + A(2)=0.3253 + A(3)=0.2553 + A(4)=0.2027 + A(5)=0.1587 + A(6)=0.1197 + A(7)=0.0837 + A(8)=0.0496 + A(9)=0.0163 + GO TO 115 + 51 IF (N .NE. 19) GO TO 53 + A(1) = 0.4808 + A(2) = 0.3232 + A(3) = 0.2561 + A(4) = 0.2059 + A(5) = 0.1641 + A(6) = 0.1271 + A(7) = 0.0932 + A(8) = 0.0612 + A(9) = 0.0303 + GO TO 115 + 53 IF (N .NE. 20) GO TO 55 + A(1) = 0.4734 + A(2) = 0.3211 + A(3) = 0.2565 + A(4) = 0.2085 + A(5) = 0.1686 + A(6) = 0.1334 + A(7) = 0.1013 + A(8) = 0.0711 + A(9) = 0.0422 + A(10) = 0.0140 + GO TO 115 + 55 IF (N .NE. 21) GO TO 57 + A(1) = 0.4643 + A(2) = 0.3185 + A(3) = 0.2578 + A(4) = 0.2119 + A(5) = 0.1736 + A(6) = 0.1399 + A(7) = 0.1092 + A(8) = 0.0804 + A(9) = 0.0530 + A(10) = 0.0263 + GO TO 115 + 57 IF (N .NE. 22) GO TO 59 + A(1) = 0.4590 + A(2) = 0.3156 + A(3) = 0.2571 + A(4) = 0.2131 + A(5) = 0.1764 + A(6) = 0.1443 + A(7) = 0.1150 + A(8) = 0.0878 + A(9) = 0.0618 + A(10) = 0.0368 + A(11) = 0.0122 + GO TO 115 + 59 IF (N .NE. 23) GO TO 61 + A(1) = 0.4542 + A(2) = 0.3126 + A(3) = 0.2563 + A(4) = 0.2139 + A(5) = 0.1787 + A(6) = 0.1480 + A(7) = 0.1201 + A(8) = 0.0941 + A(9) = 0.0696 + A(10) = 0.0459 + A(11) = 0.0228 + GO TO 115 + 61 IF (N .NE. 24) GO TO 63 + A(1) = 0.4493 + A(2) = 0.3098 + A(3) = 0.2554 + A(4) = 0.2145 + A(5) = 0.1807 + A(6) = 0.1512 + A(7) = 0.1245 + A(8) = 0.0997 + A(9) = 0.0764 + A(10) = 0.0539 + A(11) = 0.0321 + A(12) = 0.0107 + GO TO 115 + 63 IF (N .NE. 25) GO TO 65 + A(1) = 0.4450 + A(2) = 0.3069 + A(3) = 0.2543 + A(4) = 0.2148 + A(5) = 0.1822 + A(6) = 0.1539 + A(7) = 0.1283 + A(8) = 0.1046 + A(9) = 0.0823 + A(10) = 0.0610 + A(11) = 0.0403 + A(12) = 0.0200 + GO TO 115 + 65 IF (N .NE. 26) GO TO 67 + A(1) = 0.4407 + A(2) = 0.3043 + A(3) = 0.2533 + A(4) = 0.2151 + A(5) = 0.1836 + A(6) = 0.1563 + A(7) = 0.1316 + A(8) = 0.1089 + A(9) = 0.0876 + A(10) = 0.0672 + A(11) = 0.0476 + A(12) = 0.0284 + A(13) = 0.0094 + GO TO 115 + 67 IF (N .NE. 27) GO TO 69 + A(1) = 0.4366 + A(2) = 0.3018 + A(3) = 0.2522 + A(4) = 0.2152 + A(5) = 0.1848 + A(6) = 0.1584 + A(7) = 0.1346 + A(8) = 0.1128 + A(9) = 0.0923 + A(10) = 0.0728 + A(11) = 0.0540 + A(12) = 0.0358 + A(13) = 0.0178 + GO TO 115 + 69 IF (N .NE. 28) GO TO 71 + A(1) = 0.4328 + A(2) = 0.2992 + A(3) = 0.2510 + A(4) = 0.2151 + A(5) = 0.1857 + A(6) = 0.1601 + A(7) = 0.1372 + A(8) = 0.1162 + A(9) = 0.0965 + A(10) = 0.0778 + A(11) = 0.0598 + A(12) = 0.0424 + A(13) = 0.0253 + A(14) = 0.0084 + GO TO 115 + 71 IF (N .NE. 29) GO TO 73 + A(1) = 0.4291 + A(2) = 0.2968 + A(3) = 0.2499 + A(4) = 0.2150 + A(5) = 0.1864 + A(6) = 0.1616 + A(7) = 0.1395 + A(8) = 0.1192 + A(9) = 0.1002 + A(10) = 0.0822 + A(11) = 0.0650 + A(12) = 0.0483 + A(13) = 0.0320 + A(14) = 0.0159 + GO TO 115 + 73 IF (N .NE. 30) GO TO 75 + A(1) = 0.4254 + A(2) = 0.2944 + A(3) = 0.2487 + A(4) = 0.2148 + A(5) = 0.1870 + A(6) = 0.1630 + A(7) = 0.1415 + A(8) = 0.1219 + A(9) = 0.1036 + A(10) = 0.0862 + A(11) = 0.0697 + A(12) = 0.0537 + A(13) = 0.0381 + A(14) = 0.0227 + A(15) = 0.0076 + GO TO 115 + 75 IF (N .NE. 31) GO TO 77 + A(1) = 0.4220 + A(2) = 0.2921 + A(3) = 0.2475 + A(4) = 0.2145 + A(5) = 0.1874 + A(6) = 0.1641 + A(7) = 0.1433 + A(8) = 0.1243 + A(9) = 0.1066 + A(10) = 0.0899 + A(11) = 0.0739 + A(12) = 0.0585 + A(13) = 0.0435 + A(14) = 0.0289 + A(15) = 0.0144 + GO TO 115 + 77 IF (N .NE. 32) GO TO 79 + A(1) = 0.4188 + A(2) = 0.2898 + A(3) = 0.2463 + A(4) = 0.2141 + A(5) = 0.1878 + A(6) = 0.1651 + A(7) = 0.1449 + A(8) = 0.1265 + A(9) = 0.1093 + A(10) = 0.0931 + A(11) = 0.0777 + A(12) = 0.0629 + A(13) = 0.0485 + A(14) = 0.0344 + A(15) = 0.0206 + A(16) = 0.0068 + GO TO 115 + 79 IF (N .NE. 33) GO TO 81 + A(1) = 0.4156 + A(2) = 0.2876 + A(3) = 0.2451 + A(4) = 0.2137 + A(5) = 0.1880 + A(6) = 0.1660 + A(7) = 0.1463 + A(8) = 0.1284 + A(9) = 0.1118 + A(10) = 0.0961 + A(11) = 0.0812 + A(12) = 0.0669 + A(13) = 0.0530 + A(14) = 0.0395 + A(15) = 0.0262 + A(16) = 0.0131 + GO TO 115 + 81 IF (N .NE. 34) GO TO 83 + A(1) = 0.4127 + A(2) = 0.2854 + A(3) = 0.2439 + A(4) = 0.2132 + A(5) = 0.1882 + A(6) = 0.1667 + A(7) = 0.1475 + A(8) = 0.1301 + A(9) = 0.1140 + A(10) = 0.0988 + A(11) = 0.0844 + A(12) = 0.0706 + A(13) = 0.0572 + A(14) = 0.0441 + A(15) = 0.0314 + A(16) = 0.0187 + A(17) = 0.0062 + GO TO 115 + 83 IF (N .NE. 35) GO TO 85 + A(1) = 0.4096 + A(2) = 0.2834 + A(3) = 0.2427 + A(4) = 0.2127 + A(5) = 0.1883 + A(6) = 0.1673 + A(7) = 0.1487 + A(8) = 0.1317 + A(9) = 0.1160 + A(10) = 0.1013 + A(11) = 0.0873 + A(12) = 0.0739 + A(13) = 0.0610 + A(14) = 0.0484 + A(15) = 0.0361 + A(16) = 0.0239 + A(17) = 0.0119 + GO TO 115 + 85 IF (N .NE. 36) GO TO 87 + A(1) = 0.4068 + A(2) = 0.2813 + A(3) = 0.2415 + A(4) = 0.2121 + A(5) = 0.1883 + A(6) = 0.1678 + A(7) = 0.1496 + A(8) = 0.1331 + A(9) = 0.1179 + A(10) = 0.1036 + A(11) = 0.0900 + A(12) = 0.0770 + A(13) = 0.0645 + A(14) = 0.0523 + A(15) = 0.0404 + A(16) = 0.0287 + A(17) = 0.0172 + A(18) = 0.0057 + GO TO 115 + 87 IF (N .NE. 37) GO TO 89 + A(1) = 0.4040 + A(2) = 0.2794 + A(3) = 0.2403 + A(4) = 0.2116 + A(5) = 0.1883 + A(6) = 0.1683 + A(7) = 0.1505 + A(8) = 0.1344 + A(9) = 0.1196 + A(10) = 0.1056 + A(11) = 0.0924 + A(12) = 0.0798 + A(13) = 0.0677 + A(14) = 0.0559 + A(15) = 0.0444 + A(16) = 0.0331 + A(17) = 0.0220 + A(18) = 0.0110 + GO TO 115 + 89 IF (N .NE. 38) GO TO 91 + A(1) = 0.4015 + A(2) = 0.2774 + A(3) = 0.2391 + A(4) = 0.2110 + A(5) = 0.1881 + A(6) = 0.1686 + A(7) = 0.1513 + A(8) = 0.1356 + A(9) = 0.1211 + A(10) = 0.1075 + A(11) = 0.0947 + A(12) = 0.0824 + A(13) = 0.0706 + A(14) = 0.0592 + A(15) = 0.0481 + A(16) = 0.0372 + A(17) = 0.0264 + A(18) = 0.0158 + A(19) = 0.0053 + GO TO 115 + 91 IF (N .NE. 39) GO TO 93 + A(1) = 0.3989 + A(2) = 0.2755 + A(3) = 0.2380 + A(4) = 0.2104 + A(5) = 0.1880 + A(6) = 0.1689 + A(7) = 0.1520 + A(8) = 0.1366 + A(9) = 0.1225 + A(10) = 0.1092 + A(11) = 0.0967 + A(12) = 0.0848 + A(13) = 0.0733 + A(14) = 0.0622 + A(15) = 0.0515 + A(16) = 0.0409 + A(17) = 0.0305 + A(18) = 0.0203 + A(19) = 0.0101 + GO TO 115 + 93 IF (N .NE. 40) GO TO 95 + A(1) = 0.3964 + A(2) = 0.2737 + A(3) = 0.2368 + A(4) = 0.2098 + A(5) = 0.1878 + A(6) = 0.1691 + A(7) = 0.1526 + A(8) = 0.1376 + A(9) = 0.1237 + A(10) = 0.1108 + A(11) = 0.0986 + A(12) = 0.0870 + A(13) = 0.0759 + A(14) = 0.0651 + A(15) = 0.0546 + A(16) = 0.0444 + A(17) = 0.0343 + A(18) = 0.0244 + A(19) = 0.0146 + A(20) = 0.0049 + GO TO 115 + 95 IF (N .NE. 41) GO TO 97 + A(1) = 0.3940 + A(2) = 0.2719 + A(3) = 0.2357 + A(4) = 0.2091 + A(5) = 0.1876 + A(6) = 0.1693 + A(7) = 0.1531 + A(8) = 0.1384 + A(9) = 0.1249 + A(10) = 0.1123 + A(11) = 0.1004 + A(12) = 0.0891 + A(13) = 0.0782 + A(14) = 0.0677 + A(15) = 0.0575 + A(16) = 0.0476 + A(17) = 0.0379 + A(18) = 0.0283 + A(19) = 0.0188 + A(20) = 0.0094 + GO TO 115 + 97 IF (N .NE. 42) GO TO 99 + A(1) = 0.3917 + A(2) = 0.2701 + A(3) = 0.2345 + A(4) = 0.2085 + A(5) = 0.1874 + A(6) = 0.1694 + A(7) = 0.1535 + A(8) = 0.1392 + A(9) = 0.1259 + A(10) = 0.1136 + A(11) = 0.1020 + A(12) = 0.0909 + A(13) = 0.0804 + A(14) = 0.0701 + A(15) = 0.0602 + A(16) = 0.0506 + A(17) = 0.0411 + A(18) = 0.0318 + A(19) = 0.0227 + A(20) = 0.0136 + A(21) = 0.0045 + GO TO 115 + 99 IF (N .NE. 43) GO TO 101 + A(1) = 0.3894 + A(2) = 0.2684 + A(3) = 0.2334 + A(4) = 0.2078 + A(5) = 0.1871 + A(6) = 0.1695 + A(7) = 0.1539 + A(8) = 0.1398 + A(9) = 0.1269 + A(10) = 0.1149 + A(11) = 0.1035 + A(12) = 0.0927 + A(13) = 0.0824 + A(14) = 0.0724 + A(15) = 0.0628 + A(16) = 0.0534 + A(17) = 0.0442 + A(18) = 0.0352 + A(19) = 0.0263 + A(20) = 0.0175 + A(21) = 0.0087 + GO TO 115 + 101 IF (N .NE. 44) GO TO 103 + A(1) = 0.3872 + A(2) = 0.2667 + A(3) = 0.2323 + A(4) = 0.2072 + A(5) = 0.1868 + A(6) = 0.1695 + A(7) = 0.1542 + A(8) = 0.1405 + A(9) = 0.1278 + A(10) = 0.1160 + A(11) = 0.1049 + A(12) = 0.0943 + A(13) = 0.0842 + A(14) = 0.0745 + A(15) = 0.0651 + A(16) = 0.0560 + A(17) = 0.0471 + A(18) = 0.0383 + A(19) = 0.0296 + A(20) = 0.0211 + A(21) = 0.0126 + A(22) = 0.0042 + GO TO 115 + 103 IF (N .NE. 45) GO TO 105 + A(1) = 0.3850 + A(2) = 0.2651 + A(3) = 0.2313 + A(4) = 0.2065 + A(5) = 0.1865 + A(6) = 0.1695 + A(7) = 0.1545 + A(8) = 0.1410 + A(9) = 0.1286 + A(10) = 0.1170 + A(11) = 0.1062 + A(12) = 0.0959 + A(13) = 0.0860 + A(14) = 0.0765 + A(15) = 0.0673 + A(16) = 0.0584 + A(17) = 0.0497 + A(18) = 0.0412 + A(19) = 0.0328 + A(20) = 0.0245 + A(21) = 0.0163 + A(22) = 0.0081 + GO TO 115 + 105 IF (N .NE. 46) GO TO 107 + A(1) = 0.3830 + A(2) = 0.2635 + A(3) = 0.2302 + A(4) = 0.2058 + A(5) = 0.1862 + A(6) = 0.1695 + A(7) = 0.1548 + A(8) = 0.1415 + A(9) = 0.1293 + A(10) = 0.1180 + A(11) = 0.1073 + A(12) = 0.0972 + A(13) = 0.0876 + A(14) = 0.0783 + A(15) = 0.0694 + A(16) = 0.0607 + A(17) = 0.0522 + A(18) = 0.0439 + A(19) = 0.0357 + A(20) = 0.0277 + A(21) = 0.0197 + A(22) = 0.0118 + A(23) = 0.0039 + GO TO 115 + 107 IF (N .NE. 47) GO TO 109 + A(1) = 0.3808 + A(2) = 0.2620 + A(3) = 0.2291 + A(4) = 0.2052 + A(5) = 0.1859 + A(6) = 0.1695 + A(7) = 0.1550 + A(8) = 0.1420 + A(9) = 0.1300 + A(10) = 0.1189 + A(11) = 0.1085 + A(12) = 0.0986 + A(13) = 0.0892 + A(14) = 0.0801 + A(15) = 0.0713 + A(16) = 0.0628 + A(17) = 0.0546 + A(18) = 0.0465 + A(19) = 0.0385 + A(20) = 0.0307 + A(21) = 0.0229 + A(22) = 0.0153 + A(23) = 0.0076 + GO TO 115 + 109 IF (N .NE. 48) GO TO 111 + A(1) = 0.3789 + A(2) = 0.2604 + A(3) = 0.2281 + A(4) = 0.2045 + A(5) = 0.1855 + A(6) = 0.1693 + A(7) = 0.1551 + A(8) = 0.1423 + A(9) = 0.1306 + A(10) = 0.1197 + A(11) = 0.1095 + A(12) = 0.0998 + A(13) = 0.0906 + A(14) = 0.0817 + A(15) = 0.0731 + A(16) = 0.0648 + A(17) = 0.0568 + A(18) = 0.0489 + A(19) = 0.0411 + A(20) = 0.0335 + A(21) = 0.0259 + A(22) = 0.0185 + A(23) = 0.0111 + A(24) = 0.0037 + GO TO 115 + 111 IF (N .NE. 49) GO TO 113 + A(1) = 0.3770 + A(2) = 0.2589 + A(3) = 0.2271 + A(4) = 0.2038 + A(5) = 0.1851 + A(6) = 0.1692 + A(7) = 0.1553 + A(8) = 0.1427 + A(9) = 0.1312 + A(10) = 0.1205 + A(11) = 0.1105 + A(12) = 0.1010 + A(13) = 0.0919 + A(14) = 0.0832 + A(15) = 0.0748 + A(16) = 0.0667 + A(17) = 0.0588 + A(18) = 0.0511 + A(19) = 0.0436 + A(20) = 0.0361 + A(21) = 0.0288 + A(22) = 0.0215 + A(23) = 0.0143 + A(24) = 0.0071 + GO TO 115 + 113 IF (N .NE. 50) GO TO 115 + A(1) = 0.3751 + A(2) = 0.2574 + A(3) = 0.2260 + A(4) = 0.2032 + A(5) = 0.1847 + A(6) = 0.1691 + A(7) = 0.1554 + A(8) = 0.1430 + A(9) = 0.1317 + A(10) = 0.1212 + A(11) = 0.1113 + A(12) = 0.1020 + A(13) = 0.0932 + A(14) = 0.0846 + A(15) = 0.0764 + A(16) = 0.0685 + A(17) = 0.0608 + A(18) = 0.0532 + A(19) = 0.0459 + A(20) = 0.0386 + A(21) = 0.0314 + A(22) = 0.0244 + A(23) = 0.0174 + A(24) = 0.0104 + A(25) = 0.0035 + 115 IF (N .GT. 50) WRITE(6,202) + 202 FORMAT(1X,' ') + IF (N .GT. 50) WRITE(6,203) + 203 FORMAT(1X,'THIS IS THE SHAPIRO-WILK TEST FOR SMALL SAMPLES') + IF (N .GT. 50) WRITE (6,204) + 204 FORMAT(1X,'THE SAMPLE SIZE MUST BE LESS THAN OR EQUAL TO 50') + IF (N .GT. 50) GO TO 160 + DO 140 I=1,K + J=N-I+1 + 140 SUMB=SUMB+A(I)*(X(J)-X(I)) + Y(1)=SUMB**2/S2 + DO 150 I=1,N + 150 X(I)=X1(I) + WRITE(6,205) Y(1) + 205 FORMAT(/,2X,'TEST13 SW(N) =',F10.4) + 160 CONTINUE + RETURN + END + SUBROUTINE TEST14(X,Y,N) + DIMENSION X(150),X1(150),Y(2),Z(150),P(150) + EXTERNAL xinormal + EXTERNAL dl + SUMA=0 + SUMB=0 + SUMC=0 + SUMD=0 + DO 10 I =1,N + 10 X1(I)=X(I) + CALL SORT(N,X) + DO 20 I = 1,N + 20 P(I)=(FLOAT(I)-.375)/(0.25+N) + DO 25 I=1,N + 25 Z(I)=XINORMAL(P(I)) + DO 30 I=1,N + SUMA=SUMA+(Z(I)*X(I)) + SUMB=SUMB+(Z(I)**2) + SUMC=SUMC+X(I) + 30 SUMD=SUMD+X(I)**2 + Y(1)=(SUMA**2/SUMB)/(SUMD-SUMC**2/N) + DO 40 I=1,N + 40 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST14 SF(N) =',F10.4) + RETURN + END + SUBROUTINE TEST15(X,Y,N) + DIMENSION X(150),Y(2),X1(150) + REAL MEAN + DO 10 I = 1,N + 10 X1(I)=X(I) + R=FLOAT(N) + CALL SORT(N,X) + XS=X(1) + SUM1=0 + SUM2=0 + DO 15 I =1,N + 15 SUM1=SUM1+X(I) + MEAN=SUM1/N + XBAR=MEAN + DO 20 I = 1,N + 20 SUM2=SUM2+(X(I)*X(I)) + S1=SUM2-((SUM1*SUM1)/N) + B1=SQRT(R/(R-1)) + B=(XBAR-XS)*B1 + Y(1)=(B*B)/S1 + DO 30 I=1,N + 30 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST15 SW(E) =',F10.4) + RETURN + END + SUBROUTINE TEST16(X,Y,N) + DIMENSION X(150),Y(2),FX(150),FN1(150),FN2(150) + DIMENSION X1(150) + REAL MEAN + SUM1=0 + SUM2=0 + SUM3=0 + SUM4=0 + SUM5=0 + DO 10 I = 1,N + 10 X1(I)=X(I) + DO 15 I =1,N + 15 SUM1=SUM1+X(I) + MEAN=SUM1/N + XBAR=MEAN + DO 20 I = 1,N + 20 SUM2=SUM2+(X(I)*X(I)) + S1=((N*SUM2)-(SUM1*SUM1))/(N*(N-1)) + SDX=SQRT(S1) + R=FLOAT(N) + CALL SORT(N,X) + DO 30 I=1,N + FN2(I)=FLOAT((2*I)-1)/FLOAT(2*N) + FX(I)=1-EXP(X(I)*(-1.0)/XBAR) + 30 CONTINUE + DO 40 I=1,N + A=((2*I)-1)*ALOG(FX(I)) + B=((2*I)-1)*ALOG(1.0-FX(N+1-I)) + SUM3=SUM3+A+B + SUM4=SUM4+((-FN2(I)+FX(I))**2) + FN1(I)=ABS(FN1(I)-FX(I)) + 40 CONTINUE + CVM=1./FLOAT(12*N)+SUM4 + CVMOD=CVM*(1.+(.16/R)) + Y(1)=CVMOD + DO 50 I=1,N + 50 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST16 CVM(E) =',F10.4) + RETURN + END + SUBROUTINE TEST17(X,Y,N) + DIMENSION X(150),Y(2),FX(150) + DIMENSION T(150),Z(150),D(2),FN3(150),X1(150) + REAL MEAN + REAL KS + SUM1=0 + SUM2=0 + SUM3=0 + SUM4=0 + SUM5=0 + DO 10 I = 1,N + 10 X1(I)=X(I) + DO 15 I =1,N + 15 SUM1=SUM1+X(I) + MEAN=SUM1/N + XBAR=MEAN + DO 20 I = 1,N + 20 SUM2=SUM2+(X(I)*X(I)) + S1=((N*SUM2)-(SUM1*SUM1))/(N*(N-1)) + SDX=SQRT(S1) + R=FLOAT(N) + CALL SORT(N,X) + DO 30 I=1,N + FN3(I)=FLOAT(I)/R + FX(I)=1-EXP(X(I)*(-1.0)/XBAR) + 30 CONTINUE + DO 40 J=1,N + 40 Z(J)=(FN3(J)-FX(J)) + CALL SORT(N,Z) + D1=Z(N) + DO 50 J=1,N + 50 T(J)=FX(J)-((J-1)/R) + CALL SORT(N,T) + D2=T(N) + D(1)=D1 + D(2)=D2 + CALL SORT(2,D) + DMAX=D(2) + KS=(DMAX-0.2/R)*(SQRT(R)+(.5/SQRT(R))+0.26) + Y(1)=KS + DO 60 I=1,N + 60 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST17 KSD(E) =',F10.4) + RETURN + END + SUBROUTINE TEST18(X,Y,N) + DIMENSION X(150),Y(2),FX(150) + DIMENSION T(150),Z(150),D(2),FN3(150),X1(150) + REAL MEAN + SUM1=0 + SUM2=0 + SUM3=0 + SUM4=0 + SUM5=0 + DO 10 I = 1,N + 10 X1(I)=X(I) + DO 15 I =1,N + 15 SUM1=SUM1+X(I) + MEAN=SUM1/N + XBAR=MEAN + DO 20 I = 1,N + 20 SUM2=SUM2+(X(I)*X(I)) + S1=((N*SUM2)-(SUM1*SUM1))/(N*(N-1)) + SDX=SQRT(S1) + R=FLOAT(N) + CALL SORT(N,X) + DO 30 I=1,N + FN3(I)=FLOAT(I)/R + FX(I)=1-EXP(X(I)*(-1.0)/XBAR) + 30 CONTINUE + DO 40 J=1,N + 40 Z(J)=(FN3(J)-FX(J)) + CALL SORT(N,Z) + D1=Z(N) + DO 50 J=1,N + 50 T(J)=FX(J)-((J-1)/R) + CALL SORT(N,T) + D2=T(N) + D(1)=D1 + D(2)=D2 + V=D(1)+D(2) + V=(V-0.2/R)*(SQRT(R)+(.35/SQRT(R))+0.24) + Y(1)=V + DO 60 I=1,N + 60 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST18 KV(E) =',F10.4) + RETURN + END + SUBROUTINE TEST19(X,Y,N) + DIMENSION X(150),Y(2),FX(150),FN1(150),FN2(150) + DIMENSION X1(150) + REAL MEAN + SUM1=0 + SUM2=0 + SUM3=0 + SUM4=0 + SUM5=0 + DO 10 I = 1,N + 10 X1(I)=X(I) + DO 15 I =1,N + 15 SUM1=SUM1+X(I) + MEAN=SUM1/N + XBAR=MEAN + DO 20 I = 1,N + 20 SUM2=SUM2+(X(I)*X(I)) + S1=((N*SUM2)-(SUM1*SUM1))/(N*(N-1)) + SDX=SQRT(S1) + R=FLOAT(N) + CALL SORT(N,X) + DO 30 I=1,N + FN2(I)=FLOAT((2*I)-1)/FLOAT(2*N) + FX(I)=1-EXP(X(I)*(-1.0)/XBAR) + 30 CONTINUE + DO 40 I=1,N + A=((2*I)-1)*ALOG(FX(I)) + B=((2*I)-1)*ALOG(1.0-FX(N+1-I)) + SUM3=SUM3+A+B + SUM4=SUM4+((-FN2(I)+FX(I))**2) + FN1(I)=ABS(FN1(I)-FX(I)) + 40 CONTINUE + CVM=1./FLOAT(12*N)+SUM4 + DO 50 I=1,N + SUM5=SUM5+FX(I) + 50 CONTINUE + ZBAR=SUM5/R + W=CVM-R*(ZBAR-0.5)*(ZBAR-0.5) + W=W*(1.0+0.16/R) + Y(1)=W + DO 60 I=1,N + 60 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST19 WU2(E) =',F10.4) + RETURN + END + SUBROUTINE TEST20(X,Y,N) + DIMENSION X(150),Y(2),FX(150),FN1(150),FN2(150) + DIMENSION X1(150) + REAL MEAN + SUM1=0 + SUM2=0 + SUM3=0 + SUM4=0 + SUM5=0 + DO 10 I = 1,N + 10 X1(I)=X(I) + DO 15 I =1,N + 15 SUM1=SUM1+X(I) + MEAN=SUM1/N + XBAR=MEAN + DO 20 I = 1,N + 20 SUM2=SUM2+(X(I)*X(I)) + S1=((N*SUM2)-(SUM1*SUM1))/(N*(N-1)) + SDX=SQRT(S1) + R=FLOAT(N) + CALL SORT(N,X) + DO 30 I=1,N + FN2(I)=FLOAT((2*I)-1)/FLOAT(2*N) + FX(I)=1-EXP(X(I)*(-1.0)/XBAR) + 30 CONTINUE + DO 40 I=1,N + A=((2*I)-1)*ALOG(FX(I)) + B=((2*I)-1)*ALOG(1.0-FX(N+1-I)) + SUM3=SUM3+A+B + SUM4=SUM4+((-FN2(I)+FX(I))**2) + FN1(I)=ABS(FN1(I)-FX(I)) + 40 CONTINUE + ADB=SUM3/R + ADSTAT=-R-ADB + ADEXP=ADSTAT*(1.0+(0.3/R)) + Y(1)=ADEXP + DO 50 I=1,N + 50 X(I)=X1(I) + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST20 AD(E) =',F10.4) + RETURN + END + SUBROUTINE TEST21(X,Y,N) + DIMENSION X(150),Y(2),V(150),V2(150),F(150),P(150) + REAL MEAN + SUM1=0 + SUM3=0 + A=4*((0.75*(N-1)*(N-1))**2) + K1=A + C=A-K1 + IF(C .GT. 0.5) K1=K1+1 + 10 R=N/K1 + IF(R .LT. 5) K1=K1-1 + IF(R .LT.5) GOTO 10 + K2=K1-1 + DO 15 I=1,K1 + 15 F(I)=0 + DO 20 I=1,N + 20 SUM1=SUM1+X(I) + MEAN=N/SUM1 + DO 30 I=1,K2 + 30 P(I)=FLOAT(I)/K1 + DO 40 I=1,K2 + 40 V(I)=(-1.0/MEAN)*ALOG(1-P(I)) + DO 41 I=1,K2 + 41 V2(I+1)=V(I)+0.0001 + DO 55 I=1,N + DO 45 J=2,K2 + IF(X(I) .GE. V2(J) .AND. X(I) .LE. V(J)) F(J)=1+F(J) + 45 CONTINUE + IF(X(I) .GE. V2(K2+1)) F(K2+1)=F(K2+1)+1 + IF(X(I) .LE. V(1)) F(1)=F(1)+1 + 55 CONTINUE + DO 65 I=1,K1 + 65 SUM3=SUM3+F(I)*F(I) + Y(1)=SUM3*K1/N-N + Y(2)=FLOAT(K1)-2 + WRITE(6,100) Y(1),Y(2) + 100 FORMAT(/,2X,'TEST21 CS(E) =',F10.4,' DOF =',F10.4) + RETURN + END + SUBROUTINE TEST22(X,Y,N) + DIMENSION X(150),Y(2) + REAL MEAN + REAL M1 + SUM1=0 + SUM2=0 + SUM3=0 + SUM4=0 + SUM5=0 + DO 15 I =1,N + 15 SUM1=SUM1+X(I) + MEAN=SUM1/N + DO 20 I = 1,N + 20 SUM2=SUM2+ALOG(X(I)) + S1=((N*SUM2)-(SUM1*SUM1))/(N*(N-1)) + M1=SUM2/N + DO 25 I=1,N + 25 SUM4=SUM4+(ALOG(X(I))-M1)*(ALOG(X(I))-M1) + S2=SUM4/N + DO 30 I=1,N + 30 SUM3=SUM3+(X(I)-MEAN)**3 + IF(SUM3 .GE. 0) GO TO 40 + WRITE(6,100) (X(I),I=1,N) + 100 FORMAT(4(1X,F10.4,2X)) + WRITE(6,200) + 200 FORMAT(1X,'THIRD SAMPLE MOMENT ABOUT THE MEAN IS LESS THAN ZERO') + WRITE(6,300) + 300 FORMAT(1X,'HENCE WE ACCEPT THE NULL HYPOTHESIS OF NORMALITY') + Y(1)=0 + GO TO 50 + 40 CONTINUE + DO 45 I=1,N + 45 SUM5=SUM5+(X(I)-MEAN)*(X(I)-MEAN) + S1=SQRT(SUM5/N) + S3=SQRT(S2) + E1=EXP(M1) + Y(1)=S1/(S3*E1) + 50 WRITE(6,400) Y(1) + 400 FORMAT(/,2X,'TEST22 LR(NL) =',F10.4) + RETURN + END + SUBROUTINE TEST23(X,Y,N) + DIMENSION X(150),Y(2) + SUM2=0 + SUM4=0 + DO 20 I = 1,N + 20 SUM2=SUM2+ALOG(X(I)) + DO 25 I=1,N + 25 SUM4=SUM4+(ALOG(X(I))-(SUM2/N))*(ALOG(X(I))-(SUM2/N)) + S2=SUM4/(N-1) + S3=EXP(S2)-1 + S4=SQRT(S3) + Y(1)=S4 + WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST23 CV(L) =',F10.4) + RETURN + END + SUBROUTINE TEST24(X,Y,N) + DIMENSION X(150),Y(2) + SUM1=0 + SUM2=0 + SUM3=0 + SUM4=0 + SUM5=0 + R=FLOAT(N) + DO 15 I =1,N + 15 SUM1=SUM1+X(I) + B1=SUM1/N + DO 20 I = 1,N + 20 SUM2=SUM2+ALOG(X(I)) + A1=SUM2/N + DO 25 I=1,N + 25 SUM4=SUM4+(ALOG(X(I))-A1)*(ALOG(X(I))-A1) + A2=SUM4/N + B3=EXP(2*A1+A2)*(EXP(A2)-1) + C1=ALOG(A2/B3) + C2=(EXP(4*A2)+(2*EXP(3*A2))-4)/4-A2+(0.75*EXP(A2)) + C3=A2*(2*EXP(A2)-1)*(2*EXP(A2)-1) + C4=2*(EXP(A2)-1)*(EXP(A2)-1) + C5=C3/C4 + IF(C2 .LT. C5) GO TO 30 + C6=SQRT(C2-C5)*2*(SQRT(R)) + Y(1)=C1/C6 + GO TO 40 + 30 WRITE(6,35) + Y(1)=999999999 + 35 FORMAT(/,2X,'WARNING!!! STATISTICS FOR THE NEXT TEST WILL', + +' NOT BE CALCULATED DUE TO SMALL LOGVARIANCE') + 40 WRITE(6,100) Y(1) + 100 FORMAT(/,2X,'TEST24 KT(LN) =',F10.4) + RETURN + END + SUBROUTINE SORT(NN,X) + INTEGER I,J,K,L,IJ,NN,M,IU(16),IL(16) + REAL Y,YY,X(500) + M=1 + I=1 + J=NN + 150 IF (I .GE. J) GO TO 220 + 160 K=I + IJ=(J+I)/2 + Y=X(IJ) + IF (X(I) .LE. Y) GO TO 170 + X(IJ)=X(I) + X(I)=Y + Y=X(IJ) + 170 L=J + IF (X(J) .GE. Y) GO TO 190 + X(IJ)=X(J) + X(J)=Y + Y=X(IJ) + IF (X(I) .LE. Y) GO TO 190 + X(IJ)=X(I) + X(I)=Y + Y=X(IJ) + GO TO 190 + 180 X(L)=X(K) + X(K)=YY + 190 L=L-1 + IF (X(L) .GT. Y) GO TO 190 + YY=X(L) + 200 K=K+1 + IF (X(K) .LT. Y) GO TO 200 + IF (K .LE. L) GO TO 180 + IF (L-I .LE. J-K) GO TO 210 + IL(M)=I + IU(M)=L + I=K + M=M+1 + GO TO 230 + 210 IL(M)=K + IU(M)=J + J=L + M=M+1 + GO TO 230 + 220 M=M-1 + IF (M .EQ. 0) GO TO 260 + I=IL(M) + J=IU(M) + 230 IF (J-I .GE. 1) GO TO 160 + I=I-1 + 240 I=I+1 + IF (I .EQ. J) GO TO 220 + Y=X(I+1) + IF (X(I) .LE. Y) GO TO 240 + K=I + 250 X(K+I)=X(K) + K=K-1 + IF (Y .LT. X(K)) GO TO 250 + X(K+1)=Y + GO TO 240 + 260 CONTINUE + RETURN + END + FUNCTION enormp(x) + REAL x + DOUBLE PRECISION x1,x2,x3,x4,yy1,yy2 + xp1 = 0.771058495001320D-04 + xp2 = -0.00133733772997339D0 + xp3 = 0.0323076579225834D0 + xp4 = 0.0479137145607681D0 + xp5 = 0.128379167095513D0 + xq1 = 0.00301048631703895D0 + xq2 = 0.0538971687740286D0 + xq3 = 0.375795757275549D0 + xr1 = -1.36864857382717D-07 + xr2 = 0.564195517478974D0 + xr3 = 7.21175825088309D0 + xr4 = 43.1622272220567D0 + xr5 = 152.989285046940D0 + xr6 = 339.320816734344D0 + xr7 = 451.918953711873D0 + xr8 = 300.459261020162D0 + xs1 = 1.0D0 + xs2 = 12.7827273196294D0 + xs3 = 77.0001529352295D0 + xs4 = 277.585444743988D0 + xs5 = 638.980264465631D0 + xs6 = 931.354094850610D0 + xs7 = 790.950925327898D0 + xs8 = 300.459260956983D0 + xt1 = 2.10144126479064D0 + xt2 = 26.2370141675169D0 + xt3 = 21.3688200555087D0 + xt4 = 4.65807828718470D0 + xt5 = 0.282094791773523D0 + xu1 = 94.1537750555460D0 + xu2 = 187.114811799590D0 + xu3 = 99.0191814623914D0 + xu4 = 18.0124575948747D0 + x3 = 0.564189583547756D0 + x1 = abs(x) + IF (x1.GT.0.5D0) GO TO 10 + x4 = x*x + yy1 = ((((xp1*x4+xp2)*x4+xp3)*x4+xp4)*x4+xp5) +1.0D0 + yy2 = (((xq1*x4+xq2)*x4+xq3)*x4) + 1.0D0 + enormp = x* (yy1/yy2) + RETURN + 10 IF (x1.GT.4.0D0) GO TO 20 + yy1 = ((((((xr1*x1+xr2)*x1+xr3)*x1+xr4)*x1+xr5)*x1 + + + xr6)*x1+xr7)*x1+xr8 + yy2 = ((((((xs1*x1+xs2)*x1+xs3)*x1+xs4)*x1+xs5)*x1 + + + xs6)*x1+xs7)*x1+xs8 + enormp = 1.0D0-exp(-x*x)*yy1/yy2 + IF (x .LT. 0.0D0) enormp = -enormp + RETURN + 20 x2 = x*x + x4=1.0D0*x4 + yy1 = ((((xt1*x4+xt2)*x4+xt3)*x4+xt4)*x4) + xt5 + yy2 = ((((xu1*x4+xu2)*x4+xu3)*x4+xu4)*x4) + 1.0D0 + enormp = (x3/x1)-(yy1*x1)/(x2*yy2) + enormp = 1.0D0-exp(-x2)*enormp + IF (x .LT. 0.0D0) enormp = -enormp + RETURN + END + FUNCTION xinormal(p) + DOUBLE PRECISION px,pw,f0 + p0=-0.322232431088D0 + p1=-1.0D0 + p2=-0.342242088547D0 + p3=-0.0204231210245D0 + p4=-0.0000453642210148D0 + q0=0.099348462606D0 + q1=0.588581570495D0 + q2=0.531103462366D0 + q3=0.10353775285D0 + q4=0.0038560700634D0 + pind=p + IF (p .LT. 1.0E-10) GO TO 10 + GO TO 20 + 10 xinormal = -10 + RETURN + 20 IF (p .GE. 1.0) GO TO 30 + GO TO 40 + 30 xinormal = 10 + RETURN + IF (p .EQ. 0.5D0) GO TO 35 + GO TO 40 + 35 xinormal = 0.5 + RETURN + 40 IF (p .GT. 0.5D0) p=p-1 + pw=SQRT(ALOG(1/(p*p))) + f0=(((pw*q4+q3)*pw+q2)*pw+q1)*pw+q0 + px=pw+((((pw*p4+p3)*pw+p2)*pw+p1)*pw+p0)/f0 + if (pind .LT. 0.5D0) px=-px + xinormal = px + RETURN + END +``` \ No newline at end of file diff --git a/lib/external/Makefile b/lib/external/Makefile index 5453bb931f0..6c28110144c 100644 --- a/lib/external/Makefile +++ b/lib/external/Makefile @@ -3,6 +3,7 @@ MODULE_TOPDIR = ../.. SUBDIRS = \ ccmath \ + parson \ shapelib include $(MODULE_TOPDIR)/include/Make/Dir.make diff --git a/lib/external/README.license b/lib/external/README.license index d36c4b5b03e..071160af0cc 100644 --- a/lib/external/README.license +++ b/lib/external/README.license @@ -17,3 +17,7 @@ comments carefully. * shapelib/ (MIT/X) Shapefile read/write functions. Copyright (c) 2007, Frank Warmerdam + + * parson/ (MIT/X) + JSON parsing and encoding functions version 1.5.2. + Copyright (c) 2022, Krzysztof Gabis diff --git a/lib/external/README.md b/lib/external/README.md new file mode 100644 index 00000000000..ef26276acff --- /dev/null +++ b/lib/external/README.md @@ -0,0 +1,120 @@ +# How to add a new external library + +The following procedure will walk you through adding a new third-party +library to GRASS GIS. + +## License + +Before you start, make sure that the library you want to include is in +compliance with the GRASS GIS licence. + +### Approved Third-Party Licenses + +* MIT/X +* GPLv2 +* LGPL 2.1 +* MPL 2.0 +* BSD-3-Clause +* Public Domain + +## Procedure + +* Create a directory that will contain the new library's files +in `lib/external/` + +* Add the new libraries header and source files, license, and README to the newly +created directory. + +* Add a new `Makefile` to the directory. + +```make +MODULE_TOPDIR = ../../.. + +# replace SHAPE with new library name +LIB = SHAPE + +include $(MODULE_TOPDIR)/include/Make/Lib.make + +default: headers + $(MAKE) lib + +# Update header file reference to the new library +headers: $(ARCH_INCDIR)/shapefil.h + +$(ARCH_INCDIR)/%.h: %.h + $(INSTALL_DATA) $< $@ +``` + +* Update `lib/external/Makefile` to include the new subdirectory. + +```make +MODULE_TOPDIR = ../.. + +SUBDIRS = \ + ccmath \ + parson \ + shapelib \ + # Add new directory here + +include $(MODULE_TOPDIR)/include/Make/Dir.make + +default: parsubdirs +``` + +* Update the `lib/external/README.license` with a new entry containing + the *library name*, *license*, *description*, *version*, *copyright*, + and *authors name*. + +```txt +* parson/ (MIT/X) + JSON parsing and encoding functions version 1.5.2. + Copyright (c) 2022, Krzysztof Gabis +``` + +* Update `lib/README` with a new entry under external libraries. + +```md + external: external libraries + - external/parson: JSON serialization and deserialization functions + - external/shapelib: SHAPE file management functions + +``` + +* Update `include/Make/Install.make` + +```make +-cp -rL --parents lib/external/ ./grass-lib-$(GRASS_VERSION_NUMBER) +``` + +* Add reference to library in `include/Make/Grass.make` in alphabetical order. + +```make +: + +# example for the parson library +PARSON:parson \ +``` + +* Add reference to library in the root `Makefile`. + +```make +LIBDIRS = \ + lib/external/parson \ + lib/external/shapelib \ + # New reference + ... +``` + +* The library should now be able to successfully compile. + +To test run the `make` command. + +```bash +make +``` + +* If no errors are found the library should now be able to be used in development. + +```c +#include +``` diff --git a/lib/external/parson/LICENSE b/lib/external/parson/LICENSE new file mode 100644 index 00000000000..4431a611d24 --- /dev/null +++ b/lib/external/parson/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2012 - 2022 Krzysztof Gabis + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/lib/external/parson/Makefile b/lib/external/parson/Makefile new file mode 100644 index 00000000000..43aca3bc351 --- /dev/null +++ b/lib/external/parson/Makefile @@ -0,0 +1,13 @@ +MODULE_TOPDIR = ../../.. + +LIB = PARSON + +include $(MODULE_TOPDIR)/include/Make/Lib.make + +default: headers + $(MAKE) lib + +headers: $(ARCH_INCDIR)/parson.h + +$(ARCH_INCDIR)/%.h: %.h + $(INSTALL_DATA) $< $@ diff --git a/lib/external/parson/README.md b/lib/external/parson/README.md new file mode 100644 index 00000000000..2557a8f7943 --- /dev/null +++ b/lib/external/parson/README.md @@ -0,0 +1,189 @@ +# Parson + +## About + +Parson is a lightweight [json](http://json.org) library written in C. + +## Features + +* Lightweight (only 2 files) +* Simple API +* Addressing json values with dot notation (similar to C structs or objects +in most OO languages, e.g. "objectA.objectB.value") +* C89 compatible +* Test suites + +## Installation + +Run: + +```bash +git clone https://github.com/kgabis/parson.git +``` + +and copy parson.h and parson.c to you source code tree. + +Run ```bash make test``` to compile and run tests. + +## Examples + +### Parsing JSON + +Here is a function, which prints basic commit info (date, sha and author) from +a github repository. + +```c +void print_commits_info(const char *username, const char *repo) { + JSON_Value *root_value; + JSON_Array *commits; + JSON_Object *commit; + size_t i; + + char curl_command[512]; + char cleanup_command[256]; + char output_filename[] = "commits.json"; + + /* it ain't pretty, but it's not a libcurl tutorial */ + sprintf(curl_command, + "curl -s \"https://api.github.com/repos/%s/%s/commits\" > %s", + username, repo, output_filename); + sprintf(cleanup_command, "rm -f %s", output_filename); + system(curl_command); + + /* parsing json and validating output */ + root_value = json_parse_file(output_filename); + if (json_value_get_type(root_value) != JSONArray) { + system(cleanup_command); + return; + } + + /* getting array from root value and printing commit info */ + commits = json_value_get_array(root_value); + printf("%-10.10s %-10.10s %s\n", "Date", "SHA", "Author"); + for (i = 0; i < json_array_get_count(commits); i++) { + commit = json_array_get_object(commits, i); + printf("%.10s %.10s %s\n", + json_object_dotget_string(commit, "commit.author.date"), + json_object_get_string(commit, "sha"), + json_object_dotget_string(commit, "commit.author.name")); + } + + /* cleanup code */ + json_value_free(root_value); + system(cleanup_command); +} +``` + +Calling + +```c +print_commits_info("torvalds", "linux"); + +``` + +prints: + +```csv +Date SHA Author +2012-10-15 dd8e8c4a2c David Rientjes +2012-10-15 3ce9e53e78 Michal Marek +2012-10-14 29bb4cc5e0 Randy Dunlap +2012-10-15 325adeb55e Ralf Baechle +2012-10-14 68687c842c Russell King +2012-10-14 ddffeb8c4d Linus Torvalds +... +``` + +### Persistence + +In this example I'm using parson to save user information to a file and then +load it and validate later. + +```c +void persistence_example(void) { + JSON_Value *schema = json_parse_string("{\"name\":\"\"}"); + JSON_Value *user_data = json_parse_file("user_data.json"); + char buf[256]; + const char *name = NULL; + if (user_data == NULL || json_validate(schema, user_data) != JSONSuccess) { + puts("Enter your name:"); + scanf("%s", buf); + user_data = json_value_init_object(); + json_object_set_string(json_object(user_data), "name", buf); + json_serialize_to_file(user_data, "user_data.json"); + } + name = json_object_get_string(json_object(user_data), "name"); + printf("Hello, %s.", name); + json_value_free(schema); + json_value_free(user_data); + return; +} +``` + +### Serialization + +Creating JSON values is very simple thanks to the dot notation. +Object hierarchy is automatically created when addressing specific fields. +In the following example I create a simple JSON value containing basic +information about a person. + +```c +void serialization_example(void) { + JSON_Value *root_value = json_value_init_object(); + JSON_Object *root_object = json_value_get_object(root_value); + char *serialized_string = NULL; + json_object_set_string(root_object, "name", "John Smith"); + json_object_set_number(root_object, "age", 25); + json_object_dotset_string(root_object, "address.city", "Cupertino"); + json_object_dotset_value( + root_object, + "contact.emails", + json_parse_string( + "[\"email@example.com\", + \"email2@example.com\"]" + ) + ); + serialized_string = json_serialize_to_string_pretty(root_value); + puts(serialized_string); + json_free_serialized_string(serialized_string); + json_value_free(root_value); +} + +``` + +Output: + +```json +{ + "name": "John Smith", + "age": 25, + "address": { + "city": "Cupertino" + }, + "contact": { + "emails": [ + "email@example.com", + "email2@example.com" + ] + } +} +``` + +## Contributing + +I will always merge *working* bug fixes. However, if you want to add something +new to the API, please create an "issue" on github for this first so we can +discuss if it should end up in the library before you start implementing it. +Remember to follow parson's code style and write appropriate tests. + +## My other projects + +* [ape](https://github.com/kgabis/ape) - simple programming language +implemented in C library +* [kgflags](https://github.com/kgabis/kgflags) - easy to use command-line flag +parsing library +* [agnes](https://github.com/kgabis/agnes) - header-only NES emulation library + +## License + +[The MIT License (MIT)](http://opensource.org/licenses/mit-license.php) diff --git a/lib/external/parson/parson.c b/lib/external/parson/parson.c new file mode 100644 index 00000000000..21490938bb7 --- /dev/null +++ b/lib/external/parson/parson.c @@ -0,0 +1,2855 @@ +/* + SPDX-License-Identifier: MIT + + Parson 1.5.3 (https://github.com/kgabis/parson) + Copyright (c) 2012 - 2023 Krzysztof Gabis + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif /* _CRT_SECURE_NO_WARNINGS */ +#endif /* _MSC_VER */ + +#include "parson.h" + +#define PARSON_IMPL_VERSION_MAJOR 1 +#define PARSON_IMPL_VERSION_MINOR 5 +#define PARSON_IMPL_VERSION_PATCH 3 + +#if (PARSON_VERSION_MAJOR != PARSON_IMPL_VERSION_MAJOR) || \ + (PARSON_VERSION_MINOR != PARSON_IMPL_VERSION_MINOR) || \ + (PARSON_VERSION_PATCH != PARSON_IMPL_VERSION_PATCH) +#error "parson version mismatch between parson.c and parson.h" +#endif + +#include +#include +#include +#include +#include +#include +#include + +/* Apparently sscanf is not implemented in some "standard" libraries, so don't + * use it, if you don't have to. */ +#ifdef sscanf +#undef sscanf +#define sscanf THINK_TWICE_ABOUT_USING_SSCANF +#endif + +/* strcpy is unsafe */ +#ifdef strcpy +#undef strcpy +#endif +#define strcpy USE_MEMCPY_INSTEAD_OF_STRCPY + +#define STARTING_CAPACITY 16 +#define MAX_NESTING 2048 + +#ifndef PARSON_DEFAULT_FLOAT_FORMAT +#define PARSON_DEFAULT_FLOAT_FORMAT \ + "%1.17g" /* do not increase precision without incresing NUM_BUF_SIZE */ +#endif + +#ifndef PARSON_NUM_BUF_SIZE +#define PARSON_NUM_BUF_SIZE \ + 64 /* double printed with "%1.17g" shouldn't be longer than 25 bytes so \ + let's be paranoid and use 64 */ +#endif + +#ifndef PARSON_INDENT_STR +#define PARSON_INDENT_STR " " +#endif + +#define SIZEOF_TOKEN(a) (sizeof(a) - 1) +#define SKIP_CHAR(str) ((*str)++) +#define SKIP_WHITESPACES(str) \ + while (isspace((unsigned char)(**str))) { \ + SKIP_CHAR(str); \ + } +#define MAX(a, b) ((a) > (b) ? (a) : (b)) + +#undef malloc +#undef free + +#if defined(isnan) && defined(isinf) +#define IS_NUMBER_INVALID(x) (isnan((x)) || isinf((x))) +#else +#define IS_NUMBER_INVALID(x) (((x)*0.0) != 0.0) +#endif + +#define OBJECT_INVALID_IX ((size_t)-1) + +static JSON_Malloc_Function parson_malloc = malloc; +static JSON_Free_Function parson_free = free; + +static int parson_escape_slashes = 1; + +static char *parson_float_format = NULL; + +static JSON_Number_Serialization_Function parson_number_serialization_function = + NULL; + +#define IS_CONT(b) \ + (((unsigned char)(b)&0xC0) == 0x80) /* is utf-8 continuation byte */ + +typedef int parson_bool_t; + +#define PARSON_TRUE 1 +#define PARSON_FALSE 0 + +typedef struct json_string { + char *chars; + size_t length; +} JSON_String; + +/* Type definitions */ +typedef union json_value_value { + JSON_String string; + double number; + JSON_Object *object; + JSON_Array *array; + int boolean; + int null; +} JSON_Value_Value; + +struct json_value_t { + JSON_Value *parent; + JSON_Value_Type type; + JSON_Value_Value value; +}; + +struct json_object_t { + JSON_Value *wrapping_value; + size_t *cells; + unsigned long *hashes; + char **names; + JSON_Value **values; + size_t *cell_ixs; + size_t count; + size_t item_capacity; + size_t cell_capacity; +}; + +struct json_array_t { + JSON_Value *wrapping_value; + JSON_Value **items; + size_t count; + size_t capacity; +}; + +/* Various */ +static char *read_file(const char *filename); +static void remove_comments(char *string, const char *start_token, + const char *end_token); +static char *parson_strndup(const char *string, size_t n); +static char *parson_strdup(const char *string); +static int parson_sprintf(char *s, const char *format, ...); +static int hex_char_to_int(char c); +static JSON_Status parse_utf16_hex(const char *string, unsigned int *result); +static int num_bytes_in_utf8_sequence(unsigned char c); +static JSON_Status verify_utf8_sequence(const unsigned char *string, int *len); +static parson_bool_t is_valid_utf8(const char *string, size_t string_len); +static parson_bool_t is_decimal(const char *string, size_t length); +static unsigned long hash_string(const char *string, size_t n); + +/* JSON Object */ +static JSON_Object *json_object_make(JSON_Value *wrapping_value); +static JSON_Status json_object_init(JSON_Object *object, size_t capacity); +static void json_object_deinit(JSON_Object *object, parson_bool_t free_keys, + parson_bool_t free_values); +static JSON_Status json_object_grow_and_rehash(JSON_Object *object); +static size_t json_object_get_cell_ix(const JSON_Object *object, + const char *key, size_t key_len, + unsigned long hash, + parson_bool_t *out_found); +static JSON_Status json_object_add(JSON_Object *object, char *name, + JSON_Value *value); +static JSON_Value *json_object_getn_value(const JSON_Object *object, + const char *name, size_t name_len); +static JSON_Status json_object_remove_internal(JSON_Object *object, + const char *name, + parson_bool_t free_value); +static JSON_Status json_object_dotremove_internal(JSON_Object *object, + const char *name, + parson_bool_t free_value); +static void json_object_free(JSON_Object *object); + +/* JSON Array */ +static JSON_Array *json_array_make(JSON_Value *wrapping_value); +static JSON_Status json_array_add(JSON_Array *array, JSON_Value *value); +static JSON_Status json_array_resize(JSON_Array *array, size_t new_capacity); +static void json_array_free(JSON_Array *array); + +/* JSON Value */ +static JSON_Value *json_value_init_string_no_copy(char *string, size_t length); +static const JSON_String *json_value_get_string_desc(const JSON_Value *value); + +/* Parser */ +static JSON_Status skip_quotes(const char **string); +static JSON_Status parse_utf16(const char **unprocessed, char **processed); +static char *process_string(const char *input, size_t input_len, + size_t *output_len); +static char *get_quoted_string(const char **string, size_t *output_string_len); +static JSON_Value *parse_object_value(const char **string, size_t nesting); +static JSON_Value *parse_array_value(const char **string, size_t nesting); +static JSON_Value *parse_string_value(const char **string); +static JSON_Value *parse_boolean_value(const char **string); +static JSON_Value *parse_number_value(const char **string); +static JSON_Value *parse_null_value(const char **string); +static JSON_Value *parse_value(const char **string, size_t nesting); + +/* Serialization */ +static int json_serialize_to_buffer_r(const JSON_Value *value, char *buf, + int level, parson_bool_t is_pretty, + char *num_buf); +static int json_serialize_string(const char *string, size_t len, char *buf); + +/* Various */ +static char *read_file(const char *filename) +{ + FILE *fp = fopen(filename, "r"); + size_t size_to_read = 0; + size_t size_read = 0; + long pos; + char *file_contents; + if (!fp) { + return NULL; + } + fseek(fp, 0L, SEEK_END); + pos = ftell(fp); + if (pos < 0) { + fclose(fp); + return NULL; + } + size_to_read = pos; + rewind(fp); + file_contents = (char *)parson_malloc(sizeof(char) * (size_to_read + 1)); + if (!file_contents) { + fclose(fp); + return NULL; + } + size_read = fread(file_contents, 1, size_to_read, fp); + if (size_read == 0 || ferror(fp)) { + fclose(fp); + parson_free(file_contents); + return NULL; + } + fclose(fp); + file_contents[size_read] = '\0'; + return file_contents; +} + +static void remove_comments(char *string, const char *start_token, + const char *end_token) +{ + parson_bool_t in_string = PARSON_FALSE, escaped = PARSON_FALSE; + size_t i; + char *ptr = NULL, current_char; + size_t start_token_len = strlen(start_token); + size_t end_token_len = strlen(end_token); + if (start_token_len == 0 || end_token_len == 0) { + return; + } + while ((current_char = *string) != '\0') { + if (current_char == '\\' && !escaped) { + escaped = PARSON_TRUE; + string++; + continue; + } + else if (current_char == '\"' && !escaped) { + in_string = !in_string; + } + else if (!in_string && + strncmp(string, start_token, start_token_len) == 0) { + for (i = 0; i < start_token_len; i++) { + string[i] = ' '; + } + string = string + start_token_len; + ptr = strstr(string, end_token); + if (!ptr) { + return; + } + for (i = 0; i < (ptr - string) + end_token_len; i++) { + string[i] = ' '; + } + string = ptr + end_token_len - 1; + } + escaped = PARSON_FALSE; + string++; + } +} + +static char *parson_strndup(const char *string, size_t n) +{ + /* We expect the caller has validated that 'n' fits within the input buffer. + */ + char *output_string = (char *)parson_malloc(n + 1); + if (!output_string) { + return NULL; + } + output_string[n] = '\0'; + memcpy(output_string, string, n); + return output_string; +} + +static char *parson_strdup(const char *string) +{ + return parson_strndup(string, strlen(string)); +} + +static int parson_sprintf(char *s, const char *format, ...) +{ + int result; + va_list args; + va_start(args, format); + +#if defined(__APPLE__) && defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + result = vsprintf(s, format, args); +#if defined(__APPLE__) && defined(__clang__) +#pragma clang diagnostic pop +#endif + + va_end(args); + return result; +} + +static int hex_char_to_int(char c) +{ + if (c >= '0' && c <= '9') { + return c - '0'; + } + else if (c >= 'a' && c <= 'f') { + return c - 'a' + 10; + } + else if (c >= 'A' && c <= 'F') { + return c - 'A' + 10; + } + return -1; +} + +static JSON_Status parse_utf16_hex(const char *s, unsigned int *result) +{ + int x1, x2, x3, x4; + if (s[0] == '\0' || s[1] == '\0' || s[2] == '\0' || s[3] == '\0') { + return JSONFailure; + } + x1 = hex_char_to_int(s[0]); + x2 = hex_char_to_int(s[1]); + x3 = hex_char_to_int(s[2]); + x4 = hex_char_to_int(s[3]); + if (x1 == -1 || x2 == -1 || x3 == -1 || x4 == -1) { + return JSONFailure; + } + *result = (unsigned int)((x1 << 12) | (x2 << 8) | (x3 << 4) | x4); + return JSONSuccess; +} + +static int num_bytes_in_utf8_sequence(unsigned char c) +{ + if (c == 0xC0 || c == 0xC1 || c > 0xF4 || IS_CONT(c)) { + return 0; + } + else if ((c & 0x80) == 0) { /* 0xxxxxxx */ + return 1; + } + else if ((c & 0xE0) == 0xC0) { /* 110xxxxx */ + return 2; + } + else if ((c & 0xF0) == 0xE0) { /* 1110xxxx */ + return 3; + } + else if ((c & 0xF8) == 0xF0) { /* 11110xxx */ + return 4; + } + return 0; /* won't happen */ +} + +static JSON_Status verify_utf8_sequence(const unsigned char *string, int *len) +{ + unsigned int cp = 0; + *len = num_bytes_in_utf8_sequence(string[0]); + + if (*len == 1) { + cp = string[0]; + } + else if (*len == 2 && IS_CONT(string[1])) { + cp = string[0] & 0x1F; + cp = (cp << 6) | (string[1] & 0x3F); + } + else if (*len == 3 && IS_CONT(string[1]) && IS_CONT(string[2])) { + cp = ((unsigned char)string[0]) & 0xF; + cp = (cp << 6) | (string[1] & 0x3F); + cp = (cp << 6) | (string[2] & 0x3F); + } + else if (*len == 4 && IS_CONT(string[1]) && IS_CONT(string[2]) && + IS_CONT(string[3])) { + cp = string[0] & 0x7; + cp = (cp << 6) | (string[1] & 0x3F); + cp = (cp << 6) | (string[2] & 0x3F); + cp = (cp << 6) | (string[3] & 0x3F); + } + else { + return JSONFailure; + } + + /* overlong encodings */ + if ((cp < 0x80 && *len > 1) || (cp < 0x800 && *len > 2) || + (cp < 0x10000 && *len > 3)) { + return JSONFailure; + } + + /* invalid unicode */ + if (cp > 0x10FFFF) { + return JSONFailure; + } + + /* surrogate halves */ + if (cp >= 0xD800 && cp <= 0xDFFF) { + return JSONFailure; + } + + return JSONSuccess; +} + +static int is_valid_utf8(const char *string, size_t string_len) +{ + int len = 0; + const char *string_end = string + string_len; + while (string < string_end) { + if (verify_utf8_sequence((const unsigned char *)string, &len) != + JSONSuccess) { + return PARSON_FALSE; + } + string += len; + } + return PARSON_TRUE; +} + +static parson_bool_t is_decimal(const char *string, size_t length) +{ + if (length > 1 && string[0] == '0' && string[1] != '.') { + return PARSON_FALSE; + } + if (length > 2 && !strncmp(string, "-0", 2) && string[2] != '.') { + return PARSON_FALSE; + } + while (length--) { + if (strchr("xX", string[length])) { + return PARSON_FALSE; + } + } + return PARSON_TRUE; +} + +static unsigned long hash_string(const char *string, size_t n) +{ +#ifdef PARSON_FORCE_HASH_COLLISIONS + (void)string; + (void)n; + return 0; +#else + unsigned long hash = 5381; + unsigned char c; + size_t i = 0; + for (i = 0; i < n; i++) { + c = string[i]; + if (c == '\0') { + break; + } + hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ + } + return hash; +#endif +} + +/* JSON Object */ +static JSON_Object *json_object_make(JSON_Value *wrapping_value) +{ + JSON_Status res = JSONFailure; + JSON_Object *new_obj = (JSON_Object *)parson_malloc(sizeof(JSON_Object)); + if (new_obj == NULL) { + return NULL; + } + new_obj->wrapping_value = wrapping_value; + res = json_object_init(new_obj, 0); + if (res != JSONSuccess) { + parson_free(new_obj); + return NULL; + } + return new_obj; +} + +static JSON_Status json_object_init(JSON_Object *object, size_t capacity) +{ + unsigned int i = 0; + + object->cells = NULL; + object->names = NULL; + object->values = NULL; + object->cell_ixs = NULL; + object->hashes = NULL; + + object->count = 0; + object->cell_capacity = capacity; + object->item_capacity = (unsigned int)(capacity * 7 / 10); + + if (capacity == 0) { + return JSONSuccess; + } + + object->cells = + (size_t *)parson_malloc(object->cell_capacity * sizeof(*object->cells)); + object->names = + (char **)parson_malloc(object->item_capacity * sizeof(*object->names)); + object->values = (JSON_Value **)parson_malloc(object->item_capacity * + sizeof(*object->values)); + object->cell_ixs = (size_t *)parson_malloc(object->item_capacity * + sizeof(*object->cell_ixs)); + object->hashes = (unsigned long *)parson_malloc(object->item_capacity * + sizeof(*object->hashes)); + if (object->cells == NULL || object->names == NULL || + object->values == NULL || object->cell_ixs == NULL || + object->hashes == NULL) { + goto error; + } + for (i = 0; i < object->cell_capacity; i++) { + object->cells[i] = OBJECT_INVALID_IX; + } + return JSONSuccess; +error: + parson_free(object->cells); + parson_free(object->names); + parson_free(object->values); + parson_free(object->cell_ixs); + parson_free(object->hashes); + return JSONFailure; +} + +static void json_object_deinit(JSON_Object *object, parson_bool_t free_keys, + parson_bool_t free_values) +{ + unsigned int i = 0; + for (i = 0; i < object->count; i++) { + if (free_keys) { + parson_free(object->names[i]); + } + if (free_values) { + json_value_free(object->values[i]); + } + } + + object->count = 0; + object->item_capacity = 0; + object->cell_capacity = 0; + + parson_free(object->cells); + parson_free(object->names); + parson_free(object->values); + parson_free(object->cell_ixs); + parson_free(object->hashes); + + object->cells = NULL; + object->names = NULL; + object->values = NULL; + object->cell_ixs = NULL; + object->hashes = NULL; +} + +static JSON_Status json_object_grow_and_rehash(JSON_Object *object) +{ + JSON_Value *wrapping_value = NULL; + JSON_Object new_object; + char *key = NULL; + JSON_Value *value = NULL; + unsigned int i = 0; + size_t new_capacity = MAX(object->cell_capacity * 2, STARTING_CAPACITY); + JSON_Status res = json_object_init(&new_object, new_capacity); + if (res != JSONSuccess) { + return JSONFailure; + } + + wrapping_value = json_object_get_wrapping_value(object); + new_object.wrapping_value = wrapping_value; + + for (i = 0; i < object->count; i++) { + key = object->names[i]; + value = object->values[i]; + res = json_object_add(&new_object, key, value); + if (res != JSONSuccess) { + json_object_deinit(&new_object, PARSON_FALSE, PARSON_FALSE); + return JSONFailure; + } + value->parent = wrapping_value; + } + json_object_deinit(object, PARSON_FALSE, PARSON_FALSE); + *object = new_object; + return JSONSuccess; +} + +static size_t json_object_get_cell_ix(const JSON_Object *object, + const char *key, size_t key_len, + unsigned long hash, + parson_bool_t *out_found) +{ + size_t cell_ix = hash & (object->cell_capacity - 1); + size_t cell = 0; + size_t ix = 0; + unsigned int i = 0; + unsigned long hash_to_check = 0; + const char *key_to_check = NULL; + size_t key_to_check_len = 0; + + *out_found = PARSON_FALSE; + + for (i = 0; i < object->cell_capacity; i++) { + ix = (cell_ix + i) & (object->cell_capacity - 1); + cell = object->cells[ix]; + if (cell == OBJECT_INVALID_IX) { + return ix; + } + hash_to_check = object->hashes[cell]; + if (hash != hash_to_check) { + continue; + } + key_to_check = object->names[cell]; + key_to_check_len = strlen(key_to_check); + if (key_to_check_len == key_len && + strncmp(key, key_to_check, key_len) == 0) { + *out_found = PARSON_TRUE; + return ix; + } + } + return OBJECT_INVALID_IX; +} + +static JSON_Status json_object_add(JSON_Object *object, char *name, + JSON_Value *value) +{ + unsigned long hash = 0; + parson_bool_t found = PARSON_FALSE; + size_t cell_ix = 0; + JSON_Status res = JSONFailure; + + if (!object || !name || !value) { + return JSONFailure; + } + + hash = hash_string(name, strlen(name)); + found = PARSON_FALSE; + cell_ix = json_object_get_cell_ix(object, name, strlen(name), hash, &found); + if (found) { + return JSONFailure; + } + + if (object->count >= object->item_capacity) { + res = json_object_grow_and_rehash(object); + if (res != JSONSuccess) { + return JSONFailure; + } + cell_ix = + json_object_get_cell_ix(object, name, strlen(name), hash, &found); + } + + object->names[object->count] = name; + object->cells[cell_ix] = object->count; + object->values[object->count] = value; + object->cell_ixs[object->count] = cell_ix; + object->hashes[object->count] = hash; + object->count++; + value->parent = json_object_get_wrapping_value(object); + + return JSONSuccess; +} + +static JSON_Value *json_object_getn_value(const JSON_Object *object, + const char *name, size_t name_len) +{ + unsigned long hash = 0; + parson_bool_t found = PARSON_FALSE; + size_t cell_ix = 0; + size_t item_ix = 0; + if (!object || !name) { + return NULL; + } + hash = hash_string(name, name_len); + found = PARSON_FALSE; + cell_ix = json_object_get_cell_ix(object, name, name_len, hash, &found); + if (!found) { + return NULL; + } + item_ix = object->cells[cell_ix]; + return object->values[item_ix]; +} + +static JSON_Status json_object_remove_internal(JSON_Object *object, + const char *name, + parson_bool_t free_value) +{ + unsigned long hash = 0; + parson_bool_t found = PARSON_FALSE; + size_t cell = 0; + size_t item_ix = 0; + size_t last_item_ix = 0; + size_t i = 0; + size_t j = 0; + size_t x = 0; + size_t k = 0; + JSON_Value *val = NULL; + + if (object == NULL) { + return JSONFailure; + } + + hash = hash_string(name, strlen(name)); + found = PARSON_FALSE; + cell = json_object_get_cell_ix(object, name, strlen(name), hash, &found); + if (!found) { + return JSONFailure; + } + + item_ix = object->cells[cell]; + if (free_value) { + val = object->values[item_ix]; + json_value_free(val); + val = NULL; + } + + parson_free(object->names[item_ix]); + last_item_ix = object->count - 1; + if (item_ix < last_item_ix) { + object->names[item_ix] = object->names[last_item_ix]; + object->values[item_ix] = object->values[last_item_ix]; + object->cell_ixs[item_ix] = object->cell_ixs[last_item_ix]; + object->hashes[item_ix] = object->hashes[last_item_ix]; + object->cells[object->cell_ixs[item_ix]] = item_ix; + } + object->count--; + + i = cell; + j = i; + for (x = 0; x < (object->cell_capacity - 1); x++) { + j = (j + 1) & (object->cell_capacity - 1); + if (object->cells[j] == OBJECT_INVALID_IX) { + break; + } + k = object->hashes[object->cells[j]] & (object->cell_capacity - 1); + if ((j > i && (k <= i || k > j)) || (j < i && (k <= i && k > j))) { + object->cell_ixs[object->cells[j]] = i; + object->cells[i] = object->cells[j]; + i = j; + } + } + object->cells[i] = OBJECT_INVALID_IX; + return JSONSuccess; +} + +static JSON_Status json_object_dotremove_internal(JSON_Object *object, + const char *name, + parson_bool_t free_value) +{ + JSON_Value *temp_value = NULL; + JSON_Object *temp_object = NULL; + const char *dot_pos = strchr(name, '.'); + if (!dot_pos) { + return json_object_remove_internal(object, name, free_value); + } + temp_value = json_object_getn_value(object, name, dot_pos - name); + if (json_value_get_type(temp_value) != JSONObject) { + return JSONFailure; + } + temp_object = json_value_get_object(temp_value); + return json_object_dotremove_internal(temp_object, dot_pos + 1, free_value); +} + +static void json_object_free(JSON_Object *object) +{ + json_object_deinit(object, PARSON_TRUE, PARSON_TRUE); + parson_free(object); +} + +/* JSON Array */ +static JSON_Array *json_array_make(JSON_Value *wrapping_value) +{ + JSON_Array *new_array = (JSON_Array *)parson_malloc(sizeof(JSON_Array)); + if (new_array == NULL) { + return NULL; + } + new_array->wrapping_value = wrapping_value; + new_array->items = (JSON_Value **)NULL; + new_array->capacity = 0; + new_array->count = 0; + return new_array; +} + +static JSON_Status json_array_add(JSON_Array *array, JSON_Value *value) +{ + if (array->count >= array->capacity) { + size_t new_capacity = MAX(array->capacity * 2, STARTING_CAPACITY); + if (json_array_resize(array, new_capacity) != JSONSuccess) { + return JSONFailure; + } + } + value->parent = json_array_get_wrapping_value(array); + array->items[array->count] = value; + array->count++; + return JSONSuccess; +} + +static JSON_Status json_array_resize(JSON_Array *array, size_t new_capacity) +{ + JSON_Value **new_items = NULL; + if (new_capacity == 0) { + return JSONFailure; + } + new_items = + (JSON_Value **)parson_malloc(new_capacity * sizeof(JSON_Value *)); + if (new_items == NULL) { + return JSONFailure; + } + if (array->items != NULL && array->count > 0) { + memcpy(new_items, array->items, array->count * sizeof(JSON_Value *)); + } + parson_free(array->items); + array->items = new_items; + array->capacity = new_capacity; + return JSONSuccess; +} + +static void json_array_free(JSON_Array *array) +{ + size_t i; + for (i = 0; i < array->count; i++) { + json_value_free(array->items[i]); + } + parson_free(array->items); + parson_free(array); +} + +/* JSON Value */ +static JSON_Value *json_value_init_string_no_copy(char *string, size_t length) +{ + JSON_Value *new_value = (JSON_Value *)parson_malloc(sizeof(JSON_Value)); + if (!new_value) { + return NULL; + } + new_value->parent = NULL; + new_value->type = JSONString; + new_value->value.string.chars = string; + new_value->value.string.length = length; + return new_value; +} + +/* Parser */ +static JSON_Status skip_quotes(const char **string) +{ + if (**string != '\"') { + return JSONFailure; + } + SKIP_CHAR(string); + while (**string != '\"') { + if (**string == '\0') { + return JSONFailure; + } + else if (**string == '\\') { + SKIP_CHAR(string); + if (**string == '\0') { + return JSONFailure; + } + } + SKIP_CHAR(string); + } + SKIP_CHAR(string); + return JSONSuccess; +} + +static JSON_Status parse_utf16(const char **unprocessed, char **processed) +{ + unsigned int cp, lead, trail; + char *processed_ptr = *processed; + const char *unprocessed_ptr = *unprocessed; + JSON_Status status = JSONFailure; + unprocessed_ptr++; /* skips u */ + status = parse_utf16_hex(unprocessed_ptr, &cp); + if (status != JSONSuccess) { + return JSONFailure; + } + if (cp < 0x80) { + processed_ptr[0] = (char)cp; /* 0xxxxxxx */ + } + else if (cp < 0x800) { + processed_ptr[0] = ((cp >> 6) & 0x1F) | 0xC0; /* 110xxxxx */ + processed_ptr[1] = ((cp)&0x3F) | 0x80; /* 10xxxxxx */ + processed_ptr += 1; + } + else if (cp < 0xD800 || cp > 0xDFFF) { + processed_ptr[0] = ((cp >> 12) & 0x0F) | 0xE0; /* 1110xxxx */ + processed_ptr[1] = ((cp >> 6) & 0x3F) | 0x80; /* 10xxxxxx */ + processed_ptr[2] = ((cp)&0x3F) | 0x80; /* 10xxxxxx */ + processed_ptr += 2; + } + else if (cp >= 0xD800 && + cp <= 0xDBFF) { /* lead surrogate (0xD800..0xDBFF) */ + lead = cp; + unprocessed_ptr += 4; /* should always be within the buffer, otherwise + previous sscanf would fail */ + if (*unprocessed_ptr++ != '\\' || *unprocessed_ptr++ != 'u') { + return JSONFailure; + } + status = parse_utf16_hex(unprocessed_ptr, &trail); + if (status != JSONSuccess || trail < 0xDC00 || + trail > 0xDFFF) { /* valid trail surrogate? (0xDC00..0xDFFF) */ + return JSONFailure; + } + cp = ((((lead - 0xD800) & 0x3FF) << 10) | ((trail - 0xDC00) & 0x3FF)) + + 0x010000; + processed_ptr[0] = (((cp >> 18) & 0x07) | 0xF0); /* 11110xxx */ + processed_ptr[1] = (((cp >> 12) & 0x3F) | 0x80); /* 10xxxxxx */ + processed_ptr[2] = (((cp >> 6) & 0x3F) | 0x80); /* 10xxxxxx */ + processed_ptr[3] = (((cp)&0x3F) | 0x80); /* 10xxxxxx */ + processed_ptr += 3; + } + else { /* trail surrogate before lead surrogate */ + return JSONFailure; + } + unprocessed_ptr += 3; + *processed = processed_ptr; + *unprocessed = unprocessed_ptr; + return JSONSuccess; +} + +/* Copies and processes passed string up to supplied length. +Example: "\u006Corem ipsum" -> lorem ipsum */ +static char *process_string(const char *input, size_t input_len, + size_t *output_len) +{ + const char *input_ptr = input; + size_t initial_size = (input_len + 1) * sizeof(char); + size_t final_size = 0; + char *output = NULL, *output_ptr = NULL, *resized_output = NULL; + output = (char *)parson_malloc(initial_size); + if (output == NULL) { + goto error; + } + output_ptr = output; + while ((*input_ptr != '\0') && (size_t)(input_ptr - input) < input_len) { + if (*input_ptr == '\\') { + input_ptr++; + switch (*input_ptr) { + case '\"': + *output_ptr = '\"'; + break; + case '\\': + *output_ptr = '\\'; + break; + case '/': + *output_ptr = '/'; + break; + case 'b': + *output_ptr = '\b'; + break; + case 'f': + *output_ptr = '\f'; + break; + case 'n': + *output_ptr = '\n'; + break; + case 'r': + *output_ptr = '\r'; + break; + case 't': + *output_ptr = '\t'; + break; + case 'u': + if (parse_utf16(&input_ptr, &output_ptr) != JSONSuccess) { + goto error; + } + break; + default: + goto error; + } + } + else if ((unsigned char)*input_ptr < 0x20) { + goto error; /* 0x00-0x19 are invalid characters for json string + (http://www.ietf.org/rfc/rfc4627.txt) */ + } + else { + *output_ptr = *input_ptr; + } + output_ptr++; + input_ptr++; + } + *output_ptr = '\0'; + /* resize to new length */ + final_size = (size_t)(output_ptr - output) + 1; + /* todo: don't resize if final_size == initial_size */ + resized_output = (char *)parson_malloc(final_size); + if (resized_output == NULL) { + goto error; + } + memcpy(resized_output, output, final_size); + *output_len = final_size - 1; + parson_free(output); + return resized_output; +error: + parson_free(output); + return NULL; +} + +/* Return processed contents of a string between quotes and + skips passed argument to a matching quote. */ +static char *get_quoted_string(const char **string, size_t *output_string_len) +{ + const char *string_start = *string; + size_t input_string_len = 0; + JSON_Status status = skip_quotes(string); + if (status != JSONSuccess) { + return NULL; + } + input_string_len = *string - string_start - 2; /* length without quotes */ + return process_string(string_start + 1, input_string_len, + output_string_len); +} + +static JSON_Value *parse_value(const char **string, size_t nesting) +{ + if (nesting > MAX_NESTING) { + return NULL; + } + SKIP_WHITESPACES(string); + switch (**string) { + case '{': + return parse_object_value(string, nesting + 1); + case '[': + return parse_array_value(string, nesting + 1); + case '\"': + return parse_string_value(string); + case 'f': + case 't': + return parse_boolean_value(string); + case '-': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + return parse_number_value(string); + case 'n': + return parse_null_value(string); + default: + return NULL; + } +} + +static JSON_Value *parse_object_value(const char **string, size_t nesting) +{ + JSON_Status status = JSONFailure; + JSON_Value *output_value = NULL, *new_value = NULL; + JSON_Object *output_object = NULL; + char *new_key = NULL; + + output_value = json_value_init_object(); + if (output_value == NULL) { + return NULL; + } + if (**string != '{') { + json_value_free(output_value); + return NULL; + } + output_object = json_value_get_object(output_value); + SKIP_CHAR(string); + SKIP_WHITESPACES(string); + if (**string == '}') { /* empty object */ + SKIP_CHAR(string); + return output_value; + } + while (**string != '\0') { + size_t key_len = 0; + new_key = get_quoted_string(string, &key_len); + /* We do not support key names with embedded \0 chars */ + if (!new_key) { + json_value_free(output_value); + return NULL; + } + if (key_len != strlen(new_key)) { + parson_free(new_key); + json_value_free(output_value); + return NULL; + } + SKIP_WHITESPACES(string); + if (**string != ':') { + parson_free(new_key); + json_value_free(output_value); + return NULL; + } + SKIP_CHAR(string); + new_value = parse_value(string, nesting); + if (new_value == NULL) { + parson_free(new_key); + json_value_free(output_value); + return NULL; + } + status = json_object_add(output_object, new_key, new_value); + if (status != JSONSuccess) { + parson_free(new_key); + json_value_free(new_value); + json_value_free(output_value); + return NULL; + } + SKIP_WHITESPACES(string); + if (**string != ',') { + break; + } + SKIP_CHAR(string); + SKIP_WHITESPACES(string); + if (**string == '}') { + break; + } + } + SKIP_WHITESPACES(string); + if (**string != '}') { + json_value_free(output_value); + return NULL; + } + SKIP_CHAR(string); + return output_value; +} + +static JSON_Value *parse_array_value(const char **string, size_t nesting) +{ + JSON_Value *output_value = NULL, *new_array_value = NULL; + JSON_Array *output_array = NULL; + output_value = json_value_init_array(); + if (output_value == NULL) { + return NULL; + } + if (**string != '[') { + json_value_free(output_value); + return NULL; + } + output_array = json_value_get_array(output_value); + SKIP_CHAR(string); + SKIP_WHITESPACES(string); + if (**string == ']') { /* empty array */ + SKIP_CHAR(string); + return output_value; + } + while (**string != '\0') { + new_array_value = parse_value(string, nesting); + if (new_array_value == NULL) { + json_value_free(output_value); + return NULL; + } + if (json_array_add(output_array, new_array_value) != JSONSuccess) { + json_value_free(new_array_value); + json_value_free(output_value); + return NULL; + } + SKIP_WHITESPACES(string); + if (**string != ',') { + break; + } + SKIP_CHAR(string); + SKIP_WHITESPACES(string); + if (**string == ']') { + break; + } + } + SKIP_WHITESPACES(string); + if (**string != ']' || /* Trim array after parsing is over */ + json_array_resize(output_array, json_array_get_count(output_array)) != + JSONSuccess) { + json_value_free(output_value); + return NULL; + } + SKIP_CHAR(string); + return output_value; +} + +static JSON_Value *parse_string_value(const char **string) +{ + JSON_Value *value = NULL; + size_t new_string_len = 0; + char *new_string = get_quoted_string(string, &new_string_len); + if (new_string == NULL) { + return NULL; + } + value = json_value_init_string_no_copy(new_string, new_string_len); + if (value == NULL) { + parson_free(new_string); + return NULL; + } + return value; +} + +static JSON_Value *parse_boolean_value(const char **string) +{ + size_t true_token_size = SIZEOF_TOKEN("true"); + size_t false_token_size = SIZEOF_TOKEN("false"); + if (strncmp("true", *string, true_token_size) == 0) { + *string += true_token_size; + return json_value_init_boolean(1); + } + else if (strncmp("false", *string, false_token_size) == 0) { + *string += false_token_size; + return json_value_init_boolean(0); + } + return NULL; +} + +static JSON_Value *parse_number_value(const char **string) +{ + char *end; + double number = 0; + errno = 0; + number = strtod(*string, &end); + if (errno == ERANGE && (number <= -HUGE_VAL || number >= HUGE_VAL)) { + return NULL; + } + if ((errno && errno != ERANGE) || !is_decimal(*string, end - *string)) { + return NULL; + } + *string = end; + return json_value_init_number(number); +} + +static JSON_Value *parse_null_value(const char **string) +{ + size_t token_size = SIZEOF_TOKEN("null"); + if (strncmp("null", *string, token_size) == 0) { + *string += token_size; + return json_value_init_null(); + } + return NULL; +} + +/* Serialization */ + +/* APPEND_STRING() is only called on string literals. + It's a bit hacky because it makes plenty of assumptions about the external + state and should eventually be tidied up into a function (same goes for + APPEND_INDENT) + */ +#define APPEND_STRING(str) \ + do { \ + written = SIZEOF_TOKEN((str)); \ + if (buf != NULL) { \ + memcpy(buf, (str), written); \ + buf[written] = '\0'; \ + buf += written; \ + } \ + written_total += written; \ + } while (0) + +#define APPEND_INDENT(level) \ + do { \ + int level_i = 0; \ + for (level_i = 0; level_i < (level); level_i++) { \ + APPEND_STRING(PARSON_INDENT_STR); \ + } \ + } while (0) + +static int json_serialize_to_buffer_r(const JSON_Value *value, char *buf, + int level, parson_bool_t is_pretty, + char *num_buf) +{ + const char *key = NULL, *string = NULL; + JSON_Value *temp_value = NULL; + JSON_Array *array = NULL; + JSON_Object *object = NULL; + size_t i = 0, count = 0; + double num = 0.0; + int written = -1, written_total = 0; + size_t len = 0; + + switch (json_value_get_type(value)) { + case JSONArray: + array = json_value_get_array(value); + count = json_array_get_count(array); + APPEND_STRING("["); + if (count > 0 && is_pretty) { + APPEND_STRING("\n"); + } + for (i = 0; i < count; i++) { + if (is_pretty) { + APPEND_INDENT(level + 1); + } + temp_value = json_array_get_value(array, i); + written = json_serialize_to_buffer_r(temp_value, buf, level + 1, + is_pretty, num_buf); + if (written < 0) { + return -1; + } + if (buf != NULL) { + buf += written; + } + written_total += written; + if (i < (count - 1)) { + APPEND_STRING(","); + } + if (is_pretty) { + APPEND_STRING("\n"); + } + } + if (count > 0 && is_pretty) { + APPEND_INDENT(level); + } + APPEND_STRING("]"); + return written_total; + case JSONObject: + object = json_value_get_object(value); + count = json_object_get_count(object); + APPEND_STRING("{"); + if (count > 0 && is_pretty) { + APPEND_STRING("\n"); + } + for (i = 0; i < count; i++) { + key = json_object_get_name(object, i); + if (key == NULL) { + return -1; + } + if (is_pretty) { + APPEND_INDENT(level + 1); + } + /* We do not support key names with embedded \0 chars */ + written = json_serialize_string(key, strlen(key), buf); + if (written < 0) { + return -1; + } + if (buf != NULL) { + buf += written; + } + written_total += written; + APPEND_STRING(":"); + if (is_pretty) { + APPEND_STRING(" "); + } + temp_value = json_object_get_value_at(object, i); + written = json_serialize_to_buffer_r(temp_value, buf, level + 1, + is_pretty, num_buf); + if (written < 0) { + return -1; + } + if (buf != NULL) { + buf += written; + } + written_total += written; + if (i < (count - 1)) { + APPEND_STRING(","); + } + if (is_pretty) { + APPEND_STRING("\n"); + } + } + if (count > 0 && is_pretty) { + APPEND_INDENT(level); + } + APPEND_STRING("}"); + return written_total; + case JSONString: + string = json_value_get_string(value); + if (string == NULL) { + return -1; + } + len = json_value_get_string_len(value); + written = json_serialize_string(string, len, buf); + if (written < 0) { + return -1; + } + if (buf != NULL) { + buf += written; + } + written_total += written; + return written_total; + case JSONBoolean: + if (json_value_get_boolean(value)) { + APPEND_STRING("true"); + } + else { + APPEND_STRING("false"); + } + return written_total; + case JSONNumber: + num = json_value_get_number(value); + if (buf != NULL) { + num_buf = buf; + } + if (parson_number_serialization_function) { + written = parson_number_serialization_function(num, num_buf); + } + else { + const char *float_format = parson_float_format + ? parson_float_format + : PARSON_DEFAULT_FLOAT_FORMAT; + written = parson_sprintf(num_buf, float_format, num); + } + if (written < 0) { + return -1; + } + if (buf != NULL) { + buf += written; + } + written_total += written; + return written_total; + case JSONNull: + APPEND_STRING("null"); + return written_total; + case JSONError: + return -1; + default: + return -1; + } +} + +static int json_serialize_string(const char *string, size_t len, char *buf) +{ + size_t i = 0; + char c = '\0'; + int written = -1, written_total = 0; + APPEND_STRING("\""); + for (i = 0; i < len; i++) { + c = string[i]; + switch (c) { + case '\"': + APPEND_STRING("\\\""); + break; + case '\\': + APPEND_STRING("\\\\"); + break; + case '\b': + APPEND_STRING("\\b"); + break; + case '\f': + APPEND_STRING("\\f"); + break; + case '\n': + APPEND_STRING("\\n"); + break; + case '\r': + APPEND_STRING("\\r"); + break; + case '\t': + APPEND_STRING("\\t"); + break; + case '\x00': + APPEND_STRING("\\u0000"); + break; + case '\x01': + APPEND_STRING("\\u0001"); + break; + case '\x02': + APPEND_STRING("\\u0002"); + break; + case '\x03': + APPEND_STRING("\\u0003"); + break; + case '\x04': + APPEND_STRING("\\u0004"); + break; + case '\x05': + APPEND_STRING("\\u0005"); + break; + case '\x06': + APPEND_STRING("\\u0006"); + break; + case '\x07': + APPEND_STRING("\\u0007"); + break; + /* '\x08' duplicate: '\b' */ + /* '\x09' duplicate: '\t' */ + /* '\x0a' duplicate: '\n' */ + case '\x0b': + APPEND_STRING("\\u000b"); + break; + /* '\x0c' duplicate: '\f' */ + /* '\x0d' duplicate: '\r' */ + case '\x0e': + APPEND_STRING("\\u000e"); + break; + case '\x0f': + APPEND_STRING("\\u000f"); + break; + case '\x10': + APPEND_STRING("\\u0010"); + break; + case '\x11': + APPEND_STRING("\\u0011"); + break; + case '\x12': + APPEND_STRING("\\u0012"); + break; + case '\x13': + APPEND_STRING("\\u0013"); + break; + case '\x14': + APPEND_STRING("\\u0014"); + break; + case '\x15': + APPEND_STRING("\\u0015"); + break; + case '\x16': + APPEND_STRING("\\u0016"); + break; + case '\x17': + APPEND_STRING("\\u0017"); + break; + case '\x18': + APPEND_STRING("\\u0018"); + break; + case '\x19': + APPEND_STRING("\\u0019"); + break; + case '\x1a': + APPEND_STRING("\\u001a"); + break; + case '\x1b': + APPEND_STRING("\\u001b"); + break; + case '\x1c': + APPEND_STRING("\\u001c"); + break; + case '\x1d': + APPEND_STRING("\\u001d"); + break; + case '\x1e': + APPEND_STRING("\\u001e"); + break; + case '\x1f': + APPEND_STRING("\\u001f"); + break; + case '/': + if (parson_escape_slashes) { + APPEND_STRING("\\/"); /* to make json embeddable in xml\/html */ + } + else { + APPEND_STRING("/"); + } + break; + default: + if (buf != NULL) { + buf[0] = c; + buf += 1; + } + written_total += 1; + break; + } + } + APPEND_STRING("\""); + return written_total; +} + +#undef APPEND_STRING +#undef APPEND_INDENT + +/* Parser API */ +JSON_Value *json_parse_file(const char *filename) +{ + char *file_contents = read_file(filename); + JSON_Value *output_value = NULL; + if (file_contents == NULL) { + return NULL; + } + output_value = json_parse_string(file_contents); + parson_free(file_contents); + return output_value; +} + +JSON_Value *json_parse_file_with_comments(const char *filename) +{ + char *file_contents = read_file(filename); + JSON_Value *output_value = NULL; + if (file_contents == NULL) { + return NULL; + } + output_value = json_parse_string_with_comments(file_contents); + parson_free(file_contents); + return output_value; +} + +JSON_Value *json_parse_string(const char *string) +{ + if (string == NULL) { + return NULL; + } + if (string[0] == '\xEF' && string[1] == '\xBB' && string[2] == '\xBF') { + string = string + 3; /* Support for UTF-8 BOM */ + } + return parse_value((const char **)&string, 0); +} + +JSON_Value *json_parse_string_with_comments(const char *string) +{ + JSON_Value *result = NULL; + char *string_mutable_copy = NULL, *string_mutable_copy_ptr = NULL; + string_mutable_copy = parson_strdup(string); + if (string_mutable_copy == NULL) { + return NULL; + } + remove_comments(string_mutable_copy, "/*", "*/"); + remove_comments(string_mutable_copy, "//", "\n"); + string_mutable_copy_ptr = string_mutable_copy; + result = parse_value((const char **)&string_mutable_copy_ptr, 0); + parson_free(string_mutable_copy); + return result; +} + +/* JSON Object API */ + +JSON_Value *json_object_get_value(const JSON_Object *object, const char *name) +{ + if (object == NULL || name == NULL) { + return NULL; + } + return json_object_getn_value(object, name, strlen(name)); +} + +const char *json_object_get_string(const JSON_Object *object, const char *name) +{ + return json_value_get_string(json_object_get_value(object, name)); +} + +size_t json_object_get_string_len(const JSON_Object *object, const char *name) +{ + return json_value_get_string_len(json_object_get_value(object, name)); +} + +double json_object_get_number(const JSON_Object *object, const char *name) +{ + return json_value_get_number(json_object_get_value(object, name)); +} + +JSON_Object *json_object_get_object(const JSON_Object *object, const char *name) +{ + return json_value_get_object(json_object_get_value(object, name)); +} + +JSON_Array *json_object_get_array(const JSON_Object *object, const char *name) +{ + return json_value_get_array(json_object_get_value(object, name)); +} + +int json_object_get_boolean(const JSON_Object *object, const char *name) +{ + return json_value_get_boolean(json_object_get_value(object, name)); +} + +JSON_Value *json_object_dotget_value(const JSON_Object *object, + const char *name) +{ + const char *dot_position = strchr(name, '.'); + if (!dot_position) { + return json_object_get_value(object, name); + } + object = json_value_get_object( + json_object_getn_value(object, name, dot_position - name)); + return json_object_dotget_value(object, dot_position + 1); +} + +const char *json_object_dotget_string(const JSON_Object *object, + const char *name) +{ + return json_value_get_string(json_object_dotget_value(object, name)); +} + +size_t json_object_dotget_string_len(const JSON_Object *object, + const char *name) +{ + return json_value_get_string_len(json_object_dotget_value(object, name)); +} + +double json_object_dotget_number(const JSON_Object *object, const char *name) +{ + return json_value_get_number(json_object_dotget_value(object, name)); +} + +JSON_Object *json_object_dotget_object(const JSON_Object *object, + const char *name) +{ + return json_value_get_object(json_object_dotget_value(object, name)); +} + +JSON_Array *json_object_dotget_array(const JSON_Object *object, + const char *name) +{ + return json_value_get_array(json_object_dotget_value(object, name)); +} + +int json_object_dotget_boolean(const JSON_Object *object, const char *name) +{ + return json_value_get_boolean(json_object_dotget_value(object, name)); +} + +size_t json_object_get_count(const JSON_Object *object) +{ + return object ? object->count : 0; +} + +const char *json_object_get_name(const JSON_Object *object, size_t index) +{ + if (object == NULL || index >= json_object_get_count(object)) { + return NULL; + } + return object->names[index]; +} + +JSON_Value *json_object_get_value_at(const JSON_Object *object, size_t index) +{ + if (object == NULL || index >= json_object_get_count(object)) { + return NULL; + } + return object->values[index]; +} + +JSON_Value *json_object_get_wrapping_value(const JSON_Object *object) +{ + if (!object) { + return NULL; + } + return object->wrapping_value; +} + +int json_object_has_value(const JSON_Object *object, const char *name) +{ + return json_object_get_value(object, name) != NULL; +} + +int json_object_has_value_of_type(const JSON_Object *object, const char *name, + JSON_Value_Type type) +{ + JSON_Value *val = json_object_get_value(object, name); + return val != NULL && json_value_get_type(val) == type; +} + +int json_object_dothas_value(const JSON_Object *object, const char *name) +{ + return json_object_dotget_value(object, name) != NULL; +} + +int json_object_dothas_value_of_type(const JSON_Object *object, + const char *name, JSON_Value_Type type) +{ + JSON_Value *val = json_object_dotget_value(object, name); + return val != NULL && json_value_get_type(val) == type; +} + +/* JSON Array API */ +JSON_Value *json_array_get_value(const JSON_Array *array, size_t index) +{ + if (array == NULL || index >= json_array_get_count(array)) { + return NULL; + } + return array->items[index]; +} + +const char *json_array_get_string(const JSON_Array *array, size_t index) +{ + return json_value_get_string(json_array_get_value(array, index)); +} + +size_t json_array_get_string_len(const JSON_Array *array, size_t index) +{ + return json_value_get_string_len(json_array_get_value(array, index)); +} + +double json_array_get_number(const JSON_Array *array, size_t index) +{ + return json_value_get_number(json_array_get_value(array, index)); +} + +JSON_Object *json_array_get_object(const JSON_Array *array, size_t index) +{ + return json_value_get_object(json_array_get_value(array, index)); +} + +JSON_Array *json_array_get_array(const JSON_Array *array, size_t index) +{ + return json_value_get_array(json_array_get_value(array, index)); +} + +int json_array_get_boolean(const JSON_Array *array, size_t index) +{ + return json_value_get_boolean(json_array_get_value(array, index)); +} + +size_t json_array_get_count(const JSON_Array *array) +{ + return array ? array->count : 0; +} + +JSON_Value *json_array_get_wrapping_value(const JSON_Array *array) +{ + if (!array) { + return NULL; + } + return array->wrapping_value; +} + +/* JSON Value API */ +JSON_Value_Type json_value_get_type(const JSON_Value *value) +{ + return value ? value->type : JSONError; +} + +JSON_Object *json_value_get_object(const JSON_Value *value) +{ + return json_value_get_type(value) == JSONObject ? value->value.object + : NULL; +} + +JSON_Array *json_value_get_array(const JSON_Value *value) +{ + return json_value_get_type(value) == JSONArray ? value->value.array : NULL; +} + +static const JSON_String *json_value_get_string_desc(const JSON_Value *value) +{ + return json_value_get_type(value) == JSONString ? &value->value.string + : NULL; +} + +const char *json_value_get_string(const JSON_Value *value) +{ + const JSON_String *str = json_value_get_string_desc(value); + return str ? str->chars : NULL; +} + +size_t json_value_get_string_len(const JSON_Value *value) +{ + const JSON_String *str = json_value_get_string_desc(value); + return str ? str->length : 0; +} + +double json_value_get_number(const JSON_Value *value) +{ + return json_value_get_type(value) == JSONNumber ? value->value.number : 0; +} + +int json_value_get_boolean(const JSON_Value *value) +{ + return json_value_get_type(value) == JSONBoolean ? value->value.boolean + : -1; +} + +JSON_Value *json_value_get_parent(const JSON_Value *value) +{ + return value ? value->parent : NULL; +} + +void json_value_free(JSON_Value *value) +{ + switch (json_value_get_type(value)) { + case JSONObject: + json_object_free(value->value.object); + break; + case JSONString: + parson_free(value->value.string.chars); + break; + case JSONArray: + json_array_free(value->value.array); + break; + default: + break; + } + parson_free(value); +} + +JSON_Value *json_value_init_object(void) +{ + JSON_Value *new_value = (JSON_Value *)parson_malloc(sizeof(JSON_Value)); + if (!new_value) { + return NULL; + } + new_value->parent = NULL; + new_value->type = JSONObject; + new_value->value.object = json_object_make(new_value); + if (!new_value->value.object) { + parson_free(new_value); + return NULL; + } + return new_value; +} + +JSON_Value *json_value_init_array(void) +{ + JSON_Value *new_value = (JSON_Value *)parson_malloc(sizeof(JSON_Value)); + if (!new_value) { + return NULL; + } + new_value->parent = NULL; + new_value->type = JSONArray; + new_value->value.array = json_array_make(new_value); + if (!new_value->value.array) { + parson_free(new_value); + return NULL; + } + return new_value; +} + +JSON_Value *json_value_init_string(const char *string) +{ + if (string == NULL) { + return NULL; + } + return json_value_init_string_with_len(string, strlen(string)); +} + +JSON_Value *json_value_init_string_with_len(const char *string, size_t length) +{ + char *copy = NULL; + JSON_Value *value; + if (string == NULL) { + return NULL; + } + if (!is_valid_utf8(string, length)) { + return NULL; + } + copy = parson_strndup(string, length); + if (copy == NULL) { + return NULL; + } + value = json_value_init_string_no_copy(copy, length); + if (value == NULL) { + parson_free(copy); + } + return value; +} + +JSON_Value *json_value_init_number(double number) +{ + JSON_Value *new_value = NULL; + if (IS_NUMBER_INVALID(number)) { + return NULL; + } + new_value = (JSON_Value *)parson_malloc(sizeof(JSON_Value)); + if (new_value == NULL) { + return NULL; + } + new_value->parent = NULL; + new_value->type = JSONNumber; + new_value->value.number = number; + return new_value; +} + +JSON_Value *json_value_init_boolean(int boolean) +{ + JSON_Value *new_value = (JSON_Value *)parson_malloc(sizeof(JSON_Value)); + if (!new_value) { + return NULL; + } + new_value->parent = NULL; + new_value->type = JSONBoolean; + new_value->value.boolean = boolean ? 1 : 0; + return new_value; +} + +JSON_Value *json_value_init_null(void) +{ + JSON_Value *new_value = (JSON_Value *)parson_malloc(sizeof(JSON_Value)); + if (!new_value) { + return NULL; + } + new_value->parent = NULL; + new_value->type = JSONNull; + return new_value; +} + +JSON_Value *json_value_deep_copy(const JSON_Value *value) +{ + size_t i = 0; + JSON_Value *return_value = NULL, *temp_value_copy = NULL, + *temp_value = NULL; + const JSON_String *temp_string = NULL; + const char *temp_key = NULL; + char *temp_string_copy = NULL; + JSON_Array *temp_array = NULL, *temp_array_copy = NULL; + JSON_Object *temp_object = NULL, *temp_object_copy = NULL; + JSON_Status res = JSONFailure; + char *key_copy = NULL; + + switch (json_value_get_type(value)) { + case JSONArray: + temp_array = json_value_get_array(value); + return_value = json_value_init_array(); + if (return_value == NULL) { + return NULL; + } + temp_array_copy = json_value_get_array(return_value); + for (i = 0; i < json_array_get_count(temp_array); i++) { + temp_value = json_array_get_value(temp_array, i); + temp_value_copy = json_value_deep_copy(temp_value); + if (temp_value_copy == NULL) { + json_value_free(return_value); + return NULL; + } + if (json_array_add(temp_array_copy, temp_value_copy) != + JSONSuccess) { + json_value_free(return_value); + json_value_free(temp_value_copy); + return NULL; + } + } + return return_value; + case JSONObject: + temp_object = json_value_get_object(value); + return_value = json_value_init_object(); + if (!return_value) { + return NULL; + } + temp_object_copy = json_value_get_object(return_value); + for (i = 0; i < json_object_get_count(temp_object); i++) { + temp_key = json_object_get_name(temp_object, i); + temp_value = json_object_get_value(temp_object, temp_key); + temp_value_copy = json_value_deep_copy(temp_value); + if (!temp_value_copy) { + json_value_free(return_value); + return NULL; + } + key_copy = parson_strdup(temp_key); + if (!key_copy) { + json_value_free(temp_value_copy); + json_value_free(return_value); + return NULL; + } + res = json_object_add(temp_object_copy, key_copy, temp_value_copy); + if (res != JSONSuccess) { + parson_free(key_copy); + json_value_free(temp_value_copy); + json_value_free(return_value); + return NULL; + } + } + return return_value; + case JSONBoolean: + return json_value_init_boolean(json_value_get_boolean(value)); + case JSONNumber: + return json_value_init_number(json_value_get_number(value)); + case JSONString: + temp_string = json_value_get_string_desc(value); + if (temp_string == NULL) { + return NULL; + } + temp_string_copy = + parson_strndup(temp_string->chars, temp_string->length); + if (temp_string_copy == NULL) { + return NULL; + } + return_value = json_value_init_string_no_copy(temp_string_copy, + temp_string->length); + if (return_value == NULL) { + parson_free(temp_string_copy); + } + return return_value; + case JSONNull: + return json_value_init_null(); + case JSONError: + return NULL; + default: + return NULL; + } +} + +size_t json_serialization_size(const JSON_Value *value) +{ + char num_buf[PARSON_NUM_BUF_SIZE]; /* recursively allocating buffer on stack + is a bad idea, so let's do it only + once */ + int res = json_serialize_to_buffer_r(value, NULL, 0, PARSON_FALSE, num_buf); + return res < 0 ? 0 : (size_t)(res) + 1; +} + +JSON_Status json_serialize_to_buffer(const JSON_Value *value, char *buf, + size_t buf_size_in_bytes) +{ + int written = -1; + size_t needed_size_in_bytes = json_serialization_size(value); + if (needed_size_in_bytes == 0 || buf_size_in_bytes < needed_size_in_bytes) { + return JSONFailure; + } + written = json_serialize_to_buffer_r(value, buf, 0, PARSON_FALSE, NULL); + if (written < 0) { + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_serialize_to_file(const JSON_Value *value, + const char *filename) +{ + JSON_Status return_code = JSONSuccess; + FILE *fp = NULL; + char *serialized_string = json_serialize_to_string(value); + if (serialized_string == NULL) { + return JSONFailure; + } + fp = fopen(filename, "w"); + if (fp == NULL) { + json_free_serialized_string(serialized_string); + return JSONFailure; + } + if (fputs(serialized_string, fp) == EOF) { + return_code = JSONFailure; + } + if (fclose(fp) == EOF) { + return_code = JSONFailure; + } + json_free_serialized_string(serialized_string); + return return_code; +} + +char *json_serialize_to_string(const JSON_Value *value) +{ + JSON_Status serialization_result = JSONFailure; + size_t buf_size_bytes = json_serialization_size(value); + char *buf = NULL; + if (buf_size_bytes == 0) { + return NULL; + } + buf = (char *)parson_malloc(buf_size_bytes); + if (buf == NULL) { + return NULL; + } + serialization_result = json_serialize_to_buffer(value, buf, buf_size_bytes); + if (serialization_result != JSONSuccess) { + json_free_serialized_string(buf); + return NULL; + } + return buf; +} + +size_t json_serialization_size_pretty(const JSON_Value *value) +{ + char num_buf[PARSON_NUM_BUF_SIZE]; /* recursively allocating buffer on stack + is a bad idea, so let's do it only + once */ + int res = json_serialize_to_buffer_r(value, NULL, 0, PARSON_TRUE, num_buf); + return res < 0 ? 0 : (size_t)(res) + 1; +} + +JSON_Status json_serialize_to_buffer_pretty(const JSON_Value *value, char *buf, + size_t buf_size_in_bytes) +{ + int written = -1; + size_t needed_size_in_bytes = json_serialization_size_pretty(value); + if (needed_size_in_bytes == 0 || buf_size_in_bytes < needed_size_in_bytes) { + return JSONFailure; + } + written = json_serialize_to_buffer_r(value, buf, 0, PARSON_TRUE, NULL); + if (written < 0) { + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_serialize_to_file_pretty(const JSON_Value *value, + const char *filename) +{ + JSON_Status return_code = JSONSuccess; + FILE *fp = NULL; + char *serialized_string = json_serialize_to_string_pretty(value); + if (serialized_string == NULL) { + return JSONFailure; + } + fp = fopen(filename, "w"); + if (fp == NULL) { + json_free_serialized_string(serialized_string); + return JSONFailure; + } + if (fputs(serialized_string, fp) == EOF) { + return_code = JSONFailure; + } + if (fclose(fp) == EOF) { + return_code = JSONFailure; + } + json_free_serialized_string(serialized_string); + return return_code; +} + +char *json_serialize_to_string_pretty(const JSON_Value *value) +{ + JSON_Status serialization_result = JSONFailure; + size_t buf_size_bytes = json_serialization_size_pretty(value); + char *buf = NULL; + if (buf_size_bytes == 0) { + return NULL; + } + buf = (char *)parson_malloc(buf_size_bytes); + if (buf == NULL) { + return NULL; + } + serialization_result = + json_serialize_to_buffer_pretty(value, buf, buf_size_bytes); + if (serialization_result != JSONSuccess) { + json_free_serialized_string(buf); + return NULL; + } + return buf; +} + +void json_free_serialized_string(char *string) +{ + parson_free(string); +} + +JSON_Status json_array_remove(JSON_Array *array, size_t ix) +{ + size_t to_move_bytes = 0; + if (array == NULL || ix >= json_array_get_count(array)) { + return JSONFailure; + } + json_value_free(json_array_get_value(array, ix)); + to_move_bytes = + (json_array_get_count(array) - 1 - ix) * sizeof(JSON_Value *); + memmove(array->items + ix, array->items + ix + 1, to_move_bytes); + array->count -= 1; + return JSONSuccess; +} + +JSON_Status json_array_replace_value(JSON_Array *array, size_t ix, + JSON_Value *value) +{ + if (array == NULL || value == NULL || value->parent != NULL || + ix >= json_array_get_count(array)) { + return JSONFailure; + } + json_value_free(json_array_get_value(array, ix)); + value->parent = json_array_get_wrapping_value(array); + array->items[ix] = value; + return JSONSuccess; +} + +JSON_Status json_array_replace_string(JSON_Array *array, size_t i, + const char *string) +{ + JSON_Value *value = json_value_init_string(string); + if (value == NULL) { + return JSONFailure; + } + if (json_array_replace_value(array, i, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_array_replace_string_with_len(JSON_Array *array, size_t i, + const char *string, size_t len) +{ + JSON_Value *value = json_value_init_string_with_len(string, len); + if (value == NULL) { + return JSONFailure; + } + if (json_array_replace_value(array, i, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_array_replace_number(JSON_Array *array, size_t i, + double number) +{ + JSON_Value *value = json_value_init_number(number); + if (value == NULL) { + return JSONFailure; + } + if (json_array_replace_value(array, i, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_array_replace_boolean(JSON_Array *array, size_t i, int boolean) +{ + JSON_Value *value = json_value_init_boolean(boolean); + if (value == NULL) { + return JSONFailure; + } + if (json_array_replace_value(array, i, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_array_replace_null(JSON_Array *array, size_t i) +{ + JSON_Value *value = json_value_init_null(); + if (value == NULL) { + return JSONFailure; + } + if (json_array_replace_value(array, i, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_array_clear(JSON_Array *array) +{ + size_t i = 0; + if (array == NULL) { + return JSONFailure; + } + for (i = 0; i < json_array_get_count(array); i++) { + json_value_free(json_array_get_value(array, i)); + } + array->count = 0; + return JSONSuccess; +} + +JSON_Status json_array_append_value(JSON_Array *array, JSON_Value *value) +{ + if (array == NULL || value == NULL || value->parent != NULL) { + return JSONFailure; + } + return json_array_add(array, value); +} + +JSON_Status json_array_append_string(JSON_Array *array, const char *string) +{ + JSON_Value *value = json_value_init_string(string); + if (value == NULL) { + return JSONFailure; + } + if (json_array_append_value(array, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_array_append_string_with_len(JSON_Array *array, + const char *string, size_t len) +{ + JSON_Value *value = json_value_init_string_with_len(string, len); + if (value == NULL) { + return JSONFailure; + } + if (json_array_append_value(array, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_array_append_number(JSON_Array *array, double number) +{ + JSON_Value *value = json_value_init_number(number); + if (value == NULL) { + return JSONFailure; + } + if (json_array_append_value(array, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_array_append_boolean(JSON_Array *array, int boolean) +{ + JSON_Value *value = json_value_init_boolean(boolean); + if (value == NULL) { + return JSONFailure; + } + if (json_array_append_value(array, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_array_append_null(JSON_Array *array) +{ + JSON_Value *value = json_value_init_null(); + if (value == NULL) { + return JSONFailure; + } + if (json_array_append_value(array, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_object_set_value(JSON_Object *object, const char *name, + JSON_Value *value) +{ + unsigned long hash = 0; + parson_bool_t found = PARSON_FALSE; + size_t cell_ix = 0; + size_t item_ix = 0; + JSON_Value *old_value = NULL; + char *key_copy = NULL; + + if (!object || !name || !value || value->parent) { + return JSONFailure; + } + hash = hash_string(name, strlen(name)); + found = PARSON_FALSE; + cell_ix = json_object_get_cell_ix(object, name, strlen(name), hash, &found); + if (found) { + item_ix = object->cells[cell_ix]; + old_value = object->values[item_ix]; + json_value_free(old_value); + object->values[item_ix] = value; + value->parent = json_object_get_wrapping_value(object); + return JSONSuccess; + } + if (object->count >= object->item_capacity) { + JSON_Status res = json_object_grow_and_rehash(object); + if (res != JSONSuccess) { + return JSONFailure; + } + cell_ix = + json_object_get_cell_ix(object, name, strlen(name), hash, &found); + } + key_copy = parson_strdup(name); + if (!key_copy) { + return JSONFailure; + } + object->names[object->count] = key_copy; + object->cells[cell_ix] = object->count; + object->values[object->count] = value; + object->cell_ixs[object->count] = cell_ix; + object->hashes[object->count] = hash; + object->count++; + value->parent = json_object_get_wrapping_value(object); + return JSONSuccess; +} + +JSON_Status json_object_set_string(JSON_Object *object, const char *name, + const char *string) +{ + JSON_Value *value = json_value_init_string(string); + JSON_Status status = json_object_set_value(object, name, value); + if (status != JSONSuccess) { + json_value_free(value); + } + return status; +} + +JSON_Status json_object_set_string_with_len(JSON_Object *object, + const char *name, + const char *string, size_t len) +{ + JSON_Value *value = json_value_init_string_with_len(string, len); + JSON_Status status = json_object_set_value(object, name, value); + if (status != JSONSuccess) { + json_value_free(value); + } + return status; +} + +JSON_Status json_object_set_number(JSON_Object *object, const char *name, + double number) +{ + JSON_Value *value = json_value_init_number(number); + JSON_Status status = json_object_set_value(object, name, value); + if (status != JSONSuccess) { + json_value_free(value); + } + return status; +} + +JSON_Status json_object_set_boolean(JSON_Object *object, const char *name, + int boolean) +{ + JSON_Value *value = json_value_init_boolean(boolean); + JSON_Status status = json_object_set_value(object, name, value); + if (status != JSONSuccess) { + json_value_free(value); + } + return status; +} + +JSON_Status json_object_set_null(JSON_Object *object, const char *name) +{ + JSON_Value *value = json_value_init_null(); + JSON_Status status = json_object_set_value(object, name, value); + if (status != JSONSuccess) { + json_value_free(value); + } + return status; +} + +JSON_Status json_object_dotset_value(JSON_Object *object, const char *name, + JSON_Value *value) +{ + const char *dot_pos = NULL; + JSON_Value *temp_value = NULL, *new_value = NULL; + JSON_Object *temp_object = NULL, *new_object = NULL; + JSON_Status status = JSONFailure; + size_t name_len = 0; + char *name_copy = NULL; + + if (object == NULL || name == NULL || value == NULL) { + return JSONFailure; + } + dot_pos = strchr(name, '.'); + if (dot_pos == NULL) { + return json_object_set_value(object, name, value); + } + name_len = dot_pos - name; + temp_value = json_object_getn_value(object, name, name_len); + if (temp_value) { + /* Don't overwrite existing non-object (unlike json_object_set_value, + * but it shouldn't be changed at this point) */ + if (json_value_get_type(temp_value) != JSONObject) { + return JSONFailure; + } + temp_object = json_value_get_object(temp_value); + return json_object_dotset_value(temp_object, dot_pos + 1, value); + } + new_value = json_value_init_object(); + if (new_value == NULL) { + return JSONFailure; + } + new_object = json_value_get_object(new_value); + status = json_object_dotset_value(new_object, dot_pos + 1, value); + if (status != JSONSuccess) { + json_value_free(new_value); + return JSONFailure; + } + name_copy = parson_strndup(name, name_len); + if (!name_copy) { + json_object_dotremove_internal(new_object, dot_pos + 1, 0); + json_value_free(new_value); + return JSONFailure; + } + status = json_object_add(object, name_copy, new_value); + if (status != JSONSuccess) { + parson_free(name_copy); + json_object_dotremove_internal(new_object, dot_pos + 1, 0); + json_value_free(new_value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_object_dotset_string(JSON_Object *object, const char *name, + const char *string) +{ + JSON_Value *value = json_value_init_string(string); + if (value == NULL) { + return JSONFailure; + } + if (json_object_dotset_value(object, name, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_object_dotset_string_with_len(JSON_Object *object, + const char *name, + const char *string, size_t len) +{ + JSON_Value *value = json_value_init_string_with_len(string, len); + if (value == NULL) { + return JSONFailure; + } + if (json_object_dotset_value(object, name, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_object_dotset_number(JSON_Object *object, const char *name, + double number) +{ + JSON_Value *value = json_value_init_number(number); + if (value == NULL) { + return JSONFailure; + } + if (json_object_dotset_value(object, name, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_object_dotset_boolean(JSON_Object *object, const char *name, + int boolean) +{ + JSON_Value *value = json_value_init_boolean(boolean); + if (value == NULL) { + return JSONFailure; + } + if (json_object_dotset_value(object, name, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_object_dotset_null(JSON_Object *object, const char *name) +{ + JSON_Value *value = json_value_init_null(); + if (value == NULL) { + return JSONFailure; + } + if (json_object_dotset_value(object, name, value) != JSONSuccess) { + json_value_free(value); + return JSONFailure; + } + return JSONSuccess; +} + +JSON_Status json_object_remove(JSON_Object *object, const char *name) +{ + return json_object_remove_internal(object, name, PARSON_TRUE); +} + +JSON_Status json_object_dotremove(JSON_Object *object, const char *name) +{ + return json_object_dotremove_internal(object, name, PARSON_TRUE); +} + +JSON_Status json_object_clear(JSON_Object *object) +{ + size_t i = 0; + if (object == NULL) { + return JSONFailure; + } + for (i = 0; i < json_object_get_count(object); i++) { + parson_free(object->names[i]); + object->names[i] = NULL; + + json_value_free(object->values[i]); + object->values[i] = NULL; + } + object->count = 0; + for (i = 0; i < object->cell_capacity; i++) { + object->cells[i] = OBJECT_INVALID_IX; + } + return JSONSuccess; +} + +JSON_Status json_validate(const JSON_Value *schema, const JSON_Value *value) +{ + JSON_Value *temp_schema_value = NULL, *temp_value = NULL; + JSON_Array *schema_array = NULL, *value_array = NULL; + JSON_Object *schema_object = NULL, *value_object = NULL; + JSON_Value_Type schema_type = JSONError, value_type = JSONError; + const char *key = NULL; + size_t i = 0, count = 0; + if (schema == NULL || value == NULL) { + return JSONFailure; + } + schema_type = json_value_get_type(schema); + value_type = json_value_get_type(value); + if (schema_type != value_type && + schema_type != JSONNull) { /* null represents all values */ + return JSONFailure; + } + switch (schema_type) { + case JSONArray: + schema_array = json_value_get_array(schema); + value_array = json_value_get_array(value); + count = json_array_get_count(schema_array); + if (count == 0) { + return JSONSuccess; /* Empty array allows all types */ + } + /* Get first value from array, rest is ignored */ + temp_schema_value = json_array_get_value(schema_array, 0); + for (i = 0; i < json_array_get_count(value_array); i++) { + temp_value = json_array_get_value(value_array, i); + if (json_validate(temp_schema_value, temp_value) != JSONSuccess) { + return JSONFailure; + } + } + return JSONSuccess; + case JSONObject: + schema_object = json_value_get_object(schema); + value_object = json_value_get_object(value); + count = json_object_get_count(schema_object); + if (count == 0) { + return JSONSuccess; /* Empty object allows all objects */ + } + else if (json_object_get_count(value_object) < count) { + return JSONFailure; /* Tested object mustn't have less name-value + pairs than schema */ + } + for (i = 0; i < count; i++) { + key = json_object_get_name(schema_object, i); + temp_schema_value = json_object_get_value(schema_object, key); + temp_value = json_object_get_value(value_object, key); + if (temp_value == NULL) { + return JSONFailure; + } + if (json_validate(temp_schema_value, temp_value) != JSONSuccess) { + return JSONFailure; + } + } + return JSONSuccess; + case JSONString: + case JSONNumber: + case JSONBoolean: + case JSONNull: + return JSONSuccess; /* equality already tested before switch */ + case JSONError: + default: + return JSONFailure; + } +} + +int json_value_equals(const JSON_Value *a, const JSON_Value *b) +{ + JSON_Object *a_object = NULL, *b_object = NULL; + JSON_Array *a_array = NULL, *b_array = NULL; + const JSON_String *a_string = NULL, *b_string = NULL; + const char *key = NULL; + size_t a_count = 0, b_count = 0, i = 0; + JSON_Value_Type a_type, b_type; + a_type = json_value_get_type(a); + b_type = json_value_get_type(b); + if (a_type != b_type) { + return PARSON_FALSE; + } + switch (a_type) { + case JSONArray: + a_array = json_value_get_array(a); + b_array = json_value_get_array(b); + a_count = json_array_get_count(a_array); + b_count = json_array_get_count(b_array); + if (a_count != b_count) { + return PARSON_FALSE; + } + for (i = 0; i < a_count; i++) { + if (!json_value_equals(json_array_get_value(a_array, i), + json_array_get_value(b_array, i))) { + return PARSON_FALSE; + } + } + return PARSON_TRUE; + case JSONObject: + a_object = json_value_get_object(a); + b_object = json_value_get_object(b); + a_count = json_object_get_count(a_object); + b_count = json_object_get_count(b_object); + if (a_count != b_count) { + return PARSON_FALSE; + } + for (i = 0; i < a_count; i++) { + key = json_object_get_name(a_object, i); + if (!json_value_equals(json_object_get_value(a_object, key), + json_object_get_value(b_object, key))) { + return PARSON_FALSE; + } + } + return PARSON_TRUE; + case JSONString: + a_string = json_value_get_string_desc(a); + b_string = json_value_get_string_desc(b); + if (a_string == NULL || b_string == NULL) { + return PARSON_FALSE; /* shouldn't happen */ + } + return a_string->length == b_string->length && + memcmp(a_string->chars, b_string->chars, a_string->length) == 0; + case JSONBoolean: + return json_value_get_boolean(a) == json_value_get_boolean(b); + case JSONNumber: + return fabs(json_value_get_number(a) - json_value_get_number(b)) < + 0.000001; /* EPSILON */ + case JSONError: + return PARSON_TRUE; + case JSONNull: + return PARSON_TRUE; + default: + return PARSON_TRUE; + } +} + +JSON_Value_Type json_type(const JSON_Value *value) +{ + return json_value_get_type(value); +} + +JSON_Object *json_object(const JSON_Value *value) +{ + return json_value_get_object(value); +} + +JSON_Array *json_array(const JSON_Value *value) +{ + return json_value_get_array(value); +} + +const char *json_string(const JSON_Value *value) +{ + return json_value_get_string(value); +} + +size_t json_string_len(const JSON_Value *value) +{ + return json_value_get_string_len(value); +} + +double json_number(const JSON_Value *value) +{ + return json_value_get_number(value); +} + +int json_boolean(const JSON_Value *value) +{ + return json_value_get_boolean(value); +} + +void json_set_allocation_functions(JSON_Malloc_Function malloc_fun, + JSON_Free_Function free_fun) +{ + parson_malloc = malloc_fun; + parson_free = free_fun; +} + +void json_set_escape_slashes(int escape_slashes) +{ + parson_escape_slashes = escape_slashes; +} + +void json_set_float_serialization_format(const char *format) +{ + if (parson_float_format) { + parson_free(parson_float_format); + parson_float_format = NULL; + } + if (!format) { + parson_float_format = NULL; + return; + } + parson_float_format = parson_strdup(format); +} + +void json_set_number_serialization_function( + JSON_Number_Serialization_Function func) +{ + parson_number_serialization_function = func; +} diff --git a/lib/external/parson/parson.h b/lib/external/parson/parson.h new file mode 100644 index 00000000000..5799e0346ef --- /dev/null +++ b/lib/external/parson/parson.h @@ -0,0 +1,333 @@ +/* + SPDX-License-Identifier: MIT + + Parson 1.5.3 (https://github.com/kgabis/parson) + Copyright (c) 2012 - 2023 Krzysztof Gabis + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +#ifndef parson_parson_h +#define parson_parson_h + +#ifdef __cplusplus +extern "C" { +#endif +#if 0 +} /* unconfuse xcode */ +#endif + +#define PARSON_VERSION_MAJOR 1 +#define PARSON_VERSION_MINOR 5 +#define PARSON_VERSION_PATCH 3 + +#define PARSON_VERSION_STRING "1.5.3" + +#include /* size_t */ + +/* Types and enums */ +typedef struct json_object_t JSON_Object; +typedef struct json_array_t JSON_Array; +typedef struct json_value_t JSON_Value; + +enum json_value_type { + JSONError = -1, + JSONNull = 1, + JSONString = 2, + JSONNumber = 3, + JSONObject = 4, + JSONArray = 5, + JSONBoolean = 6 +}; +typedef int JSON_Value_Type; + +enum json_result_t { JSONSuccess = 0, JSONFailure = -1 }; +typedef int JSON_Status; + +typedef void *(*JSON_Malloc_Function)(size_t); +typedef void (*JSON_Free_Function)(void *); + +/* A function used for serializing numbers (see + json_set_number_serialization_function). If 'buf' is null then it should + return number of bytes that would've been written (but not more than + PARSON_NUM_BUF_SIZE). +*/ +typedef int (*JSON_Number_Serialization_Function)(double num, char *buf); + +/* Call only once, before calling any other function from parson API. If not + called, malloc and free from stdlib will be used for all allocations */ +void json_set_allocation_functions(JSON_Malloc_Function malloc_fun, + JSON_Free_Function free_fun); + +/* Sets if slashes should be escaped or not when serializing JSON. By default + slashes are escaped. This function sets a global setting and is not thread + safe. */ +void json_set_escape_slashes(int escape_slashes); + +/* Sets float format used for serialization of numbers. + Make sure it can't serialize to a string longer than PARSON_NUM_BUF_SIZE. + If format is null then the default format is used. */ +void json_set_float_serialization_format(const char *format); + +/* Sets a function that will be used for serialization of numbers. + If function is null then the default serialization function is used. */ +void json_set_number_serialization_function( + JSON_Number_Serialization_Function fun); + +/* Parses first JSON value in a file, returns NULL in case of error */ +JSON_Value *json_parse_file(const char *filename); + +/* Parses first JSON value in a file and ignores comments (/ * * / and //), + returns NULL in case of error */ +JSON_Value *json_parse_file_with_comments(const char *filename); + +/* Parses first JSON value in a string, returns NULL in case of error */ +JSON_Value *json_parse_string(const char *string); + +/* Parses first JSON value in a string and ignores comments (/ * * / and //), + returns NULL in case of error */ +JSON_Value *json_parse_string_with_comments(const char *string); + +/* Serialization */ +size_t json_serialization_size(const JSON_Value *value); /* returns 0 on fail */ +JSON_Status json_serialize_to_buffer(const JSON_Value *value, char *buf, + size_t buf_size_in_bytes); +JSON_Status json_serialize_to_file(const JSON_Value *value, + const char *filename); +char *json_serialize_to_string(const JSON_Value *value); + +/* Pretty serialization */ +size_t +json_serialization_size_pretty(const JSON_Value *value); /* returns 0 on fail */ +JSON_Status json_serialize_to_buffer_pretty(const JSON_Value *value, char *buf, + size_t buf_size_in_bytes); +JSON_Status json_serialize_to_file_pretty(const JSON_Value *value, + const char *filename); +char *json_serialize_to_string_pretty(const JSON_Value *value); + +void json_free_serialized_string( + char *string); /* frees string from json_serialize_to_string and + json_serialize_to_string_pretty */ + +/* Comparing */ +int json_value_equals(const JSON_Value *a, const JSON_Value *b); + +/* Validation + This is *NOT* JSON Schema. It validates json by checking if object have + identically named fields with matching types. For example schema {"name":"", + "age":0} will validate + {"name":"Joe", "age":25} and {"name":"Joe", "age":25, "gender":"m"}, + but not {"name":"Joe"} or {"name":"Joe", "age":"Cucumber"}. + In case of arrays, only first value in schema is checked against all values + in tested array. Empty objects ({}) validate all objects, empty arrays ([]) + validate all arrays, null validates values of every type. + */ +JSON_Status json_validate(const JSON_Value *schema, const JSON_Value *value); + +/* + * JSON Object + */ +JSON_Value *json_object_get_value(const JSON_Object *object, const char *name); +const char *json_object_get_string(const JSON_Object *object, const char *name); +size_t json_object_get_string_len( + const JSON_Object *object, + const char *name); /* doesn't account for last null character */ +JSON_Object *json_object_get_object(const JSON_Object *object, + const char *name); +JSON_Array *json_object_get_array(const JSON_Object *object, const char *name); +double json_object_get_number(const JSON_Object *object, + const char *name); /* returns 0 on fail */ +int json_object_get_boolean(const JSON_Object *object, + const char *name); /* returns -1 on fail */ + +/* dotget functions enable addressing values with dot notation in nested + objects, just like in structs or c++/java/c# objects (e.g. + objectA.objectB.value). Because valid names in JSON can contain dots, some + values may be inaccessible this way. */ +JSON_Value *json_object_dotget_value(const JSON_Object *object, + const char *name); +const char *json_object_dotget_string(const JSON_Object *object, + const char *name); +size_t json_object_dotget_string_len( + const JSON_Object *object, + const char *name); /* doesn't account for last null character */ +JSON_Object *json_object_dotget_object(const JSON_Object *object, + const char *name); +JSON_Array *json_object_dotget_array(const JSON_Object *object, + const char *name); +double json_object_dotget_number(const JSON_Object *object, + const char *name); /* returns 0 on fail */ +int json_object_dotget_boolean(const JSON_Object *object, + const char *name); /* returns -1 on fail */ + +/* Functions to get available names */ +size_t json_object_get_count(const JSON_Object *object); +const char *json_object_get_name(const JSON_Object *object, size_t index); +JSON_Value *json_object_get_value_at(const JSON_Object *object, size_t index); +JSON_Value *json_object_get_wrapping_value(const JSON_Object *object); + +/* Functions to check if object has a value with a specific name. Returned value + * is 1 if object has a value and 0 if it doesn't. dothas functions behave + * exactly like dotget functions. */ +int json_object_has_value(const JSON_Object *object, const char *name); +int json_object_has_value_of_type(const JSON_Object *object, const char *name, + JSON_Value_Type type); + +int json_object_dothas_value(const JSON_Object *object, const char *name); +int json_object_dothas_value_of_type(const JSON_Object *object, + const char *name, JSON_Value_Type type); + +/* Creates new name-value pair or frees and replaces old value with a new one. + * json_object_set_value does not copy passed value so it shouldn't be freed + * afterwards. */ +JSON_Status json_object_set_value(JSON_Object *object, const char *name, + JSON_Value *value); +JSON_Status json_object_set_string(JSON_Object *object, const char *name, + const char *string); +JSON_Status json_object_set_string_with_len( + JSON_Object *object, const char *name, const char *string, + size_t len); /* length shouldn't include last null character */ +JSON_Status json_object_set_number(JSON_Object *object, const char *name, + double number); +JSON_Status json_object_set_boolean(JSON_Object *object, const char *name, + int boolean); +JSON_Status json_object_set_null(JSON_Object *object, const char *name); + +/* Works like dotget functions, but creates whole hierarchy if necessary. + * json_object_dotset_value does not copy passed value so it shouldn't be freed + * afterwards. */ +JSON_Status json_object_dotset_value(JSON_Object *object, const char *name, + JSON_Value *value); +JSON_Status json_object_dotset_string(JSON_Object *object, const char *name, + const char *string); +JSON_Status json_object_dotset_string_with_len( + JSON_Object *object, const char *name, const char *string, + size_t len); /* length shouldn't include last null character */ +JSON_Status json_object_dotset_number(JSON_Object *object, const char *name, + double number); +JSON_Status json_object_dotset_boolean(JSON_Object *object, const char *name, + int boolean); +JSON_Status json_object_dotset_null(JSON_Object *object, const char *name); + +/* Frees and removes name-value pair */ +JSON_Status json_object_remove(JSON_Object *object, const char *name); + +/* Works like dotget function, but removes name-value pair only on exact match. + */ +JSON_Status json_object_dotremove(JSON_Object *object, const char *key); + +/* Removes all name-value pairs in object */ +JSON_Status json_object_clear(JSON_Object *object); + +/* + *JSON Array + */ +JSON_Value *json_array_get_value(const JSON_Array *array, size_t index); +const char *json_array_get_string(const JSON_Array *array, size_t index); +size_t json_array_get_string_len( + const JSON_Array *array, + size_t index); /* doesn't account for last null character */ +JSON_Object *json_array_get_object(const JSON_Array *array, size_t index); +JSON_Array *json_array_get_array(const JSON_Array *array, size_t index); +double json_array_get_number(const JSON_Array *array, + size_t index); /* returns 0 on fail */ +int json_array_get_boolean(const JSON_Array *array, + size_t index); /* returns -1 on fail */ +size_t json_array_get_count(const JSON_Array *array); +JSON_Value *json_array_get_wrapping_value(const JSON_Array *array); + +/* Frees and removes value at given index, does nothing and returns JSONFailure + * if index doesn't exist. Order of values in array may change during execution. + */ +JSON_Status json_array_remove(JSON_Array *array, size_t i); + +/* Frees and removes from array value at given index and replaces it with given + * one. Does nothing and returns JSONFailure if index doesn't exist. + * json_array_replace_value does not copy passed value so it shouldn't be freed + * afterwards. */ +JSON_Status json_array_replace_value(JSON_Array *array, size_t i, + JSON_Value *value); +JSON_Status json_array_replace_string(JSON_Array *array, size_t i, + const char *string); +JSON_Status json_array_replace_string_with_len( + JSON_Array *array, size_t i, const char *string, + size_t len); /* length shouldn't include last null character */ +JSON_Status json_array_replace_number(JSON_Array *array, size_t i, + double number); +JSON_Status json_array_replace_boolean(JSON_Array *array, size_t i, + int boolean); +JSON_Status json_array_replace_null(JSON_Array *array, size_t i); + +/* Frees and removes all values from array */ +JSON_Status json_array_clear(JSON_Array *array); + +/* Appends new value at the end of array. + * json_array_append_value does not copy passed value so it shouldn't be freed + * afterwards. */ +JSON_Status json_array_append_value(JSON_Array *array, JSON_Value *value); +JSON_Status json_array_append_string(JSON_Array *array, const char *string); +JSON_Status json_array_append_string_with_len( + JSON_Array *array, const char *string, + size_t len); /* length shouldn't include last null character */ +JSON_Status json_array_append_number(JSON_Array *array, double number); +JSON_Status json_array_append_boolean(JSON_Array *array, int boolean); +JSON_Status json_array_append_null(JSON_Array *array); + +/* + *JSON Value + */ +JSON_Value *json_value_init_object(void); +JSON_Value *json_value_init_array(void); +JSON_Value * +json_value_init_string(const char *string); /* copies passed string */ +JSON_Value *json_value_init_string_with_len( + const char *string, + size_t length); /* copies passed string, length shouldn't include last null + character */ +JSON_Value *json_value_init_number(double number); +JSON_Value *json_value_init_boolean(int boolean); +JSON_Value *json_value_init_null(void); +JSON_Value *json_value_deep_copy(const JSON_Value *value); +void json_value_free(JSON_Value *value); + +JSON_Value_Type json_value_get_type(const JSON_Value *value); +JSON_Object *json_value_get_object(const JSON_Value *value); +JSON_Array *json_value_get_array(const JSON_Value *value); +const char *json_value_get_string(const JSON_Value *value); +size_t json_value_get_string_len( + const JSON_Value *value); /* doesn't account for last null character */ +double json_value_get_number(const JSON_Value *value); +int json_value_get_boolean(const JSON_Value *value); +JSON_Value *json_value_get_parent(const JSON_Value *value); + +/* Same as above, but shorter */ +JSON_Value_Type json_type(const JSON_Value *value); +JSON_Object *json_object(const JSON_Value *value); +JSON_Array *json_array(const JSON_Value *value); +const char *json_string(const JSON_Value *value); +size_t json_string_len( + const JSON_Value *value); /* doesn't account for last null character */ +double json_number(const JSON_Value *value); +int json_boolean(const JSON_Value *value); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/lib/init/grass.py b/lib/init/grass.py index be78eb00a81..55242c34361 100755 --- a/lib/init/grass.py +++ b/lib/init/grass.py @@ -280,7 +280,7 @@ def f(fmt, *args): matches = [] # https://docs.python.org/3/library/stdtypes.html#old-string-formatting for m in re.finditer( - "%([#0 +-]*)([0-9]*)(\.[0-9]*)?([hlL]?[diouxXeEfFgGcrsa%])", fmt + r"%([#0 +-]*)([0-9]*)(\.[0-9]*)?([hlL]?[diouxXeEfFgGcrsa%])", fmt ): matches.append(m) diff --git a/lib/vector/Vlib/field.c b/lib/vector/Vlib/field.c index 8ee4855d925..8a5b180ae2a 100644 --- a/lib/vector/Vlib/field.c +++ b/lib/vector/Vlib/field.c @@ -731,8 +731,6 @@ static int read_dblinks_ogr(struct Map_info *Map) #ifndef HAVE_OGR G_warning(_("GRASS is not compiled with OGR support")); #else -#if GDAL_VERSION_NUM > 1320 && \ - HAVE_OGR /* seems to be fixed after 1320 release */ int nLayers; char *ogr_fid_col; @@ -777,112 +775,6 @@ static int read_dblinks_ogr(struct Map_info *Map) Vect_add_dblink(dbl, 1, Map->fInfo.ogr.layer_name, Map->fInfo.ogr.layer_name, ogr_fid_col, Map->fInfo.ogr.dsn, "ogr"); -#else - dbDriver *driver; - dbCursor cursor; - dbString sql; - int FID = 0, OGC_FID = 0, OGR_FID = 0, GID = 0; - - G_debug(3, "GDAL_VERSION_NUM: %d", GDAL_VERSION_NUM); - - /* FID is not available for all OGR drivers */ - db_init_string(&sql); - - driver = db_start_driver_open_database("ogr", Map->fInfo.ogr.dsn); - - if (driver == NULL) { - G_warning(_("Unable to open OGR DBMI driver")); - return -1; - } - - /* this is a bit stupid, but above FID auto-detection doesn't work yet...: - */ - db_auto_print_errors(0); - sprintf(buf, "select FID from %s where FID > 0", Map->fInfo.ogr.layer_name); - db_set_string(&sql, buf); - - if (db_open_select_cursor(driver, &sql, &cursor, DB_SEQUENTIAL) != DB_OK) { - /* FID not available, so we try ogc_fid */ - G_debug(3, "Failed. Now searching for ogc_fid column in OGR DB"); - sprintf(buf, "select ogc_fid from %s where ogc_fid > 0", - Map->fInfo.ogr.layer_name); - db_set_string(&sql, buf); - - if (db_open_select_cursor(driver, &sql, &cursor, DB_SEQUENTIAL) != - DB_OK) { - /* Neither FID nor ogc_fid available, so we try ogr_fid */ - G_debug(3, "Failed. Now searching for ogr_fid column in OGR DB"); - sprintf(buf, "select ogr_fid from %s where ogr_fid > 0", - Map->fInfo.ogr.layer_name); - db_set_string(&sql, buf); - - if (db_open_select_cursor(driver, &sql, &cursor, DB_SEQUENTIAL) != - DB_OK) { - /* Neither FID nor ogc_fid available, so we try gid */ - G_debug(3, "Failed. Now searching for gid column in OGR DB"); - sprintf(buf, "select gid from %s where gid > 0", - Map->fInfo.ogr.layer_name); - db_set_string(&sql, buf); - - if (db_open_select_cursor(driver, &sql, &cursor, - DB_SEQUENTIAL) != DB_OK) { - /* neither FID nor ogc_fid nor ogr_fid nor gid available */ - G_warning( - _("All FID tests failed. Neither 'FID' nor 'ogc_fid' " - "nor 'ogr_fid' nor 'gid' available in OGR DB table")); - db_close_database_shutdown_driver(driver); - return 0; - } - else - GID = 1; - } - else - OGR_FID = 1; - } - else - OGC_FID = 1; - } - else - FID = 1; - - G_debug(3, "FID: %d, OGC_FID: %d, OGR_FID: %d, GID: %d", FID, OGC_FID, - OGR_FID, GID); - - db_close_cursor(&cursor); - db_close_database_shutdown_driver(driver); - db_auto_print_errors(1); - - if (FID) { - G_debug(3, "Using FID column in OGR DB"); - Vect_add_dblink(dbl, 1, Map->fInfo.ogr.layer_name, - Map->fInfo.ogr.layer_name, "FID", Map->fInfo.ogr.dsn, - "ogr"); - } - else { - if (OGC_FID) { - G_debug(3, "Using ogc_fid column in OGR DB"); - Vect_add_dblink(dbl, 1, Map->fInfo.ogr.layer_name, - Map->fInfo.ogr.layer_name, "ogc_fid", - Map->fInfo.ogr.dsn, "ogr"); - } - else { - if (OGR_FID) { - G_debug(3, "Using ogr_fid column in OGR DB"); - Vect_add_dblink(dbl, 1, Map->fInfo.ogr.layer_name, - Map->fInfo.ogr.layer_name, "ogr_fid", - Map->fInfo.ogr.dsn, "ogr"); - } - else { - if (GID) { - G_debug(3, "Using gid column in OGR DB"); - Vect_add_dblink(dbl, 1, Map->fInfo.ogr.layer_name, - Map->fInfo.ogr.layer_name, "gid", - Map->fInfo.ogr.dsn, "ogr"); - } - } - } - } -#endif /* GDAL_VERSION_NUM > 1320 && HAVE_OGR */ return 1; #endif /* HAVE_GDAL */ } diff --git a/man/parser_standard_options.py b/man/parser_standard_options.py index 9635adccbb0..3454084f330 100644 --- a/man/parser_standard_options.py +++ b/man/parser_standard_options.py @@ -64,7 +64,7 @@ def parse_glines(glines): if line.startswith("/*"): continue if line.startswith(startswith) and line.endswith(";"): - key, default = [w.strip() for w in split_opt_line(line[5:])] + key, default = (w.strip() for w in split_opt_line(line[5:])) res[key] = default elif line.startswith(startswith): key, default = split_opt_line(line[5:]) diff --git a/python/grass/docs/src/gunittest_running_tests.rst b/python/grass/docs/src/gunittest_running_tests.rst index 2e6e402835a..93f99cc93fb 100644 --- a/python/grass/docs/src/gunittest_running_tests.rst +++ b/python/grass/docs/src/gunittest_running_tests.rst @@ -100,7 +100,7 @@ you would use:: [gunittest] exclude = vector/* - raster/r.contour/testsuite/testrc.py + raster/r.contour/testsuite/test_broken.py Running tests and creating report diff --git a/python/grass/pydispatch/dispatcher.py b/python/grass/pydispatch/dispatcher.py index 2106494b5d8..a34706f8cf7 100644 --- a/python/grass/pydispatch/dispatcher.py +++ b/python/grass/pydispatch/dispatcher.py @@ -442,8 +442,7 @@ def _removeBackrefs(senderkey): def allReceivers(): for signal, set in items: - for item in set: - yield item + yield from set for receiver in allReceivers(): _killBackref(receiver, senderkey) diff --git a/python/grass/pygrass/gis/__init__.py b/python/grass/pygrass/gis/__init__.py index 90703194646..3f380368d28 100644 --- a/python/grass/pygrass/gis/__init__.py +++ b/python/grass/pygrass/gis/__init__.py @@ -425,8 +425,7 @@ def __repr__(self): return repr(self.read()) def __iter__(self): - for mapset in self.read(): - yield mapset + yield from self.read() def read(self): """Return the mapsets in the search path""" diff --git a/python/grass/pygrass/messages/__init__.py b/python/grass/pygrass/messages/__init__.py index b0aa324a812..60e8e43e31c 100644 --- a/python/grass/pygrass/messages/__init__.py +++ b/python/grass/pygrass/messages/__init__.py @@ -77,10 +77,6 @@ def message_server(lock, conn): sys.exit() message = data[1] - # libgis limitation - if isinstance(message, type(" ")): - if len(message) >= 2000: - message = message[:1999] if message_type == "PERCENT": n = int(data[1]) diff --git a/python/grass/pygrass/modules/grid/grid.py b/python/grass/pygrass/modules/grid/grid.py index 37b20e1458c..0fd6038a078 100644 --- a/python/grass/pygrass/modules/grid/grid.py +++ b/python/grass/pygrass/modules/grid/grid.py @@ -44,8 +44,7 @@ def select(parms, ptype): par = parms[k] if par.type == ptype or par.typedesc == ptype and par.value: if par.multiple: - for val in par.value: - yield val + yield from par.value else: yield par.value diff --git a/python/grass/pygrass/modules/interface/parameter.py b/python/grass/pygrass/modules/interface/parameter.py index ec70c7b7cc7..8d58165d3ee 100644 --- a/python/grass/pygrass/modules/interface/parameter.py +++ b/python/grass/pygrass/modules/interface/parameter.py @@ -13,9 +13,8 @@ def _check_value(param, value): """Function to check the correctness of a value and return the checked value and the original. """ - must_val = "The Parameter <%s>, must be one of the following values: %r" req = "The Parameter <%s>, require: %s, get: %s instead: %r\n%s" - string = (type(b""), type("")) + string = (bytes, str) def raiseexcpet(exc, param, ptype, value): """Function to modifa the error message""" @@ -107,7 +106,17 @@ def check_string(value): raise ValueError(err_str) # check if value is in the list of valid values if param.values is not None and newvalue not in param.values: - raise ValueError(must_val % (param.name, param.values)) + good = False + if param.type == str: + for param_value in param.values: + if param_value.startswith(newvalue): + good = True + break + if not good: + raise ValueError( + f"The Parameter <{param.name}>, must be one of the following values:" + f" {param.values!r} not '{newvalue}'" + ) return ( ( [ @@ -134,7 +143,7 @@ class Parameter: >>> param.value = 3 Traceback (most recent call last): ... - ValueError: The Parameter , must be one of the following values: [2, 4, 6, 8] + ValueError: The Parameter , must be one of the following values: [2, 4, 6, 8] not '3' ... """ diff --git a/python/grass/pygrass/modules/testsuite/test_import_isolation.py b/python/grass/pygrass/modules/testsuite/test_import_isolation.py index 1426657d5a5..d91ae1a830b 100644 --- a/python/grass/pygrass/modules/testsuite/test_import_isolation.py +++ b/python/grass/pygrass/modules/testsuite/test_import_isolation.py @@ -9,8 +9,6 @@ Created on Wed Jul 15 11:34:32 2015 """ -from __future__ import absolute_import - import sys import fnmatch diff --git a/python/grass/pygrass/tests/benchmark.py b/python/grass/pygrass/tests/benchmark.py index bd46dfa79a3..a8212a04324 100644 --- a/python/grass/pygrass/tests/benchmark.py +++ b/python/grass/pygrass/tests/benchmark.py @@ -302,7 +302,7 @@ def run_benchmark(resolution_list, runs, testdict, profile): locals(), filename=filename, ) - print((" {0}: {1: 40.6f}s".format(oper, operdict["time"]))) + print(" {0}: {1: 40.6f}s".format(oper, operdict["time"])) del operdict["func"] regions.append(result) diff --git a/python/grass/script/vector.py b/python/grass/script/vector.py index ce7d1612efc..6b0c9efe2b2 100644 --- a/python/grass/script/vector.py +++ b/python/grass/script/vector.py @@ -17,7 +17,6 @@ .. sectionauthor:: Martin Landa """ import os -import sys from .utils import parse_key_val from .core import ( @@ -446,8 +445,7 @@ def vector_what( if encoding: kwargs["encoding"] = encoding - if sys.version_info[0:2] > (2, 6): - kwargs["object_pairs_hook"] = orderedDict + kwargs["object_pairs_hook"] = orderedDict try: result = json.loads(ret, **kwargs) diff --git a/python/grass/temporal/datetime_math.py b/python/grass/temporal/datetime_math.py index e79709302a6..66bee770ead 100644 --- a/python/grass/temporal/datetime_math.py +++ b/python/grass/temporal/datetime_math.py @@ -212,7 +212,7 @@ def increment_datetime_by_string(mydate, increment, mult=1): :param mult: A multiplier, default is 1 :return: The new datetime object or none in case of an error """ - return modify_datetime_by_string(mydate, increment, mult, sign=int(1)) + return modify_datetime_by_string(mydate, increment, mult, sign=1) ############################################################################### diff --git a/raster/r.contour/testsuite/testrc.py b/raster/r.contour/testsuite/testrc.py deleted file mode 100644 index 89e1b685c67..00000000000 --- a/raster/r.contour/testsuite/testrc.py +++ /dev/null @@ -1,120 +0,0 @@ -""" -Name: r.contour test -Purpose: Tests r.contour and its flags/options. - -Author: Sunveer Singh, Google Code-in 2018 -Copyright: (C) 2018 by Sunveer Singh and the GRASS Development Team -Licence: This program is free software under the GNU General Public - License (>=v2). Read the file COPYING that comes with GRASS - for details. -""" -from grass.gunittest.case import TestCase -from grass.gunittest.main import test -from grass.gunittest.gmodules import SimpleModule - -out_where = """cat|level -1|56 -2|58 -3|60 -4|62 -5|64 -6|66 -7|68 -8|70 -9|72 -10|74 -11|76 -12|78 -13|80 -14|82 -15|84 -16|86 -17|88 -18|90 -19|92 -20|94 -21|96 -22|98 -23|100 -24|102 -25|104 -26|106 -27|108 -28|110 -29|112 -30|114 -31|116 -32|118 -33|120 -34|122 -35|124 -36|126 -37|128 -38|130 -39|132 -40|134 -41|136 -42|138 -43|140 -44|142 -45|144 -46|146 -47|148 -48|150 -49|152 -50|154 -51|156 -""" - - -class Testrr(TestCase): - input = "elevation" - output = "towns" - - @classmethod - def setUpClass(cls): - cls.use_temp_region() - cls.runModule("g.region", raster=cls.input) - - @classmethod - def tearDownClass(cls): - cls.del_temp_region() - - def tearDown(cls): - cls.runModule("g.remove", type="vector", flags="f", name=cls.output) - - def test_flag_t(self): - """Testing flag t""" - string = """min=1 - max=6""" - self.assertModule( - "r.contour", - input=self.input, - output=self.output, - levels=1, - step=1, - flags="t", - ) - self.assertRasterFitsUnivar(self.output, reference=string, precision=2) - - def test_vector(self): - """Testing vector output""" - self.assertModule( - "r.contour", input=self.input, output=self.output, step=5, flags="t" - ) - self.assertModule("v.info", map=self.output, flags="t") - topology = dict(points=0, lines=2222, areas=0) - self.assertVectorFitsTopoInfo(self.output, topology) - - def test_v_db_select(self): - """Testing attribute values of contours with v.db.select""" - self.assertModule("r.contour", input=self.input, output=self.output, step=2) - v_db_select = SimpleModule("v.db.select", map=self.output) - v_db_select.run() - self.assertLooksLike(reference=out_where, actual=v_db_select.outputs.stdout) - - -if __name__ == "__main__": - from grass.gunittest.main import test - - test() diff --git a/raster/r.in.gdal/main.c b/raster/r.in.gdal/main.c index 3fc96e5ee46..372bda483e2 100644 --- a/raster/r.in.gdal/main.c +++ b/raster/r.in.gdal/main.c @@ -48,12 +48,8 @@ static GDALDatasetH opends(char *dsname, const char **doo, GDALDriverH *hDriver) { GDALDatasetH hDS = NULL; -#if GDAL_VERSION_NUM >= 2000000 hDS = GDALOpenEx(dsname, GDAL_OF_RASTER | GDAL_OF_READONLY, NULL, doo, NULL); -#else - hDS = GDALOpen(dsname, GA_ReadOnly); -#endif if (hDS == NULL) G_fatal_error(_("Unable to open datasource <%s>"), dsname); G_add_error_handler(error_handler_ds, hDS); @@ -138,9 +134,6 @@ int main(int argc, char *argv[]) parm.band->guisection = _("Bands"); parm.memory = G_define_standard_option(G_OPT_MEMORYMB); -#if GDAL_VERSION_NUM < 1800 - parm.memory->options = "0-2047"; -#endif parm.target = G_define_option(); parm.target->key = "target"; diff --git a/scripts/db.dropcolumn/db.dropcolumn.py b/scripts/db.dropcolumn/db.dropcolumn.py index 5ce57616c6c..4728bc67182 100755 --- a/scripts/db.dropcolumn/db.dropcolumn.py +++ b/scripts/db.dropcolumn/db.dropcolumn.py @@ -80,30 +80,42 @@ def main(): return 0 if driver == "sqlite": - # echo "Using special trick for SQLite" - # http://www.sqlite.org/faq.html#q13 - colnames = [] - coltypes = [] - for f in gscript.db_describe(table)["cols"]: - if f[0] != column: - colnames.append(f[0]) - coltypes.append("%s %s" % (f[0], f[1])) - - colnames = ", ".join(colnames) - coltypes = ", ".join(coltypes) - - cmds = [ - "BEGIN TRANSACTION", - "CREATE TEMPORARY TABLE ${table}_backup(${coldef})", - "INSERT INTO ${table}_backup SELECT ${colnames} FROM ${table}", - "DROP TABLE ${table}", - "CREATE TABLE ${table}(${coldef})", - "INSERT INTO ${table} SELECT ${colnames} FROM ${table}_backup", - "DROP TABLE ${table}_backup", - "COMMIT", - ] - tmpl = string.Template(";\n".join(cmds)) - sql = tmpl.substitute(table=table, coldef=coltypes, colnames=colnames) + sqlite3_version = gscript.read_command( + "db.select", + sql="SELECT sqlite_version();", + flags="c", + database=database, + driver=driver, + ).split(".")[0:2] + + if [int(i) for i in sqlite3_version] >= [int(i) for i in "3.35".split(".")]: + sql = "ALTER TABLE %s DROP COLUMN %s" % (table, column) + if column == "cat": + sql = "DROP INDEX %s_%s; %s" % (table, column, sql) + else: + # for older sqlite3 versions, use old way to remove column + colnames = [] + coltypes = [] + for f in gscript.db_describe(table)["cols"]: + if f[0] != column: + colnames.append(f[0]) + coltypes.append("%s %s" % (f[0], f[1])) + + colnames = ", ".join(colnames) + coltypes = ", ".join(coltypes) + + cmds = [ + "BEGIN TRANSACTION", + "CREATE TEMPORARY TABLE ${table}_backup(${coldef})", + "INSERT INTO ${table}_backup SELECT ${colnames} FROM ${table}", + "DROP TABLE ${table}", + "CREATE TABLE ${table}(${coldef})", + "INSERT INTO ${table} SELECT ${colnames} FROM ${table}_backup", + "DROP TABLE ${table}_backup", + "COMMIT", + ] + tmpl = string.Template(";\n".join(cmds)) + sql = tmpl.substitute(table=table, coldef=coltypes, colnames=colnames) else: sql = "ALTER TABLE %s DROP COLUMN %s" % (table, column) diff --git a/scripts/r.in.wms/wms_cap_parsers.py b/scripts/r.in.wms/wms_cap_parsers.py index d299349b18b..6846124efa3 100644 --- a/scripts/r.in.wms/wms_cap_parsers.py +++ b/scripts/r.in.wms/wms_cap_parsers.py @@ -136,7 +136,7 @@ def _checkLayerTree(self, parent_layer, first=True): if first: self._initLayer(parent_layer, None) - layers = parent_layer.findall((self.xml_ns.Ns("Layer"))) + layers = parent_layer.findall(self.xml_ns.Ns("Layer")) for l in layers: self._initLayer(l, parent_layer) diff --git a/scripts/r.in.wms/wms_drv.py b/scripts/r.in.wms/wms_drv.py index 747b0c94132..df592624031 100644 --- a/scripts/r.in.wms/wms_drv.py +++ b/scripts/r.in.wms/wms_drv.py @@ -774,7 +774,7 @@ def _getMatSize(self, tile_mat, mat_set_link): # get extend restriction in TileMatrixSetLink for the tile matrix, if exists tile_mat_set_limits = mat_set_link.find( - (self.xml_ns.NsWmts("TileMatrixSetLimits")) + self.xml_ns.NsWmts("TileMatrixSetLimits") ) if tile_mat_set_limits is None: return mat_num_bbox diff --git a/scripts/v.rast.stats/v.rast.stats.py b/scripts/v.rast.stats/v.rast.stats.py index bc16ab1a010..cea37e38cca 100644 --- a/scripts/v.rast.stats/v.rast.stats.py +++ b/scripts/v.rast.stats/v.rast.stats.py @@ -237,13 +237,11 @@ def main(): "db.execute", input=sqltmp, database=fi["database"], driver=fi["driver"] ) grass.verbose( - ( - _( - "Statistics calculated from raster map <{raster}>" - " and uploaded to attribute table" - " of vector map <{vector}>." - ).format(raster=raster, vector=vector) - ) + _( + "Statistics calculated from raster map <{raster}>" + " and uploaded to attribute table" + " of vector map <{vector}>." + ).format(raster=raster, vector=vector) ) except CalledModuleError: grass.warning( diff --git a/temporal/t.rast.aggregate/testsuite/test_aggregation_absolute_parallel.py b/temporal/t.rast.aggregate/testsuite/test_aggregation_absolute_parallel.py index 0148cdf7cd9..f70c150c7c0 100644 --- a/temporal/t.rast.aggregate/testsuite/test_aggregation_absolute_parallel.py +++ b/temporal/t.rast.aggregate/testsuite/test_aggregation_absolute_parallel.py @@ -7,8 +7,6 @@ :authors: Soeren Gebbert """ -from __future__ import print_function - import os import grass.pygrass.modules as pymod import grass.temporal as tgis diff --git a/utils/release.yml b/utils/release.yml index ea4acf1c680..bec730857f8 100644 --- a/utils/release.yml +++ b/utils/release.yml @@ -2,7 +2,7 @@ notes: categories: - title: Modules - regexp: '(d|db|g|i|m|ps|r|r3|t|v)\.[^ ]*: |(modules|tools): ' + regexp: '((d|db|g|i|m|ps|r|r3|t|v)\.[^ ]*)(, (d|db|g|i|m|ps|r|r3|t|v)\.[^ ]*)?: |(modules|tools): ' - title: Graphical User Interface regexp: '(wxGUI.*|gui|GUI): ' @@ -20,16 +20,16 @@ notes: regexp: '(init|startup): ' - title: Translations, Internationalization, and Localization - regexp: '(i18n|i18N|L10n|L10N|t9n|translations?): ' + regexp: '(i18n|i18N|L10n|L10N|t9n|translations?): |Translations update from ' - title: Windows regexp: '(winGRASS|win|[Ww]indows): ' - title: Packaging, Configuration, Portability, and Compilation - regexp: '(pkg|rpm|deb|pkg-config|configure|config|[Mm]ake): ' + regexp: '(packaging|pkg|rpm|deb|pkg-config|configure|config|[Mm]ake|build): ' - title: Docker - regexp: '[Dd]ocker: ' + regexp: '[Dd]ocker(/[^ ]+)?: ' - title: Singularity regexp: '[Ss]ingularity: ' @@ -38,7 +38,7 @@ notes: regexp: '(CI|ci|CI\(deps\)|ci\(deps\)|[Tt]ests|[Cc]hecks|pytest): ' - title: Contributing and Management - regexp: '(contributing|CONTRIBUTING.md|contributors.csv): ' + regexp: '(contributing|CONTRIBUTING.md|contributors|contributors.csv): ' exclude: regexp: diff --git a/vector/v.external/list.c b/vector/v.external/list.c index 5dd15e869a5..900aede55ab 100644 --- a/vector/v.external/list.c +++ b/vector/v.external/list.c @@ -293,9 +293,6 @@ int list_layers_ogr(FILE *fd, const char *dsn, char **layer, int print_types) for (i = 0; i < nlayers; i++) { Ogr_layer = OGR_DS_GetLayer(Ogr_ds, i); Ogr_featuredefn = OGR_L_GetLayerDefn(Ogr_layer); -#if GDAL_VERSION_NUM < 1110000 - Ogr_geom_type = OGR_FD_GetGeomType(Ogr_featuredefn); -#endif layer_name = (char *)OGR_FD_GetName(Ogr_featuredefn); if (fd) { @@ -303,9 +300,7 @@ int list_layers_ogr(FILE *fd, const char *dsn, char **layer, int print_types) int proj_same, igeom; OGRSpatialReferenceH Ogr_projection; -#if GDAL_VERSION_NUM >= 1110000 OGRGeomFieldDefnH Ogr_geomdefn; -#endif /* projection check */ Ogr_projection = OGR_L_GetSpatialRef(Ogr_layer); proj_same = 0; @@ -327,7 +322,6 @@ int list_layers_ogr(FILE *fd, const char *dsn, char **layer, int print_types) proj_same = 0; } G_suppress_warnings(FALSE); -#if GDAL_VERSION_NUM >= 1110000 for (igeom = 0; igeom < OGR_FD_GetGeomFieldCount(Ogr_featuredefn); igeom++) { @@ -343,11 +337,6 @@ int list_layers_ogr(FILE *fd, const char *dsn, char **layer, int print_types) feature_type(OGRGeometryTypeToName(Ogr_geom_type)), proj_same, OGR_GFld_GetNameRef(Ogr_geomdefn)); } -#else - fprintf(fd, "%s,%s,%d,\n", layer_name, - feature_type(OGRGeometryTypeToName(Ogr_geom_type)), - proj_same); -#endif } else { fprintf(fd, "%s\n", layer_name); diff --git a/vector/v.external/local_proto.h b/vector/v.external/local_proto.h index 3c8d02808fa..04fa7bff3f2 100644 --- a/vector/v.external/local_proto.h +++ b/vector/v.external/local_proto.h @@ -5,21 +5,6 @@ #include #include -/* define type of input datasource - * as of GDAL 2.2, all functions having as argument a GDAL/OGR dataset - * must use the GDAL version, not the OGR version */ -#if GDAL_VERSION_NUM >= 2020000 -typedef GDALDatasetH ds_t; - -#define ds_getlayerbyindex(ds, i) GDALDatasetGetLayer((ds), (i)) -#define ds_close(ds) GDALClose(ds) -#else -typedef OGRDataSourceH ds_t; - -#define ds_getlayerbyindex(ds, i) OGR_DS_GetLayer((ds), (i)) -#define ds_close(ds) OGR_DS_Destroy(ds) -#endif - struct _options { struct Option *dsn, *output, *layer, *where; }; @@ -40,6 +25,6 @@ int list_layers(FILE *, const char *, char **, int, int); void get_table_name(const char *, char **, char **); /* proj.c */ -void check_projection(struct Cell_head *, ds_t, int, char *, char *, int, int, - int); +void check_projection(struct Cell_head *, GDALDatasetH, int, char *, char *, + int, int, int); #endif diff --git a/vector/v.external/main.c b/vector/v.external/main.c index 7d72d421174..686b1359eaa 100644 --- a/vector/v.external/main.c +++ b/vector/v.external/main.c @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) char buf[GPATH_MAX], *dsn, *layer; const char *output; struct Cell_head cellhd; - ds_t Ogr_ds; + GDALDatasetH Ogr_ds; G_gisinit(argv[0]); @@ -141,12 +141,8 @@ int main(int argc, char *argv[]) /* open OGR DSN */ Ogr_ds = NULL; if (strlen(options.dsn->answer) > 0) { -#if GDAL_VERSION_NUM >= 2020000 Ogr_ds = GDALOpenEx(options.dsn->answer, GDAL_OF_VECTOR, NULL, NULL, NULL); -#else - Ogr_ds = OGROpen(dsn, FALSE, NULL); -#endif } if (Ogr_ds == NULL) G_fatal_error(_("Unable to open data source <%s>"), dsn); @@ -173,7 +169,7 @@ int main(int argc, char *argv[]) /* check projection match */ check_projection(&cellhd, Ogr_ds, ilayer, NULL, NULL, 0, flags.override->answer, flags.proj->answer); - ds_close(Ogr_ds); + GDALClose(Ogr_ds); /* create new vector map */ putenv("GRASS_VECTOR_EXTERNAL_IGNORE=1"); diff --git a/vector/v.external/proj.c b/vector/v.external/proj.c index 901baf31e92..b1eae407c35 100644 --- a/vector/v.external/proj.c +++ b/vector/v.external/proj.c @@ -23,7 +23,6 @@ int get_layer_proj(OGRLayerH Ogr_layer, struct Cell_head *cellhd, *proj_wkt = NULL; /* Fetch input layer projection in GRASS form. */ -#if GDAL_VERSION_NUM >= 1110000 if (geom_col) { int igeom; OGRGeomFieldDefnH Ogr_geomdefn; @@ -41,9 +40,6 @@ int get_layer_proj(OGRLayerH Ogr_layer, struct Cell_head *cellhd, else { hSRS = OGR_L_GetSpatialRef(Ogr_layer); } -#else - hSRS = OGR_L_GetSpatialRef(Ogr_layer); /* should not be freed later */ -#endif /* verbose is used only when comparing input SRS to GRASS projection, * not when comparing SRS's of several input layers */ @@ -131,7 +127,7 @@ int get_layer_proj(OGRLayerH Ogr_layer, struct Cell_head *cellhd, } /* keep in sync with r.in.gdal, r.external, v.in.ogr */ -void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, +void check_projection(struct Cell_head *cellhd, GDALDatasetH hDS, int layer, char *geom_col, char *outloc, int create_only, int override, int check_only) { @@ -144,7 +140,7 @@ void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, OGRLayerH Ogr_layer; /* Get first layer to be imported to use for projection check */ - Ogr_layer = ds_getlayerbyindex(hDS, layer); + Ogr_layer = GDALDatasetGetLayer(hDS, layer); /* -------------------------------------------------------------------- */ /* Fetch the projection in GRASS form, SRID, and WKT. */ @@ -183,7 +179,7 @@ void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, /* If create only, clean up and exit here */ if (create_only) { - ds_close(hDS); + GDALClose(hDS); exit(EXIT_SUCCESS); } } @@ -205,7 +201,7 @@ void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, } else { msg_fn = G_fatal_error; - ds_close(hDS); + GDALClose(hDS); } msg_fn(error_msg); if (!override) { @@ -374,7 +370,7 @@ void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, msg_fn = G_fatal_error; msg_fn("%s", error_msg); if (check_only) { - ds_close(hDS); + GDALClose(hDS); exit(EXIT_FAILURE); } } @@ -386,7 +382,7 @@ void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, msg_fn(_("Projection of input dataset and current location " "appear to match")); if (check_only) { - ds_close(hDS); + GDALClose(hDS); exit(EXIT_SUCCESS); } } diff --git a/vector/v.in.ogr/geom.c b/vector/v.in.ogr/geom.c index 8fa0018fea3..68b39bf9259 100644 --- a/vector/v.in.ogr/geom.c +++ b/vector/v.in.ogr/geom.c @@ -61,7 +61,6 @@ int centroid(OGRGeometryH hGeomAny, CENTR *Centr, struct spatial_index *Sindex, hGeom = hGeomAny; -#if GDAL_VERSION_NUM >= 2000000 if (OGR_G_HasCurveGeometry(hGeom, 0)) { G_debug(2, "Approximating curves in a '%s'", OGR_G_GetGeometryName(hGeom)); @@ -69,7 +68,6 @@ int centroid(OGRGeometryH hGeomAny, CENTR *Centr, struct spatial_index *Sindex, /* The ownership of the returned geometry belongs to the caller. */ hGeom = OGR_G_GetLinearGeometry(hGeom, 0, NULL); } -#endif eType = wkbFlatten(OGR_G_GetGeometryType(hGeom)); @@ -196,7 +194,6 @@ int poly_count(OGRGeometryH hGeomAny, int line2boundary) hGeom = hGeomAny; -#if GDAL_VERSION_NUM >= 2000000 if (OGR_G_HasCurveGeometry(hGeom, 0)) { G_debug(2, "Approximating curves in a '%s'", OGR_G_GetGeometryName(hGeom)); @@ -204,7 +201,6 @@ int poly_count(OGRGeometryH hGeomAny, int line2boundary) /* The ownership of the returned geometry belongs to the caller. */ hGeom = OGR_G_GetLinearGeometry(hGeom, 0, NULL); } -#endif eType = wkbFlatten(OGR_G_GetGeometryType(hGeom)); @@ -274,6 +270,7 @@ int geom(OGRGeometryH hGeomAny, struct Map_info *Map, int field, int cat, OGRGeometryH hRing; double x, y; double size; + int lastidx; G_debug(3, "geom() cat = %d", cat); @@ -290,7 +287,6 @@ int geom(OGRGeometryH hGeomAny, struct Map_info *Map, int field, int cat, hGeom = hGeomAny; -#if GDAL_VERSION_NUM >= 2000000 if (OGR_G_HasCurveGeometry(hGeom, 0)) { G_debug(2, "Approximating curves in a '%s'", OGR_G_GetGeometryName(hGeom)); @@ -298,7 +294,6 @@ int geom(OGRGeometryH hGeomAny, struct Map_info *Map, int field, int cat, /* The ownership of the returned geometry belongs to the caller. */ hGeom = OGR_G_GetLinearGeometry(hGeom, 0, NULL); } -#endif eType = wkbFlatten(OGR_G_GetGeometryType(hGeom)); @@ -361,6 +356,23 @@ int geom(OGRGeometryH hGeomAny, struct Map_info *Map, int field, int cat, } Vect_line_prune(Points); + lastidx = Points->n_points - 1; + if (Points->x[0] != Points->x[lastidx] || + Points->y[0] != Points->y[lastidx] || + Points->z[0] != Points->z[lastidx]) { + if (mk_centr) { + /* do not clean polygons */ + G_fatal_error( + _("Found unclosed outer polygon ring, can be " + "closed when cleaning polygons is not disabled")); + } + else { + G_warning(_("Closing unclosed outer polygon ring")); + Vect_append_point(Points, Points->x[0], Points->y[0], + Points->z[0]); + } + } + /* Degenerate is not ignored because it may be useful to see where it * is, but may be eliminated by min_area option */ if (Points->n_points < 4) @@ -407,6 +419,28 @@ int geom(OGRGeometryH hGeomAny, struct Map_info *Map, int field, int cat, } Vect_line_prune(IPoints[valid_isles]); + lastidx = Points->n_points - 1; + if (IPoints[valid_isles]->x[0] != + IPoints[valid_isles]->x[lastidx] || + IPoints[valid_isles]->y[0] != + IPoints[valid_isles]->y[lastidx] || + IPoints[valid_isles]->z[0] != + IPoints[valid_isles]->z[lastidx]) { + if (mk_centr) { + /* do not clean polygons */ + G_fatal_error( + _("Found unclosed inner polygon ring, can be " + "closed when cleaning polygons is not disabled")); + } + else { + G_warning(_("Closing unclosed inner polygon ring")); + Vect_append_point(IPoints[valid_isles], + IPoints[valid_isles]->x[0], + IPoints[valid_isles]->y[0], + IPoints[valid_isles]->z[0]); + } + } + if (IPoints[valid_isles]->n_points < 4) G_warning(_("Degenerate island (%d vertices)"), IPoints[i - 1]->n_points); diff --git a/vector/v.in.ogr/global.h b/vector/v.in.ogr/global.h index 8e3b36998b5..de7984de341 100644 --- a/vector/v.in.ogr/global.h +++ b/vector/v.in.ogr/global.h @@ -26,19 +26,6 @@ #include #include -/* define type of input datasource - * as of GDAL 2.2, all functions having as argument a GDAL/OGR dataset - * must use the GDAL version, not the OGR version */ -#if GDAL_VERSION_NUM >= 2020000 -typedef GDALDatasetH ds_t; -#define ds_getlayerbyindex(ds, i) GDALDatasetGetLayer((ds), (i)) -#define ds_close(ds) GDALClose(ds) -#else -typedef OGRDataSourceH ds_t; -#define ds_getlayerbyindex(ds, i) OGR_DS_GetLayer((ds), (i)) -#define ds_close(ds) OGR_DS_Destroy(ds) -#endif - extern int n_polygons; extern int n_polygon_boundaries; extern double split_distance; diff --git a/vector/v.in.ogr/main.c b/vector/v.in.ogr/main.c index a5de8fa8cff..730d8fa64cd 100644 --- a/vector/v.in.ogr/main.c +++ b/vector/v.in.ogr/main.c @@ -50,17 +50,17 @@ char *get_datasource_name(const char *, int); void convert_osm_lines(struct Map_info *Map, double snap); -int cmp_layer_srs(ds_t, int, int *, char **, char *); -void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, +int cmp_layer_srs(GDALDatasetH, int, int *, char **, char *); +void check_projection(struct Cell_head *cellhd, GDALDatasetH hDS, int layer, char *geom_col, char *outloc, int create_only, int override, int check_only); -int create_spatial_filter(ds_t Ogr_ds, OGRGeometryH *, int, int *, char **, - double *, double *, double *, double *, int, +int create_spatial_filter(GDALDatasetH Ogr_ds, OGRGeometryH *, int, int *, + char **, double *, double *, double *, double *, int, struct Option *); struct OGR_iterator { - ds_t Ogr_ds; + GDALDatasetH Ogr_ds; char *dsn; int nlayers; int has_nonempty_layers; @@ -72,8 +72,8 @@ struct OGR_iterator { int done; }; -void OGR_iterator_init(struct OGR_iterator *OGR_iter, ds_t Ogr_ds, char *dsn, - int nlayers, int ogr_interleaved_reading); +void OGR_iterator_init(struct OGR_iterator *OGR_iter, GDALDatasetH Ogr_ds, + char *dsn, int nlayers, int ogr_interleaved_reading); void OGR_iterator_reset(struct OGR_iterator *OGR_iter); OGRFeatureH ogr_getnextfeature(struct OGR_iterator *, int, char *, OGRGeometryH, @@ -160,7 +160,7 @@ int main(int argc, char *argv[]) int *key_idx; /* OGR */ - ds_t Ogr_ds; + GDALDatasetH Ogr_ds; const char *ogr_driver_name; int ogr_interleaved_reading; OGRLayerH Ogr_layer; @@ -419,11 +419,7 @@ int main(int argc, char *argv[]) if (G_parser(argc, argv)) exit(EXIT_FAILURE); -#if GDAL_VERSION_NUM >= 2000000 GDALAllRegister(); -#else - OGRRegisterAll(); -#endif G_debug(1, "GDAL version %d", GDAL_VERSION_NUM); @@ -433,7 +429,6 @@ int main(int argc, char *argv[]) G_message(_("Supported formats:")); -#if GDAL_VERSION_NUM >= 2000000 for (iDriver = 0; iDriver < GDALGetDriverCount(); iDriver++) { GDALDriverH hDriver = GDALGetDriver(iDriver); const char *pszRWFlag; @@ -451,21 +446,6 @@ int main(int argc, char *argv[]) fprintf(stdout, " %s (%s): %s\n", GDALGetDriverShortName(hDriver), pszRWFlag, GDALGetDriverLongName(hDriver)); } - -#else - for (iDriver = 0; iDriver < OGRGetDriverCount(); iDriver++) { - OGRSFDriverH poDriver = OGRGetDriver(iDriver); - const char *pszRWFlag; - - if (OGR_Dr_TestCapability(poDriver, ODrCCreateDataSource)) - pszRWFlag = "rw"; - else - pszRWFlag = "ro"; - - fprintf(stdout, " %s (%s): %s\n", OGR_Dr_GetName(poDriver), - pszRWFlag, OGR_Dr_GetName(poDriver)); - } -#endif exit(EXIT_SUCCESS); } @@ -563,36 +543,22 @@ int main(int argc, char *argv[]) /* open OGR DSN */ Ogr_ds = NULL; if (strlen(dsn) > 0) { -#if GDAL_VERSION_NUM >= 2020000 Ogr_ds = GDALOpenEx(dsn, GDAL_OF_VECTOR, NULL, (const char **)doo, NULL); -#else - Ogr_ds = OGROpen(dsn, FALSE, NULL); -#endif } if (Ogr_ds == NULL) G_fatal_error(_("Unable to open data source <%s>"), dsn); - /* driver name */ -#if GDAL_VERSION_NUM >= 2020000 + /* driver name */ ogr_driver_name = GDALGetDriverShortName(GDALGetDatasetDriver(Ogr_ds)); G_verbose_message(_("Using OGR driver '%s/%s'"), ogr_driver_name, GDALGetDriverLongName(GDALGetDatasetDriver(Ogr_ds))); -#else - ogr_driver_name = OGR_Dr_GetName(OGR_DS_GetDriver(Ogr_ds)); - G_verbose_message(_("Using OGR driver '%s'"), ogr_driver_name); -#endif /* OGR interleaved reading */ ogr_interleaved_reading = 0; if (strcmp(ogr_driver_name, "OSM") == 0) { /* re-open OGR DSN */ -#if GDAL_VERSION_NUM < 2020000 - CPLSetConfigOption("OGR_INTERLEAVED_READING", "YES"); - OGR_DS_Destroy(Ogr_ds); - Ogr_ds = OGROpen(dsn, FALSE, NULL); -#endif ogr_interleaved_reading = 1; } if (strcmp(ogr_driver_name, "GMLAS") == 0) @@ -601,28 +567,13 @@ int main(int argc, char *argv[]) G_verbose_message(_("Using interleaved reading mode")); if (param.geom->answer) { -#if GDAL_VERSION_NUM >= 1110000 -#if GDAL_VERSION_NUM >= 2020000 if (!GDALDatasetTestCapability(Ogr_ds, ODsCCreateGeomFieldAfterCreateLayer)) { G_warning(_("Option <%s> will be ignored. OGR doesn't support it " "for selected format (%s)."), param.geom->key, ogr_driver_name); -#else - if (!OGR_DS_TestCapability(Ogr_ds, - ODsCCreateGeomFieldAfterCreateLayer)) { - G_warning(_("Option <%s> will be ignored. OGR doesn't support it " - "for selected format (%s)."), - param.geom->key, ogr_driver_name); -#endif param.geom->answer = NULL; } -#else - G_warning(_("Option <%s> will be ignored. Multiple geometry fields are " - "supported by GDAL >= 1.11"), - param.geom->key); - param.geom->answer = NULL; -#endif } /* check encoding for given driver */ @@ -633,11 +584,7 @@ int main(int argc, char *argv[]) ogr_driver_name); } -#if GDAL_VERSION_NUM >= 2020000 navailable_layers = GDALDatasetGetLayerCount(Ogr_ds); -#else - navailable_layers = OGR_DS_GetLayerCount(Ogr_ds); -#endif if (navailable_layers < 1) G_fatal_error(_("No OGR layers available")); @@ -651,7 +598,7 @@ int main(int argc, char *argv[]) ogr_driver_name, navailable_layers); } for (i = 0; i < navailable_layers; i++) { - Ogr_layer = ds_getlayerbyindex(Ogr_ds, i); + Ogr_layer = GDALDatasetGetLayer(Ogr_ds, i); available_layer_names[i] = G_store((char *)OGR_L_GetName(Ogr_layer)); @@ -660,7 +607,7 @@ int main(int argc, char *argv[]) } if (flag.list->answer) { fflush(stdout); - ds_close(Ogr_ds); + GDALClose(Ogr_ds); exit(EXIT_SUCCESS); } @@ -698,7 +645,7 @@ int main(int argc, char *argv[]) /* compare SRS of the different layers to be imported */ if (cmp_layer_srs(Ogr_ds, nlayers, layers, layer_names, param.geom->answer)) { - ds_close(Ogr_ds); + GDALClose(Ogr_ds); G_fatal_error(_("Detected different projections of input layers. " "Input layers must be imported separately.")); } @@ -737,13 +684,13 @@ int main(int argc, char *argv[]) /* check output name */ if (Vect_legal_filename(output) != 1) { - ds_close(Ogr_ds); + GDALClose(Ogr_ds); G_fatal_error(_("Illegal output name <%s>"), output); } /* Check if the output map exists */ if (G_find_vector2(output, G_mapset()) && !overwrite) { - ds_close(Ogr_ds); + GDALClose(Ogr_ds); G_fatal_error(_("Vector map <%s> already exists"), output); } @@ -783,8 +730,7 @@ int main(int argc, char *argv[]) attr_filter) { for (layer = 0; layer < nlayers; layer++) { - Ogr_layer = ds_getlayerbyindex(Ogr_ds, layers[layer]); -#if GDAL_VERSION_NUM >= 1110000 + Ogr_layer = GDALDatasetGetLayer(Ogr_ds, layers[layer]); if (param.geom->answer) { Ogr_featuredefn = OGR_L_GetLayerDefn(Ogr_layer); igeom = OGR_FD_GetGeomFieldIndex(Ogr_featuredefn, @@ -800,9 +746,6 @@ int main(int argc, char *argv[]) else { OGR_L_SetSpatialFilter(Ogr_layer, poSpatialFilter[layer]); } -#else - OGR_L_SetSpatialFilter(Ogr_layer, poSpatialFilter[layer]); -#endif if (OGR_L_SetAttributeFilter(Ogr_layer, attr_filter) != OGRERR_NONE) G_fatal_error(_("Error setting attribute filter '%s'"), attr_filter); @@ -837,10 +780,9 @@ int main(int argc, char *argv[]) n_features[layer] = 0; layer_id = layers[layer]; - Ogr_layer = ds_getlayerbyindex(Ogr_ds, layer_id); + Ogr_layer = GDALDatasetGetLayer(Ogr_ds, layer_id); Ogr_featuredefn = OGR_L_GetLayerDefn(Ogr_layer); igeom = -1; -#if GDAL_VERSION_NUM >= 1110000 if (param.geom->answer) { igeom = OGR_FD_GetGeomFieldIndex(Ogr_featuredefn, param.geom->answer); @@ -849,7 +791,6 @@ int main(int argc, char *argv[]) _("Geometry column <%s> not found in OGR layer <%s>"), param.geom->answer, OGR_L_GetName(Ogr_layer)); } -#endif feature_count = 0; ogr_feature_count = 0; @@ -871,35 +812,25 @@ int main(int argc, char *argv[]) if (ogr_feature_count <= 0) n_features[layer]++; - /* Geometry */ -#if GDAL_VERSION_NUM >= 1110000 + /* Geometry */ Ogr_featuredefn = OGR_iter.Ogr_featuredefn; for (i = 0; i < OGR_FD_GetGeomFieldCount(Ogr_featuredefn); i++) { if (igeom > -1 && i != igeom) continue; /* use only geometry defined via param.geom */ Ogr_geometry = OGR_F_GetGeomFieldRef(Ogr_feature, i); -#else - Ogr_geometry = OGR_F_GetGeometryRef(Ogr_feature); -#endif if (Ogr_geometry != NULL) { -#if GDAL_VERSION_NUM >= 2000000 Ogr_geometry = OGR_G_GetLinearGeometry(Ogr_geometry, 0, NULL); } if (Ogr_geometry != NULL) { -#endif if (!flag.no_clean->answer) poly_count(Ogr_geometry, (type & GV_BOUNDARY)); if (OGR_G_GetCoordinateDimension(Ogr_geometry) > 2) input3d = 1; -#if GDAL_VERSION_NUM >= 2000000 OGR_G_DestroyGeometry(Ogr_geometry); -#endif } -#if GDAL_VERSION_NUM >= 1110000 } -#endif OGR_F_Destroy(Ogr_feature); } G_percent(1, 1, 1); @@ -977,7 +908,7 @@ int main(int argc, char *argv[]) key_column[layer] = GV_KEY_COLUMN; key_idx[layer] = -2; /* -1 for fid column */ layer_id = layers[layer]; - Ogr_layer = ds_getlayerbyindex(Ogr_ds, layer_id); + Ogr_layer = GDALDatasetGetLayer(Ogr_ds, layer_id); Ogr_featuredefn = OGR_L_GetLayerDefn(Ogr_layer); if (param.key->answer) { @@ -1003,11 +934,7 @@ int main(int argc, char *argv[]) Ogr_field = OGR_FD_GetFieldDefn(Ogr_featuredefn, key_idx[layer]); Ogr_ftype = OGR_Fld_GetType(Ogr_field); - if (!(Ogr_ftype == OFTInteger -#if GDAL_VERSION_NUM >= 2000000 - || Ogr_ftype == OFTInteger64 -#endif - )) { + if (!(Ogr_ftype == OFTInteger || Ogr_ftype == OFTInteger64)) { G_fatal_error( _("Key column '%s' in input layer <%s> is not integer"), param.key->answer, layer_names[layer]); @@ -1114,7 +1041,6 @@ int main(int argc, char *argv[]) if (Ogr_ftype == OFTInteger) { col_info[i_out].type = "integer"; } -#if GDAL_VERSION_NUM >= 2000000 else if (Ogr_ftype == OFTInteger64) { if (strcmp(Fi->driver, "pg") == 0) col_info[i_out].type = "bigint"; @@ -1126,12 +1052,8 @@ int main(int argc, char *argv[]) Ogr_fieldname); } } -#endif - else if (Ogr_ftype == OFTIntegerList -#if GDAL_VERSION_NUM >= 2000000 - || Ogr_ftype == OFTInteger64List -#endif - ) { + else if (Ogr_ftype == OFTIntegerList || + Ogr_ftype == OFTInteger64List) { /* hack: treat as string */ sprintf(buf, "varchar ( %d )", OFTIntegerListlength); col_info[i_out].type = G_store(buf); @@ -1141,7 +1063,6 @@ int main(int argc, char *argv[]) } else if (Ogr_ftype == OFTReal) { col_info[i_out].type = "double precision"; -#if GDAL_VERSION_NUM >= 1320 } else if (Ogr_ftype == OFTDate) { col_info[i_out].type = "date"; @@ -1152,7 +1073,6 @@ int main(int argc, char *argv[]) else if (Ogr_ftype == OFTDateTime) { sprintf(buf, "%s", datetime_type); col_info[i_out].type = G_store(buf); -#endif } else if (Ogr_ftype == OFTString) { int fwidth; @@ -1294,15 +1214,13 @@ int main(int argc, char *argv[]) db_begin_transaction(driver); } - Ogr_layer = ds_getlayerbyindex(Ogr_ds, layer_id); + Ogr_layer = GDALDatasetGetLayer(Ogr_ds, layer_id); Ogr_featuredefn = OGR_L_GetLayerDefn(Ogr_layer); igeom = -1; -#if GDAL_VERSION_NUM >= 1110000 if (param.geom->answer) igeom = OGR_FD_GetGeomFieldIndex(Ogr_featuredefn, param.geom->answer); -#endif while ((Ogr_feature = ogr_getnextfeature( &OGR_iter, layer_id, layer_names[layer], @@ -1324,7 +1242,6 @@ int main(int argc, char *argv[]) /* Geometry */ Ogr_featuredefn = OGR_iter.Ogr_featuredefn; -#if GDAL_VERSION_NUM >= 1110000 for (i = 0; i < OGR_FD_GetGeomFieldCount(Ogr_featuredefn); i++) { if (igeom > -1 && i != igeom) continue; /* use only geometry defined via param.geom */ @@ -1332,9 +1249,6 @@ int main(int argc, char *argv[]) /* Ogr_geometry from OGR_F_GetGeomFieldRef() should not be * modified. */ Ogr_geometry = OGR_F_GetGeomFieldRef(Ogr_feature, i); -#else - Ogr_geometry = OGR_F_GetGeometryRef(Ogr_feature); -#endif if (Ogr_geometry == NULL) { nogeom++; } @@ -1348,9 +1262,7 @@ int main(int argc, char *argv[]) geom(Ogr_geometry, Out, layer + 1, cat, min_area, type, flag.no_clean->answer); } -#if GDAL_VERSION_NUM >= 1110000 } -#endif /* Attributes */ ncols = OGR_FD_GetFieldCount(Ogr_featuredefn); if (!flag.notab->answer) { @@ -1369,14 +1281,10 @@ int main(int argc, char *argv[]) Ogr_fstring = OGR_F_GetFieldAsString(Ogr_feature, i); if (Ogr_fstring && *Ogr_fstring) { if (Ogr_ftype == OFTInteger || -#if GDAL_VERSION_NUM >= 2000000 - Ogr_ftype == OFTInteger64 || -#endif - Ogr_ftype == OFTReal) { + Ogr_ftype == OFTInteger64 || Ogr_ftype == OFTReal) { G_rasprintf(&sqlbuf, &sqlbufsize, ", %s", Ogr_fstring); } -#if GDAL_VERSION_NUM >= 1320 /* should we use OGR_F_GetFieldAsDateTime() here ? */ else if (Ogr_ftype == OFTDate || Ogr_ftype == OFTTime || Ogr_ftype == OFTDateTime) { @@ -1392,14 +1300,10 @@ int main(int argc, char *argv[]) G_rasprintf(&sqlbuf, &sqlbufsize, "%s", newbuf); G_free(newbuf); } -#endif else if (Ogr_ftype == OFTString || Ogr_ftype == OFTStringList || - Ogr_ftype == OFTIntegerList -#if GDAL_VERSION_NUM >= 2000000 - || Ogr_ftype == OFTInteger64List -#endif - ) { + Ogr_ftype == OFTIntegerList || + Ogr_ftype == OFTInteger64List) { db_set_string(&strval, (char *)Ogr_fstring); db_double_quote_string(&strval); G_rasprintf(&sqlbuf, &sqlbufsize, ", '%s'", @@ -1414,25 +1318,17 @@ int main(int argc, char *argv[]) else { /* G_warning (_("Column value not set" )); */ if (Ogr_ftype == OFTInteger || -#if GDAL_VERSION_NUM >= 2000000 - Ogr_ftype == OFTInteger64 || -#endif - Ogr_ftype == OFTReal) { + Ogr_ftype == OFTInteger64 || Ogr_ftype == OFTReal) { G_rasprintf(&sqlbuf, &sqlbufsize, ", NULL"); } -#if GDAL_VERSION_NUM >= 1320 else if (Ogr_ftype == OFTDate || Ogr_ftype == OFTTime || Ogr_ftype == OFTDateTime) { G_rasprintf(&sqlbuf, &sqlbufsize, ", NULL"); } -#endif else if (Ogr_ftype == OFTString || Ogr_ftype == OFTStringList || - Ogr_ftype == OFTIntegerList -#if GDAL_VERSION_NUM >= 2000000 - || Ogr_ftype == OFTInteger64List -#endif - ) { + Ogr_ftype == OFTIntegerList || + Ogr_ftype == OFTInteger64List) { G_rasprintf(&sqlbuf, &sqlbufsize, ", NULL"); } else { @@ -1657,15 +1553,13 @@ int main(int argc, char *argv[]) G_message(_("Finding centroids for OGR layer <%s>..."), layer_names[layer]); layer_id = layers[layer]; - Ogr_layer = ds_getlayerbyindex(Ogr_ds, layer_id); + Ogr_layer = GDALDatasetGetLayer(Ogr_ds, layer_id); Ogr_featuredefn = OGR_L_GetLayerDefn(Ogr_layer); igeom = -1; -#if GDAL_VERSION_NUM >= 1110000 if (param.geom->answer) igeom = OGR_FD_GetGeomFieldIndex(Ogr_featuredefn, param.geom->answer); -#endif cat = 0; /* field = layer + 1 */ feature_count = 0; @@ -1705,7 +1599,6 @@ int main(int argc, char *argv[]) } /* Geometry */ -#if GDAL_VERSION_NUM >= 1110000 Ogr_featuredefn = OGR_iter.Ogr_featuredefn; for (i = 0; i < OGR_FD_GetGeomFieldCount(Ogr_featuredefn); i++) { @@ -1713,16 +1606,11 @@ int main(int argc, char *argv[]) continue; /* use only geometry defined via param.geom */ Ogr_geometry = OGR_F_GetGeomFieldRef(Ogr_feature, i); -#else - Ogr_geometry = OGR_F_GetGeometryRef(Ogr_feature); -#endif if (Ogr_geometry != NULL) { centroid(Ogr_geometry, Centr, &si, layer + 1, area_cat, min_area, type); } -#if GDAL_VERSION_NUM >= 1110000 } -#endif OGR_F_Destroy(Ogr_feature); } /* search tree is no longer needed */ @@ -1804,7 +1692,7 @@ int main(int argc, char *argv[]) G_message("%s", separator); } - ds_close(Ogr_ds); + GDALClose(Ogr_ds); G_free(fid_cat_tree); if (use_tmp_vect) { @@ -2098,8 +1986,8 @@ int main(int argc, char *argv[]) exit(EXIT_SUCCESS); } -void OGR_iterator_init(struct OGR_iterator *OGR_iter, ds_t Ogr_ds, char *dsn, - int nlayers, int ogr_interleaved_reading) +void OGR_iterator_init(struct OGR_iterator *OGR_iter, GDALDatasetH Ogr_ds, + char *dsn, int nlayers, int ogr_interleaved_reading) { OGR_iter->Ogr_ds = Ogr_ds; OGR_iter->dsn = dsn; @@ -2112,25 +2000,16 @@ void OGR_iterator_init(struct OGR_iterator *OGR_iter, ds_t Ogr_ds, char *dsn, OGR_iter->done = 0; if (OGR_iter->ogr_interleaved_reading) { -#if GDAL_VERSION_NUM >= 2020000 G_verbose_message(_("Using GDAL 2.2+ style interleaved reading for " "GDAL version %d.%d.%d"), GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, GDAL_VERSION_REV); -#else - G_verbose_message(_("Using GDAL 1.x style interleaved reading for GDAL " - "version %d.%d.%d"), - GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, - GDAL_VERSION_REV); -#endif } } void OGR_iterator_reset(struct OGR_iterator *OGR_iter) { -#if GDAL_VERSION_NUM >= 2020000 GDALDatasetResetReading(OGR_iter->Ogr_ds); -#endif OGR_iter->requested_layer = -1; OGR_iter->curr_layer = -1; OGR_iter->Ogr_layer = NULL; @@ -2148,7 +2027,7 @@ OGRFeatureH ogr_getnextfeature(struct OGR_iterator *OGR_iter, int layer, if (!OGR_iter->ogr_interleaved_reading) { OGR_iter->curr_layer = layer; OGR_iter->Ogr_layer = - ds_getlayerbyindex(OGR_iter->Ogr_ds, OGR_iter->curr_layer); + GDALDatasetGetLayer(OGR_iter->Ogr_ds, OGR_iter->curr_layer); OGR_iter->Ogr_featuredefn = OGR_L_GetLayerDefn(OGR_iter->Ogr_layer); OGR_L_ResetReading(OGR_iter->Ogr_layer); } @@ -2157,36 +2036,19 @@ OGRFeatureH ogr_getnextfeature(struct OGR_iterator *OGR_iter, int layer, /* clear filters */ for (i = 0; i < OGR_iter->nlayers; i++) { - OGR_iter->Ogr_layer = ds_getlayerbyindex(OGR_iter->Ogr_ds, i); + OGR_iter->Ogr_layer = GDALDatasetGetLayer(OGR_iter->Ogr_ds, i); OGR_L_SetSpatialFilter(OGR_iter->Ogr_layer, NULL); OGR_L_SetAttributeFilter(OGR_iter->Ogr_layer, NULL); } -#if GDAL_VERSION_NUM >= 2020000 GDALDatasetResetReading(OGR_iter->Ogr_ds); -#else - /* need to re-open OGR DSN in order to start reading from the - * beginning NOTE: any constraints are lost */ - OGR_DS_Destroy(OGR_iter->Ogr_ds); - OGR_iter->Ogr_ds = OGROpen(OGR_iter->dsn, FALSE, NULL); - if (OGR_iter->Ogr_ds == NULL) - G_fatal_error(_("Unable to re-open data source <%s>"), - OGR_iter->dsn); - OGR_iter->Ogr_layer = OGR_DS_GetLayer(OGR_iter->Ogr_ds, layer); - OGR_iter->curr_layer = 0; - OGR_iter->has_nonempty_layers = 0; -#endif - OGR_iter->Ogr_layer = ds_getlayerbyindex(OGR_iter->Ogr_ds, layer); + OGR_iter->Ogr_layer = GDALDatasetGetLayer(OGR_iter->Ogr_ds, layer); OGR_iter->Ogr_featuredefn = OGR_L_GetLayerDefn(OGR_iter->Ogr_layer); OGR_L_SetSpatialFilter(OGR_iter->Ogr_layer, poSpatialFilter); if (OGR_L_SetAttributeFilter(OGR_iter->Ogr_layer, attr_filter) != OGRERR_NONE) G_fatal_error(_("Error setting attribute filter '%s'"), attr_filter); -#if GDAL_VERSION_NUM < 2020000 - OGR_iter->Ogr_layer = - OGR_DS_GetLayer(OGR_iter->Ogr_ds, OGR_iter->curr_layer); -#endif } OGR_iter->requested_layer = layer; OGR_iter->done = 0; @@ -2210,7 +2072,6 @@ OGRFeatureH ogr_getnextfeature(struct OGR_iterator *OGR_iter, int layer, OGRFeatureH Ogr_feature = NULL; /* fetch next feature */ -#if GDAL_VERSION_NUM >= 2020000 while (1) { OGR_iter->Ogr_layer = NULL; Ogr_feature = GDALDatasetGetNextFeature( @@ -2233,44 +2094,12 @@ OGRFeatureH ogr_getnextfeature(struct OGR_iterator *OGR_iter, int layer, OGR_F_Destroy(Ogr_feature); OGR_iter->Ogr_layer = NULL; } -#else - while (1) { - Ogr_feature = OGR_L_GetNextFeature(OGR_iter->Ogr_layer); - if (Ogr_feature != NULL) { - OGR_iter->has_nonempty_layers = 1; - if (OGR_iter->curr_layer != layer) - OGR_F_Destroy(Ogr_feature); - else - return Ogr_feature; - } - else { - OGR_iter->curr_layer++; - if (OGR_iter->curr_layer == OGR_iter->nlayers) { - if (!OGR_iter->has_nonempty_layers) { - OGR_iter->Ogr_layer = NULL; - OGR_iter->done = 1; - - return NULL; - } - else { - OGR_iter->curr_layer = 0; - OGR_iter->has_nonempty_layers = 0; - } - } - G_debug(3, "advancing to layer %d ...", OGR_iter->curr_layer); - OGR_iter->Ogr_layer = - OGR_DS_GetLayer(OGR_iter->Ogr_ds, OGR_iter->curr_layer); - OGR_iter->Ogr_featuredefn = - OGR_L_GetLayerDefn(OGR_iter->Ogr_layer); - } - } -#endif } return NULL; } -int create_spatial_filter(ds_t Ogr_ds, OGRGeometryH *poSpatialFilter, +int create_spatial_filter(GDALDatasetH Ogr_ds, OGRGeometryH *poSpatialFilter, int nlayers, int *layers, char **layer_names, double *xmin, double *ymin, double *xmax, double *ymax, int use_region, struct Option *spat) @@ -2292,7 +2121,7 @@ int create_spatial_filter(ds_t Ogr_ds, OGRGeometryH *poSpatialFilter, ymaxl = (double *)G_malloc(nlayers * sizeof(double)); for (layer = 0; layer < nlayers; layer++) { - Ogr_layer = ds_getlayerbyindex(Ogr_ds, layers[layer]); + Ogr_layer = GDALDatasetGetLayer(Ogr_ds, layers[layer]); have_ogr_extent[layer] = 0; if ((OGR_L_GetExtent(Ogr_layer, &oExt, 1)) == OGRERR_NONE) { xminl[layer] = oExt.MinX; @@ -2327,11 +2156,7 @@ int create_spatial_filter(ds_t Ogr_ds, OGRGeometryH *poSpatialFilter, /* OGR_L_GetExtent(): * Note that some implementations of this method may alter * the read cursor of the layer. */ -#if GDAL_VERSION_NUM >= 2020000 GDALDatasetResetReading(Ogr_ds); -#else - OGR_L_ResetReading(Ogr_layer); -#endif } /* set spatial filter */ diff --git a/vector/v.in.ogr/proj.c b/vector/v.in.ogr/proj.c index 4ddbe546384..ad7b6363c4f 100644 --- a/vector/v.in.ogr/proj.c +++ b/vector/v.in.ogr/proj.c @@ -24,7 +24,6 @@ int get_layer_proj(OGRLayerH Ogr_layer, struct Cell_head *cellhd, *proj_wkt = NULL; /* Fetch input layer projection in GRASS form. */ -#if GDAL_VERSION_NUM >= 1110000 if (geom_col) { int igeom; OGRGeomFieldDefnH Ogr_geomdefn; @@ -42,9 +41,6 @@ int get_layer_proj(OGRLayerH Ogr_layer, struct Cell_head *cellhd, else { hSRS = OGR_L_GetSpatialRef(Ogr_layer); } -#else - hSRS = OGR_L_GetSpatialRef(Ogr_layer); /* should not be freed later */ -#endif /* verbose is used only when comparing input SRS to GRASS projection, * not when comparing SRS's of several input layers */ @@ -133,8 +129,8 @@ int get_layer_proj(OGRLayerH Ogr_layer, struct Cell_head *cellhd, /* compare projections of all OGR layers * return 0 if all layers have the same projection * return 1 if layer projections differ */ -int cmp_layer_srs(ds_t Ogr_ds, int nlayers, int *layers, char **layer_names, - char *geom_col) +int cmp_layer_srs(GDALDatasetH Ogr_ds, int nlayers, int *layers, + char **layer_names, char *geom_col) { int layer; struct Key_Value *proj_info1, *proj_units1; @@ -156,7 +152,7 @@ int cmp_layer_srs(ds_t Ogr_ds, int nlayers, int *layers, char **layer_names, layer = 0; do { /* Get first SRS */ - Ogr_layer = ds_getlayerbyindex(Ogr_ds, layers[layer]); + Ogr_layer = GDALDatasetGetLayer(Ogr_ds, layers[layer]); if (get_layer_proj(Ogr_layer, &cellhd1, &proj_info1, &proj_units1, &proj_srid1, &proj_wkt1, geom_col, 0) == 0) { @@ -201,7 +197,7 @@ int cmp_layer_srs(ds_t Ogr_ds, int nlayers, int *layers, char **layer_names, for (layer = 1; layer < nlayers; layer++) { /* Get SRS of other layer(s) */ - Ogr_layer = ds_getlayerbyindex(Ogr_ds, layers[layer]); + Ogr_layer = GDALDatasetGetLayer(Ogr_ds, layers[layer]); G_get_window(&cellhd2); if (get_layer_proj(Ogr_layer, &cellhd2, &proj_info2, &proj_units2, &proj_srid2, &proj_wkt2, geom_col, 0) != 0) { @@ -265,7 +261,7 @@ int cmp_layer_srs(ds_t Ogr_ds, int nlayers, int *layers, char **layer_names, } /* keep in sync with r.in.gdal, r.external, v.external */ -void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, +void check_projection(struct Cell_head *cellhd, GDALDatasetH hDS, int layer, char *geom_col, char *outloc, int create_only, int override, int check_only) { @@ -278,7 +274,7 @@ void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, OGRLayerH Ogr_layer; /* Get first layer to be imported to use for projection check */ - Ogr_layer = ds_getlayerbyindex(hDS, layer); + Ogr_layer = GDALDatasetGetLayer(hDS, layer); /* -------------------------------------------------------------------- */ /* Fetch the projection in GRASS form, SRID, and WKT. */ @@ -317,7 +313,7 @@ void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, /* If create only, clean up and exit here */ if (create_only) { - ds_close(hDS); + GDALClose(hDS); exit(EXIT_SUCCESS); } } @@ -339,7 +335,7 @@ void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, } else { msg_fn = G_fatal_error; - ds_close(hDS); + GDALClose(hDS); } msg_fn(error_msg); if (!override) { @@ -506,7 +502,7 @@ void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, msg_fn = G_fatal_error; msg_fn("%s", error_msg); if (check_only) { - ds_close(hDS); + GDALClose(hDS); exit(EXIT_FAILURE); } } @@ -518,7 +514,7 @@ void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, msg_fn(_("Projection of input dataset and current location " "appear to match")); if (check_only) { - ds_close(hDS); + GDALClose(hDS); exit(EXIT_SUCCESS); } } diff --git a/vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py b/vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py index 90c4abbfed8..c28386dab81 100644 --- a/vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py +++ b/vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py @@ -10,6 +10,7 @@ """ import os +import shutil from grass.gunittest.case import TestCase from grass.gunittest.main import test import unittest diff --git a/vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py b/vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py index 01026456667..7acc25a60ac 100644 --- a/vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py +++ b/vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py @@ -10,6 +10,7 @@ """ import os +import shutil from grass.gunittest.case import TestCase from grass.gunittest.main import test import unittest diff --git a/vector/v.out.ogr/attrb.c b/vector/v.out.ogr/attrb.c index fdcdf72c6b7..4992018eb95 100644 --- a/vector/v.out.ogr/attrb.c +++ b/vector/v.out.ogr/attrb.c @@ -98,11 +98,7 @@ int mk_att(int cat, struct field_info *Fi, dbDriver *driver, int ncol, if ((nocat && strcmp(Fi->key, colname[j]) == 0) == 0) { /* if this is 'cat', then execute the following only if * the '-s' flag was NOT given */ -#if GDAL_VERSION_NUM >= 2020000 OGR_F_SetFieldNull(Ogr_feature, ogrfieldnum); -#else - OGR_F_UnsetField(Ogr_feature, ogrfieldnum); -#endif } /* prevent writing NULL values */ @@ -135,10 +131,8 @@ int mk_att(int cat, struct field_info *Fi, dbDriver *driver, int ncol, } } } -#if GDAL_VERSION_NUM >= 2020000 else OGR_F_SetFieldNull(Ogr_feature, ogrfieldnum); -#endif } } db_close_cursor(&cursor); diff --git a/vector/v.out.ogr/create.c b/vector/v.out.ogr/create.c index d6adfdec474..fa0bbe10f52 100644 --- a/vector/v.out.ogr/create.c +++ b/vector/v.out.ogr/create.c @@ -6,25 +6,21 @@ void create_ogr_layer(const char *dsn, const char *format, const char *layer, unsigned int wkbtype, char **papszDSCO, char **papszLCO) { char *pszDriverName; - dr_t hDriver; - ds_t hDS; + GDALDriverH hDriver; + GDALDatasetH hDS; OGRLayerH hLayer; pszDriverName = G_store(format); G_strchg(pszDriverName, '_', ' '); /* '_' -> ' ' */ /* start driver */ - hDriver = get_driver_by_name(pszDriverName); + hDriver = GDALGetDriverByName(pszDriverName); if (hDriver == NULL) { G_fatal_error(_("OGR driver <%s> not available"), pszDriverName); } /* create datasource */ -#if GDAL_VERSION_NUM >= 2020000 hDS = GDALCreate(hDriver, dsn, 0, 0, 0, GDT_Unknown, papszDSCO); -#else - hDS = OGR_Dr_CreateDataSource(hDriver, dsn, papszDSCO); -#endif if (hDS == NULL) { G_fatal_error(_("Creation of output OGR datasource <%s> failed"), dsn); } @@ -33,16 +29,12 @@ void create_ogr_layer(const char *dsn, const char *format, const char *layer, /* create layer */ /* todo: SRS */ -#if GDAL_VERSION_NUM >= 2020000 hLayer = GDALDatasetCreateLayer(hDS, layer, NULL, wkbtype, papszLCO); -#else - hLayer = OGR_DS_CreateLayer(hDS, layer, NULL, wkbtype, papszLCO); -#endif if (hLayer == NULL) { G_fatal_error(_("Creation of OGR layer <%s> failed"), layer); } - ds_close(hDS); + GDALClose(hDS); } OGRwkbGeometryType get_multi_wkbtype(OGRwkbGeometryType wkbtype) diff --git a/vector/v.out.ogr/list.c b/vector/v.out.ogr/list.c index 6ced3ba4f19..0df74cf5dac 100644 --- a/vector/v.out.ogr/list.c +++ b/vector/v.out.ogr/list.c @@ -10,11 +10,7 @@ char *OGR_list_write_drivers(void) int i, count; size_t len; -#if GDAL_VERSION_NUM >= 2000000 GDALDriverH hDriver; -#else - OGRSFDriverH Ogr_driver; -#endif char buf[2000]; char **list, *ret; @@ -22,7 +18,6 @@ char *OGR_list_write_drivers(void) list = NULL; count = len = 0; -#if GDAL_VERSION_NUM >= 2000000 /* get GDAL driver names */ GDALAllRegister(); G_debug(2, "driver count = %d", GDALGetDriverCount()); @@ -47,28 +42,6 @@ char *OGR_list_write_drivers(void) list[count++] = G_store(buf); len += strlen(buf) + 1; /* + ',' */ } -#else - /* get OGR driver names */ - OGRRegisterAll(); - G_debug(2, "driver count = %d", OGRGetDriverCount()); - for (i = 0; i < OGRGetDriverCount(); i++) { - /* only fetch read/write drivers */ - if (!OGR_Dr_TestCapability(OGRGetDriver(i), ODrCCreateDataSource)) - continue; - - Ogr_driver = OGRGetDriver(i); - G_debug(2, "driver %d/%d : %s", i, OGRGetDriverCount(), - OGR_Dr_GetName(Ogr_driver)); - - list = G_realloc(list, (count + 1) * sizeof(char *)); - - /* chg white space to underscore in OGR driver names */ - sprintf(buf, "%s", OGR_Dr_GetName(Ogr_driver)); - G_strchg(buf, ' ', '_'); - list[count++] = G_store(buf); - len += strlen(buf) + 1; /* + ',' */ - } -#endif qsort(list, count, sizeof(char *), cmp); @@ -99,11 +72,7 @@ int cmp(const void *a, const void *b) char *default_driver(void) { -#if GDAL_VERSION_NUM >= 2000000 if (GDALGetDriverByName("GPKG")) { -#else - if (OGRGetDriverByName("GPKG")) { -#endif return G_store("GPKG"); } @@ -116,7 +85,6 @@ void list_formats(void) G_message(_("Supported formats:")); -#if GDAL_VERSION_NUM >= 2000000 for (iDriver = 0; iDriver < GDALGetDriverCount(); iDriver++) { GDALDriverH hDriver = GDALGetDriver(iDriver); const char *pszRWFlag; @@ -134,19 +102,4 @@ void list_formats(void) fprintf(stdout, " %s (%s): %s\n", GDALGetDriverShortName(hDriver), pszRWFlag, GDALGetDriverLongName(hDriver)); } - -#else - for (iDriver = 0; iDriver < OGRGetDriverCount(); iDriver++) { - OGRSFDriverH poDriver = OGRGetDriver(iDriver); - const char *pszRWFlag; - - if (OGR_Dr_TestCapability(poDriver, ODrCCreateDataSource)) - pszRWFlag = "rw"; - else - continue; - - fprintf(stdout, " %s (%s): %s\n", OGR_Dr_GetName(poDriver), pszRWFlag, - OGR_Dr_GetName(poDriver)); - } -#endif } diff --git a/vector/v.out.ogr/local_proto.h b/vector/v.out.ogr/local_proto.h index 7ed25a5170c..a0406a350a1 100644 --- a/vector/v.out.ogr/local_proto.h +++ b/vector/v.out.ogr/local_proto.h @@ -7,25 +7,6 @@ #include #include -/* switch to new GDAL API with GDAL 2.2+ */ -#if GDAL_VERSION_NUM >= 2020000 -typedef GDALDatasetH ds_t; -typedef GDALDriverH dr_t; - -#define get_driver_by_name GDALGetDriverByName -#define get_driver GDALGetDriver -#define ds_getlayerbyindex(ds, i) GDALDatasetGetLayer((ds), (i)) -#define ds_close(ds) GDALClose(ds) -#else -typedef OGRDataSourceH ds_t; -typedef OGRSFDriverH dr_t; - -#define get_driver_by_name OGRGetDriverByName -#define get_driver OGRGetDriver -#define ds_getlayerbyindex(ds, i) OGR_DS_GetLayer((ds), (i)) -#define ds_close(ds) OGR_DS_Destroy(ds) -#endif - /* some hard limits */ #define SQL_BUFFER_SIZE 2000 diff --git a/vector/v.out.ogr/main.c b/vector/v.out.ogr/main.c index 1c4c554ab51..788d27a3665 100644 --- a/vector/v.out.ogr/main.c +++ b/vector/v.out.ogr/main.c @@ -64,8 +64,8 @@ int main(int argc, char *argv[]) /* OGR */ int drn; OGRFieldType ogr_ftype = OFTInteger; - ds_t hDS; - dr_t hDriver; + GDALDatasetH hDS; + GDALDriverH hDriver; OGRLayerH Ogr_layer; OGRFieldDefnH Ogr_field; OGRFeatureDefnH Ogr_featuredefn; @@ -514,7 +514,6 @@ int main(int argc, char *argv[]) G_debug(1, "Requested to export %d features", num_to_export); /* Open OGR DSN */ -#if GDAL_VERSION_NUM >= 2020000 G_debug(2, "driver count = %d", GDALGetDriverCount()); drn = -1; for (i = 0; i < GDALGetDriverCount(); i++) { @@ -528,28 +527,12 @@ int main(int argc, char *argv[]) G_debug(2, " -> driver = %d", drn); } } -#else - G_debug(2, "driver count = %d", OGRGetDriverCount()); - drn = -1; - for (i = 0; i < OGRGetDriverCount(); i++) { - hDriver = OGRGetDriver(i); - G_debug(2, "driver %d : %s", i, OGR_Dr_GetName(hDriver)); - /* chg white space to underscore in OGR driver names */ - sprintf(buf, "%s", OGR_Dr_GetName(hDriver)); - G_strchg(buf, ' ', '_'); - if (strcmp(buf, options.format->answer) == 0) { - drn = i; - G_debug(2, " -> driver = %d", drn); - } - } -#endif if (drn == -1) G_fatal_error(_("OGR driver <%s> not found"), options.format->answer); - hDriver = get_driver(drn); + hDriver = GDALGetDriver(drn); if (flags.append->answer) { G_debug(1, "Append to OGR layer"); -#if GDAL_VERSION_NUM >= 2020000 hDS = GDALOpenEx(dsn, GDAL_OF_VECTOR | GDAL_OF_UPDATE, NULL, NULL, NULL); @@ -557,17 +540,8 @@ int main(int argc, char *argv[]) G_debug(1, "Create OGR data source"); hDS = GDALCreate(hDriver, dsn, 0, 0, 0, GDT_Unknown, papszDSCO); } -#else - hDS = OGR_Dr_Open(hDriver, dsn, TRUE); - - if (hDS == NULL) { - G_debug(1, "Create OGR data source"); - hDS = OGR_Dr_CreateDataSource(hDriver, dsn, papszDSCO); - } -#endif } else { -#if GDAL_VERSION_NUM >= 2020000 if (flags.update->answer) { G_debug(1, "Update OGR data source"); hDS = GDALOpenEx(dsn, GDAL_OF_VECTOR | GDAL_OF_UPDATE, NULL, NULL, @@ -577,16 +551,6 @@ int main(int argc, char *argv[]) G_debug(1, "Create OGR data source"); hDS = GDALCreate(hDriver, dsn, 0, 0, 0, GDT_Unknown, papszDSCO); } -#else - if (flags.update->answer) { - G_debug(1, "Update OGR data source"); - hDS = OGR_Dr_Open(hDriver, dsn, TRUE); - } - else { - G_debug(1, "Create OGR data source"); - hDS = OGR_Dr_CreateDataSource(hDriver, dsn, papszDSCO); - } -#endif } CSLDestroy(papszDSCO); @@ -597,14 +561,8 @@ int main(int argc, char *argv[]) /* check if OGR layer exists */ overwrite = G_check_overwrite(argc, argv); found = FALSE; -#if GDAL_VERSION_NUM >= 2020000 for (i = 0; i < GDALDatasetGetLayerCount(hDS); i++) { Ogr_layer = GDALDatasetGetLayer(hDS, i); -#else - for (i = 0; i < OGR_DS_GetLayerCount(hDS); i++) { - Ogr_layer = OGR_DS_GetLayer(hDS, i); - -#endif Ogr_field = OGR_L_GetLayerDefn(Ogr_layer); if (G_strcasecmp(OGR_FD_GetName(Ogr_field), options.layer->answer)) continue; @@ -615,15 +573,11 @@ int main(int argc, char *argv[]) _("Layer <%s> already exists in OGR data source '%s'"), options.layer->answer, options.dsn->answer); } - else if (overwrite) { + else if (overwrite && !flags.append->answer) { G_warning( _("OGR layer <%s> already exists and will be overwritten"), options.layer->answer); -#if GDAL_VERSION_NUM >= 2020000 GDALDatasetDeleteLayer(hDS, i); -#else - OGR_DS_DeleteLayer(hDS, i); -#endif break; } } @@ -704,19 +658,11 @@ int main(int argc, char *argv[]) } G_debug(1, "Create OGR layer"); -#if GDAL_VERSION_NUM >= 2020000 if (flags.append->answer) Ogr_layer = GDALDatasetGetLayerByName(hDS, options.layer->answer); else Ogr_layer = GDALDatasetCreateLayer(hDS, options.layer->answer, Ogr_projection, wkbtype, papszLCO); -#else - if (flags.append->answer) - Ogr_layer = OGR_DS_GetLayerByName(hDS, options.layer->answer); - else - Ogr_layer = OGR_DS_CreateLayer(hDS, options.layer->answer, - Ogr_projection, wkbtype, papszLCO); -#endif CSLDestroy(papszLCO); if (Ogr_layer == NULL) { @@ -800,11 +746,7 @@ int main(int argc, char *argv[]) ogr_ftype = OFTString; break; case DB_C_TYPE_DATETIME: -#if GDAL_VERSION_NUM >= 1320 ogr_ftype = OFTDateTime; -#else - ogr_ftype = OFTString; -#endif break; } G_debug(2, "ogr_ftype = %d", ogr_ftype); @@ -918,7 +860,7 @@ int main(int argc, char *argv[]) } } - ds_close(hDS); + GDALClose(hDS); Vect_close(&In); diff --git a/vector/v.to.rast/testsuite/test_v_to_rast.py b/vector/v.to.rast/testsuite/test_v_to_rast.py new file mode 100644 index 00000000000..273c77983d8 --- /dev/null +++ b/vector/v.to.rast/testsuite/test_v_to_rast.py @@ -0,0 +1,58 @@ +""" +Name: v.to.rast test + +Purpose: Test v.to.rast + +Author: Vaclav Petras + +Copyright: (C) 2023 by Vaclav Petras and the GRASS Development Team + +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" +from grass.gunittest.case import TestCase +from grass.gunittest.main import test + + +class TestParameters(TestCase): + """Test v.to.rast""" + + output = "roads" + + @classmethod + def setUpClass(cls): + """Specify region for raster creation for this class""" + cls.use_temp_region() + cls.runModule("g.region", raster="roadsmajor", res=10, flags="a") + + @classmethod + def tearDownClass(cls): + """Remove temporary region""" + cls.del_temp_region() + + def tearDown(self): + """Remove maps after each test method""" + self.runModule( + "g.remove", + flags="f", + type="raster", + name=[self.output], + ) + + def test_legacy_use_interface(self): + """Check that a legacy value for use parameter works""" + self.assertModule( + "v.to.rast", input="roadsmajor", output=self.output, use="val", value=1 + ) + + def test_use_interface(self): + """Check that use=value value=1 works""" + self.assertModule( + "v.to.rast", input="roadsmajor", output=self.output, use="value", value=1 + ) + self.assertRasterFitsInfo(raster=self.output, reference={"min": 1, "max": 1}) + + +if __name__ == "__main__": + test()