From c34e951aef09382104b5fe02e20b235eb4742eb2 Mon Sep 17 00:00:00 2001 From: dnzbk Date: Wed, 25 Oct 2023 09:10:31 +0300 Subject: [PATCH 01/34] Fix: remove usless X86 prefixies in script names on macOS --- osx/build-nzbget.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osx/build-nzbget.sh b/osx/build-nzbget.sh index 83d8e88f..72faa7f4 100644 --- a/osx/build-nzbget.sh +++ b/osx/build-nzbget.sh @@ -115,7 +115,7 @@ Compile_x86_64() --build=x86_64-apple-darwin \ --target=x86_64-apple-darwin \ --with-tlslib=OpenSSL \ - --program-prefix=x86 \ + --program-prefix="" \ CXXFLAGS="-arch x86_64 -I$(pwd)tmp/openssl/x86/include" \ LDFLAGS="-arch x86_64 -L$(pwd)/tmp/openssl/x86" @@ -129,7 +129,7 @@ Compile_arm() --build=arm-apple-darwin \ --target=arm-apple-darwin \ --with-tlslib=OpenSSL \ - --program-prefix=arm \ + --program-prefix="" \ CXXFLAGS="-arch arm64 -I$(pwd)tmp/openssl/arm/include" \ LDFLAGS="-arch arm64 -L$(pwd)/tmp/openssl/arm" @@ -138,7 +138,7 @@ Compile_arm() Make_universal() { - lipo -create ./tmp/arm/bin/armnzbget ./tmp/x86/bin/x86nzbget -output ./tmp/bin/nzbget + lipo -create ./tmp/arm/bin/nzbget ./tmp/x86/bin/nzbget -output ./tmp/bin/nzbget } Build() From 885058f985f98cf225208f61241ae50f1422d903 Mon Sep 17 00:00:00 2001 From: dnzbk <146707790+dnzbk@users.noreply.github.com> Date: Thu, 26 Oct 2023 07:59:11 +0100 Subject: [PATCH 02/34] Bugfix/script shebangs for py3 (#42) * Fix: Windows specific python3 shebang --- scripts/EMail.py | 2 +- scripts/Logger.py | 2 +- windows/build-nzbget-vs22.bat | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/EMail.py b/scripts/EMail.py index 1932efd2..5628f451 100755 --- a/scripts/EMail.py +++ b/scripts/EMail.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # E-Mail post-processing script for NZBGet # diff --git a/scripts/Logger.py b/scripts/Logger.py index 61fb4a65..3c111ab2 100755 --- a/scripts/Logger.py +++ b/scripts/Logger.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Logger post-processing script for NZBGet # diff --git a/windows/build-nzbget-vs22.bat b/windows/build-nzbget-vs22.bat index 0c32f65a..e562367a 100644 --- a/windows/build-nzbget-vs22.bat +++ b/windows/build-nzbget-vs22.bat @@ -230,6 +230,15 @@ mkdir ..\distrib\NZBGet\scripts xcopy /E scripts ..\distrib\NZBGet\scripts if errorlevel 1 goto BUILD_FAILED +rem The default PATH to python changed in most POSIX systems after python2 was deprecated. +rem On Windows, it remained the same. +rem Now we need to add Windows specific shebang (#!/usr/bin/env python) to the scripts. +set "SCRIPTS=..\distrib\NZBGet\scripts\EMail.py ..\distrib\NZBGet\scripts\Logger.py" +for %%F in (%SCRIPTS%) do ( + %SED% -e "s|#!/usr/bin/env python3|#!/usr/bin/env python|" -i %%F +) +if errorlevel 1 goto BUILD_FAILED + copy ..\..\image\* ..\distrib\NZBGet copy ..\..\image\32\* ..\distrib\NZBGet\32 copy ..\..\image\64\* ..\distrib\NZBGet\64 From 1aa42f2df9a9148d3a79e17694381de873557fce Mon Sep 17 00:00:00 2001 From: Denis <146707790+dnzbk@users.noreply.github.com> Date: Wed, 8 Nov 2023 09:39:27 +0000 Subject: [PATCH 03/34] Feature/article read chunk size (#52) * Added ArticleReadChunkSize config option which allows to adjust the buffer size for customization on different platforms, which can lead to increased performance. --- daemon/main/Options.cpp | 3 +++ daemon/main/Options.h | 2 ++ daemon/nntp/ArticleDownloader.cpp | 2 +- nzbget.conf | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/daemon/main/Options.cpp b/daemon/main/Options.cpp index 5fc8c7fc..38870473 100644 --- a/daemon/main/Options.cpp +++ b/daemon/main/Options.cpp @@ -68,6 +68,7 @@ static const char* OPTION_CERTSTORE = "CertStore"; static const char* OPTION_CERTCHECK = "CertCheck"; static const char* OPTION_AUTHORIZEDIP = "AuthorizedIP"; static const char* OPTION_ARTICLETIMEOUT = "ArticleTimeout"; +static const char* OPTION_ARTICLEREADCHUNKSIZE = "ArticleReadChunkSize"; static const char* OPTION_URLTIMEOUT = "UrlTimeout"; static const char* OPTION_REMOTETIMEOUT = "RemoteTimeout"; static const char* OPTION_FLUSHQUEUE = "FlushQueue"; @@ -447,6 +448,7 @@ void Options::InitDefaults() SetOption(OPTION_CERTCHECK, "no"); SetOption(OPTION_AUTHORIZEDIP, ""); SetOption(OPTION_ARTICLETIMEOUT, "60"); + SetOption(OPTION_ARTICLEREADCHUNKSIZE, "4"); SetOption(OPTION_URLTIMEOUT, "60"); SetOption(OPTION_REMOTETIMEOUT, "90"); SetOption(OPTION_FLUSHQUEUE, "yes"); @@ -694,6 +696,7 @@ void Options::InitOptions() m_downloadRate = ParseIntValue(OPTION_DOWNLOADRATE, 10) * 1024; m_articleTimeout = ParseIntValue(OPTION_ARTICLETIMEOUT, 10); + m_articleReadChunkSize = ParseIntValue(OPTION_ARTICLEREADCHUNKSIZE, 10) * 1024; m_urlTimeout = ParseIntValue(OPTION_URLTIMEOUT, 10); m_remoteTimeout = ParseIntValue(OPTION_REMOTETIMEOUT, 10); m_articleRetries = ParseIntValue(OPTION_ARTICLERETRIES, 10); diff --git a/daemon/main/Options.h b/daemon/main/Options.h index ad7fbc21..b59c69cd 100644 --- a/daemon/main/Options.h +++ b/daemon/main/Options.h @@ -210,6 +210,7 @@ class Options EMessageTarget GetDebugTarget() const { return m_debugTarget; } EMessageTarget GetDetailTarget() const { return m_detailTarget; } int GetArticleTimeout() { return m_articleTimeout; } + int GetArticleReadChunkSize() { return m_articleReadChunkSize; } int GetUrlTimeout() { return m_urlTimeout; } int GetRemoteTimeout() { return m_remoteTimeout; } bool GetRawArticle() { return m_rawArticle; }; @@ -345,6 +346,7 @@ class Options bool m_rawArticle = false; bool m_nzbLog = false; int m_articleTimeout = 0; + int m_articleReadChunkSize = 4; int m_urlTimeout = 0; int m_remoteTimeout = 0; bool m_appendCategoryDir = false; diff --git a/daemon/nntp/ArticleDownloader.cpp b/daemon/nntp/ArticleDownloader.cpp index 1efbeaa3..67bd79fa 100644 --- a/daemon/nntp/ArticleDownloader.cpp +++ b/daemon/nntp/ArticleDownloader.cpp @@ -335,7 +335,7 @@ ArticleDownloader::EStatus ArticleDownloader::Download() m_decoder.SetRawMode(g_Options->GetRawArticle()); status = adRunning; - CharBuffer lineBuf(1024*4); + CharBuffer lineBuf(g_Options->GetArticleReadChunkSize()); while (!IsStopped() && !m_decoder.GetEof()) { diff --git a/nzbget.conf b/nzbget.conf index f870420e..3c86a4a3 100644 --- a/nzbget.conf +++ b/nzbget.conf @@ -1004,6 +1004,9 @@ ArticleInterval=10 # Connection timeout for article downloading (seconds). ArticleTimeout=60 +# Chunk size when reading data from the news server (kilobytes). +ArticleReadChunkSize=4 + # Number of download attempts for URL fetching (0-99). # # If fetching of nzb-file via URL or fetching of RSS feed fails another From 55eca4ce57cc119b51acc2e6915f6c0547dd8123 Mon Sep 17 00:00:00 2001 From: Denis <146707790+dnzbk@users.noreply.github.com> Date: Wed, 8 Nov 2023 11:08:22 +0000 Subject: [PATCH 04/34] Add: increased the number of default connections to 8 (#54) --- nzbget.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nzbget.conf b/nzbget.conf index 3c86a4a3..84d75d17 100644 --- a/nzbget.conf +++ b/nzbget.conf @@ -231,7 +231,7 @@ Server1.Encryption=no Server1.Cipher= # Maximum number of simultaneous connections to this server (0-999). -Server1.Connections=4 +Server1.Connections=8 # Server retention time (days). # From 1913e331bb87cdd592048b37fd57507f82a17144 Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Wed, 15 Nov 2023 17:20:08 +0300 Subject: [PATCH 05/34] Docker support (#55) - added docker support for NZBGet - added workflow for build and push to DockerHub and GitHub --- .github/workflows/docker.yml | 82 ++++++++++++++++++++++++ .gitignore | 2 + README.md | 3 + docker/Dockerfile | 73 +++++++++++++++++++++ docker/README.md | 119 +++++++++++++++++++++++++++++++++++ docker/docker-compose.yml | 21 +++++++ docker/entrypoint.sh | 44 +++++++++++++ 7 files changed, 344 insertions(+) create mode 100644 .github/workflows/docker.yml create mode 100644 docker/Dockerfile create mode 100644 docker/README.md create mode 100644 docker/docker-compose.yml create mode 100644 docker/entrypoint.sh diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..149fffed --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,82 @@ +name: docker build + +on: + push: + branches: + - develop + - main + tags: + - v* + +env: + REGISTRY_IMAGE: nzbgetcom/nzbget + +jobs: + build: + runs-on: ubuntu-latest + permissions: + packages: write + + steps: + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Generate image tags + id: gen_tags + run: | + if [[ "$GITHUB_REF_NAME" == "develop" ]]; then + TAG="testing" + fi + if [[ "$GITHUB_REF_NAME" == "main" ]]; then + TAG="latest" + fi + if [[ $GITHUB_REF == 'refs/tags/'* ]]; then + TAG="${GITHUB_REF/refs\/tags\//}" + fi + if [[ "$TAG" == "" ]]; then + TAG="${GITHUB_REF_NAME/\//-}" + fi + TAGS="${{ env.REGISTRY_IMAGE }}:$TAG,ghcr.io/${{ env.REGISTRY_IMAGE }}:$TAG" + echo "tags=$TAGS" >> $GITHUB_OUTPUT + echo "version=$TAG" >> $GITHUB_OUTPUT + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: docker + platforms: linux/amd64,linux/arm64,linux/arm/v7 + provenance: false + push: true + tags: ${{ steps.gen_tags.outputs.tags }} + outputs: "type=image,name=${{ env.REGISTRY_IMAGE }},annotation-index.org.opencontainers.image.description=NZBGet from nzbget.com - version ${{ steps.gen_tags.outputs.version }}" + build-args: | + "NZBGET_RELEASE=${{ github.ref_name }}" + "MAKE_JOBS=2" + + - name: Update Docker Hub Description + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: ${{ env.REGISTRY_IMAGE }} + readme-filepath: ./docker/README.md diff --git a/.gitignore b/.gitignore index 3bd6a5cb..c2921df7 100644 --- a/.gitignore +++ b/.gitignore @@ -73,3 +73,5 @@ code_revision.cpp pytest.ini .cache /.idea +docker/downloads +docker/config diff --git a/README.md b/README.md index 03294e88..14060a27 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![linux build](https://github.com/nzbgetcom/nzbget/actions/workflows/linux.yml/badge.svg?branch=main)](https://github.com/nzbgetcom/nzbget/actions/workflows/linux.yml) [![windows build](https://github.com/nzbgetcom/nzbget/actions/workflows/windows.yml/badge.svg?branch=main)](https://github.com/nzbgetcom/nzbget/actions/workflows/windows.yml) [![osx build](https://github.com/nzbgetcom/nzbget/actions/workflows/osx.yml/badge.svg)](https://github.com/nzbgetcom/nzbget/actions/workflows/osx.yml) +[![docker build](https://github.com/nzbgetcom/nzbget/actions/workflows/docker.yml/badge.svg)](https://github.com/nzbgetcom/nzbget/actions/workflows/docker.yml) ![Contributions welcome](https://img.shields.io/badge/contributions-welcome-blue.svg) @@ -30,6 +31,8 @@ More information available at https://nzbget.com We provide a easy-to-use installer for each platform we support. Please download binaries from our [releases](https://github.com/nzbgetcom/nzbget/tags) page. +We also provide a docker image for popular architectures. [Docker readme](docker/README.md) + ## Building from sources Please follow [instructions](https://nzbget.com/documentation/building-development-version/) on the website diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..d03d0ca2 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,73 @@ +# build stage +FROM alpine:3.18.4 AS build + +# args +ARG NZBGET_RELEASE=develop +ARG UNRAR_VERSION=6.2.12 +ARG MAKE_JOBS=1 + +RUN \ + echo "**** install build packages ****" && \ + apk add g++ gcc git libxml2-dev libxslt-dev make ncurses-dev openssl-dev curl && \ + echo "**** build nzbget ****" && \ + mkdir -p /app/nzbget && \ + git clone https://github.com/nzbgetcom/nzbget.git nzbget && \ + cd nzbget/ && \ + git checkout ${NZBGET_RELEASE} && \ + ./configure bindir='${exec_prefix}' && \ + make -j ${MAKE_JOBS} && \ + make prefix=/app/nzbget install && \ + sed -i \ + -e "s#^MainDir=.*#MainDir=/downloads#g" \ + -e "s#^ScriptDir=.*#ScriptDir=$\{MainDir\}/scripts#g" \ + -e "s#^WebDir=.*#WebDir=$\{AppDir\}/webui#g" \ + -e "s#^ConfigTemplate=.*#ConfigTemplate=$\{AppDir\}/webui/nzbget.conf.template#g" \ + -e "s#^UnrarCmd=.*#UnrarCmd=$\{AppDir\}/unrar#g" \ + -e "s#^SevenZipCmd=.*#SevenZipCmd=$\{AppDir\}/7za#g" \ + -e "s#^CertStore=.*#CertStore=$\{AppDir\}/cacert.pem#g" \ + -e "s#^CertCheck=.*#CertCheck=yes#g" \ + -e "s#^DestDir=.*#DestDir=$\{MainDir\}/completed#g" \ + -e "s#^InterDir=.*#InterDir=$\{MainDir\}/intermediate#g" \ + -e "s#^LogFile=.*#LogFile=$\{MainDir\}/nzbget.log#g" \ + -e "s#^AuthorizedIP=.*#AuthorizedIP=127.0.0.1#g" \ + /app/nzbget/share/nzbget/nzbget.conf && \ + mv /app/nzbget/share/nzbget/webui /app/nzbget/ && \ + cp /app/nzbget/share/nzbget/nzbget.conf /app/nzbget/webui/nzbget.conf.template && \ + ln -s /usr/bin/7za /app/nzbget/7za && \ + ln -s /usr/bin/unrar /app/nzbget/unrar && \ + cp /nzbget/pubkey.pem /app/nzbget/pubkey.pem && \ + curl -o /app/nzbget/cacert.pem -L "https://curl.se/ca/cacert.pem" && \ + echo "**** install unrar from source ****" && \ + mkdir /tmp/unrar && \ + curl -o /tmp/unrar.tar.gz -L "https://www.rarlab.com/rar/unrarsrc-${UNRAR_VERSION}.tar.gz" && \ + tar xf /tmp/unrar.tar.gz -C /tmp/unrar --strip-components=1 && \ + cd /tmp/unrar && \ + make -j ${MAKE_JOBS} && \ + install -v -m755 unrar /usr/bin + +# runtime stage +FROM alpine:3.18.4 +ARG NZBGET_RELEASE=develop + +# labels +LABEL org.opencontainers.image.description="NZBGet from nzbget.com, version ${NZBGET_RELEASE}" +LABEL org.opencontainers.image.source="https://github.com/nzbgetcom/nzbget" +LABEL maintainer="nzbget@nzbget.com" + +ENV TERM linux +RUN \ + echo "**** install packages ****" && \ + apk add --no-cache --update shadow libxml2 libxslt openssl p7zip python3 && \ + ln -sf /usr/bin/python3 /usr/bin/python && \ + echo "**** cleanup ****" && \ + rm -rf /root/.cache /root/.cargo /tmp/* +COPY --from=build /usr/bin/unrar /usr/bin/unrar +COPY --from=build /app/nzbget/ /app/nzbget/ +ADD entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh && \ + echo "**** create non-root user ****" && \ + adduser -G users -D -u 1000 -h /config -s /bin/sh user && \ + mkdir -p /config && \ + mkdir -p /downloads && \ + chown -R user:users /app /config /downloads +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 00000000..de1efd37 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,119 @@ +![NZBGet logo](https://nzbget.com/img/logo.svg) + +# NZBGet builds from [nzbgetcom/nzbget](https://github.com/nzbgetcom/nzbget) repository + +NZBGet is an efficient, open-source Usenet software designed for downloading binary content from Usenet newsgroups. + +# Supported Architectures + +| Architecture +|:- +| x86-64 +| arm64 +| armhf + +# Version Tags + +| Tag | Description +|:-------------|- +| latest | Stable nzbget releases (from `main` repository branch) +| testing | Development nzbget builds (from `develop` repository branch) +| v* | Version-specific release builds (like v22.0 for 22.0 nzbget release) + +# Usage + +[docker-compose](https://docs.docker.com/compose/) (recommended) +``` +--- +version: "2.1" +services: + nzbget: + image: nzbgetcom/nzbget:latest + container_name: nzbget + environment: + - PUID=1000 + - PGID=1000 + - TZ=Europe/London + - NZBGET_USER=nzbget #optional + - NZBGET_PASS=tegbzn6789 #optional + volumes: + - /path/to/config:/config + - /path/to/downloads:/downloads #optional + ports: + - 6789:6789 + restart: unless-stopped +``` + +[docker cli](https://docs.docker.com/engine/reference/commandline/cli/) +``` +docker run -d \ + --name=nzbget \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ=Europe/London \ + -e NZBGET_USER=nzbget `#optional` \ + -e NZBGET_PASS=tegbzn6789 `#optional` \ + -p 6789:6789 \ + -v /path/to/config:/config \ + -v /path/to/downloads:/downloads `#optional` \ + --restart unless-stopped \ + nzbgetcom/nzbget:latest +``` + +# Supported environment variables + +NZBGet container can be configured by passing environment variables to it. This can be done in docker-compose mode by specifying `environment:` and in cli mode by using -e switch. + +| Parameter | Description +|:------------|- +| PUID | UserID (see below) +| PGID | GroupID (see below) +| TZ | Timezone +| NZBGET_USER | User name for web auth +| NZBGET_PASS | Password for web auth + +# User / Group Identifiers + +When using volumes (-v flags) permissions issues can arise between the host OS and the container. To avoid this problem we allow to specify the user PUID and group PGID. + +The example above uses PUID=1000 and PGID=1000. To find the required ids, run `id user`: +``` +$ id user +uid=1000(user) gid=1000(users) groups=1000(users) +``` + +# Building locally + +For development purposes can be used Dockerfile or docker-compose file from official repository (`docker` folder): + +``` +git clone https://github.com/nzbgetcom/nzbget.git +cd docker +docker compose up +-or- +docker build . -t nzbget-local +``` + +Dockerfile supports next build arguments: + +| Argument | Description +|:----------------|- +| NZBGET_RELEASE | Branch name or tag to build from +| UNRAR_VERSION | Unrar version +| MAKE_JOBS | Number of make jobs for speed up build + +# ghcr.io + +Docker images also available on [GitHub](https://github.com/nzbgetcom/nzbget/pkgs/container/nzbget). For use - replace `nzbgetcom/nzbget:TAG` with `ghcr.io/nzbgetcom/nzbget:TAG` in above examples. + +# Python version + +NZBGet docker image bundled with Python 3.11 + +# Troubleshooting max speed issues + +In case a linux image or docker image is slower than expected, here are some tips to increase download speed: + +1. Increase number of server connections (NEWS-SERVERS -> Connections) - default is 8, and 16 and 32 are worth trying +2. For slower machines/hosts - increase article read chunk size from 4 to 64 (CONNECTION -> ArticleReadChunkSize). This is new setting, available only on v22 testing images and planned in v23. + diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 00000000..4a63cc34 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,21 @@ +--- +version: "2.1" +services: + nzbget: + build: + context: . + args: + NZBGET_RELEASE: develop + MAKE_JOBS: 4 + environment: + - PUID=1000 + - PGID=1000 + - TZ=Europe/London + - NZBGET_USER=admin + - NZBGET_PASS=admin + volumes: + - ./config:/config + - ./downloads:/downloads + ports: + - 6789:6789 + restart: unless-stopped diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 00000000..8c143ce1 --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env sh +set -e + +# create downloads if not exist +if [ ! -d /downloads ]; then + mkdir -p /downloads +fi + +# delete lock file if found +if [ -f /downloads/nzbget.lock ]; then + rm /downloads/nzbget.lock +fi + +# create default config if not exist +if [ ! -f /config/nzbget.conf ]; then + cp /app/nzbget/share/nzbget/nzbget.conf /config/nzbget.conf +fi + +# parse env vars to options +OPTIONS="" +if [ ! -z "${NZBGET_USER}" ]; then + OPTIONS="${OPTIONS}-o ControlUsername=${NZBGET_USER} " +fi +if [ ! -z "${NZBGET_PASS}" ]; then + OPTIONS="${OPTIONS}-o ControlPassword=${NZBGET_PASS} " +fi + +# copy default scripts if not exists +mkdir -p /downloads/scripts +for SCRIPT in EMail.py Logger.py; do + if [ ! -f /downloads/scripts/$SCRIPT ]; then + cp /app/nzbget/share/nzbget/scripts/$SCRIPT /downloads/scripts/ + fi +done + +# change userid and groupid +PUID=${PUID:-1000} +PGID=${PGID:-1000} +groupmod -o -g "$PGID" users +usermod -o -u "$PUID" user + +chown -R user:users /config +chown -R user:users /downloads +su -p user -c "/app/nzbget/nzbget -s -c /config/nzbget.conf -o OutputMode=log ${OPTIONS}" From 959985473cdfcf51d88e6a49770650b4edced043 Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Mon, 20 Nov 2023 16:38:30 +0300 Subject: [PATCH 06/34] Add aarch64 for linux build (#61) --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index bdde1152..8f51f817 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -23,7 +23,7 @@ jobs: rm -rf /build/nzbget cp -r . /build/nzbget cd /build - docker run -e ALL_ARCHS="i686 x86_64 armhf armel" -v /build:/build nzbget-build /build/scripts/build-nzbget-ci.sh + docker run -e ALL_ARCHS="i686 x86_64 aarch64 armhf armel" -v /build:/build nzbget-build /build/scripts/build-nzbget-ci.sh - name: Upload build artifacts uses: actions/upload-artifact@v3 From 85645ad0843750050695d0d6f58d7a1675402d90 Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Mon, 20 Nov 2023 16:42:48 +0300 Subject: [PATCH 07/34] Add generate signatures to build workflow (#62) --- .github/workflows/build.yml | 81 +++++++++++++++++++++++++++++++++++ .github/workflows/linux.yml | 5 +-- .github/workflows/osx.yml | 5 +-- .github/workflows/windows.yml | 5 +-- 4 files changed, 84 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..a2005f17 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,81 @@ +name: build + +on: + push: + branches: + - develop + - main + workflow_dispatch: + +jobs: + build-windows: + uses: ./.github/workflows/windows.yml + + build-linux: + uses: ./.github/workflows/linux.yml + + build-osx: + uses: ./.github/workflows/osx.yml + + generate-signatures: + env: + PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} + runs-on: ubuntu-latest + needs: [build-windows, build-linux, build-osx] + steps: + + - name: Download build artifacts + uses: actions/download-artifact@v3 + + - name: Generate signatures + run: | + mkdir -p builds + mv nzbget-windows-installers/* builds + mv nzbget-linux-installers/* builds + mv nzbget-osx-installers/* builds + cd builds + VERSION=$(ls | grep bin-windows-setup | cut -d - -f 2) + SIGS_FILE="nzbget-$VERSION.sig.txt" + + echo "Generating $SIGS_FILE ..." + echo + + echo "nzbget_signatures({" | tee $SIGS_FILE + echo | tee -a $SIGS_FILE + + for FILE in *.exe *.run *.zip; do + [ -f $FILE ] || continue + + MD5=$(openssl dgst -md5 $FILE | cut -d ' ' -f 2) + SHA1=$(openssl dgst -sha1 $FILE | cut -d ' ' -f 2) + SHA256=$(openssl dgst -rsa-sha256 $FILE | cut -d ' ' -f 2) + RSASHA256=$(openssl dgst -rsa-sha256 -sign <(echo "$PRIVATE_KEY") $FILE | hexdump -ve '1/1 "%.2x"') + + echo "\"MD5($FILE)\" : \"$MD5\"," | tee -a $SIGS_FILE + echo "\"SHA1($FILE)\" : \"$SHA1\"," | tee -a $SIGS_FILE + echo "\"SHA256($FILE)\" : \"$SHA256\"," | tee -a $SIGS_FILE + echo "\"RSA-SHA256($FILE)\" : \"$RSASHA256\"," | tee -a $SIGS_FILE + + echo | tee -a $SIGS_FILE + done + + echo "\"\" : \"\"});" | tee -a $SIGS_FILE + + cd .. + echo + echo "Done." + + - name: Upload build artifacts with signatures + uses: actions/upload-artifact@v3 + with: + name: nzbget-installers + path: builds/* + retention-days: 5 + + - name: Delete unneded platform-specific artifacts + uses: geekyeggo/delete-artifact@v2 + with: + name: | + nzbget-windows-installers + nzbget-linux-installers + nzbget-osx-installers diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 8f51f817..261b5ddb 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,10 +1,7 @@ name: linux build on: - push: - branches: - - develop - - main + workflow_call: workflow_dispatch: jobs: diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index 10104686..19f31f1c 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -1,10 +1,7 @@ name: osx build on: - push: - branches: - - develop - - main + workflow_call: workflow_dispatch: jobs: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 0db0e720..2084b420 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,10 +1,7 @@ name: windows build on: - push: - branches: - - develop - - main + workflow_call: workflow_dispatch: jobs: From 73e8c00d29f21a44de8fd3d979e4f74628d99e1e Mon Sep 17 00:00:00 2001 From: Denis <146707790+dnzbk@users.noreply.github.com> Date: Thu, 23 Nov 2023 14:51:30 +0300 Subject: [PATCH 08/34] Feature/unit tests (#64) - fixed unit tests on Windows. We will adapt them for other platforms as well. nntp and postprocessor tests do not pass. We will debug them later. - separated the tests from the application itself - using CMake to configure files for building tests. We will completely switch to CMake later. - deleted obsolete Autotools generated files - updated README --- .github/workflows/windows-tests.yml | 44 + .gitignore | 11 + CMakeLists.txt | 62 + Makefile.am | 31 - Makefile.in | 2245 ----- README | 52 +- aclocal.m4 | 1400 ---- cmake_config.h.in | 5 + code_revision.sh | 53 + config.h.in | 196 - configure | 10089 ----------------------- configure.ac | 20 +- daemon/main/nzbget.cpp | 17 - daemon/main/nzbget.h | 16 +- daemon/util/NString.cpp | 4 +- daemon/util/NString.h | 7 +- docker/Dockerfile | 3 +- lib/CMakeLists.txt | 45 + lib/catch/catch.h | 9427 --------------------- lib/par2/diskfile.cpp | 2 +- lib/par2/par2cmdline.h | 1 - lib/regex/regex.c | 4 +- linux/build-nzbget | 1 + osx/build-nzbget.sh | 1 + posix/ax_cxx_compile_stdcxx.m4 | 575 +- posix/config.guess | 1421 ---- posix/config.sub | 1807 ---- posix/depcomp | 791 -- posix/install-sh | 501 -- posix/missing | 215 - tests/CMakeLists.txt | 8 + tests/feed/CMakeLists.txt | 30 + tests/feed/FeedFilterTest.cpp | 17 +- tests/main/CMakeLists.txt | 34 + tests/main/CommandLineParserTest.cpp | 53 +- tests/main/OptionsTest.cpp | 24 +- tests/main/main.cpp | 2 + tests/nntp/CMakeLists.txt | 38 + tests/nntp/ServerPoolTest.cpp | 286 +- tests/postprocess/CMakeLists.txt | 55 + tests/postprocess/DirectUnpackTest.cpp | 110 +- tests/postprocess/DupeMatcherTest.cpp | 95 +- tests/postprocess/ParCheckerTest.cpp | 74 +- tests/postprocess/ParRenamerTest.cpp | 32 +- tests/postprocess/RarReaderTest.cpp | 238 +- tests/postprocess/main.cpp | 2 + tests/queue/CMakeLists.txt | 33 + tests/queue/NzbFileTest.cpp | 36 +- tests/suite/TestMain.cpp | 71 - tests/suite/TestMain.h | 27 - tests/suite/TestUtil.cpp | 12 +- tests/util/CMakeLists.txt | 32 + tests/util/FileSystemTest.cpp | 20 +- tests/util/NStringTest.cpp | 123 +- tests/util/UtilTest.cpp | 88 +- tests/util/main.cpp | 2 + webui/index.html | 10 +- 57 files changed, 1673 insertions(+), 28925 deletions(-) create mode 100644 .github/workflows/windows-tests.yml create mode 100644 CMakeLists.txt delete mode 100644 Makefile.in delete mode 100644 aclocal.m4 create mode 100644 cmake_config.h.in create mode 100755 code_revision.sh delete mode 100644 config.h.in delete mode 100755 configure create mode 100644 lib/CMakeLists.txt delete mode 100644 lib/catch/catch.h mode change 100644 => 100755 osx/build-nzbget.sh delete mode 100755 posix/config.guess delete mode 100755 posix/config.sub delete mode 100755 posix/depcomp delete mode 100755 posix/install-sh delete mode 100755 posix/missing create mode 100644 tests/CMakeLists.txt create mode 100644 tests/feed/CMakeLists.txt create mode 100644 tests/main/CMakeLists.txt create mode 100644 tests/main/main.cpp create mode 100644 tests/nntp/CMakeLists.txt create mode 100644 tests/postprocess/CMakeLists.txt create mode 100644 tests/postprocess/main.cpp create mode 100644 tests/queue/CMakeLists.txt delete mode 100644 tests/suite/TestMain.cpp delete mode 100644 tests/suite/TestMain.h create mode 100644 tests/util/CMakeLists.txt create mode 100644 tests/util/main.cpp diff --git a/.github/workflows/windows-tests.yml b/.github/workflows/windows-tests.yml new file mode 100644 index 00000000..660da590 --- /dev/null +++ b/.github/workflows/windows-tests.yml @@ -0,0 +1,44 @@ +name: windows tests + +on: + push: + branches: + - feature/* + - develop + - main + workflow_call: + workflow_dispatch: + +jobs: + test: + runs-on: [self-hosted, windows] + + steps: + + - name: Prepare environment + run: | + "C:\Program Files\CMake\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Checkout + uses: actions/checkout@v3 + + - name: Build + run: | + cmake --version + mkdir build + cd build + cmake .. "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static + cmake --build . --config Release -j 2 + + - name: Test + run: | + cd build + ctest -C Release + + - name: Upload test artifacts + uses: actions/upload-artifact@v3 + if: failure() + with: + name: nzbget-windows-test-log + path: build/Testing/Temporary/LastTest.log + retention-days: 5 diff --git a/.gitignore b/.gitignore index c2921df7..16ee1cd9 100644 --- a/.gitignore +++ b/.gitignore @@ -26,10 +26,20 @@ # GNU Autotools .deps/ config.h +config.h.in config.h.in~ +configure +configure~ config.log config.status Makefile +Makefile.in +aclocal.m4 +posix/config.guess +posix/config.sub +posix/depcomp +posix/install-sh +posix/missing stamp-h1 autom4te.cache/ .dirstamp @@ -67,6 +77,7 @@ ipch/ # NZBGet specific nzbget +build code_revision.cpp *.temp *.pyc diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..6cd78396 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,62 @@ +cmake_minimum_required(VERSION 3.22) + +project( + nzbget + VERSION "22.0" + DESCRIPTION "NZBGet is a binary downloader, which downloads files from Usenet" + LANGUAGES C CXX +) + +option(ENABLE_TESTS "Enable tests" ON) + +set(VERSION "22") +set(PACKAGE "nzbget") +add_compile_definitions(HAVE_CONFIG_H=1) + +configure_file( + ${CMAKE_SOURCE_DIR}/cmake_config.h.in + ${CMAKE_BINARY_DIR}/config.h +) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_C_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_C_EXTENSIONS OFF) +set(BUILD_SHARED_LIBS OFF) +set(OPENSSL_USE_STATIC_LIBS ON) +set(ZLIB_USE_STATIC_LIBS ON) +set(Boost_USE_STATIC_LIBS ON) +set(Boost_USE_MULTITHREADED ON) +set(Boost_USE_STATIC_RUNTIME OFF) +set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") + +find_package(OpenSSL REQUIRED) +find_package(ZLIB REQUIRED) + +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Weverything") +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall") +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2 /W4") + set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} winmm.lib /NODEFAULTLIB:msvcrt.lib;libcmt.lib;msvcrtd.lib") +endif() + +include_directories(lib/regex) +include_directories(${CMAKE_BINARY_DIR}) +add_subdirectory(lib) + +if (NOT WIN32) + find_package(LibXml2 REQUIRED) + include_directories(${LIBXML2_INCLUDE_DIR}) + execute_process(COMMAND chmod +x ${CMAKE_SOURCE_DIR}/code_revision.sh) + execute_process(COMMAND ${CMAKE_SOURCE_DIR}/code_revision.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + execute_process(COMMAND mv ${CMAKE_SOURCE_DIR}/code_revision.cpp ${CMAKE_BINARY_DIR}) +endif() + +if(ENABLE_TESTS) + include(CTest) + add_subdirectory(tests) +endif() diff --git a/Makefile.am b/Makefile.am index e325a1fc..7d310435 100644 --- a/Makefile.am +++ b/Makefile.am @@ -250,37 +250,6 @@ AM_CPPFLAGS = \ -I$(srcdir)/lib/par2 \ -I$(srcdir)/lib/yencode -if WITH_TESTS -nzbget_SOURCES += \ - lib/catch/catch.h \ - tests/suite/TestMain.cpp \ - tests/suite/TestMain.h \ - tests/suite/TestUtil.cpp \ - tests/suite/TestUtil.h \ - tests/main/CommandLineParserTest.cpp \ - tests/main/OptionsTest.cpp \ - tests/feed/FeedFilterTest.cpp \ - tests/postprocess/DupeMatcherTest.cpp \ - tests/postprocess/RarRenamerTest.cpp \ - tests/postprocess/RarReaderTest.cpp \ - tests/postprocess/DirectUnpackTest.cpp \ - tests/queue/NzbFileTest.cpp \ - tests/nntp/ServerPoolTest.cpp \ - tests/util/FileSystemTest.cpp \ - tests/util/NStringTest.cpp \ - tests/util/UtilTest.cpp - -if WITH_PAR2 -nzbget_SOURCES += \ - tests/postprocess/ParCheckerTest.cpp \ - tests/postprocess/ParRenamerTest.cpp -endif - -AM_CPPFLAGS += \ - -I$(srcdir)/lib/catch \ - -I$(srcdir)/tests/suite -endif - EXTRA_DIST = \ $(windows_FILES) \ $(osx_FILES) \ diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index 4c9e6760..00000000 --- a/Makefile.in +++ /dev/null @@ -1,2245 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# -# This file is part of nzbget. See . -# -# Copyright (C) 2008-2019 Andrey Prygunkov -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - - - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -bin_PROGRAMS = nzbget$(EXEEXT) -@WITH_PAR2_TRUE@am__append_1 = \ -@WITH_PAR2_TRUE@ lib/par2/commandline.cpp \ -@WITH_PAR2_TRUE@ lib/par2/commandline.h \ -@WITH_PAR2_TRUE@ lib/par2/crc.cpp \ -@WITH_PAR2_TRUE@ lib/par2/crc.h \ -@WITH_PAR2_TRUE@ lib/par2/creatorpacket.cpp \ -@WITH_PAR2_TRUE@ lib/par2/creatorpacket.h \ -@WITH_PAR2_TRUE@ lib/par2/criticalpacket.cpp \ -@WITH_PAR2_TRUE@ lib/par2/criticalpacket.h \ -@WITH_PAR2_TRUE@ lib/par2/datablock.cpp \ -@WITH_PAR2_TRUE@ lib/par2/datablock.h \ -@WITH_PAR2_TRUE@ lib/par2/descriptionpacket.cpp \ -@WITH_PAR2_TRUE@ lib/par2/descriptionpacket.h \ -@WITH_PAR2_TRUE@ lib/par2/diskfile.cpp \ -@WITH_PAR2_TRUE@ lib/par2/diskfile.h \ -@WITH_PAR2_TRUE@ lib/par2/filechecksummer.cpp \ -@WITH_PAR2_TRUE@ lib/par2/filechecksummer.h \ -@WITH_PAR2_TRUE@ lib/par2/galois.cpp \ -@WITH_PAR2_TRUE@ lib/par2/galois.h \ -@WITH_PAR2_TRUE@ lib/par2/letype.h \ -@WITH_PAR2_TRUE@ lib/par2/mainpacket.cpp \ -@WITH_PAR2_TRUE@ lib/par2/mainpacket.h \ -@WITH_PAR2_TRUE@ lib/par2/md5.cpp \ -@WITH_PAR2_TRUE@ lib/par2/md5.h \ -@WITH_PAR2_TRUE@ lib/par2/par2cmdline.h \ -@WITH_PAR2_TRUE@ lib/par2/par2fileformat.cpp \ -@WITH_PAR2_TRUE@ lib/par2/par2fileformat.h \ -@WITH_PAR2_TRUE@ lib/par2/par2repairer.cpp \ -@WITH_PAR2_TRUE@ lib/par2/par2repairer.h \ -@WITH_PAR2_TRUE@ lib/par2/par2repairersourcefile.cpp \ -@WITH_PAR2_TRUE@ lib/par2/par2repairersourcefile.h \ -@WITH_PAR2_TRUE@ lib/par2/parheaders.cpp \ -@WITH_PAR2_TRUE@ lib/par2/parheaders.h \ -@WITH_PAR2_TRUE@ lib/par2/recoverypacket.cpp \ -@WITH_PAR2_TRUE@ lib/par2/recoverypacket.h \ -@WITH_PAR2_TRUE@ lib/par2/reedsolomon.cpp \ -@WITH_PAR2_TRUE@ lib/par2/reedsolomon.h \ -@WITH_PAR2_TRUE@ lib/par2/verificationhashtable.cpp \ -@WITH_PAR2_TRUE@ lib/par2/verificationhashtable.h \ -@WITH_PAR2_TRUE@ lib/par2/verificationpacket.cpp \ -@WITH_PAR2_TRUE@ lib/par2/verificationpacket.h - -@WITH_TESTS_TRUE@am__append_2 = \ -@WITH_TESTS_TRUE@ lib/catch/catch.h \ -@WITH_TESTS_TRUE@ tests/suite/TestMain.cpp \ -@WITH_TESTS_TRUE@ tests/suite/TestMain.h \ -@WITH_TESTS_TRUE@ tests/suite/TestUtil.cpp \ -@WITH_TESTS_TRUE@ tests/suite/TestUtil.h \ -@WITH_TESTS_TRUE@ tests/main/CommandLineParserTest.cpp \ -@WITH_TESTS_TRUE@ tests/main/OptionsTest.cpp \ -@WITH_TESTS_TRUE@ tests/feed/FeedFilterTest.cpp \ -@WITH_TESTS_TRUE@ tests/postprocess/DupeMatcherTest.cpp \ -@WITH_TESTS_TRUE@ tests/postprocess/RarRenamerTest.cpp \ -@WITH_TESTS_TRUE@ tests/postprocess/RarReaderTest.cpp \ -@WITH_TESTS_TRUE@ tests/postprocess/DirectUnpackTest.cpp \ -@WITH_TESTS_TRUE@ tests/queue/NzbFileTest.cpp \ -@WITH_TESTS_TRUE@ tests/nntp/ServerPoolTest.cpp \ -@WITH_TESTS_TRUE@ tests/util/FileSystemTest.cpp \ -@WITH_TESTS_TRUE@ tests/util/NStringTest.cpp \ -@WITH_TESTS_TRUE@ tests/util/UtilTest.cpp - -@WITH_PAR2_TRUE@@WITH_TESTS_TRUE@am__append_3 = \ -@WITH_PAR2_TRUE@@WITH_TESTS_TRUE@ tests/postprocess/ParCheckerTest.cpp \ -@WITH_PAR2_TRUE@@WITH_TESTS_TRUE@ tests/postprocess/ParRenamerTest.cpp - -@WITH_TESTS_TRUE@am__append_4 = \ -@WITH_TESTS_TRUE@ -I$(srcdir)/lib/catch \ -@WITH_TESTS_TRUE@ -I$(srcdir)/tests/suite - -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/posix/ax_cxx_compile_stdcxx.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(nobase_dist_scripts_SCRIPTS) \ - $(dist_doc_DATA) $(dist_exampleconf_DATA) \ - $(nobase_dist_webui_DATA) $(am__DIST_COMMON) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(scriptsdir)" \ - "$(DESTDIR)$(docdir)" "$(DESTDIR)$(exampleconfdir)" \ - "$(DESTDIR)$(webuidir)" -PROGRAMS = $(bin_PROGRAMS) -am__nzbget_SOURCES_DIST = daemon/connect/Connection.cpp \ - daemon/connect/Connection.h daemon/connect/TlsSocket.cpp \ - daemon/connect/TlsSocket.h daemon/connect/WebDownloader.cpp \ - daemon/connect/WebDownloader.h daemon/extension/FeedScript.cpp \ - daemon/extension/FeedScript.h \ - daemon/extension/CommandScript.cpp \ - daemon/extension/CommandScript.h \ - daemon/extension/NzbScript.cpp daemon/extension/NzbScript.h \ - daemon/extension/PostScript.cpp daemon/extension/PostScript.h \ - daemon/extension/QueueScript.cpp \ - daemon/extension/QueueScript.h daemon/extension/ScanScript.cpp \ - daemon/extension/ScanScript.h \ - daemon/extension/SchedulerScript.cpp \ - daemon/extension/SchedulerScript.h \ - daemon/extension/ScriptConfig.cpp \ - daemon/extension/ScriptConfig.h \ - daemon/feed/FeedCoordinator.cpp daemon/feed/FeedCoordinator.h \ - daemon/feed/FeedFile.cpp daemon/feed/FeedFile.h \ - daemon/feed/FeedFilter.cpp daemon/feed/FeedFilter.h \ - daemon/feed/FeedInfo.cpp daemon/feed/FeedInfo.h \ - daemon/frontend/ColoredFrontend.cpp \ - daemon/frontend/ColoredFrontend.h daemon/frontend/Frontend.cpp \ - daemon/frontend/Frontend.h \ - daemon/frontend/LoggableFrontend.cpp \ - daemon/frontend/LoggableFrontend.h \ - daemon/frontend/NCursesFrontend.cpp \ - daemon/frontend/NCursesFrontend.h \ - daemon/main/CommandLineParser.cpp \ - daemon/main/CommandLineParser.h daemon/main/DiskService.cpp \ - daemon/main/DiskService.h daemon/main/Maintenance.cpp \ - daemon/main/Maintenance.h daemon/main/nzbget.cpp \ - daemon/main/nzbget.h daemon/main/Options.cpp \ - daemon/main/Options.h daemon/main/WorkState.cpp \ - daemon/main/WorkState.h daemon/main/Scheduler.cpp \ - daemon/main/Scheduler.h daemon/main/StackTrace.cpp \ - daemon/main/StackTrace.h daemon/nntp/ArticleDownloader.cpp \ - daemon/nntp/ArticleDownloader.h daemon/nntp/ArticleWriter.cpp \ - daemon/nntp/ArticleWriter.h daemon/nntp/Decoder.cpp \ - daemon/nntp/Decoder.h daemon/nntp/NewsServer.cpp \ - daemon/nntp/NewsServer.h daemon/nntp/NntpConnection.cpp \ - daemon/nntp/NntpConnection.h daemon/nntp/ServerPool.cpp \ - daemon/nntp/ServerPool.h daemon/nntp/StatMeter.cpp \ - daemon/nntp/StatMeter.h daemon/postprocess/Cleanup.cpp \ - daemon/postprocess/Cleanup.h \ - daemon/postprocess/DupeMatcher.cpp \ - daemon/postprocess/DupeMatcher.h \ - daemon/postprocess/ParChecker.cpp \ - daemon/postprocess/ParChecker.h \ - daemon/postprocess/ParParser.cpp \ - daemon/postprocess/ParParser.h \ - daemon/postprocess/ParRenamer.cpp \ - daemon/postprocess/ParRenamer.h \ - daemon/postprocess/PrePostProcessor.cpp \ - daemon/postprocess/PrePostProcessor.h \ - daemon/postprocess/RarRenamer.cpp \ - daemon/postprocess/RarRenamer.h \ - daemon/postprocess/RarReader.cpp \ - daemon/postprocess/RarReader.h daemon/postprocess/Rename.cpp \ - daemon/postprocess/Rename.h daemon/postprocess/Repair.cpp \ - daemon/postprocess/Repair.h daemon/postprocess/Unpack.cpp \ - daemon/postprocess/Unpack.h \ - daemon/postprocess/DirectUnpack.cpp \ - daemon/postprocess/DirectUnpack.h \ - daemon/queue/DirectRenamer.cpp daemon/queue/DirectRenamer.h \ - daemon/queue/DiskState.cpp daemon/queue/DiskState.h \ - daemon/queue/DownloadInfo.cpp daemon/queue/DownloadInfo.h \ - daemon/queue/DupeCoordinator.cpp \ - daemon/queue/DupeCoordinator.h \ - daemon/queue/HistoryCoordinator.cpp \ - daemon/queue/HistoryCoordinator.h daemon/queue/NzbFile.cpp \ - daemon/queue/NzbFile.h daemon/queue/QueueCoordinator.cpp \ - daemon/queue/QueueCoordinator.h daemon/queue/QueueEditor.cpp \ - daemon/queue/QueueEditor.h daemon/queue/Scanner.cpp \ - daemon/queue/Scanner.h daemon/queue/UrlCoordinator.cpp \ - daemon/queue/UrlCoordinator.h daemon/remote/BinRpc.cpp \ - daemon/remote/BinRpc.h daemon/remote/MessageBase.h \ - daemon/remote/RemoteClient.cpp daemon/remote/RemoteClient.h \ - daemon/remote/RemoteServer.cpp daemon/remote/RemoteServer.h \ - daemon/remote/WebServer.cpp daemon/remote/WebServer.h \ - daemon/remote/XmlRpc.cpp daemon/remote/XmlRpc.h \ - daemon/util/Log.cpp daemon/util/Log.h daemon/util/NString.cpp \ - daemon/util/NString.h daemon/util/Container.h \ - daemon/util/Observer.cpp daemon/util/Observer.h \ - daemon/util/Script.cpp daemon/util/Script.h \ - daemon/util/Thread.cpp daemon/util/Thread.h \ - daemon/util/Service.cpp daemon/util/Service.h \ - daemon/util/FileSystem.cpp daemon/util/FileSystem.h \ - daemon/util/Util.cpp daemon/util/Util.h \ - daemon/nserv/NServMain.h daemon/nserv/NServMain.cpp \ - daemon/nserv/NServFrontend.h daemon/nserv/NServFrontend.cpp \ - daemon/nserv/NntpServer.h daemon/nserv/NntpServer.cpp \ - daemon/nserv/NzbGenerator.h daemon/nserv/NzbGenerator.cpp \ - daemon/nserv/YEncoder.h daemon/nserv/YEncoder.cpp \ - code_revision.cpp lib/par2/commandline.cpp \ - lib/par2/commandline.h lib/par2/crc.cpp lib/par2/crc.h \ - lib/par2/creatorpacket.cpp lib/par2/creatorpacket.h \ - lib/par2/criticalpacket.cpp lib/par2/criticalpacket.h \ - lib/par2/datablock.cpp lib/par2/datablock.h \ - lib/par2/descriptionpacket.cpp lib/par2/descriptionpacket.h \ - lib/par2/diskfile.cpp lib/par2/diskfile.h \ - lib/par2/filechecksummer.cpp lib/par2/filechecksummer.h \ - lib/par2/galois.cpp lib/par2/galois.h lib/par2/letype.h \ - lib/par2/mainpacket.cpp lib/par2/mainpacket.h lib/par2/md5.cpp \ - lib/par2/md5.h lib/par2/par2cmdline.h \ - lib/par2/par2fileformat.cpp lib/par2/par2fileformat.h \ - lib/par2/par2repairer.cpp lib/par2/par2repairer.h \ - lib/par2/par2repairersourcefile.cpp \ - lib/par2/par2repairersourcefile.h lib/par2/parheaders.cpp \ - lib/par2/parheaders.h lib/par2/recoverypacket.cpp \ - lib/par2/recoverypacket.h lib/par2/reedsolomon.cpp \ - lib/par2/reedsolomon.h lib/par2/verificationhashtable.cpp \ - lib/par2/verificationhashtable.h \ - lib/par2/verificationpacket.cpp lib/par2/verificationpacket.h \ - lib/yencode/YEncode.h lib/yencode/SimdInit.cpp \ - lib/yencode/SimdDecoder.cpp lib/yencode/ScalarDecoder.cpp \ - lib/yencode/Sse2Decoder.cpp lib/yencode/Ssse3Decoder.cpp \ - lib/yencode/PclmulCrc.cpp lib/yencode/NeonDecoder.cpp \ - lib/yencode/AcleCrc.cpp lib/yencode/SliceCrc.cpp \ - lib/catch/catch.h tests/suite/TestMain.cpp \ - tests/suite/TestMain.h tests/suite/TestUtil.cpp \ - tests/suite/TestUtil.h tests/main/CommandLineParserTest.cpp \ - tests/main/OptionsTest.cpp tests/feed/FeedFilterTest.cpp \ - tests/postprocess/DupeMatcherTest.cpp \ - tests/postprocess/RarRenamerTest.cpp \ - tests/postprocess/RarReaderTest.cpp \ - tests/postprocess/DirectUnpackTest.cpp \ - tests/queue/NzbFileTest.cpp tests/nntp/ServerPoolTest.cpp \ - tests/util/FileSystemTest.cpp tests/util/NStringTest.cpp \ - tests/util/UtilTest.cpp tests/postprocess/ParCheckerTest.cpp \ - tests/postprocess/ParRenamerTest.cpp -am__dirstamp = $(am__leading_dot)dirstamp -@WITH_PAR2_TRUE@am__objects_1 = lib/par2/commandline.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/crc.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/creatorpacket.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/criticalpacket.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/datablock.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/descriptionpacket.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/diskfile.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/filechecksummer.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/galois.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/mainpacket.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/md5.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/par2fileformat.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/par2repairer.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/par2repairersourcefile.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/parheaders.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/recoverypacket.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/reedsolomon.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/verificationhashtable.$(OBJEXT) \ -@WITH_PAR2_TRUE@ lib/par2/verificationpacket.$(OBJEXT) -@WITH_TESTS_TRUE@am__objects_2 = tests/suite/TestMain.$(OBJEXT) \ -@WITH_TESTS_TRUE@ tests/suite/TestUtil.$(OBJEXT) \ -@WITH_TESTS_TRUE@ tests/main/CommandLineParserTest.$(OBJEXT) \ -@WITH_TESTS_TRUE@ tests/main/OptionsTest.$(OBJEXT) \ -@WITH_TESTS_TRUE@ tests/feed/FeedFilterTest.$(OBJEXT) \ -@WITH_TESTS_TRUE@ tests/postprocess/DupeMatcherTest.$(OBJEXT) \ -@WITH_TESTS_TRUE@ tests/postprocess/RarRenamerTest.$(OBJEXT) \ -@WITH_TESTS_TRUE@ tests/postprocess/RarReaderTest.$(OBJEXT) \ -@WITH_TESTS_TRUE@ tests/postprocess/DirectUnpackTest.$(OBJEXT) \ -@WITH_TESTS_TRUE@ tests/queue/NzbFileTest.$(OBJEXT) \ -@WITH_TESTS_TRUE@ tests/nntp/ServerPoolTest.$(OBJEXT) \ -@WITH_TESTS_TRUE@ tests/util/FileSystemTest.$(OBJEXT) \ -@WITH_TESTS_TRUE@ tests/util/NStringTest.$(OBJEXT) \ -@WITH_TESTS_TRUE@ tests/util/UtilTest.$(OBJEXT) -@WITH_PAR2_TRUE@@WITH_TESTS_TRUE@am__objects_3 = tests/postprocess/ParCheckerTest.$(OBJEXT) \ -@WITH_PAR2_TRUE@@WITH_TESTS_TRUE@ tests/postprocess/ParRenamerTest.$(OBJEXT) -am_nzbget_OBJECTS = daemon/connect/Connection.$(OBJEXT) \ - daemon/connect/TlsSocket.$(OBJEXT) \ - daemon/connect/WebDownloader.$(OBJEXT) \ - daemon/extension/FeedScript.$(OBJEXT) \ - daemon/extension/CommandScript.$(OBJEXT) \ - daemon/extension/NzbScript.$(OBJEXT) \ - daemon/extension/PostScript.$(OBJEXT) \ - daemon/extension/QueueScript.$(OBJEXT) \ - daemon/extension/ScanScript.$(OBJEXT) \ - daemon/extension/SchedulerScript.$(OBJEXT) \ - daemon/extension/ScriptConfig.$(OBJEXT) \ - daemon/feed/FeedCoordinator.$(OBJEXT) \ - daemon/feed/FeedFile.$(OBJEXT) \ - daemon/feed/FeedFilter.$(OBJEXT) \ - daemon/feed/FeedInfo.$(OBJEXT) \ - daemon/frontend/ColoredFrontend.$(OBJEXT) \ - daemon/frontend/Frontend.$(OBJEXT) \ - daemon/frontend/LoggableFrontend.$(OBJEXT) \ - daemon/frontend/NCursesFrontend.$(OBJEXT) \ - daemon/main/CommandLineParser.$(OBJEXT) \ - daemon/main/DiskService.$(OBJEXT) \ - daemon/main/Maintenance.$(OBJEXT) daemon/main/nzbget.$(OBJEXT) \ - daemon/main/Options.$(OBJEXT) daemon/main/WorkState.$(OBJEXT) \ - daemon/main/Scheduler.$(OBJEXT) \ - daemon/main/StackTrace.$(OBJEXT) \ - daemon/nntp/ArticleDownloader.$(OBJEXT) \ - daemon/nntp/ArticleWriter.$(OBJEXT) \ - daemon/nntp/Decoder.$(OBJEXT) daemon/nntp/NewsServer.$(OBJEXT) \ - daemon/nntp/NntpConnection.$(OBJEXT) \ - daemon/nntp/ServerPool.$(OBJEXT) \ - daemon/nntp/StatMeter.$(OBJEXT) \ - daemon/postprocess/Cleanup.$(OBJEXT) \ - daemon/postprocess/DupeMatcher.$(OBJEXT) \ - daemon/postprocess/ParChecker.$(OBJEXT) \ - daemon/postprocess/ParParser.$(OBJEXT) \ - daemon/postprocess/ParRenamer.$(OBJEXT) \ - daemon/postprocess/PrePostProcessor.$(OBJEXT) \ - daemon/postprocess/RarRenamer.$(OBJEXT) \ - daemon/postprocess/RarReader.$(OBJEXT) \ - daemon/postprocess/Rename.$(OBJEXT) \ - daemon/postprocess/Repair.$(OBJEXT) \ - daemon/postprocess/Unpack.$(OBJEXT) \ - daemon/postprocess/DirectUnpack.$(OBJEXT) \ - daemon/queue/DirectRenamer.$(OBJEXT) \ - daemon/queue/DiskState.$(OBJEXT) \ - daemon/queue/DownloadInfo.$(OBJEXT) \ - daemon/queue/DupeCoordinator.$(OBJEXT) \ - daemon/queue/HistoryCoordinator.$(OBJEXT) \ - daemon/queue/NzbFile.$(OBJEXT) \ - daemon/queue/QueueCoordinator.$(OBJEXT) \ - daemon/queue/QueueEditor.$(OBJEXT) \ - daemon/queue/Scanner.$(OBJEXT) \ - daemon/queue/UrlCoordinator.$(OBJEXT) \ - daemon/remote/BinRpc.$(OBJEXT) \ - daemon/remote/RemoteClient.$(OBJEXT) \ - daemon/remote/RemoteServer.$(OBJEXT) \ - daemon/remote/WebServer.$(OBJEXT) \ - daemon/remote/XmlRpc.$(OBJEXT) daemon/util/Log.$(OBJEXT) \ - daemon/util/NString.$(OBJEXT) daemon/util/Observer.$(OBJEXT) \ - daemon/util/Script.$(OBJEXT) daemon/util/Thread.$(OBJEXT) \ - daemon/util/Service.$(OBJEXT) daemon/util/FileSystem.$(OBJEXT) \ - daemon/util/Util.$(OBJEXT) daemon/nserv/NServMain.$(OBJEXT) \ - daemon/nserv/NServFrontend.$(OBJEXT) \ - daemon/nserv/NntpServer.$(OBJEXT) \ - daemon/nserv/NzbGenerator.$(OBJEXT) \ - daemon/nserv/YEncoder.$(OBJEXT) code_revision.$(OBJEXT) \ - $(am__objects_1) lib/yencode/SimdInit.$(OBJEXT) \ - lib/yencode/SimdDecoder.$(OBJEXT) \ - lib/yencode/ScalarDecoder.$(OBJEXT) \ - lib/yencode/Sse2Decoder.$(OBJEXT) \ - lib/yencode/Ssse3Decoder.$(OBJEXT) \ - lib/yencode/PclmulCrc.$(OBJEXT) \ - lib/yencode/NeonDecoder.$(OBJEXT) \ - lib/yencode/AcleCrc.$(OBJEXT) lib/yencode/SliceCrc.$(OBJEXT) \ - $(am__objects_2) $(am__objects_3) -nzbget_OBJECTS = $(am_nzbget_OBJECTS) -nzbget_LDADD = $(LDADD) -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -SCRIPTS = $(nobase_dist_scripts_SCRIPTS) -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/posix/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -AM_V_CXX = $(am__v_CXX_@AM_V@) -am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) -am__v_CXX_0 = @echo " CXX " $@; -am__v_CXX_1 = -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) -am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) -am__v_CXXLD_0 = @echo " CXXLD " $@; -am__v_CXXLD_1 = -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(nzbget_SOURCES) -DIST_SOURCES = $(am__nzbget_SOURCES_DIST) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -DATA = $(dist_doc_DATA) $(dist_exampleconf_DATA) \ - $(nobase_dist_webui_DATA) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)config.h.in -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope -AM_RECURSIVE_TARGETS = cscope -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/posix/config.guess \ - $(top_srcdir)/posix/config.sub $(top_srcdir)/posix/depcomp \ - $(top_srcdir)/posix/install-sh $(top_srcdir)/posix/missing \ - COPYING ChangeLog README posix/config.guess posix/config.sub \ - posix/depcomp posix/install-sh posix/missing -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__post_remove_distdir = $(am__remove_distdir) -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -DIST_TARGETS = dist-gzip -distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -ACLECRC_CXXFLAGS = @ACLECRC_CXXFLAGS@ -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -GREP = @GREP@ -HAVE_CXX14 = @HAVE_CXX14@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKE = @MAKE@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -NEON_CXXFLAGS = @NEON_CXXFLAGS@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PCLMUL_CXXFLAGS = @PCLMUL_CXXFLAGS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SSE2_CXXFLAGS = @SSE2_CXXFLAGS@ -SSSE3_CXXFLAGS = @SSSE3_CXXFLAGS@ -STRIP = @STRIP@ -TAR = @TAR@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CXX = @ac_ct_CXX@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -gnutls_CFLAGS = @gnutls_CFLAGS@ -gnutls_LIBS = @gnutls_LIBS@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -libxml2_CFLAGS = @libxml2_CFLAGS@ -libxml2_LIBS = @libxml2_LIBS@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -ncurses_CFLAGS = @ncurses_CFLAGS@ -ncurses_LIBS = @ncurses_LIBS@ -nettle_CFLAGS = @nettle_CFLAGS@ -nettle_LIBS = @nettle_LIBS@ -oldincludedir = @oldincludedir@ -openssl_CFLAGS = @openssl_CFLAGS@ -openssl_LIBS = @openssl_LIBS@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -zlib_CFLAGS = @zlib_CFLAGS@ -zlib_LIBS = @zlib_LIBS@ - -# Simd decoder and Crc32 -nzbget_SOURCES = daemon/connect/Connection.cpp \ - daemon/connect/Connection.h daemon/connect/TlsSocket.cpp \ - daemon/connect/TlsSocket.h daemon/connect/WebDownloader.cpp \ - daemon/connect/WebDownloader.h daemon/extension/FeedScript.cpp \ - daemon/extension/FeedScript.h \ - daemon/extension/CommandScript.cpp \ - daemon/extension/CommandScript.h \ - daemon/extension/NzbScript.cpp daemon/extension/NzbScript.h \ - daemon/extension/PostScript.cpp daemon/extension/PostScript.h \ - daemon/extension/QueueScript.cpp \ - daemon/extension/QueueScript.h daemon/extension/ScanScript.cpp \ - daemon/extension/ScanScript.h \ - daemon/extension/SchedulerScript.cpp \ - daemon/extension/SchedulerScript.h \ - daemon/extension/ScriptConfig.cpp \ - daemon/extension/ScriptConfig.h \ - daemon/feed/FeedCoordinator.cpp daemon/feed/FeedCoordinator.h \ - daemon/feed/FeedFile.cpp daemon/feed/FeedFile.h \ - daemon/feed/FeedFilter.cpp daemon/feed/FeedFilter.h \ - daemon/feed/FeedInfo.cpp daemon/feed/FeedInfo.h \ - daemon/frontend/ColoredFrontend.cpp \ - daemon/frontend/ColoredFrontend.h daemon/frontend/Frontend.cpp \ - daemon/frontend/Frontend.h \ - daemon/frontend/LoggableFrontend.cpp \ - daemon/frontend/LoggableFrontend.h \ - daemon/frontend/NCursesFrontend.cpp \ - daemon/frontend/NCursesFrontend.h \ - daemon/main/CommandLineParser.cpp \ - daemon/main/CommandLineParser.h daemon/main/DiskService.cpp \ - daemon/main/DiskService.h daemon/main/Maintenance.cpp \ - daemon/main/Maintenance.h daemon/main/nzbget.cpp \ - daemon/main/nzbget.h daemon/main/Options.cpp \ - daemon/main/Options.h daemon/main/WorkState.cpp \ - daemon/main/WorkState.h daemon/main/Scheduler.cpp \ - daemon/main/Scheduler.h daemon/main/StackTrace.cpp \ - daemon/main/StackTrace.h daemon/nntp/ArticleDownloader.cpp \ - daemon/nntp/ArticleDownloader.h daemon/nntp/ArticleWriter.cpp \ - daemon/nntp/ArticleWriter.h daemon/nntp/Decoder.cpp \ - daemon/nntp/Decoder.h daemon/nntp/NewsServer.cpp \ - daemon/nntp/NewsServer.h daemon/nntp/NntpConnection.cpp \ - daemon/nntp/NntpConnection.h daemon/nntp/ServerPool.cpp \ - daemon/nntp/ServerPool.h daemon/nntp/StatMeter.cpp \ - daemon/nntp/StatMeter.h daemon/postprocess/Cleanup.cpp \ - daemon/postprocess/Cleanup.h \ - daemon/postprocess/DupeMatcher.cpp \ - daemon/postprocess/DupeMatcher.h \ - daemon/postprocess/ParChecker.cpp \ - daemon/postprocess/ParChecker.h \ - daemon/postprocess/ParParser.cpp \ - daemon/postprocess/ParParser.h \ - daemon/postprocess/ParRenamer.cpp \ - daemon/postprocess/ParRenamer.h \ - daemon/postprocess/PrePostProcessor.cpp \ - daemon/postprocess/PrePostProcessor.h \ - daemon/postprocess/RarRenamer.cpp \ - daemon/postprocess/RarRenamer.h \ - daemon/postprocess/RarReader.cpp \ - daemon/postprocess/RarReader.h daemon/postprocess/Rename.cpp \ - daemon/postprocess/Rename.h daemon/postprocess/Repair.cpp \ - daemon/postprocess/Repair.h daemon/postprocess/Unpack.cpp \ - daemon/postprocess/Unpack.h \ - daemon/postprocess/DirectUnpack.cpp \ - daemon/postprocess/DirectUnpack.h \ - daemon/queue/DirectRenamer.cpp daemon/queue/DirectRenamer.h \ - daemon/queue/DiskState.cpp daemon/queue/DiskState.h \ - daemon/queue/DownloadInfo.cpp daemon/queue/DownloadInfo.h \ - daemon/queue/DupeCoordinator.cpp \ - daemon/queue/DupeCoordinator.h \ - daemon/queue/HistoryCoordinator.cpp \ - daemon/queue/HistoryCoordinator.h daemon/queue/NzbFile.cpp \ - daemon/queue/NzbFile.h daemon/queue/QueueCoordinator.cpp \ - daemon/queue/QueueCoordinator.h daemon/queue/QueueEditor.cpp \ - daemon/queue/QueueEditor.h daemon/queue/Scanner.cpp \ - daemon/queue/Scanner.h daemon/queue/UrlCoordinator.cpp \ - daemon/queue/UrlCoordinator.h daemon/remote/BinRpc.cpp \ - daemon/remote/BinRpc.h daemon/remote/MessageBase.h \ - daemon/remote/RemoteClient.cpp daemon/remote/RemoteClient.h \ - daemon/remote/RemoteServer.cpp daemon/remote/RemoteServer.h \ - daemon/remote/WebServer.cpp daemon/remote/WebServer.h \ - daemon/remote/XmlRpc.cpp daemon/remote/XmlRpc.h \ - daemon/util/Log.cpp daemon/util/Log.h daemon/util/NString.cpp \ - daemon/util/NString.h daemon/util/Container.h \ - daemon/util/Observer.cpp daemon/util/Observer.h \ - daemon/util/Script.cpp daemon/util/Script.h \ - daemon/util/Thread.cpp daemon/util/Thread.h \ - daemon/util/Service.cpp daemon/util/Service.h \ - daemon/util/FileSystem.cpp daemon/util/FileSystem.h \ - daemon/util/Util.cpp daemon/util/Util.h \ - daemon/nserv/NServMain.h daemon/nserv/NServMain.cpp \ - daemon/nserv/NServFrontend.h daemon/nserv/NServFrontend.cpp \ - daemon/nserv/NntpServer.h daemon/nserv/NntpServer.cpp \ - daemon/nserv/NzbGenerator.h daemon/nserv/NzbGenerator.cpp \ - daemon/nserv/YEncoder.h daemon/nserv/YEncoder.cpp \ - code_revision.cpp $(am__append_1) lib/yencode/YEncode.h \ - lib/yencode/SimdInit.cpp lib/yencode/SimdDecoder.cpp \ - lib/yencode/ScalarDecoder.cpp lib/yencode/Sse2Decoder.cpp \ - lib/yencode/Ssse3Decoder.cpp lib/yencode/PclmulCrc.cpp \ - lib/yencode/NeonDecoder.cpp lib/yencode/AcleCrc.cpp \ - lib/yencode/SliceCrc.cpp $(am__append_2) $(am__append_3) -AM_CPPFLAGS = -I$(srcdir)/daemon/connect -I$(srcdir)/daemon/extension \ - -I$(srcdir)/daemon/feed -I$(srcdir)/daemon/frontend \ - -I$(srcdir)/daemon/main -I$(srcdir)/daemon/nntp \ - -I$(srcdir)/daemon/postprocess -I$(srcdir)/daemon/queue \ - -I$(srcdir)/daemon/remote -I$(srcdir)/daemon/util \ - -I$(srcdir)/daemon/nserv -I$(srcdir)/lib/par2 \ - -I$(srcdir)/lib/yencode $(am__append_4) -EXTRA_DIST = \ - $(windows_FILES) \ - $(osx_FILES) \ - $(linux_FILES) \ - $(testdata_FILES) \ - $(par2doc_FILES) - -windows_FILES = \ - daemon/windows/StdAfx.cpp \ - daemon/windows/WinService.cpp \ - daemon/windows/WinService.h \ - daemon/windows/WinConsole.cpp \ - daemon/windows/WinConsole.h \ - nzbget.vcxproj \ - windows/nzbget-command-shell.bat \ - windows/install-update.bat \ - windows/README-WINDOWS.txt \ - windows/package-info.json \ - windows/resources/mainicon.ico \ - windows/resources/nzbget.rc \ - windows/resources/resource.h \ - windows/resources/trayicon_idle.ico \ - windows/resources/trayicon_paused.ico \ - windows/resources/trayicon_working.ico \ - windows/resources/install.bmp \ - windows/resources/uninstall.bmp \ - windows/nzbget-setup.nsi - -osx_FILES = \ - osx/App_Prefix.pch \ - osx/NZBGet-Info.plist \ - osx/DaemonController.h \ - osx/DaemonController.m \ - osx/MainApp.h \ - osx/MainApp.m \ - osx/MainApp.xib \ - osx/PFMoveApplication.h \ - osx/PFMoveApplication.m \ - osx/PreferencesDialog.h \ - osx/PreferencesDialog.m \ - osx/PreferencesDialog.xib \ - osx/RPC.h \ - osx/RPC.m \ - osx/WebClient.h \ - osx/WebClient.m \ - osx/WelcomeDialog.h \ - osx/WelcomeDialog.m \ - osx/WelcomeDialog.xib \ - osx/NZBGet.xcodeproj/project.pbxproj \ - osx/Resources/Images/mainicon.icns \ - osx/Resources/Images/statusicon.png \ - osx/Resources/Images/statusicon@2x.png \ - osx/Resources/licenses/license-bootstrap.txt \ - osx/Resources/licenses/license-jquery-GPL.txt \ - osx/Resources/licenses/license-jquery-MIT.txt \ - osx/Resources/Credits.rtf \ - osx/Resources/Localizable.strings \ - osx/Resources/Welcome.rtf - -linux_FILES = \ - linux/installer.sh \ - linux/install-update.sh \ - linux/package-info.json \ - linux/build-info.txt \ - linux/build-nzbget \ - linux/build-unpack \ - linux/build-toolchain-android \ - linux/build-toolchain-freebsd - -doc_FILES = \ - README \ - ChangeLog \ - COPYING - -par2doc_FILES = \ - lib/par2/AUTHORS \ - lib/par2/README - -exampleconf_FILES = \ - nzbget.conf - -webui_FILES = \ - webui/index.html \ - webui/index.js \ - webui/downloads.js \ - webui/edit.js \ - webui/fasttable.js \ - webui/history.js \ - webui/messages.js \ - webui/status.js \ - webui/style.css \ - webui/upload.js \ - webui/util.js \ - webui/config.js \ - webui/feed.js \ - webui/lib/bootstrap.js \ - webui/lib/bootstrap.min.js \ - webui/lib/bootstrap.css \ - webui/lib/jquery.js \ - webui/lib/jquery.min.js \ - webui/lib/raphael.js \ - webui/lib/raphael.min.js \ - webui/lib/elycharts.js \ - webui/lib/elycharts.min.js \ - webui/img/icons.png \ - webui/img/icons-2x.png \ - webui/img/transmit.gif \ - webui/img/transmit-file.gif \ - webui/img/favicon.ico \ - webui/img/download-anim-green-2x.png \ - webui/img/download-anim-orange-2x.png \ - webui/img/transmit-reload-2x.gif \ - webui/img/favicon-256x256-opaque.png \ - webui/img/favicon-256x256.png - -scripts_FILES = \ - scripts/EMail.py \ - scripts/Logger.py - -testdata_FILES = \ - tests/testdata/dupematcher1/testfile.part01.rar \ - tests/testdata/dupematcher1/testfile.part24.rar \ - tests/testdata/dupematcher2/testfile.part04.rar \ - tests/testdata/dupematcher2/testfile.part43.rar \ - tests/testdata/nzbfile/dotless.nzb \ - tests/testdata/nzbfile/dotless.txt \ - tests/testdata/nzbfile/plain.nzb \ - tests/testdata/nzbfile/plain.txt \ - tests/testdata/parchecker/crc.txt \ - tests/testdata/parchecker/testfile.dat \ - tests/testdata/parchecker/testfile.nfo \ - tests/testdata/parchecker/testfile.par2 \ - tests/testdata/parchecker/testfile.vol00+1.PAR2 \ - tests/testdata/parchecker/testfile.vol01+2.PAR2 \ - tests/testdata/parchecker/testfile.vol03+3.PAR2 \ - tests/testdata/parchecker2/crc.txt \ - tests/testdata/parchecker2/testfile.7z.001 \ - tests/testdata/parchecker2/testfile.7z.002 \ - tests/testdata/parchecker2/testfile.7z.003 \ - tests/testdata/parchecker2/testfile.7z.par2 \ - tests/testdata/parchecker2/testfile.7z.vol0+1.PAR2 \ - tests/testdata/parchecker2/testfile.7z.vol1+2.PAR2 \ - tests/testdata/parchecker2/testfile.7z.vol3+3.PAR2 \ - tests/testdata/rarrenamer/testfile3.part01.rar \ - tests/testdata/rarrenamer/testfile3.part02.rar \ - tests/testdata/rarrenamer/testfile3.part03.rar \ - tests/testdata/rarrenamer/testfile5.part01.rar \ - tests/testdata/rarrenamer/testfile5.part02.rar \ - tests/testdata/rarrenamer/testfile5.part03.rar \ - tests/testdata/rarrenamer/testfile3oldnam.rar \ - tests/testdata/rarrenamer/testfile3oldnam.r00 \ - tests/testdata/rarrenamer/testfile3oldnam.r01 \ - tests/testdata/rarrenamer/testfile3encdata.part01.rar \ - tests/testdata/rarrenamer/testfile3encdata.part02.rar \ - tests/testdata/rarrenamer/testfile3encdata.part03.rar \ - tests/testdata/rarrenamer/testfile3encnam.part01.rar \ - tests/testdata/rarrenamer/testfile3encnam.part02.rar \ - tests/testdata/rarrenamer/testfile3encnam.part03.rar \ - tests/testdata/rarrenamer/testfile5encdata.part01.rar \ - tests/testdata/rarrenamer/testfile5encdata.part02.rar \ - tests/testdata/rarrenamer/testfile5encdata.part03.rar \ - tests/testdata/rarrenamer/testfile5encnam.part01.rar \ - tests/testdata/rarrenamer/testfile5encnam.part02.rar \ - tests/testdata/rarrenamer/testfile5encnam.part03.rar - - -# Install -dist_doc_DATA = $(doc_FILES) -exampleconfdir = $(datadir)/nzbget -dist_exampleconf_DATA = $(exampleconf_FILES) -webuidir = $(datadir)/nzbget -nobase_dist_webui_DATA = $(webui_FILES) -scriptsdir = $(datadir)/nzbget -nobase_dist_scripts_SCRIPTS = $(scripts_FILES) - -# Ignore "code_revision.cpp" in distcleancheck -distcleancheck_listfiles = \ - find . -type f -exec sh -c 'test -f $(srcdir)/$$1 || echo $$1' \ - sh '{}' ';' - -all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-am - -.SUFFIXES: -.SUFFIXES: .cpp .o .obj -am--refresh: Makefile - @: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): - -config.h: stamp-h1 - @test -f $@ || rm -f stamp-h1 - @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -daemon/connect/$(am__dirstamp): - @$(MKDIR_P) daemon/connect - @: > daemon/connect/$(am__dirstamp) -daemon/connect/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) daemon/connect/$(DEPDIR) - @: > daemon/connect/$(DEPDIR)/$(am__dirstamp) -daemon/connect/Connection.$(OBJEXT): daemon/connect/$(am__dirstamp) \ - daemon/connect/$(DEPDIR)/$(am__dirstamp) -daemon/connect/TlsSocket.$(OBJEXT): daemon/connect/$(am__dirstamp) \ - daemon/connect/$(DEPDIR)/$(am__dirstamp) -daemon/connect/WebDownloader.$(OBJEXT): \ - daemon/connect/$(am__dirstamp) \ - daemon/connect/$(DEPDIR)/$(am__dirstamp) -daemon/extension/$(am__dirstamp): - @$(MKDIR_P) daemon/extension - @: > daemon/extension/$(am__dirstamp) -daemon/extension/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) daemon/extension/$(DEPDIR) - @: > daemon/extension/$(DEPDIR)/$(am__dirstamp) -daemon/extension/FeedScript.$(OBJEXT): \ - daemon/extension/$(am__dirstamp) \ - daemon/extension/$(DEPDIR)/$(am__dirstamp) -daemon/extension/CommandScript.$(OBJEXT): \ - daemon/extension/$(am__dirstamp) \ - daemon/extension/$(DEPDIR)/$(am__dirstamp) -daemon/extension/NzbScript.$(OBJEXT): \ - daemon/extension/$(am__dirstamp) \ - daemon/extension/$(DEPDIR)/$(am__dirstamp) -daemon/extension/PostScript.$(OBJEXT): \ - daemon/extension/$(am__dirstamp) \ - daemon/extension/$(DEPDIR)/$(am__dirstamp) -daemon/extension/QueueScript.$(OBJEXT): \ - daemon/extension/$(am__dirstamp) \ - daemon/extension/$(DEPDIR)/$(am__dirstamp) -daemon/extension/ScanScript.$(OBJEXT): \ - daemon/extension/$(am__dirstamp) \ - daemon/extension/$(DEPDIR)/$(am__dirstamp) -daemon/extension/SchedulerScript.$(OBJEXT): \ - daemon/extension/$(am__dirstamp) \ - daemon/extension/$(DEPDIR)/$(am__dirstamp) -daemon/extension/ScriptConfig.$(OBJEXT): \ - daemon/extension/$(am__dirstamp) \ - daemon/extension/$(DEPDIR)/$(am__dirstamp) -daemon/feed/$(am__dirstamp): - @$(MKDIR_P) daemon/feed - @: > daemon/feed/$(am__dirstamp) -daemon/feed/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) daemon/feed/$(DEPDIR) - @: > daemon/feed/$(DEPDIR)/$(am__dirstamp) -daemon/feed/FeedCoordinator.$(OBJEXT): daemon/feed/$(am__dirstamp) \ - daemon/feed/$(DEPDIR)/$(am__dirstamp) -daemon/feed/FeedFile.$(OBJEXT): daemon/feed/$(am__dirstamp) \ - daemon/feed/$(DEPDIR)/$(am__dirstamp) -daemon/feed/FeedFilter.$(OBJEXT): daemon/feed/$(am__dirstamp) \ - daemon/feed/$(DEPDIR)/$(am__dirstamp) -daemon/feed/FeedInfo.$(OBJEXT): daemon/feed/$(am__dirstamp) \ - daemon/feed/$(DEPDIR)/$(am__dirstamp) -daemon/frontend/$(am__dirstamp): - @$(MKDIR_P) daemon/frontend - @: > daemon/frontend/$(am__dirstamp) -daemon/frontend/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) daemon/frontend/$(DEPDIR) - @: > daemon/frontend/$(DEPDIR)/$(am__dirstamp) -daemon/frontend/ColoredFrontend.$(OBJEXT): \ - daemon/frontend/$(am__dirstamp) \ - daemon/frontend/$(DEPDIR)/$(am__dirstamp) -daemon/frontend/Frontend.$(OBJEXT): daemon/frontend/$(am__dirstamp) \ - daemon/frontend/$(DEPDIR)/$(am__dirstamp) -daemon/frontend/LoggableFrontend.$(OBJEXT): \ - daemon/frontend/$(am__dirstamp) \ - daemon/frontend/$(DEPDIR)/$(am__dirstamp) -daemon/frontend/NCursesFrontend.$(OBJEXT): \ - daemon/frontend/$(am__dirstamp) \ - daemon/frontend/$(DEPDIR)/$(am__dirstamp) -daemon/main/$(am__dirstamp): - @$(MKDIR_P) daemon/main - @: > daemon/main/$(am__dirstamp) -daemon/main/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) daemon/main/$(DEPDIR) - @: > daemon/main/$(DEPDIR)/$(am__dirstamp) -daemon/main/CommandLineParser.$(OBJEXT): daemon/main/$(am__dirstamp) \ - daemon/main/$(DEPDIR)/$(am__dirstamp) -daemon/main/DiskService.$(OBJEXT): daemon/main/$(am__dirstamp) \ - daemon/main/$(DEPDIR)/$(am__dirstamp) -daemon/main/Maintenance.$(OBJEXT): daemon/main/$(am__dirstamp) \ - daemon/main/$(DEPDIR)/$(am__dirstamp) -daemon/main/nzbget.$(OBJEXT): daemon/main/$(am__dirstamp) \ - daemon/main/$(DEPDIR)/$(am__dirstamp) -daemon/main/Options.$(OBJEXT): daemon/main/$(am__dirstamp) \ - daemon/main/$(DEPDIR)/$(am__dirstamp) -daemon/main/WorkState.$(OBJEXT): daemon/main/$(am__dirstamp) \ - daemon/main/$(DEPDIR)/$(am__dirstamp) -daemon/main/Scheduler.$(OBJEXT): daemon/main/$(am__dirstamp) \ - daemon/main/$(DEPDIR)/$(am__dirstamp) -daemon/main/StackTrace.$(OBJEXT): daemon/main/$(am__dirstamp) \ - daemon/main/$(DEPDIR)/$(am__dirstamp) -daemon/nntp/$(am__dirstamp): - @$(MKDIR_P) daemon/nntp - @: > daemon/nntp/$(am__dirstamp) -daemon/nntp/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) daemon/nntp/$(DEPDIR) - @: > daemon/nntp/$(DEPDIR)/$(am__dirstamp) -daemon/nntp/ArticleDownloader.$(OBJEXT): daemon/nntp/$(am__dirstamp) \ - daemon/nntp/$(DEPDIR)/$(am__dirstamp) -daemon/nntp/ArticleWriter.$(OBJEXT): daemon/nntp/$(am__dirstamp) \ - daemon/nntp/$(DEPDIR)/$(am__dirstamp) -daemon/nntp/Decoder.$(OBJEXT): daemon/nntp/$(am__dirstamp) \ - daemon/nntp/$(DEPDIR)/$(am__dirstamp) -daemon/nntp/NewsServer.$(OBJEXT): daemon/nntp/$(am__dirstamp) \ - daemon/nntp/$(DEPDIR)/$(am__dirstamp) -daemon/nntp/NntpConnection.$(OBJEXT): daemon/nntp/$(am__dirstamp) \ - daemon/nntp/$(DEPDIR)/$(am__dirstamp) -daemon/nntp/ServerPool.$(OBJEXT): daemon/nntp/$(am__dirstamp) \ - daemon/nntp/$(DEPDIR)/$(am__dirstamp) -daemon/nntp/StatMeter.$(OBJEXT): daemon/nntp/$(am__dirstamp) \ - daemon/nntp/$(DEPDIR)/$(am__dirstamp) -daemon/postprocess/$(am__dirstamp): - @$(MKDIR_P) daemon/postprocess - @: > daemon/postprocess/$(am__dirstamp) -daemon/postprocess/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) daemon/postprocess/$(DEPDIR) - @: > daemon/postprocess/$(DEPDIR)/$(am__dirstamp) -daemon/postprocess/Cleanup.$(OBJEXT): \ - daemon/postprocess/$(am__dirstamp) \ - daemon/postprocess/$(DEPDIR)/$(am__dirstamp) -daemon/postprocess/DupeMatcher.$(OBJEXT): \ - daemon/postprocess/$(am__dirstamp) \ - daemon/postprocess/$(DEPDIR)/$(am__dirstamp) -daemon/postprocess/ParChecker.$(OBJEXT): \ - daemon/postprocess/$(am__dirstamp) \ - daemon/postprocess/$(DEPDIR)/$(am__dirstamp) -daemon/postprocess/ParParser.$(OBJEXT): \ - daemon/postprocess/$(am__dirstamp) \ - daemon/postprocess/$(DEPDIR)/$(am__dirstamp) -daemon/postprocess/ParRenamer.$(OBJEXT): \ - daemon/postprocess/$(am__dirstamp) \ - daemon/postprocess/$(DEPDIR)/$(am__dirstamp) -daemon/postprocess/PrePostProcessor.$(OBJEXT): \ - daemon/postprocess/$(am__dirstamp) \ - daemon/postprocess/$(DEPDIR)/$(am__dirstamp) -daemon/postprocess/RarRenamer.$(OBJEXT): \ - daemon/postprocess/$(am__dirstamp) \ - daemon/postprocess/$(DEPDIR)/$(am__dirstamp) -daemon/postprocess/RarReader.$(OBJEXT): \ - daemon/postprocess/$(am__dirstamp) \ - daemon/postprocess/$(DEPDIR)/$(am__dirstamp) -daemon/postprocess/Rename.$(OBJEXT): \ - daemon/postprocess/$(am__dirstamp) \ - daemon/postprocess/$(DEPDIR)/$(am__dirstamp) -daemon/postprocess/Repair.$(OBJEXT): \ - daemon/postprocess/$(am__dirstamp) \ - daemon/postprocess/$(DEPDIR)/$(am__dirstamp) -daemon/postprocess/Unpack.$(OBJEXT): \ - daemon/postprocess/$(am__dirstamp) \ - daemon/postprocess/$(DEPDIR)/$(am__dirstamp) -daemon/postprocess/DirectUnpack.$(OBJEXT): \ - daemon/postprocess/$(am__dirstamp) \ - daemon/postprocess/$(DEPDIR)/$(am__dirstamp) -daemon/queue/$(am__dirstamp): - @$(MKDIR_P) daemon/queue - @: > daemon/queue/$(am__dirstamp) -daemon/queue/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) daemon/queue/$(DEPDIR) - @: > daemon/queue/$(DEPDIR)/$(am__dirstamp) -daemon/queue/DirectRenamer.$(OBJEXT): daemon/queue/$(am__dirstamp) \ - daemon/queue/$(DEPDIR)/$(am__dirstamp) -daemon/queue/DiskState.$(OBJEXT): daemon/queue/$(am__dirstamp) \ - daemon/queue/$(DEPDIR)/$(am__dirstamp) -daemon/queue/DownloadInfo.$(OBJEXT): daemon/queue/$(am__dirstamp) \ - daemon/queue/$(DEPDIR)/$(am__dirstamp) -daemon/queue/DupeCoordinator.$(OBJEXT): daemon/queue/$(am__dirstamp) \ - daemon/queue/$(DEPDIR)/$(am__dirstamp) -daemon/queue/HistoryCoordinator.$(OBJEXT): \ - daemon/queue/$(am__dirstamp) \ - daemon/queue/$(DEPDIR)/$(am__dirstamp) -daemon/queue/NzbFile.$(OBJEXT): daemon/queue/$(am__dirstamp) \ - daemon/queue/$(DEPDIR)/$(am__dirstamp) -daemon/queue/QueueCoordinator.$(OBJEXT): daemon/queue/$(am__dirstamp) \ - daemon/queue/$(DEPDIR)/$(am__dirstamp) -daemon/queue/QueueEditor.$(OBJEXT): daemon/queue/$(am__dirstamp) \ - daemon/queue/$(DEPDIR)/$(am__dirstamp) -daemon/queue/Scanner.$(OBJEXT): daemon/queue/$(am__dirstamp) \ - daemon/queue/$(DEPDIR)/$(am__dirstamp) -daemon/queue/UrlCoordinator.$(OBJEXT): daemon/queue/$(am__dirstamp) \ - daemon/queue/$(DEPDIR)/$(am__dirstamp) -daemon/remote/$(am__dirstamp): - @$(MKDIR_P) daemon/remote - @: > daemon/remote/$(am__dirstamp) -daemon/remote/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) daemon/remote/$(DEPDIR) - @: > daemon/remote/$(DEPDIR)/$(am__dirstamp) -daemon/remote/BinRpc.$(OBJEXT): daemon/remote/$(am__dirstamp) \ - daemon/remote/$(DEPDIR)/$(am__dirstamp) -daemon/remote/RemoteClient.$(OBJEXT): daemon/remote/$(am__dirstamp) \ - daemon/remote/$(DEPDIR)/$(am__dirstamp) -daemon/remote/RemoteServer.$(OBJEXT): daemon/remote/$(am__dirstamp) \ - daemon/remote/$(DEPDIR)/$(am__dirstamp) -daemon/remote/WebServer.$(OBJEXT): daemon/remote/$(am__dirstamp) \ - daemon/remote/$(DEPDIR)/$(am__dirstamp) -daemon/remote/XmlRpc.$(OBJEXT): daemon/remote/$(am__dirstamp) \ - daemon/remote/$(DEPDIR)/$(am__dirstamp) -daemon/util/$(am__dirstamp): - @$(MKDIR_P) daemon/util - @: > daemon/util/$(am__dirstamp) -daemon/util/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) daemon/util/$(DEPDIR) - @: > daemon/util/$(DEPDIR)/$(am__dirstamp) -daemon/util/Log.$(OBJEXT): daemon/util/$(am__dirstamp) \ - daemon/util/$(DEPDIR)/$(am__dirstamp) -daemon/util/NString.$(OBJEXT): daemon/util/$(am__dirstamp) \ - daemon/util/$(DEPDIR)/$(am__dirstamp) -daemon/util/Observer.$(OBJEXT): daemon/util/$(am__dirstamp) \ - daemon/util/$(DEPDIR)/$(am__dirstamp) -daemon/util/Script.$(OBJEXT): daemon/util/$(am__dirstamp) \ - daemon/util/$(DEPDIR)/$(am__dirstamp) -daemon/util/Thread.$(OBJEXT): daemon/util/$(am__dirstamp) \ - daemon/util/$(DEPDIR)/$(am__dirstamp) -daemon/util/Service.$(OBJEXT): daemon/util/$(am__dirstamp) \ - daemon/util/$(DEPDIR)/$(am__dirstamp) -daemon/util/FileSystem.$(OBJEXT): daemon/util/$(am__dirstamp) \ - daemon/util/$(DEPDIR)/$(am__dirstamp) -daemon/util/Util.$(OBJEXT): daemon/util/$(am__dirstamp) \ - daemon/util/$(DEPDIR)/$(am__dirstamp) -daemon/nserv/$(am__dirstamp): - @$(MKDIR_P) daemon/nserv - @: > daemon/nserv/$(am__dirstamp) -daemon/nserv/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) daemon/nserv/$(DEPDIR) - @: > daemon/nserv/$(DEPDIR)/$(am__dirstamp) -daemon/nserv/NServMain.$(OBJEXT): daemon/nserv/$(am__dirstamp) \ - daemon/nserv/$(DEPDIR)/$(am__dirstamp) -daemon/nserv/NServFrontend.$(OBJEXT): daemon/nserv/$(am__dirstamp) \ - daemon/nserv/$(DEPDIR)/$(am__dirstamp) -daemon/nserv/NntpServer.$(OBJEXT): daemon/nserv/$(am__dirstamp) \ - daemon/nserv/$(DEPDIR)/$(am__dirstamp) -daemon/nserv/NzbGenerator.$(OBJEXT): daemon/nserv/$(am__dirstamp) \ - daemon/nserv/$(DEPDIR)/$(am__dirstamp) -daemon/nserv/YEncoder.$(OBJEXT): daemon/nserv/$(am__dirstamp) \ - daemon/nserv/$(DEPDIR)/$(am__dirstamp) -lib/par2/$(am__dirstamp): - @$(MKDIR_P) lib/par2 - @: > lib/par2/$(am__dirstamp) -lib/par2/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) lib/par2/$(DEPDIR) - @: > lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/commandline.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/crc.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/creatorpacket.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/criticalpacket.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/datablock.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/descriptionpacket.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/diskfile.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/filechecksummer.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/galois.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/mainpacket.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/md5.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/par2fileformat.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/par2repairer.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/par2repairersourcefile.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/parheaders.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/recoverypacket.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/reedsolomon.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/verificationhashtable.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/par2/verificationpacket.$(OBJEXT): lib/par2/$(am__dirstamp) \ - lib/par2/$(DEPDIR)/$(am__dirstamp) -lib/yencode/$(am__dirstamp): - @$(MKDIR_P) lib/yencode - @: > lib/yencode/$(am__dirstamp) -lib/yencode/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) lib/yencode/$(DEPDIR) - @: > lib/yencode/$(DEPDIR)/$(am__dirstamp) -lib/yencode/SimdInit.$(OBJEXT): lib/yencode/$(am__dirstamp) \ - lib/yencode/$(DEPDIR)/$(am__dirstamp) -lib/yencode/SimdDecoder.$(OBJEXT): lib/yencode/$(am__dirstamp) \ - lib/yencode/$(DEPDIR)/$(am__dirstamp) -lib/yencode/ScalarDecoder.$(OBJEXT): lib/yencode/$(am__dirstamp) \ - lib/yencode/$(DEPDIR)/$(am__dirstamp) -lib/yencode/Sse2Decoder.$(OBJEXT): lib/yencode/$(am__dirstamp) \ - lib/yencode/$(DEPDIR)/$(am__dirstamp) -lib/yencode/Ssse3Decoder.$(OBJEXT): lib/yencode/$(am__dirstamp) \ - lib/yencode/$(DEPDIR)/$(am__dirstamp) -lib/yencode/PclmulCrc.$(OBJEXT): lib/yencode/$(am__dirstamp) \ - lib/yencode/$(DEPDIR)/$(am__dirstamp) -lib/yencode/NeonDecoder.$(OBJEXT): lib/yencode/$(am__dirstamp) \ - lib/yencode/$(DEPDIR)/$(am__dirstamp) -lib/yencode/AcleCrc.$(OBJEXT): lib/yencode/$(am__dirstamp) \ - lib/yencode/$(DEPDIR)/$(am__dirstamp) -lib/yencode/SliceCrc.$(OBJEXT): lib/yencode/$(am__dirstamp) \ - lib/yencode/$(DEPDIR)/$(am__dirstamp) -tests/suite/$(am__dirstamp): - @$(MKDIR_P) tests/suite - @: > tests/suite/$(am__dirstamp) -tests/suite/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) tests/suite/$(DEPDIR) - @: > tests/suite/$(DEPDIR)/$(am__dirstamp) -tests/suite/TestMain.$(OBJEXT): tests/suite/$(am__dirstamp) \ - tests/suite/$(DEPDIR)/$(am__dirstamp) -tests/suite/TestUtil.$(OBJEXT): tests/suite/$(am__dirstamp) \ - tests/suite/$(DEPDIR)/$(am__dirstamp) -tests/main/$(am__dirstamp): - @$(MKDIR_P) tests/main - @: > tests/main/$(am__dirstamp) -tests/main/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) tests/main/$(DEPDIR) - @: > tests/main/$(DEPDIR)/$(am__dirstamp) -tests/main/CommandLineParserTest.$(OBJEXT): \ - tests/main/$(am__dirstamp) \ - tests/main/$(DEPDIR)/$(am__dirstamp) -tests/main/OptionsTest.$(OBJEXT): tests/main/$(am__dirstamp) \ - tests/main/$(DEPDIR)/$(am__dirstamp) -tests/feed/$(am__dirstamp): - @$(MKDIR_P) tests/feed - @: > tests/feed/$(am__dirstamp) -tests/feed/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) tests/feed/$(DEPDIR) - @: > tests/feed/$(DEPDIR)/$(am__dirstamp) -tests/feed/FeedFilterTest.$(OBJEXT): tests/feed/$(am__dirstamp) \ - tests/feed/$(DEPDIR)/$(am__dirstamp) -tests/postprocess/$(am__dirstamp): - @$(MKDIR_P) tests/postprocess - @: > tests/postprocess/$(am__dirstamp) -tests/postprocess/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) tests/postprocess/$(DEPDIR) - @: > tests/postprocess/$(DEPDIR)/$(am__dirstamp) -tests/postprocess/DupeMatcherTest.$(OBJEXT): \ - tests/postprocess/$(am__dirstamp) \ - tests/postprocess/$(DEPDIR)/$(am__dirstamp) -tests/postprocess/RarRenamerTest.$(OBJEXT): \ - tests/postprocess/$(am__dirstamp) \ - tests/postprocess/$(DEPDIR)/$(am__dirstamp) -tests/postprocess/RarReaderTest.$(OBJEXT): \ - tests/postprocess/$(am__dirstamp) \ - tests/postprocess/$(DEPDIR)/$(am__dirstamp) -tests/postprocess/DirectUnpackTest.$(OBJEXT): \ - tests/postprocess/$(am__dirstamp) \ - tests/postprocess/$(DEPDIR)/$(am__dirstamp) -tests/queue/$(am__dirstamp): - @$(MKDIR_P) tests/queue - @: > tests/queue/$(am__dirstamp) -tests/queue/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) tests/queue/$(DEPDIR) - @: > tests/queue/$(DEPDIR)/$(am__dirstamp) -tests/queue/NzbFileTest.$(OBJEXT): tests/queue/$(am__dirstamp) \ - tests/queue/$(DEPDIR)/$(am__dirstamp) -tests/nntp/$(am__dirstamp): - @$(MKDIR_P) tests/nntp - @: > tests/nntp/$(am__dirstamp) -tests/nntp/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) tests/nntp/$(DEPDIR) - @: > tests/nntp/$(DEPDIR)/$(am__dirstamp) -tests/nntp/ServerPoolTest.$(OBJEXT): tests/nntp/$(am__dirstamp) \ - tests/nntp/$(DEPDIR)/$(am__dirstamp) -tests/util/$(am__dirstamp): - @$(MKDIR_P) tests/util - @: > tests/util/$(am__dirstamp) -tests/util/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) tests/util/$(DEPDIR) - @: > tests/util/$(DEPDIR)/$(am__dirstamp) -tests/util/FileSystemTest.$(OBJEXT): tests/util/$(am__dirstamp) \ - tests/util/$(DEPDIR)/$(am__dirstamp) -tests/util/NStringTest.$(OBJEXT): tests/util/$(am__dirstamp) \ - tests/util/$(DEPDIR)/$(am__dirstamp) -tests/util/UtilTest.$(OBJEXT): tests/util/$(am__dirstamp) \ - tests/util/$(DEPDIR)/$(am__dirstamp) -tests/postprocess/ParCheckerTest.$(OBJEXT): \ - tests/postprocess/$(am__dirstamp) \ - tests/postprocess/$(DEPDIR)/$(am__dirstamp) -tests/postprocess/ParRenamerTest.$(OBJEXT): \ - tests/postprocess/$(am__dirstamp) \ - tests/postprocess/$(DEPDIR)/$(am__dirstamp) - -nzbget$(EXEEXT): $(nzbget_OBJECTS) $(nzbget_DEPENDENCIES) $(EXTRA_nzbget_DEPENDENCIES) - @rm -f nzbget$(EXEEXT) - $(AM_V_CXXLD)$(CXXLINK) $(nzbget_OBJECTS) $(nzbget_LDADD) $(LIBS) -install-nobase_dist_scriptsSCRIPTS: $(nobase_dist_scripts_SCRIPTS) - @$(NORMAL_INSTALL) - @list='$(nobase_dist_scripts_SCRIPTS)'; test -n "$(scriptsdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(scriptsdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(scriptsdir)" || exit 1; \ - fi; \ - $(am__nobase_strip_setup); \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e "s|$$srcdirstrip/||" -e 'h;s|[^/]*$$||; s|^$$|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - case $$type in \ - d) echo " $(MKDIR_P) '$(DESTDIR)$(scriptsdir)/$$dir'"; \ - $(MKDIR_P) "$(DESTDIR)$(scriptsdir)/$$dir" || exit $$?;; \ - f) \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(scriptsdir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(scriptsdir)$$dir" || exit $$?; \ - } \ - ;; esac \ - ; done - -uninstall-nobase_dist_scriptsSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(nobase_dist_scripts_SCRIPTS)'; test -n "$(scriptsdir)" || exit 0; \ - $(am__nobase_strip_setup); \ - files=`$(am__nobase_strip) \ - -e 'h;s,.*/,,;$(transform);x;s|[^/]*$$||;G;s,\n,,'`; \ - dir='$(DESTDIR)$(scriptsdir)'; $(am__uninstall_files_from_dir) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -rm -f daemon/connect/*.$(OBJEXT) - -rm -f daemon/extension/*.$(OBJEXT) - -rm -f daemon/feed/*.$(OBJEXT) - -rm -f daemon/frontend/*.$(OBJEXT) - -rm -f daemon/main/*.$(OBJEXT) - -rm -f daemon/nntp/*.$(OBJEXT) - -rm -f daemon/nserv/*.$(OBJEXT) - -rm -f daemon/postprocess/*.$(OBJEXT) - -rm -f daemon/queue/*.$(OBJEXT) - -rm -f daemon/remote/*.$(OBJEXT) - -rm -f daemon/util/*.$(OBJEXT) - -rm -f lib/par2/*.$(OBJEXT) - -rm -f lib/yencode/*.$(OBJEXT) - -rm -f tests/feed/*.$(OBJEXT) - -rm -f tests/main/*.$(OBJEXT) - -rm -f tests/nntp/*.$(OBJEXT) - -rm -f tests/postprocess/*.$(OBJEXT) - -rm -f tests/queue/*.$(OBJEXT) - -rm -f tests/suite/*.$(OBJEXT) - -rm -f tests/util/*.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/code_revision.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/connect/$(DEPDIR)/Connection.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/connect/$(DEPDIR)/TlsSocket.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/connect/$(DEPDIR)/WebDownloader.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/extension/$(DEPDIR)/CommandScript.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/extension/$(DEPDIR)/FeedScript.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/extension/$(DEPDIR)/NzbScript.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/extension/$(DEPDIR)/PostScript.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/extension/$(DEPDIR)/QueueScript.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/extension/$(DEPDIR)/ScanScript.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/extension/$(DEPDIR)/SchedulerScript.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/extension/$(DEPDIR)/ScriptConfig.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/feed/$(DEPDIR)/FeedCoordinator.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/feed/$(DEPDIR)/FeedFile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/feed/$(DEPDIR)/FeedFilter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/feed/$(DEPDIR)/FeedInfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/frontend/$(DEPDIR)/ColoredFrontend.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/frontend/$(DEPDIR)/Frontend.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/frontend/$(DEPDIR)/LoggableFrontend.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/frontend/$(DEPDIR)/NCursesFrontend.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/main/$(DEPDIR)/CommandLineParser.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/main/$(DEPDIR)/DiskService.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/main/$(DEPDIR)/Maintenance.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/main/$(DEPDIR)/Options.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/main/$(DEPDIR)/Scheduler.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/main/$(DEPDIR)/StackTrace.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/main/$(DEPDIR)/WorkState.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/main/$(DEPDIR)/nzbget.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/nntp/$(DEPDIR)/ArticleDownloader.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/nntp/$(DEPDIR)/ArticleWriter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/nntp/$(DEPDIR)/Decoder.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/nntp/$(DEPDIR)/NewsServer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/nntp/$(DEPDIR)/NntpConnection.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/nntp/$(DEPDIR)/ServerPool.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/nntp/$(DEPDIR)/StatMeter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/nserv/$(DEPDIR)/NServFrontend.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/nserv/$(DEPDIR)/NServMain.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/nserv/$(DEPDIR)/NntpServer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/nserv/$(DEPDIR)/NzbGenerator.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/nserv/$(DEPDIR)/YEncoder.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/postprocess/$(DEPDIR)/Cleanup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/postprocess/$(DEPDIR)/DirectUnpack.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/postprocess/$(DEPDIR)/DupeMatcher.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/postprocess/$(DEPDIR)/ParChecker.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/postprocess/$(DEPDIR)/ParParser.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/postprocess/$(DEPDIR)/ParRenamer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/postprocess/$(DEPDIR)/PrePostProcessor.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/postprocess/$(DEPDIR)/RarReader.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/postprocess/$(DEPDIR)/RarRenamer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/postprocess/$(DEPDIR)/Rename.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/postprocess/$(DEPDIR)/Repair.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/postprocess/$(DEPDIR)/Unpack.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/queue/$(DEPDIR)/DirectRenamer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/queue/$(DEPDIR)/DiskState.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/queue/$(DEPDIR)/DownloadInfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/queue/$(DEPDIR)/DupeCoordinator.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/queue/$(DEPDIR)/HistoryCoordinator.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/queue/$(DEPDIR)/NzbFile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/queue/$(DEPDIR)/QueueCoordinator.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/queue/$(DEPDIR)/QueueEditor.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/queue/$(DEPDIR)/Scanner.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/queue/$(DEPDIR)/UrlCoordinator.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/remote/$(DEPDIR)/BinRpc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/remote/$(DEPDIR)/RemoteClient.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/remote/$(DEPDIR)/RemoteServer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/remote/$(DEPDIR)/WebServer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/remote/$(DEPDIR)/XmlRpc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/util/$(DEPDIR)/FileSystem.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/util/$(DEPDIR)/Log.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/util/$(DEPDIR)/NString.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/util/$(DEPDIR)/Observer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/util/$(DEPDIR)/Script.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/util/$(DEPDIR)/Service.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/util/$(DEPDIR)/Thread.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@daemon/util/$(DEPDIR)/Util.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/commandline.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/crc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/creatorpacket.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/criticalpacket.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/datablock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/descriptionpacket.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/diskfile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/filechecksummer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/galois.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/mainpacket.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/md5.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/par2fileformat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/par2repairer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/par2repairersourcefile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/parheaders.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/recoverypacket.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/reedsolomon.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/verificationhashtable.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/par2/$(DEPDIR)/verificationpacket.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/yencode/$(DEPDIR)/AcleCrc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/yencode/$(DEPDIR)/NeonDecoder.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/yencode/$(DEPDIR)/PclmulCrc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/yencode/$(DEPDIR)/ScalarDecoder.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/yencode/$(DEPDIR)/SimdDecoder.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/yencode/$(DEPDIR)/SimdInit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/yencode/$(DEPDIR)/SliceCrc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/yencode/$(DEPDIR)/Sse2Decoder.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lib/yencode/$(DEPDIR)/Ssse3Decoder.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/feed/$(DEPDIR)/FeedFilterTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/main/$(DEPDIR)/CommandLineParserTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/main/$(DEPDIR)/OptionsTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/nntp/$(DEPDIR)/ServerPoolTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/postprocess/$(DEPDIR)/DirectUnpackTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/postprocess/$(DEPDIR)/DupeMatcherTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/postprocess/$(DEPDIR)/ParCheckerTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/postprocess/$(DEPDIR)/ParRenamerTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/postprocess/$(DEPDIR)/RarReaderTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/postprocess/$(DEPDIR)/RarRenamerTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/queue/$(DEPDIR)/NzbFileTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/suite/$(DEPDIR)/TestMain.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/suite/$(DEPDIR)/TestUtil.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/util/$(DEPDIR)/FileSystemTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/util/$(DEPDIR)/NStringTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/util/$(DEPDIR)/UtilTest.Po@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` -install-dist_docDATA: $(dist_doc_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ - done - -uninstall-dist_docDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) -install-dist_exampleconfDATA: $(dist_exampleconf_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_exampleconf_DATA)'; test -n "$(exampleconfdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(exampleconfdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(exampleconfdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(exampleconfdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(exampleconfdir)" || exit $$?; \ - done - -uninstall-dist_exampleconfDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_exampleconf_DATA)'; test -n "$(exampleconfdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(exampleconfdir)'; $(am__uninstall_files_from_dir) -install-nobase_dist_webuiDATA: $(nobase_dist_webui_DATA) - @$(NORMAL_INSTALL) - @list='$(nobase_dist_webui_DATA)'; test -n "$(webuidir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(webuidir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(webuidir)" || exit 1; \ - fi; \ - $(am__nobase_list) | while read dir files; do \ - xfiles=; for file in $$files; do \ - if test -f "$$file"; then xfiles="$$xfiles $$file"; \ - else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ - test -z "$$xfiles" || { \ - test "x$$dir" = x. || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(webuidir)/$$dir'"; \ - $(MKDIR_P) "$(DESTDIR)$(webuidir)/$$dir"; }; \ - echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(webuidir)/$$dir'"; \ - $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(webuidir)/$$dir" || exit $$?; }; \ - done - -uninstall-nobase_dist_webuiDATA: - @$(NORMAL_UNINSTALL) - @list='$(nobase_dist_webui_DATA)'; test -n "$(webuidir)" || list=; \ - $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - dir='$(DESTDIR)$(webuidir)'; $(am__uninstall_files_from_dir) - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscope: cscope.files - test ! -s cscope.files \ - || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) -clean-cscope: - -rm -f cscope.files -cscope.files: clean-cscope cscopelist -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - -distdir: $(DISTFILES) - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__post_remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__post_remove_distdir) - -dist-lzip: distdir - tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__post_remove_distdir) - -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__post_remove_distdir) - -dist-tarZ: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__post_remove_distdir) - -dist-shar: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__post_remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__post_remove_distdir) - -dist dist-all: - $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' - $(am__post_remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lz*) \ - lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir) - chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build/sub \ - && ../../configure \ - $(AM_DISTCHECK_CONFIGURE_FLAGS) \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=../.. --prefix="$$dc_install_base" \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 - $(am__post_remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @test -n '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: trying to run $@ with an empty' \ - '$$(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - $(am__cd) '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) config.h -installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(scriptsdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(exampleconfdir)" "$(DESTDIR)$(webuidir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -rm -f daemon/connect/$(DEPDIR)/$(am__dirstamp) - -rm -f daemon/connect/$(am__dirstamp) - -rm -f daemon/extension/$(DEPDIR)/$(am__dirstamp) - -rm -f daemon/extension/$(am__dirstamp) - -rm -f daemon/feed/$(DEPDIR)/$(am__dirstamp) - -rm -f daemon/feed/$(am__dirstamp) - -rm -f daemon/frontend/$(DEPDIR)/$(am__dirstamp) - -rm -f daemon/frontend/$(am__dirstamp) - -rm -f daemon/main/$(DEPDIR)/$(am__dirstamp) - -rm -f daemon/main/$(am__dirstamp) - -rm -f daemon/nntp/$(DEPDIR)/$(am__dirstamp) - -rm -f daemon/nntp/$(am__dirstamp) - -rm -f daemon/nserv/$(DEPDIR)/$(am__dirstamp) - -rm -f daemon/nserv/$(am__dirstamp) - -rm -f daemon/postprocess/$(DEPDIR)/$(am__dirstamp) - -rm -f daemon/postprocess/$(am__dirstamp) - -rm -f daemon/queue/$(DEPDIR)/$(am__dirstamp) - -rm -f daemon/queue/$(am__dirstamp) - -rm -f daemon/remote/$(DEPDIR)/$(am__dirstamp) - -rm -f daemon/remote/$(am__dirstamp) - -rm -f daemon/util/$(DEPDIR)/$(am__dirstamp) - -rm -f daemon/util/$(am__dirstamp) - -rm -f lib/par2/$(DEPDIR)/$(am__dirstamp) - -rm -f lib/par2/$(am__dirstamp) - -rm -f lib/yencode/$(DEPDIR)/$(am__dirstamp) - -rm -f lib/yencode/$(am__dirstamp) - -rm -f tests/feed/$(DEPDIR)/$(am__dirstamp) - -rm -f tests/feed/$(am__dirstamp) - -rm -f tests/main/$(DEPDIR)/$(am__dirstamp) - -rm -f tests/main/$(am__dirstamp) - -rm -f tests/nntp/$(DEPDIR)/$(am__dirstamp) - -rm -f tests/nntp/$(am__dirstamp) - -rm -f tests/postprocess/$(DEPDIR)/$(am__dirstamp) - -rm -f tests/postprocess/$(am__dirstamp) - -rm -f tests/queue/$(DEPDIR)/$(am__dirstamp) - -rm -f tests/queue/$(am__dirstamp) - -rm -f tests/suite/$(DEPDIR)/$(am__dirstamp) - -rm -f tests/suite/$(am__dirstamp) - -rm -f tests/util/$(DEPDIR)/$(am__dirstamp) - -rm -f tests/util/$(am__dirstamp) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic mostlyclean-am - -distclean: distclean-am - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf ./$(DEPDIR) daemon/connect/$(DEPDIR) daemon/extension/$(DEPDIR) daemon/feed/$(DEPDIR) daemon/frontend/$(DEPDIR) daemon/main/$(DEPDIR) daemon/nntp/$(DEPDIR) daemon/nserv/$(DEPDIR) daemon/postprocess/$(DEPDIR) daemon/queue/$(DEPDIR) daemon/remote/$(DEPDIR) daemon/util/$(DEPDIR) lib/par2/$(DEPDIR) lib/yencode/$(DEPDIR) tests/feed/$(DEPDIR) tests/main/$(DEPDIR) tests/nntp/$(DEPDIR) tests/postprocess/$(DEPDIR) tests/queue/$(DEPDIR) tests/suite/$(DEPDIR) tests/util/$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-hdr distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-dist_docDATA install-dist_exampleconfDATA \ - install-nobase_dist_scriptsSCRIPTS \ - install-nobase_dist_webuiDATA - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-data-hook -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf ./$(DEPDIR) daemon/connect/$(DEPDIR) daemon/extension/$(DEPDIR) daemon/feed/$(DEPDIR) daemon/frontend/$(DEPDIR) daemon/main/$(DEPDIR) daemon/nntp/$(DEPDIR) daemon/nserv/$(DEPDIR) daemon/postprocess/$(DEPDIR) daemon/queue/$(DEPDIR) daemon/remote/$(DEPDIR) daemon/util/$(DEPDIR) lib/par2/$(DEPDIR) lib/yencode/$(DEPDIR) tests/feed/$(DEPDIR) tests/main/$(DEPDIR) tests/nntp/$(DEPDIR) tests/postprocess/$(DEPDIR) tests/queue/$(DEPDIR) tests/suite/$(DEPDIR) tests/util/$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-dist_docDATA \ - uninstall-dist_exampleconfDATA \ - uninstall-nobase_dist_scriptsSCRIPTS \ - uninstall-nobase_dist_webuiDATA - -.MAKE: all install-am install-data-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ - clean-binPROGRAMS clean-cscope clean-generic cscope \ - cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ - dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ - dist-zip distcheck distclean distclean-compile \ - distclean-generic distclean-hdr distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-binPROGRAMS install-data \ - install-data-am install-data-hook install-dist_docDATA \ - install-dist_exampleconfDATA install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man \ - install-nobase_dist_scriptsSCRIPTS \ - install-nobase_dist_webuiDATA install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-binPROGRAMS uninstall-dist_docDATA \ - uninstall-dist_exampleconfDATA \ - uninstall-nobase_dist_scriptsSCRIPTS \ - uninstall-nobase_dist_webuiDATA - -.PRECIOUS: Makefile - - -lib/yencode/Sse2Decoder.$(OBJEXT) : CXXFLAGS+=$(SSE2_CXXFLAGS) -lib/yencode/Ssse3Decoder.$(OBJEXT) : CXXFLAGS+=$(SSSE3_CXXFLAGS) -lib/yencode/PclmulCrc.$(OBJEXT) : CXXFLAGS+=$(PCLMUL_CXXFLAGS) -lib/yencode/NeonDecoder.$(OBJEXT) : CXXFLAGS+=$(NEON_CXXFLAGS) -lib/yencode/AcleCrc.$(OBJEXT) : CXXFLAGS+=$(ACLECRC_CXXFLAGS) - -# Note about "sed": -# We need to make some changes in installed files. -# On Linux "sed" has option "-i" for in-place-edit. Unfortunateley the BSD version of "sed" -# has incompatible syntax. To solve the problem we perform in-place-edit in three steps: -# 1) copy the original file to original.temp (delete existing original.temp, if any); -# 2) sed < original.temp > original -# 3) delete original.temp -# These steps ensure that the output file has the same permissions as the original file. - -# Prepare example configuration file -install-data-hook: - rm -f "$(DESTDIR)$(exampleconfdir)/nzbget.conf.temp" - cp "$(DESTDIR)$(exampleconfdir)/nzbget.conf" "$(DESTDIR)$(exampleconfdir)/nzbget.conf.temp" - sed 's:^ConfigTemplate=:ConfigTemplate=$(exampleconfdir)/nzbget.conf:' < "$(DESTDIR)$(exampleconfdir)/nzbget.conf.temp" > "$(DESTDIR)$(exampleconfdir)/nzbget.conf" - sed 's:configuration file (typically installed:configuration file (installed:' < "$(DESTDIR)$(exampleconfdir)/nzbget.conf" > "$(DESTDIR)$(exampleconfdir)/nzbget.conf.temp" - sed 's:/usr/local/share/nzbget/nzbget.conf):$(exampleconfdir)/nzbget.conf):' < "$(DESTDIR)$(exampleconfdir)/nzbget.conf.temp" > "$(DESTDIR)$(exampleconfdir)/nzbget.conf" - sed 's:^WebDir=:WebDir=$(webuidir)/webui:' < "$(DESTDIR)$(exampleconfdir)/nzbget.conf" > "$(DESTDIR)$(exampleconfdir)/nzbget.conf.temp" - sed 's:typically installed to /usr/local/share/nzbget/scripts:installed to $(scriptsdir)/scripts:' < "$(DESTDIR)$(exampleconfdir)/nzbget.conf.temp" > "$(DESTDIR)$(exampleconfdir)/nzbget.conf" - rm "$(DESTDIR)$(exampleconfdir)/nzbget.conf.temp" - -# Install configuration files into /etc -# (only if they do not exist there to prevent override by update) -install-conf: - if test ! -f "$(DESTDIR)$(sysconfdir)/nzbget.conf" ; then \ - $(mkinstalldirs) "$(DESTDIR)$(sysconfdir)" ; \ - cp "$(DESTDIR)$(exampleconfdir)/nzbget.conf" "$(DESTDIR)$(sysconfdir)/nzbget.conf" ; \ - fi - -uninstall-conf: - rm -f "$(DESTDIR)$(sysconfdir)/nzbget.conf" - -# Determining git revision: -# 1) If directory ".git" exists we take revision from git log. -# File is recreated only if revision number was changed. -# 2) If directory ".git" doesn't exists we keep and reuse file "code_revision.cpp", -# which was possibly created early. -# 3) If neither directory ".git" nor file "code_revision.cpp" are available -# we create new file "code_revision.c" with empty revision number. -code_revision.cpp: FORCE - @ if test -d ./.git ; then \ - B=`git branch | sed -n -e 's/^\* \(.*\)/\1/p'`; \ - M=`git status --porcelain` ; \ - if test "$$M" != "" ; then \ - M="M" ; \ - fi ; \ - if test "$$B" = "master" ; then \ - V="$$M" ; \ - elif test "$$B" = "develop" ; then \ - V=`git rev-list HEAD | wc -l | xargs` ; \ - V="$${V}$$M" ; \ - else \ - V=`git rev-list HEAD | wc -l | xargs` ; \ - V="$${V}$$M ($$B)" ; \ - fi ; \ - H=`test -f ./code_revision.cpp && head -n 1 code_revision.cpp`; \ - if test "/* $$V */" != "$$H" ; then \ - ( \ - echo "/* $$V */" ;\ - echo "/* This file is automatically regenerated on each build. Do not edit it. */" ;\ - echo "#include \"nzbget.h\"" ;\ - echo "const char* code_revision(void)" ;\ - echo "{" ;\ - echo " const char* revision = \"$$V\";" ;\ - echo " return revision;" ;\ - echo "}" ;\ - ) > code_revision.cpp ; \ - fi \ - elif test -f ./code_revision.cpp ; then \ - test "ok, reuse existing file"; \ - else \ - ( \ - echo "/* */" ;\ - echo "/* This file is automatically regenerated on each build. Do not edit it. */" ;\ - echo "#include \"nzbget.h\"" ;\ - echo "const char* code_revision(void)" ;\ - echo "{" ;\ - echo " const char* revision = \"\";" ;\ - echo " return revision;" ;\ - echo "}" ;\ - ) > code_revision.cpp ; \ - fi -FORCE: - -clean-bak: rm *~ - -# Fix premissions -dist-hook: - find $(distdir)/daemon -type f -print -exec chmod -x {} \; - find $(distdir)/webui -type f -print -exec chmod -x {} \; - find $(distdir)/lib -type f -print -exec chmod -x {} \; - find $(distdir)/tests -type f -print -exec chmod -x {} \; - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/README b/README index 64c26363..992a1374 100644 --- a/README +++ b/README @@ -68,22 +68,29 @@ POSIX platforms. NZBGet absolutely needs the following libraries: - libstdc++ (usually part of compiler) - - libxml2 (http://www.xmlsoft.org) + - libxml2 (https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home) And the following libraries are optional: - for curses-output-mode (enabled by default): - libcurses (usually part of commercial systems) or (better) - - libncurses (http://invisible-island.net/ncurses) + - libncurses (https://invisible-island.net/ncurses) - for encrypted connections (TLS/SSL): - - OpenSSL (http://www.openssl.org) + - OpenSSL (https://www.openssl.org) or - - GnuTLS (http://www.gnu.org/software/gnutls) + - GnuTLS (https://gnutls.org) - for gzip support in web-server and web-client (enabled by default): - - zlib (http://www.zlib.net) + - zlib (https://www.zlib.net/) + + - for configuration: + - autotools (https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html) + - autoconf (https://www.gnu.org/software/autoconf/) + + - for managing package dependencies: + - pkg-config (https://www.freedesktop.org/wiki/Software/pkg-config/) All these libraries are included in modern POSIX distributions and should be available as installable packages. Please note that you also @@ -104,6 +111,9 @@ Installation from the source distribution archive (nzbget-VERSION.tar.gz): cd nzbget-VERSION - configure it via + + autoreconf --install + ./configure (maybe you have to tell configure, where to find some libraries. @@ -210,13 +220,13 @@ NZBGet is developed using MS Visual Studio 2015 (Community Edition). The project file is provided. To compile the program with TLS/SSL support you need either OpenSSL or GnuTLS: - - OpenSSL (http://www.openssl.org) + - OpenSSL (https://www.openssl.org) or - - GnuTLS (http://www.gnu.org/software/gnutls) + - GnuTLS (https://gnutls.org/) Also required are: - - Regex (http://gnuwin32.sourceforge.net/packages/regex.htm) - - Zlib (http://gnuwin32.sourceforge.net/packages/zlib.htm) + - Regex (https://gnuwin32.sourceforge.net/packages/regex.htm) + - Zlib (https://gnuwin32.sourceforge.net/packages/zlib.htm) ===================================== 6. Configuration @@ -462,15 +472,12 @@ Par2: Par2 library API: Francois Lesueur -Catch: - Two Blue Cubes Ltd - jQuery: - John Resig - The Dojo Foundation + John Resig + The Dojo Foundation Bootstrap: - Twitter, Inc + Twitter, Inc Raphaël: Dmitry Baranovskiy @@ -480,7 +487,11 @@ Elycharts: Void Labs s.n.c. iconSweets: - Yummygum + Yummygum + +Boost: + Boost organization and wider Boost community + ===================================== 9. Copyright @@ -499,10 +510,5 @@ Additional exemption: compiling, linking, and/or using OpenSSL is allowed. 10. Contact ===================================== -If you encounter any problem, feel free to use the forum - - nzbget.com/forum - -or contact me at - - hugbug@users.sourceforge.net +If you encounter any problem, feel free to contact us + https://nzbget.com/contact/ diff --git a/aclocal.m4 b/aclocal.m4 deleted file mode 100644 index 454a48f8..00000000 --- a/aclocal.m4 +++ /dev/null @@ -1,1400 +0,0 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- - -# Copyright (C) 1996-2014 Free Software Foundation, Inc. - -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically 'autoreconf'.])]) - -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 12 (pkg-config-0.29.2) - -dnl Copyright © 2004 Scott James Remnant . -dnl Copyright © 2012-2015 Dan Nicholson -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but -dnl WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -dnl 02111-1307, USA. -dnl -dnl As a special exception to the GNU General Public License, if you -dnl distribute this file as part of a program that contains a -dnl configuration script generated by Autoconf, you may include it under -dnl the same distribution terms that you use for the rest of that -dnl program. - -dnl PKG_PREREQ(MIN-VERSION) -dnl ----------------------- -dnl Since: 0.29 -dnl -dnl Verify that the version of the pkg-config macros are at least -dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's -dnl installed version of pkg-config, this checks the developer's version -dnl of pkg.m4 when generating configure. -dnl -dnl To ensure that this macro is defined, also add: -dnl m4_ifndef([PKG_PREREQ], -dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) -dnl -dnl See the "Since" comment for each macro you use to see what version -dnl of the macros you require. -m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29.2]) -m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, - [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) -])dnl PKG_PREREQ - -dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) -dnl ---------------------------------- -dnl Since: 0.16 -dnl -dnl Search for the pkg-config tool and set the PKG_CONFIG variable to -dnl first found in the path. Checks that the version of pkg-config found -dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is -dnl used since that's the first version where most current features of -dnl pkg-config existed. -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) -m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi -fi[]dnl -])dnl PKG_PROG_PKG_CONFIG - -dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl ------------------------------------------------------------------- -dnl Since: 0.18 -dnl -dnl Check to see whether a particular set of modules exists. Similar to -dnl PKG_CHECK_MODULES(), but does not set variables or print errors. -dnl -dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -dnl only at the first occurence in configure.ac, so if the first place -dnl it's called might be skipped (such as if it is within an "if", you -dnl have to call PKG_CHECK_EXISTS manually -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_default([$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - -dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -dnl --------------------------------------------- -dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting -dnl pkg_failed based on the result. -m4_define([_PKG_CONFIG], -[if test -n "$$1"; then - pkg_cv_[]$1="$$1" - elif test -n "$PKG_CONFIG"; then - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes ], - [pkg_failed=yes]) - else - pkg_failed=untried -fi[]dnl -])dnl _PKG_CONFIG - -dnl _PKG_SHORT_ERRORS_SUPPORTED -dnl --------------------------- -dnl Internal check to see if pkg-config supports short errors. -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])dnl _PKG_SHORT_ERRORS_SUPPORTED - - -dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -dnl [ACTION-IF-NOT-FOUND]) -dnl -------------------------------------------------------------- -dnl Since: 0.4.0 -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES might not happen, you should be sure to include an -dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $2]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - m4_default([$4], [AC_MSG_ERROR( -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT])[]dnl - ]) -elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see .])[]dnl - ]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - $3 -fi[]dnl -])dnl PKG_CHECK_MODULES - - -dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -dnl [ACTION-IF-NOT-FOUND]) -dnl --------------------------------------------------------------------- -dnl Since: 0.29 -dnl -dnl Checks for existence of MODULES and gathers its build flags with -dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags -dnl and VARIABLE-PREFIX_LIBS from --libs. -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to -dnl include an explicit call to PKG_PROG_PKG_CONFIG in your -dnl configure.ac. -AC_DEFUN([PKG_CHECK_MODULES_STATIC], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -_save_PKG_CONFIG=$PKG_CONFIG -PKG_CONFIG="$PKG_CONFIG --static" -PKG_CHECK_MODULES($@) -PKG_CONFIG=$_save_PKG_CONFIG[]dnl -])dnl PKG_CHECK_MODULES_STATIC - - -dnl PKG_INSTALLDIR([DIRECTORY]) -dnl ------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable pkgconfigdir as the location where a module -dnl should install pkg-config .pc files. By default the directory is -dnl $libdir/pkgconfig, but the default can be changed by passing -dnl DIRECTORY. The user can override through the --with-pkgconfigdir -dnl parameter. -AC_DEFUN([PKG_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([pkgconfigdir], - [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, - [with_pkgconfigdir=]pkg_default) -AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -])dnl PKG_INSTALLDIR - - -dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) -dnl -------------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable noarch_pkgconfigdir as the location where a -dnl module should install arch-independent pkg-config .pc files. By -dnl default the directory is $datadir/pkgconfig, but the default can be -dnl changed by passing DIRECTORY. The user can override through the -dnl --with-noarch-pkgconfigdir parameter. -AC_DEFUN([PKG_NOARCH_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([noarch-pkgconfigdir], - [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, - [with_noarch_pkgconfigdir=]pkg_default) -AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -])dnl PKG_NOARCH_INSTALLDIR - - -dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl ------------------------------------------- -dnl Since: 0.28 -dnl -dnl Retrieves the value of the pkg-config variable for the given module. -AC_DEFUN([PKG_CHECK_VAR], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl - -_PKG_CONFIG([$1], [variable="][$3]["], [$2]) -AS_VAR_COPY([$1], [pkg_cv_][$1]) - -AS_VAR_IF([$1], [""], [$5], [$4])dnl -])dnl PKG_CHECK_VAR - -# Copyright (C) 2002-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.15' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to -# '$srcdir', '$srcdir/..', or '$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is '.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ([2.52])dnl - m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - - -# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], - [$1], [UPC], [depcc="$UPC" am_compiler_list=], - [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES. -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. -m4_define([AC_PROG_CC], -m4_defn([AC_PROG_CC]) -[_AM_PROG_CC_C_O -]) - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.65])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[AC_DIAGNOSE([obsolete], - [$0: two- and three-arguments forms are deprecated.]) -m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -AM_MISSING_PROG([AUTOHEADER], [autoheader]) -AM_MISSING_PROG([MAKEINFO], [makeinfo]) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -AC_REQUIRE([AM_SILENT_RULES])dnl -dnl The testsuite driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This -dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi -dnl The trailing newline in this macro's definition is deliberate, for -dnl backward compatibility and to allow trailing 'dnl'-style comments -dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. -]) - -dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST([install_sh])]) - -# Copyright (C) 2003-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- -# From Jim Meyering - -# Copyright (C) 1996-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAINTAINER_MODE([DEFAULT-MODE]) -# ---------------------------------- -# Control maintainer-specific portions of Makefiles. -# Default is to disable them, unless 'enable' is passed literally. -# For symmetry, 'disable' may be passed as well. Anyway, the user -# can override the default with the --enable/--disable switch. -AC_DEFUN([AM_MAINTAINER_MODE], -[m4_case(m4_default([$1], [disable]), - [enable], [m4_define([am_maintainer_other], [disable])], - [disable], [m4_define([am_maintainer_other], [enable])], - [m4_define([am_maintainer_other], [enable]) - m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode's default is 'disable' unless 'enable' is passed - AC_ARG_ENABLE([maintainer-mode], - [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], - am_maintainer_other[ make rules and dependencies not useful - (and sometimes confusing) to the casual installer])], - [USE_MAINTAINER_MODE=$enableval], - [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) - AC_MSG_RESULT([$USE_MAINTAINER_MODE]) - AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST([MAINT])dnl -] -) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it is modern enough. -# If it is, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - AC_MSG_WARN(['missing' script is too old or missing]) -fi -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# -------------------- -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) - -# _AM_SET_OPTIONS(OPTIONS) -# ------------------------ -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT([yes]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) - -# Copyright (C) 2009-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# ("yes" being less verbose, "no" or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], [dnl -AS_HELP_STRING( - [--enable-silent-rules], - [less verbose build output (undo: "make V=1")]) -AS_HELP_STRING( - [--disable-silent-rules], - [verbose build output (undo: "make V=0")])dnl -]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac -dnl -dnl A few 'make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) - -# Copyright (C) 2001-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor 'install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in "make install-strip", and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Copyright (C) 2006-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of 'v7', 'ustar', or 'pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -# -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' - -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - - [m4_case([$1], - [ustar], - [# The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi - AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi], - - [pax], - [], - - [m4_fatal([Unknown tar format])]) - - AC_MSG_CHECKING([how to create a $1 tar archive]) - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_$1-$_am_tools} - - for _am_tool in $_am_tools; do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works. - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi - done - rm -rf conftest.dir - - AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) - AC_MSG_RESULT([$am_cv_prog_tar_$1])]) - -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - diff --git a/cmake_config.h.in b/cmake_config.h.in new file mode 100644 index 00000000..aa35cd47 --- /dev/null +++ b/cmake_config.h.in @@ -0,0 +1,5 @@ +/* Name of package */ +#cmakedefine PACKAGE "@PACKAGE@" + +/* Version number of package */ +#cmakedefine VERSION "@VERSION@" diff --git a/code_revision.sh b/code_revision.sh new file mode 100755 index 00000000..420371f2 --- /dev/null +++ b/code_revision.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +# TODO: Delete this file after full migration to CMake +# Determining git revision: +# 1) If directory ".git" exists we take revision from git log. +# File is recreated only if revision number was changed. +# 2) If directory ".git" doesn't exists we keep and reuse file "code_revision.cpp", +# which was possibly created early. +# 3) If neither directory ".git" nor file "code_revision.cpp" are available +# we create new file "code_revision.c" with empty revision number. + +if test -d ./.git ; then \ + B=`git branch | sed -n -e 's/^\* \(.*\)/\1/p'`; \ + M=`git status --porcelain` ; \ +if test "$$M" != "" ; then \ + M="M" ; \ +fi ; \ +if test "$$B" = "master" ; then \ + V="$$M" ; \ +elif test "$$B" = "develop" ; then \ + V=`git rev-list HEAD | wc -l | xargs` ; \ + V="$${V}$$M" ; \ +else \ + V=`git rev-list HEAD | wc -l | xargs` ; \ + V="$${V}$$M ($$B)" ; \ +fi ; \ + H=`test -f ./code_revision.cpp && head -n 1 code_revision.cpp`; \ +if test "/* $$V */" != "$$H" ; then \ + ( \ + echo "/* $$V */" ;\ + echo "/* This file is automatically regenerated on each build. Do not edit it. */" ;\ + echo "#include \"nzbget.h\"" ;\ + echo "const char* code_revision(void)" ;\ + echo "{" ;\ + echo "const char* revision = \"$$V\";" ;\ + echo "return revision;" ;\ + echo "}" ;\ +) > code_revision.cpp ; \ +fi \ +elif test -f ./code_revision.cpp ; then \ + test "ok, reuse existing file"; \ +else \ + ( \ + echo "/* */" ;\ + echo "/* This file is automatically regenerated on each build. Do not edit it. */" ;\ + echo "#include \"nzbget.h\"" ;\ + echo "const char* code_revision(void)" ;\ + echo "{" ;\ + echo "const char* revision = \"\";" ;\ + echo "return revision;" ;\ + echo "}" ;\ + ) > code_revision.cpp ; \ +fi diff --git a/config.h.in b/config.h.in deleted file mode 100644 index b757759c..00000000 --- a/config.h.in +++ /dev/null @@ -1,196 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 to include debug-code */ -#undef DEBUG - -/* Define to 1 to not use curses */ -#undef DISABLE_CURSES - -/* Define to 1 to disable gzip-support */ -#undef DISABLE_GZIP - -/* Define to 1 to not use libxml2, only for development purposes */ -#undef DISABLE_LIBXML2 - -/* Define to 1 to disable par-verification and repair */ -#undef DISABLE_PARCHECK - -/* Define to 1 to not use TLS/SSL */ -#undef DISABLE_TLS - -/* Define to 1 to enable unit and integration tests */ -#undef ENABLE_TESTS - -/* Define to the name of macro which returns the name of function being - compiled */ -#undef FUNCTION_MACRO_NAME - -/* Define to 1 to create stacktrace on segmentation faults */ -#undef HAVE_BACKTRACE - -/* Define to 1 if ctime_r takes 2 arguments */ -#undef HAVE_CTIME_R_2 - -/* Define to 1 if ctime_r takes 3 arguments */ -#undef HAVE_CTIME_R_3 - -/* Define to 1 if you have the header file. */ -#undef HAVE_CURSES_H - -/* define if the compiler supports basic C++14 syntax */ -#undef HAVE_CXX14 - -/* Define to 1 if you have the header file. */ -#undef HAVE_ENDIAN_H - -/* Define to 1 if fdatasync is supported */ -#undef HAVE_FDATASYNC - -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ -#undef HAVE_FSEEKO - -/* Define to 1 if F_FULLFSYNC is supported */ -#undef HAVE_FULLFSYNC - -/* Define to 1 if getaddrinfo is supported */ -#undef HAVE_GETADDRINFO - -/* Define to 1 if gethostbyname_r is supported */ -#undef HAVE_GETHOSTBYNAME_R - -/* Define to 1 if gethostbyname_r takes 3 arguments */ -#undef HAVE_GETHOSTBYNAME_R_3 - -/* Define to 1 if gethostbyname_r takes 5 arguments */ -#undef HAVE_GETHOSTBYNAME_R_5 - -/* Define to 1 if gethostbyname_r takes 6 arguments */ -#undef HAVE_GETHOSTBYNAME_R_6 - -/* Define to 1 if you have the `getopt' function. */ -#undef HAVE_GETOPT - -/* Define to 1 if you have the header file. */ -#undef HAVE_GETOPT_H - -/* Define to 1 if getopt_long is supported */ -#undef HAVE_GETOPT_LONG - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 to use GnuTLS library for TLS/SSL-support. */ -#undef HAVE_LIBGNUTLS - -/* Define to 1 if lockf is supported */ -#undef HAVE_LOCKF - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NCURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NCURSES_NCURSES_H - -/* Define to 1 to use Nettle library for decryption. */ -#undef HAVE_NETTLE - -/* Define to 1 to use OpenSSL library for TLS/SSL-support and decryption. */ -#undef HAVE_OPENSSL - -/* Define to 1 if pthread_cancel is supported */ -#undef HAVE_PTHREAD_CANCEL - -/* Define to 1 if you have the header file. */ -#undef HAVE_REGEX_H - -/* Define to 1 if _SC_NPROCESSORS_ONLN is present in unistd.h */ -#undef HAVE_SC_NPROCESSORS_ONLN - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `stricmp' function. */ -#undef HAVE_STRICMP - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PRCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if variadic macros are supported */ -#undef HAVE_VARIADIC_MACROS - -/* Define to 1 if OpenSSL supports function "X509_check_host". */ -#undef HAVE_X509_CHECK_HOST - -/* Define to 1 to exclude debug-code */ -#undef NDEBUG - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 to install an empty signal handler for SIGCHLD */ -#undef SIGCHLD_HANDLER - -/* Determine what socket length (socklen_t) data type is */ -#undef SOCKLEN_T - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION - -/* Enable large inode numbers on Mac OS X 10.5. */ -#ifndef _DARWIN_USE_64_BIT_INODE -# define _DARWIN_USE_64_BIT_INODE 1 -#endif - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ -#undef _LARGEFILE_SOURCE - -/* Define for large files, on AIX-style hosts. */ -#undef _LARGE_FILES - -/* Define to `unsigned int' if does not define. */ -#undef size_t diff --git a/configure b/configure deleted file mode 100755 index 9a140d84..00000000 --- a/configure +++ /dev/null @@ -1,10089 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for nzbget 22.0. -# -# Report bugs to . -# -# -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (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 - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -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 - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; 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 || - PATH_SEPARATOR=';' - } -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 #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -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 - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$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. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -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 - 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 : - 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 - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -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 : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || 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 : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - 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=. - 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 - 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 : - 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 : - break 2 -fi -fi - done;; - 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 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 -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -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 -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." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: nzbget@nzbget.com 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." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$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" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# 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 : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# 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 : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -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 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO 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'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - 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; } - - # 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 - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='nzbget' -PACKAGE_TARNAME='nzbget' -PACKAGE_VERSION='22.0' -PACKAGE_STRING='nzbget 22.0' -PACKAGE_BUGREPORT='nzbget@nzbget.com' -PACKAGE_URL='' - -ac_unique_file="daemon/main/nzbget.cpp" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# 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_UNISTD_H -# include -#endif" - -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIBOBJS -WITH_TESTS_FALSE -WITH_TESTS_TRUE -ACLECRC_CXXFLAGS -NEON_CXXFLAGS -PCLMUL_CXXFLAGS -SSSE3_CXXFLAGS -SSE2_CXXFLAGS -zlib_LIBS -zlib_CFLAGS -nettle_LIBS -nettle_CFLAGS -gnutls_LIBS -gnutls_CFLAGS -openssl_LIBS -openssl_CFLAGS -WITH_PAR2_FALSE -WITH_PAR2_TRUE -ncurses_LIBS -ncurses_CFLAGS -libxml2_LIBS -libxml2_CFLAGS -PKG_CONFIG_LIBDIR -PKG_CONFIG_PATH -PKG_CONFIG -EGREP -GREP -CXXCPP -HAVE_CXX14 -MAKE -TAR -am__fastdepCXX_FALSE -am__fastdepCXX_TRUE -CXXDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__quote -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CXX -CPPFLAGS -LDFLAGS -CXXFLAGS -CXX -MAINT -MAINTAINER_MODE_FALSE -MAINTAINER_MODE_TRUE -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -target_os -target_vendor -target_cpu -target -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_silent_rules -enable_maintainer_mode -enable_dependency_tracking -enable_cpp_check -enable_largefile -enable_libxml2 -with_libxml2_includes -with_libxml2_libraries -enable_curses -with_libcurses_includes -with_libcurses_libraries -enable_parcheck -enable_tls -with_tlslib -with_openssl_includes -with_openssl_libraries -with_libgnutls_includes -with_libgnutls_libraries -with_libnettle_includes -with_libnettle_libraries -enable_gzip -with_zlib_includes -with_zlib_libraries -enable_sigchld_handler -enable_debug -enable_tests -' - ac_precious_vars='build_alias -host_alias -target_alias -CXX -CXXFLAGS -LDFLAGS -LIBS -CPPFLAGS -CCC -CXXCPP -PKG_CONFIG -PKG_CONFIG_PATH -PKG_CONFIG_LIBDIR -libxml2_CFLAGS -libxml2_LIBS -ncurses_CFLAGS -ncurses_LIBS -openssl_CFLAGS -openssl_LIBS -gnutls_CFLAGS -gnutls_LIBS -nettle_CFLAGS -nettle_LIBS -zlib_CFLAGS -zlib_LIBS' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$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 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -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 ;; - esac -fi - -# Check all directory arguments for consistency. -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 -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$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" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures nzbget 22.0 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --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] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/nzbget] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of nzbget 22.0:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-silent-rules less verbose build output (undo: "make V=1") - --disable-silent-rules verbose build output (undo: "make V=0") - --enable-maintainer-mode - enable make rules and dependencies not useful (and - sometimes confusing) to the casual installer - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build - --disable-cpp-check disable check for C++14 compiler features - --disable-largefile omit support for large files - --disable-libxml2 do not use libxml2 (removes dependency from - libxml2-library, only for development purposes) - --disable-curses do not use curses (removes dependency from - curses-library) - --disable-parcheck do not include par-check/-repair-support - --disable-tls do not use TLS/SSL (removes dependency from - TLS/SSL-libraries) - --disable-gzip disable gzip-compression/decompression (removes - dependency from zlib-library) - --disable-sigchld-handler - do not use sigchld-handler (the disabling may be - neccessary on 32-Bit BSD) - --enable-debug enable debugging - --enable-tests enable unit and integration tests - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-libxml2-includes=DIR - libxml2 include directory - --with-libxml2-libraries=DIR - libxml2 library directory - --with-libcurses-includes=DIR - libcurses include directory - --with-libcurses-libraries=DIR - libcurses library directory - --with-tlslib=(OpenSSL, GnuTLS) - TLS/SSL library to use - --with-openssl-includes=DIR - OpenSSL include directory - --with-openssl-libraries=DIR - OpenSSL library directory - --with-libgnutls-includes=DIR - GnuTLS include directory - --with-libgnutls-libraries=DIR - GnuTLS library directory - --with-libnettle-includes=DIR - Nettle include directory - --with-libnettle-libraries=DIR - Nettle library directory - --with-zlib-includes=DIR - zlib include directory - --with-zlib-libraries=DIR - zlib library directory - -Some influential environment variables: - CXX C++ compiler command - CXXFLAGS C++ compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CXXCPP C++ preprocessor - PKG_CONFIG path to pkg-config utility - PKG_CONFIG_PATH - directories to add to pkg-config's search path - PKG_CONFIG_LIBDIR - path overriding pkg-config's built-in search path - libxml2_CFLAGS - C compiler flags for libxml2, overriding pkg-config - libxml2_LIBS - linker flags for libxml2, overriding pkg-config - ncurses_CFLAGS - C compiler flags for ncurses, overriding pkg-config - ncurses_LIBS - linker flags for ncurses, overriding pkg-config - openssl_CFLAGS - C compiler flags for openssl, overriding pkg-config - openssl_LIBS - linker flags for openssl, overriding pkg-config - gnutls_CFLAGS - C compiler flags for gnutls, overriding pkg-config - gnutls_LIBS linker flags for gnutls, overriding pkg-config - nettle_CFLAGS - C compiler flags for nettle, overriding pkg-config - nettle_LIBS linker flags for nettle, overriding pkg-config - zlib_CFLAGS C compiler flags for zlib, overriding pkg-config - zlib_LIBS linker flags for zlib, overriding pkg-config - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$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|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -nzbget configure 22.0 -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - 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 - (eval "$ac_compile") 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; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; 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_cxx_try_compile - -# ac_fn_cxx_try_cpp LINENO -# ------------------------ -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_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_cxx_preproc_warn_flag$ac_cxx_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_cxx_try_cpp - -# ac_fn_cxx_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_cxx_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; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -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_cxx_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_cxx_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_cxx_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;} -( $as_echo "## ------------------------------------------- ## -## Report this to nzbget@nzbget.com ## -## ------------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -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_cxx_check_header_mongrel - -# ac_fn_cxx_try_run LINENO -# ------------------------ -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_cxx_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - 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 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$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 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$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 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_run - -# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES -# --------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_cxx_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; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_cxx_check_header_compile - -# ac_fn_cxx_try_link LINENO -# ------------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -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 - 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 - (eval "$ac_link") 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; } && { - 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 : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_link - -# ac_fn_cxx_check_func LINENO FUNC VAR -# ------------------------------------ -# Tests whether FUNC exists, setting the cache variable VAR accordingly -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; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#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 - -#undef $2 - -/* 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 $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_cxx_check_func - -# ac_fn_cxx_check_decl LINENO SYMBOL VAR INCLUDES -# ----------------------------------------------- -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_cxx_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_cxx_check_decl - -# ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES -# --------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_cxx_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; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_cxx_check_type -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 nzbget $as_me 22.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -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" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# 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=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - 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;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -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 - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# 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 -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -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;} - 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;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -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,) - { $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. ## -## -------------------- ## - -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_aux_dir= -for ac_dir in posix "$srcdir"/posix; 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" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in posix \"$srcdir\"/posix" "$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. - - -# 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; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -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; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if ${ac_cv_target+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- -am__api_version='1.15' - -# 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 -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# 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; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # 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 test $ac_prog = install && - 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 - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - 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" && - 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" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi - -rm -f conftest.file - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" - $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 - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -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_ac_ct_STRIP="strip" - $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 - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - 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;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -for ac_prog in gawk mawk nawk awk -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; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # 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_AWK="$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 - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -# Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='nzbget' - VERSION='22.0' - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -mkdir_p='$(MKDIR_P)' - -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar pax cpio none' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi - - -ac_config_headers="$ac_config_headers config.h" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - - -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the specified -# version of the C++ standard. If necessary, add switches to CXXFLAGS to -# enable support. VERSION may be '11' (for the C++11 standard) or '14' -# (for the C++14 standard). -# -# The second argument, if specified, indicates whether you insist on an -# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. -# -std=c++11). If neither is specified, you get whatever works, with -# preference for an extended mode. -# -# The third argument, if specified 'mandatory' or if left unspecified, -# indicates that baseline support for the specified C++ standard is -# required and that the macro should error out if no mode with that -# support is found. If specified 'optional', then configuration proceeds -# regardless, after defining HAVE_CXX${VERSION} if and only if a -# supporting mode is found. -# -# LICENSE -# -# Copyright (c) 2008 Benjamin Kosnik -# Copyright (c) 2012 Zack Weinberg -# Copyright (c) 2013 Roy Stogner -# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov -# Copyright (c) 2015 Paul Norman -# Copyright (c) 2015 Moritz Klammler -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 1 - - - - - - - - - - - - - - - - - - - - - - -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' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; 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 - 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; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # 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_CXX="$ac_tool_prefix$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 - -fi -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; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CXX" && break - done -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 -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; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_ac_ct_CXX="$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 - -fi -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; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - 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;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -$as_echo "$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 - { { 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 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -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[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -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_link_default") 2>&5 - ac_status=$? - $as_echo "$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, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - 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 -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;} -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; } -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; } -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 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) 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;} -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; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_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; } -if test "$cross_compiling" != yes; then - { { 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 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_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 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$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. -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; } - -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; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -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 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$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 - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$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;} -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 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$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; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -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; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ $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 - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -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 -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CXX" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CXX_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CXX_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' -else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= -fi - - -# Extract the first word of "tar", so it can be a program name with args. -set dummy tar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TAR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TAR in - [\\/]* | ?:[\\/]*) - ac_cv_path_TAR="$TAR" # 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_TAR="$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 - - test -z "$ac_cv_path_TAR" && ac_cv_path_TAR="$FALSE" - ;; -esac -fi -TAR=$ac_cv_path_TAR -if test -n "$TAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 -$as_echo "$TAR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "make", so it can be a program name with args. -set dummy make; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MAKE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAKE in - [\\/]* | ?:[\\/]*) - ac_cv_path_MAKE="$MAKE" # 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_MAKE="$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 - - test -z "$ac_cv_path_MAKE" && ac_cv_path_MAKE="$FALSE" - ;; -esac -fi -MAKE=$ac_cv_path_MAKE -if test -n "$MAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 -$as_echo "$MAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - - -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' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to test compiler features" >&5 -$as_echo_n "checking whether to test compiler features... " >&6; } -# Check whether --enable-cpp-check was given. -if test "${enable_cpp_check+set}" = set; then : - enableval=$enable_cpp_check; ENABLECPPCHECK=$enableval -else - ENABLECPPCHECK=yes -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLECPPCHECK" >&5 -$as_echo "$ENABLECPPCHECK" >&6; } -if test "$ENABLECPPCHECK" = "yes"; then - - ax_cxx_compile_cxx14_required=false - 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' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ac_success=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features by default" >&5 -$as_echo_n "checking whether $CXX supports C++14 features by default... " >&6; } -if ${ax_cv_cxx_compile_cxx14+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201103L - -#error "This is not a C++11 compiler" - -#else - -namespace cxx11 -{ - - namespace test_static_assert - { - - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - } - - namespace test_final_override - { - - struct Base - { - virtual void f() {} - }; - - struct Derived : public Base - { - virtual void f() override {} - }; - - } - - namespace test_double_right_angle_brackets - { - - template < typename T > - struct check {}; - - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; - - } - - namespace test_decltype - { - - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } - - } - - namespace test_type_deduction - { - - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - - template < typename T > - struct is_same - { - static const bool value = true; - }; - - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - - } - - namespace test_noexcept - { - - int f() { return 0; } - int g() noexcept { return 0; } - - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); - - } - - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); - - } - - namespace test_rvalue_references - { - - template < int N > - struct answer - { - static constexpr int value = N; - }; - - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } - - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } - - } - - namespace test_uniform_initialization - { - - struct test - { - static const int zero {}; - static const int one {1}; - }; - - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - - } - - namespace test_lambdas - { - - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } - - } - - namespace test_variadic_templates - { - - template - struct sum; - - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; - - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - - } - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); - - void test() { func(0); } - - } - -} // namespace cxx11 - -#endif // __cplusplus >= 201103L - - - - -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -//check for full C++14 support (disabed) -//#elif __cplusplus < 201402L - -// check for partial C++14 support (accept gcc 4.9) -#elif __cplusplus < 201300L - -#error "This is not a C++14 compiler" - -#else - -namespace cxx14 -{ - - namespace test_polymorphic_lambdas - { - - int - test() - { - const auto lambda = [](auto&&... args){ - const auto istiny = [](auto x){ - return (sizeof(x) == 1UL) ? 1 : 0; - }; - const int aretiny[] = { istiny(args)... }; - return aretiny[0]; - }; - return lambda(1, 1L, 1.0f, '1'); - } - - } - - namespace test_binary_literals - { - - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); - - } - -/* - namespace test_generalized_constexpr - { - - template < typename CharT > - constexpr unsigned long - strlen_c(const CharT *const s) noexcept - { - auto length = 0UL; - for (auto p = s; *p; ++p) - ++length; - return length; - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("x") == 1UL, ""); - static_assert(strlen_c("test") == 4UL, ""); - static_assert(strlen_c("another\0test") == 7UL, ""); - - } -*/ - - namespace test_lambda_init_capture - { - - int - test() - { - auto x = 0; - const auto lambda1 = [a = x](int b){ return a + b; }; - const auto lambda2 = [a = lambda1(x)](){ return a; }; - return lambda2(); - } - - } - - namespace test_digit_seperators - { - - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); - - } - - namespace test_return_type_deduction - { - - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } - - template < typename T1, typename T2 > - struct is_same - { - static constexpr auto value = false; - }; - - template < typename T > - struct is_same - { - static constexpr auto value = true; - }; - - int - test() - { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; - } - - } - -} // namespace cxx14 - -#endif // __cplusplus >= 201402L - - - -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ax_cv_cxx_compile_cxx14=yes -else - ax_cv_cxx_compile_cxx14=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx14" >&5 -$as_echo "$ax_cv_cxx_compile_cxx14" >&6; } - if test x$ax_cv_cxx_compile_cxx14 = xyes; then - ac_success=yes - fi - - if test x$ac_success = xno; then - for switch in -std=c++14 -std=c++0x +std=c++14 "-h std=c++14"; do - cachevar=`$as_echo "ax_cv_cxx_compile_cxx14_$switch" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5 -$as_echo_n "checking whether $CXX supports C++14 features with $switch... " >&6; } -if eval \${$cachevar+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201103L - -#error "This is not a C++11 compiler" - -#else - -namespace cxx11 -{ - - namespace test_static_assert - { - - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - } - - namespace test_final_override - { - - struct Base - { - virtual void f() {} - }; - - struct Derived : public Base - { - virtual void f() override {} - }; - - } - - namespace test_double_right_angle_brackets - { - - template < typename T > - struct check {}; - - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; - - } - - namespace test_decltype - { - - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } - - } - - namespace test_type_deduction - { - - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - - template < typename T > - struct is_same - { - static const bool value = true; - }; - - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - - } - - namespace test_noexcept - { - - int f() { return 0; } - int g() noexcept { return 0; } - - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); - - } - - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); - - } - - namespace test_rvalue_references - { - - template < int N > - struct answer - { - static constexpr int value = N; - }; - - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } - - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } - - } - - namespace test_uniform_initialization - { - - struct test - { - static const int zero {}; - static const int one {1}; - }; - - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - - } - - namespace test_lambdas - { - - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } - - } - - namespace test_variadic_templates - { - - template - struct sum; - - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; - - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - - } - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); - - void test() { func(0); } - - } - -} // namespace cxx11 - -#endif // __cplusplus >= 201103L - - - - -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -//check for full C++14 support (disabed) -//#elif __cplusplus < 201402L - -// check for partial C++14 support (accept gcc 4.9) -#elif __cplusplus < 201300L - -#error "This is not a C++14 compiler" - -#else - -namespace cxx14 -{ - - namespace test_polymorphic_lambdas - { - - int - test() - { - const auto lambda = [](auto&&... args){ - const auto istiny = [](auto x){ - return (sizeof(x) == 1UL) ? 1 : 0; - }; - const int aretiny[] = { istiny(args)... }; - return aretiny[0]; - }; - return lambda(1, 1L, 1.0f, '1'); - } - - } - - namespace test_binary_literals - { - - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); - - } - -/* - namespace test_generalized_constexpr - { - - template < typename CharT > - constexpr unsigned long - strlen_c(const CharT *const s) noexcept - { - auto length = 0UL; - for (auto p = s; *p; ++p) - ++length; - return length; - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("x") == 1UL, ""); - static_assert(strlen_c("test") == 4UL, ""); - static_assert(strlen_c("another\0test") == 7UL, ""); - - } -*/ - - namespace test_lambda_init_capture - { - - int - test() - { - auto x = 0; - const auto lambda1 = [a = x](int b){ return a + b; }; - const auto lambda2 = [a = lambda1(x)](){ return a; }; - return lambda2(); - } - - } - - namespace test_digit_seperators - { - - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); - - } - - namespace test_return_type_deduction - { - - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } - - template < typename T1, typename T2 > - struct is_same - { - static constexpr auto value = false; - }; - - template < typename T > - struct is_same - { - static constexpr auto value = true; - }; - - int - test() - { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; - } - - } - -} // namespace cxx14 - -#endif // __cplusplus >= 201402L - - - -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - eval $cachevar=yes -else - eval $cachevar=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXXFLAGS="$ac_save_CXXFLAGS" -fi -eval ac_res=\$$cachevar - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXXFLAGS="$CXXFLAGS $switch" - ac_success=yes - break - fi - done - fi - - if test x$ac_success = xno; then - for switch in -std=gnu++14 -std=gnu++0x; do - cachevar=`$as_echo "ax_cv_cxx_compile_cxx14_$switch" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5 -$as_echo_n "checking whether $CXX supports C++14 features with $switch... " >&6; } -if eval \${$cachevar+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201103L - -#error "This is not a C++11 compiler" - -#else - -namespace cxx11 -{ - - namespace test_static_assert - { - - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - } - - namespace test_final_override - { - - struct Base - { - virtual void f() {} - }; - - struct Derived : public Base - { - virtual void f() override {} - }; - - } - - namespace test_double_right_angle_brackets - { - - template < typename T > - struct check {}; - - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; - - } - - namespace test_decltype - { - - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } - - } - - namespace test_type_deduction - { - - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - - template < typename T > - struct is_same - { - static const bool value = true; - }; - - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - - } - - namespace test_noexcept - { - - int f() { return 0; } - int g() noexcept { return 0; } - - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); - - } - - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); - - } - - namespace test_rvalue_references - { - - template < int N > - struct answer - { - static constexpr int value = N; - }; - - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } - - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } - - } - - namespace test_uniform_initialization - { - - struct test - { - static const int zero {}; - static const int one {1}; - }; - - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - - } - - namespace test_lambdas - { - - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } - - } - - namespace test_variadic_templates - { - - template - struct sum; - - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; - - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - - } - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); - - void test() { func(0); } - - } - -} // namespace cxx11 - -#endif // __cplusplus >= 201103L - - - - -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -//check for full C++14 support (disabed) -//#elif __cplusplus < 201402L - -// check for partial C++14 support (accept gcc 4.9) -#elif __cplusplus < 201300L - -#error "This is not a C++14 compiler" - -#else - -namespace cxx14 -{ - - namespace test_polymorphic_lambdas - { - - int - test() - { - const auto lambda = [](auto&&... args){ - const auto istiny = [](auto x){ - return (sizeof(x) == 1UL) ? 1 : 0; - }; - const int aretiny[] = { istiny(args)... }; - return aretiny[0]; - }; - return lambda(1, 1L, 1.0f, '1'); - } - - } - - namespace test_binary_literals - { - - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); - - } - -/* - namespace test_generalized_constexpr - { - - template < typename CharT > - constexpr unsigned long - strlen_c(const CharT *const s) noexcept - { - auto length = 0UL; - for (auto p = s; *p; ++p) - ++length; - return length; - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("x") == 1UL, ""); - static_assert(strlen_c("test") == 4UL, ""); - static_assert(strlen_c("another\0test") == 7UL, ""); - - } -*/ - - namespace test_lambda_init_capture - { - - int - test() - { - auto x = 0; - const auto lambda1 = [a = x](int b){ return a + b; }; - const auto lambda2 = [a = lambda1(x)](){ return a; }; - return lambda2(); - } - - } - - namespace test_digit_seperators - { - - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); - - } - - namespace test_return_type_deduction - { - - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } - - template < typename T1, typename T2 > - struct is_same - { - static constexpr auto value = false; - }; - - template < typename T > - struct is_same - { - static constexpr auto value = true; - }; - - int - test() - { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; - } - - } - -} // namespace cxx14 - -#endif // __cplusplus >= 201402L - - - -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - eval $cachevar=yes -else - eval $cachevar=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXXFLAGS="$ac_save_CXXFLAGS" -fi -eval ac_res=\$$cachevar - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXXFLAGS="$CXXFLAGS $switch" - ac_success=yes - break - fi - done - fi - - 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' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - if test x$ax_cxx_compile_cxx14_required = xtrue; then - if test x$ac_success = xno; then - as_fn_error $? "*** A compiler with support for C++14 language features is required." "$LINENO" 5 - fi - else - if test x$ac_success = xno; then - HAVE_CXX14=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++14 support was found" >&5 -$as_echo "$as_me: No compiler with C++14 support was found" >&6;} - else - HAVE_CXX14=1 - -$as_echo "#define HAVE_CXX14 1" >>confdefs.h - - fi - - - fi - - if test "$HAVE_CXX14" != "1"; then - as_fn_error $? "\"A compiler with support for C++14 language features is required. For details visit http://nzbget.com/cpp14\"" "$LINENO" 5 - fi -fi - -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' -ac_compiler_gnu=$ac_cv_cxx_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; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_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 - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -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 : - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_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 - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -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 : - -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 $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -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' -ac_compiler_gnu=$ac_cv_cxx_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; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -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 - for ac_exec_ext in '' $ac_executable_extensions; do - 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 -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 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" - "$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 - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$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; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - 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" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 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" - "$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 - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$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; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_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 - -_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* - -fi - -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_cxx_try_run "$LINENO"; 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 - -fi -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 - -fi - -# 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_cxx_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 - - -for ac_header in sys/prctl.h regex.h endian.h getopt.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_cxx_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 - -fi - -done - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 -$as_echo_n "checking for library containing pthread_create... " >&6; } -if ${ac_cv_search_pthread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_create (); -int -main () -{ -return pthread_create (); - ; - return 0; -} -_ACEOF -for ac_lib in '' pthread; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_pthread_create=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_pthread_create+:} false; then : - break -fi -done -if ${ac_cv_search_pthread_create+:} false; then : - -else - ac_cv_search_pthread_create=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_create" >&5 -$as_echo "$ac_cv_search_pthread_create" >&6; } -ac_res=$ac_cv_search_pthread_create -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 -$as_echo_n "checking for library containing socket... " >&6; } -if ${ac_cv_search_socket+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char socket (); -int -main () -{ -return socket (); - ; - return 0; -} -_ACEOF -for ac_lib in '' socket; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_socket=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_socket+:} false; then : - break -fi -done -if ${ac_cv_search_socket+:} false; then : - -else - ac_cv_search_socket=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 -$as_echo "$ac_cv_search_socket" >&6; } -ac_res=$ac_cv_search_socket -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_addr" >&5 -$as_echo_n "checking for library containing inet_addr... " >&6; } -if ${ac_cv_search_inet_addr+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char inet_addr (); -int -main () -{ -return inet_addr (); - ; - return 0; -} -_ACEOF -for ac_lib in '' nsl; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_inet_addr=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_inet_addr+:} false; then : - break -fi -done -if ${ac_cv_search_inet_addr+:} false; then : - -else - ac_cv_search_inet_addr=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_addr" >&5 -$as_echo "$ac_cv_search_inet_addr" >&6; } -ac_res=$ac_cv_search_inet_addr -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing hstrerror" >&5 -$as_echo_n "checking for library containing hstrerror... " >&6; } -if ${ac_cv_search_hstrerror+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char hstrerror (); -int -main () -{ -return hstrerror (); - ; - return 0; -} -_ACEOF -for ac_lib in '' resolv; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_hstrerror=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_hstrerror+:} false; then : - break -fi -done -if ${ac_cv_search_hstrerror+:} false; then : - -else - ac_cv_search_hstrerror=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_hstrerror" >&5 -$as_echo "$ac_cv_search_hstrerror" >&6; } -ac_res=$ac_cv_search_hstrerror -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - - -ac_fn_cxx_check_func "$LINENO" "lockf" "ac_cv_func_lockf" -if test "x$ac_cv_func_lockf" = xyes; then : - ac_fn_cxx_check_decl "$LINENO" "lockf" "ac_cv_have_decl_lockf" "#include -" -if test "x$ac_cv_have_decl_lockf" = xyes; then : - -$as_echo "#define HAVE_LOCKF 1" >>confdefs.h - -fi - -fi - -ac_fn_cxx_check_func "$LINENO" "pthread_cancel" "ac_cv_func_pthread_cancel" -if test "x$ac_cv_func_pthread_cancel" = xyes; then : - ac_fn_cxx_check_decl "$LINENO" "pthread_cancel" "ac_cv_have_decl_pthread_cancel" "#include -" -if test "x$ac_cv_have_decl_pthread_cancel" = xyes; then : - -$as_echo "#define HAVE_PTHREAD_CANCEL 1" >>confdefs.h - -fi - -fi - - - -ac_fn_cxx_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long" -if test "x$ac_cv_func_getopt_long" = xyes; then : - -$as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h - -fi - - - -ac_fn_cxx_check_func "$LINENO" "fdatasync" "ac_cv_func_fdatasync" -if test "x$ac_cv_func_fdatasync" = xyes; then : - -$as_echo "#define HAVE_FDATASYNC 1" >>confdefs.h - -fi - -ac_fn_cxx_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" "#include -" -if test "x$ac_cv_have_decl_F_FULLFSYNC" = xyes; then : - -$as_echo "#define HAVE_FULLFSYNC 1" >>confdefs.h - -fi - - -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then : - enableval=$enable_largefile; -fi - -if test "$enable_largefile" != no; then - - { $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; } -if ${ac_cv_sys_largefile_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF - if ac_fn_cxx_try_compile "$LINENO"; then : - break -fi -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_sys_largefile_CC=' -n32'; break -fi -rm -f core conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - 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; } -if ${ac_cv_sys_file_offset_bits+:} false; then : - $as_echo_n "(cached) " >&6 -else - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=64; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF -;; -esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { $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; } -if ${ac_cv_sys_large_files+:} false; then : - $as_echo_n "(cached) " >&6 -else - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_sys_large_files=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_sys_large_files=1; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF -;; -esac -rm -rf conftest* - fi - - -fi - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ctime_r" >&5 -$as_echo_n "checking for ctime_r... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - time_t clock; char buf[26]; ctime_r(&clock, buf, 26); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, and it takes 3 arguments" >&5 -$as_echo "yes, and it takes 3 arguments" >&6; } - FOUND="yes" - -$as_echo "#define HAVE_CTIME_R_3 1" >>confdefs.h - -else - FOUND="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -if test "$FOUND" = "no"; then -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - time_t clock; char buf[26]; ctime_r(&clock, buf); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, and it takes 2 arguments" >&5 -$as_echo "yes, and it takes 2 arguments" >&6; } - FOUND="yes" - -$as_echo "#define HAVE_CTIME_R_2 1" >>confdefs.h - -else - FOUND="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -if test "$FOUND" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "\"function ctime_r not found\"" "$LINENO" 5 -fi - - -ac_fn_cxx_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" -if test "x$ac_cv_func_getaddrinfo" = xyes; then : - FOUND="yes" - -$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5 -$as_echo_n "checking for library containing getaddrinfo... " >&6; } -if ${ac_cv_search_getaddrinfo+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char getaddrinfo (); -int -main () -{ -return getaddrinfo (); - ; - return 0; -} -_ACEOF -for ac_lib in '' nsl; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_getaddrinfo=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_getaddrinfo+:} false; then : - break -fi -done -if ${ac_cv_search_getaddrinfo+:} false; then : - -else - ac_cv_search_getaddrinfo=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5 -$as_echo "$ac_cv_search_getaddrinfo" >&6; } -ac_res=$ac_cv_search_getaddrinfo -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - FOUND="no" -fi - - - -if test "$FOUND" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r" >&5 -$as_echo_n "checking for gethostbyname_r... " >&6; } - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - char* szHost; struct hostent hinfobuf; char* strbuf; int h_errnop; - struct hostent* hinfo = gethostbyname_r(szHost, &hinfobuf, strbuf, 1024, &h_errnop); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, and it takes 5 arguments" >&5 -$as_echo "yes, and it takes 5 arguments" >&6; } - FOUND="yes" - -$as_echo "#define HAVE_GETHOSTBYNAME_R_5 1" >>confdefs.h - -else - FOUND="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - if test "$FOUND" = "no"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - char* szHost; struct hostent* hinfo; struct hostent hinfobuf; char* strbuf; int h_errnop; - int err = gethostbyname_r(szHost, &hinfobuf, strbuf, 1024, &hinfo, &h_errnop); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, and it takes 6 arguments" >&5 -$as_echo "yes, and it takes 6 arguments" >&6; } - FOUND="yes" - -$as_echo "#define HAVE_GETHOSTBYNAME_R_6 1" >>confdefs.h - -else - FOUND="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - - if test "$FOUND" = "no"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - char* szHost; struct hostent hinfo; struct hostent_data hinfobuf; - int err = gethostbyname_r(szHost, &hinfo, &hinfobuf); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, and it takes 3 arguments" >&5 -$as_echo "yes, and it takes 3 arguments" >&6; } - FOUND="yes" - -$as_echo "#define HAVE_GETHOSTBYNAME_R_3 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - FOUND="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - - if test "$FOUND" = "yes"; then - -$as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname_r" >&5 -$as_echo_n "checking for library containing gethostbyname_r... " >&6; } -if ${ac_cv_search_gethostbyname_r+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname_r (); -int -main () -{ -return gethostbyname_r (); - ; - return 0; -} -_ACEOF -for ac_lib in '' nsl; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_gethostbyname_r=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_gethostbyname_r+:} false; then : - break -fi -done -if ${ac_cv_search_gethostbyname_r+:} false; then : - -else - ac_cv_search_gethostbyname_r=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname_r" >&5 -$as_echo "$ac_cv_search_gethostbyname_r" >&6; } -ac_res=$ac_cv_search_gethostbyname_r -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - fi -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type of socket length (socklen_t)" >&5 -$as_echo_n "checking for type of socket length (socklen_t)... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include -int -main () -{ - -(void)getsockopt (1, 1, 1, NULL, (socklen_t*)NULL) - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: socklen_t" >&5 -$as_echo "socklen_t" >&6; } - SOCKLEN_T=socklen_t -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include -int -main () -{ - -(void)getsockopt (1, 1, 1, NULL, (size_t*)NULL) - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: size_t" >&5 -$as_echo "size_t" >&6; } - SOCKLEN_T=size_t -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include -int -main () -{ - -(void)getsockopt (1, 1, 1, NULL, (int*)NULL) - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: int" >&5 -$as_echo "int" >&6; } - SOCKLEN_T=int -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not determine" >&5 -$as_echo "$as_me: WARNING: could not determine" >&2;} - SOCKLEN_T=int -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -cat >>confdefs.h <<_ACEOF -#define SOCKLEN_T $SOCKLEN_T -_ACEOF - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cpu cores via sysconf" >&5 -$as_echo_n "checking for cpu cores via sysconf... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - int a = _SC_NPROCESSORS_ONLN; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - FOUND="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_SC_NPROCESSORS_ONLN 1" >>confdefs.h - -else - FOUND="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use libxml2" >&5 -$as_echo_n "checking whether to use libxml2... " >&6; } -# Check whether --enable-libxml2 was given. -if test "${enable_libxml2+set}" = set; then : - enableval=$enable_libxml2; USELIBXML2=$enableval -else - USELIBXML2=yes -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USELIBXML2" >&5 -$as_echo "$USELIBXML2" >&6; } -if test "$USELIBXML2" = "yes"; then - -# Check whether --with-libxml2_includes was given. -if test "${with_libxml2_includes+set}" = set; then : - withval=$with_libxml2_includes; CPPFLAGS="${CPPFLAGS} -I${withval}" - INCVAL="yes" -else - INCVAL="no" -fi - - -# Check whether --with-libxml2_libraries was given. -if test "${with_libxml2_libraries+set}" = set; then : - withval=$with_libxml2_libraries; LDFLAGS="${LDFLAGS} -L${withval}" - LIBVAL="yes" -else - LIBVAL="no" -fi - - if test "$INCVAL" = "no" -o "$LIBVAL" = "no"; then - - - - - - - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # 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_PKG_CONFIG="$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 - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # 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_ac_pt_PKG_CONFIG="$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 - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - 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;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; 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; } - PKG_CONFIG="" - fi -fi - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml-2.0" >&5 -$as_echo_n "checking for libxml-2.0... " >&6; } - -if test -n "$libxml2_CFLAGS"; then - pkg_cv_libxml2_CFLAGS="$libxml2_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_libxml2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$libxml2_LIBS"; then - pkg_cv_libxml2_LIBS="$libxml2_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_libxml2_LIBS=`$PKG_CONFIG --libs "libxml-2.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - libxml2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxml-2.0" 2>&1` - else - libxml2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxml-2.0" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$libxml2_PKG_ERRORS" >&5 - - as_fn_error $? "\"libxml2 library not found\"" "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "\"libxml2 library not found\"" "$LINENO" 5 -else - libxml2_CFLAGS=$pkg_cv_libxml2_CFLAGS - libxml2_LIBS=$pkg_cv_libxml2_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBS="${LIBS} $libxml2_LIBS" - CPPFLAGS="${CPPFLAGS} $libxml2_CFLAGS" -fi - fi - ac_fn_cxx_check_header_mongrel "$LINENO" "libxml/tree.h" "ac_cv_header_libxml_tree_h" "$ac_includes_default" -if test "x$ac_cv_header_libxml_tree_h" = xyes; then : - -else - as_fn_error $? "\"libxml2 header files not found\"" "$LINENO" 5 -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing xmlNewNode" >&5 -$as_echo_n "checking for library containing xmlNewNode... " >&6; } -if ${ac_cv_search_xmlNewNode+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char xmlNewNode (); -int -main () -{ -return xmlNewNode (); - ; - return 0; -} -_ACEOF -for ac_lib in '' xml2; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_xmlNewNode=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_xmlNewNode+:} false; then : - break -fi -done -if ${ac_cv_search_xmlNewNode+:} false; then : - -else - ac_cv_search_xmlNewNode=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_xmlNewNode" >&5 -$as_echo "$ac_cv_search_xmlNewNode" >&6; } -ac_res=$ac_cv_search_xmlNewNode -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -else - as_fn_error $? "\"libxml2 library not found\"" "$LINENO" 5 -fi - -else - -$as_echo "#define DISABLE_LIBXML2 1" >>confdefs.h - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use curses" >&5 -$as_echo_n "checking whether to use curses... " >&6; } -# Check whether --enable-curses was given. -if test "${enable_curses+set}" = set; then : - enableval=$enable_curses; USECURSES=$enableval -else - USECURSES=yes -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USECURSES" >&5 -$as_echo "$USECURSES" >&6; } -if test "$USECURSES" = "yes"; then - -# Check whether --with-libcurses_includes was given. -if test "${with_libcurses_includes+set}" = set; then : - withval=$with_libcurses_includes; CPPFLAGS="${CPPFLAGS} -I${withval}" - INCVAL="yes" -else - INCVAL="no" -fi - - -# Check whether --with-libcurses_libraries was given. -if test "${with_libcurses_libraries+set}" = set; then : - withval=$with_libcurses_libraries; LDFLAGS="${LDFLAGS} -L${withval}" - LIBVAL="yes" -else - LIBVAL="no" -fi - - if test "$INCVAL" = "no" -o "$LIBVAL" = "no"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ncurses" >&5 -$as_echo_n "checking for ncurses... " >&6; } - -if test -n "$ncurses_CFLAGS"; then - pkg_cv_ncurses_CFLAGS="$ncurses_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ncurses\""; } >&5 - ($PKG_CONFIG --exists --print-errors "ncurses") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_ncurses_CFLAGS=`$PKG_CONFIG --cflags "ncurses" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$ncurses_LIBS"; then - pkg_cv_ncurses_LIBS="$ncurses_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ncurses\""; } >&5 - ($PKG_CONFIG --exists --print-errors "ncurses") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_ncurses_LIBS=`$PKG_CONFIG --libs "ncurses" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - ncurses_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ncurses" 2>&1` - else - ncurses_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ncurses" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$ncurses_PKG_ERRORS" >&5 - - as_fn_error $? "\"ncurses library not found\"" "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "\"ncurses library not found\"" "$LINENO" 5 -else - ncurses_CFLAGS=$pkg_cv_ncurses_CFLAGS - ncurses_LIBS=$pkg_cv_ncurses_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBS="${LIBS} $ncurses_LIBS" - CPPFLAGS="${CPPFLAGS} $ncurses_CFLAGS" -fi - fi - - ac_fn_cxx_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" -if test "x$ac_cv_header_ncurses_h" = xyes; then : - FOUND=yes - -$as_echo "#define HAVE_NCURSES_H 1" >>confdefs.h - -else - FOUND=no -fi - - - if test "$FOUND" = "no"; then - ac_fn_cxx_check_header_mongrel "$LINENO" "ncurses/ncurses.h" "ac_cv_header_ncurses_ncurses_h" "$ac_includes_default" -if test "x$ac_cv_header_ncurses_ncurses_h" = xyes; then : - FOUND=yes - -$as_echo "#define HAVE_NCURSES_NCURSES_H 1" >>confdefs.h - -else - FOUND=no -fi - - - fi - if test "$FOUND" = "no"; then - ac_fn_cxx_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" -if test "x$ac_cv_header_curses_h" = xyes; then : - FOUND=yes - -$as_echo "#define HAVE_CURSES_H 1" >>confdefs.h - -else - FOUND=no -fi - - - fi - if test "$FOUND" = "no"; then - as_fn_error $? "Couldn't find curses headers (ncurses.h or curses.h)" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing refresh" >&5 -$as_echo_n "checking for library containing refresh... " >&6; } -if ${ac_cv_search_refresh+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char refresh (); -int -main () -{ -return refresh (); - ; - return 0; -} -_ACEOF -for ac_lib in '' ncurses curses; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_refresh=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_refresh+:} false; then : - break -fi -done -if ${ac_cv_search_refresh+:} false; then : - -else - ac_cv_search_refresh=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_refresh" >&5 -$as_echo "$ac_cv_search_refresh" >&6; } -ac_res=$ac_cv_search_refresh -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -else - as_fn_error $? "Couldn't find curses library" "$LINENO" 5 -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nodelay" >&5 -$as_echo_n "checking for library containing nodelay... " >&6; } -if ${ac_cv_search_nodelay+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char nodelay (); -int -main () -{ -return nodelay (); - ; - return 0; -} -_ACEOF -for ac_lib in '' ncurses curses tinfo; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_nodelay=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_nodelay+:} false; then : - break -fi -done -if ${ac_cv_search_nodelay+:} false; then : - -else - ac_cv_search_nodelay=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nodelay" >&5 -$as_echo "$ac_cv_search_nodelay" >&6; } -ac_res=$ac_cv_search_nodelay -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -else - as_fn_error $? "Couldn't find curses library" "$LINENO" 5 -fi - -else - -$as_echo "#define DISABLE_CURSES 1" >>confdefs.h - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include code for par-checking" >&5 -$as_echo_n "checking whether to include code for par-checking... " >&6; } -# Check whether --enable-parcheck was given. -if test "${enable_parcheck+set}" = set; then : - enableval=$enable_parcheck; ENABLEPARCHECK=$enableval -else - ENABLEPARCHECK=yes -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLEPARCHECK" >&5 -$as_echo "$ENABLEPARCHECK" >&6; } -if test "$ENABLEPARCHECK" = "yes"; then - ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -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; } -if ${ac_cv_sys_largefile_source+:} false; then : - $as_echo_n "(cached) " >&6 -else - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include /* for off_t */ - #include -int -main () -{ -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_sys_largefile_source=no; break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _LARGEFILE_SOURCE 1 -#include /* for off_t */ - #include -int -main () -{ -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_sys_largefile_source=1; break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_cv_sys_largefile_source=unknown - break -done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 -$as_echo "$ac_cv_sys_largefile_source" >&6; } -case $ac_cv_sys_largefile_source in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source -_ACEOF -;; -esac -rm -rf conftest* - -# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug -# 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. -if test $ac_cv_sys_largefile_source != unknown; then - -$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h - -fi - - for ac_func in stricmp -do : - ac_fn_cxx_check_func "$LINENO" "stricmp" "ac_cv_func_stricmp" -if test "x$ac_cv_func_stricmp" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRICMP 1 -_ACEOF - -fi -done - - for ac_func in getopt -do : - ac_fn_cxx_check_func "$LINENO" "getopt" "ac_cv_func_getopt" -if test "x$ac_cv_func_getopt" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETOPT 1 -_ACEOF - -fi -done - - if true; then - WITH_PAR2_TRUE= - WITH_PAR2_FALSE='#' -else - WITH_PAR2_TRUE='#' - WITH_PAR2_FALSE= -fi - -else - -$as_echo "#define DISABLE_PARCHECK 1" >>confdefs.h - - if false; then - WITH_PAR2_TRUE= - WITH_PAR2_FALSE='#' -else - WITH_PAR2_TRUE='#' - WITH_PAR2_FALSE= -fi - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use TLS/SSL" >&5 -$as_echo_n "checking whether to use TLS/SSL... " >&6; } -# Check whether --enable-tls was given. -if test "${enable_tls+set}" = set; then : - enableval=$enable_tls; USETLS=$enableval -else - USETLS=yes -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USETLS" >&5 -$as_echo "$USETLS" >&6; } -if test "$USETLS" = "yes"; then - -# Check whether --with-tlslib was given. -if test "${with_tlslib+set}" = set; then : - withval=$with_tlslib; TLSLIB="$withval" -fi - - if test "$TLSLIB" != "GnuTLS" -a "$TLSLIB" != "OpenSSL" -a "$TLSLIB" != ""; then - as_fn_error $? "Invalid argument for option --with-tlslib" "$LINENO" 5 - fi - - if test "$TLSLIB" = "OpenSSL" -o "$TLSLIB" = ""; then - -# Check whether --with-openssl_includes was given. -if test "${with_openssl_includes+set}" = set; then : - withval=$with_openssl_includes; CPPFLAGS="${CPPFLAGS} -I${withval}" - INCVAL="yes" -else - INCVAL="no" -fi - - -# Check whether --with-openssl_libraries was given. -if test "${with_openssl_libraries+set}" = set; then : - withval=$with_openssl_libraries; LDFLAGS="${LDFLAGS} -L${withval}" - LIBVAL="yes" -else - LIBVAL="no" -fi - - if test "$INCVAL" = "no" -o "$LIBVAL" = "no"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl" >&5 -$as_echo_n "checking for openssl... " >&6; } - -if test -n "$openssl_CFLAGS"; then - pkg_cv_openssl_CFLAGS="$openssl_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl\""; } >&5 - ($PKG_CONFIG --exists --print-errors "openssl") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_openssl_CFLAGS=`$PKG_CONFIG --cflags "openssl" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$openssl_LIBS"; then - pkg_cv_openssl_LIBS="$openssl_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl\""; } >&5 - ($PKG_CONFIG --exists --print-errors "openssl") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_openssl_LIBS=`$PKG_CONFIG --libs "openssl" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - openssl_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl" 2>&1` - else - openssl_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$openssl_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (openssl) were not met: - -$openssl_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables openssl_CFLAGS -and openssl_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables openssl_CFLAGS -and openssl_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - openssl_CFLAGS=$pkg_cv_openssl_CFLAGS - openssl_LIBS=$pkg_cv_openssl_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBS="${LIBS} $openssl_LIBS" - CPPFLAGS="${CPPFLAGS} $openssl_CFLAGS" -fi - fi - - ac_fn_cxx_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_ssl_h" = xyes; then : - FOUND=yes - TLSHEADERS=yes -else - FOUND=no -fi - - - if test "$FOUND" = "no" -a "$TLSLIB" = "OpenSSL"; then - as_fn_error $? "Couldn't find OpenSSL headers (ssl.h)" "$LINENO" 5 - fi - if test "$FOUND" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ASN1_OBJECT_free" >&5 -$as_echo_n "checking for library containing ASN1_OBJECT_free... " >&6; } -if ${ac_cv_search_ASN1_OBJECT_free+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char ASN1_OBJECT_free (); -int -main () -{ -return ASN1_OBJECT_free (); - ; - return 0; -} -_ACEOF -for ac_lib in '' crypto; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_ASN1_OBJECT_free=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_ASN1_OBJECT_free+:} false; then : - break -fi -done -if ${ac_cv_search_ASN1_OBJECT_free+:} false; then : - -else - ac_cv_search_ASN1_OBJECT_free=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ASN1_OBJECT_free" >&5 -$as_echo "$ac_cv_search_ASN1_OBJECT_free" >&6; } -ac_res=$ac_cv_search_ASN1_OBJECT_free -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_CTX_new" >&5 -$as_echo_n "checking for library containing SSL_CTX_new... " >&6; } -if ${ac_cv_search_SSL_CTX_new+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char SSL_CTX_new (); -int -main () -{ -return SSL_CTX_new (); - ; - return 0; -} -_ACEOF -for ac_lib in '' ssl; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_SSL_CTX_new=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_SSL_CTX_new+:} false; then : - break -fi -done -if ${ac_cv_search_SSL_CTX_new+:} false; then : - -else - ac_cv_search_SSL_CTX_new=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SSL_CTX_new" >&5 -$as_echo "$ac_cv_search_SSL_CTX_new" >&6; } -ac_res=$ac_cv_search_SSL_CTX_new -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - FOUND=yes -else - FOUND=no -fi - -else - FOUND=no -fi - - if test "$FOUND" = "no" -a "$TLSLIB" = "OpenSSL"; then - as_fn_error $? "Couldn't find OpenSSL library" "$LINENO" 5 - fi - if test "$FOUND" = "yes"; then - TLSLIB="OpenSSL" - -$as_echo "#define HAVE_OPENSSL 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing X509_check_host" >&5 -$as_echo_n "checking for library containing X509_check_host... " >&6; } -if ${ac_cv_search_X509_check_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char X509_check_host (); -int -main () -{ -return X509_check_host (); - ; - return 0; -} -_ACEOF -for ac_lib in '' crypto; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_X509_check_host=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_X509_check_host+:} false; then : - break -fi -done -if ${ac_cv_search_X509_check_host+:} false; then : - -else - ac_cv_search_X509_check_host=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_X509_check_host" >&5 -$as_echo "$ac_cv_search_X509_check_host" >&6; } -ac_res=$ac_cv_search_X509_check_host -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -$as_echo "#define HAVE_X509_CHECK_HOST 1" >>confdefs.h - -fi - - fi - fi - fi - - if test "$TLSLIB" = "GnuTLS" -o "$TLSLIB" = ""; then - -# Check whether --with-libgnutls_includes was given. -if test "${with_libgnutls_includes+set}" = set; then : - withval=$with_libgnutls_includes; CPPFLAGS="${CPPFLAGS} -I${withval}" - INCVAL="yes" -else - INCVAL="no" -fi - - -# Check whether --with-libgnutls_libraries was given. -if test "${with_libgnutls_libraries+set}" = set; then : - withval=$with_libgnutls_libraries; LDFLAGS="${LDFLAGS} -L${withval}" - LIBVAL="yes" -else - LIBVAL="no" -fi - - if test "$INCVAL" = "no" -o "$LIBVAL" = "no"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls" >&5 -$as_echo_n "checking for gnutls... " >&6; } - -if test -n "$gnutls_CFLAGS"; then - pkg_cv_gnutls_CFLAGS="$gnutls_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gnutls") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_gnutls_CFLAGS=`$PKG_CONFIG --cflags "gnutls" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$gnutls_LIBS"; then - pkg_cv_gnutls_LIBS="$gnutls_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gnutls") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_gnutls_LIBS=`$PKG_CONFIG --libs "gnutls" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - gnutls_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls" 2>&1` - else - gnutls_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$gnutls_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (gnutls) were not met: - -$gnutls_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables gnutls_CFLAGS -and gnutls_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables gnutls_CFLAGS -and gnutls_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - gnutls_CFLAGS=$pkg_cv_gnutls_CFLAGS - gnutls_LIBS=$pkg_cv_gnutls_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBS="${LIBS} $gnutls_LIBS" - CPPFLAGS="${CPPFLAGS} $gnutls_CFLAGS" -fi - fi - - ac_fn_cxx_check_header_mongrel "$LINENO" "gnutls/gnutls.h" "ac_cv_header_gnutls_gnutls_h" "$ac_includes_default" -if test "x$ac_cv_header_gnutls_gnutls_h" = xyes; then : - FOUND=yes - TLSHEADERS=yes -else - FOUND=no -fi - - - if test "$FOUND" = "no" -a "$TLSLIB" = "GnuTLS"; then - as_fn_error $? "Couldn't find GnuTLS headers (gnutls.h)" "$LINENO" 5 - fi - if test "$FOUND" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gnutls_global_init" >&5 -$as_echo_n "checking for library containing gnutls_global_init... " >&6; } -if ${ac_cv_search_gnutls_global_init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gnutls_global_init (); -int -main () -{ -return gnutls_global_init (); - ; - return 0; -} -_ACEOF -for ac_lib in '' gnutls; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_gnutls_global_init=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_gnutls_global_init+:} false; then : - break -fi -done -if ${ac_cv_search_gnutls_global_init+:} false; then : - -else - ac_cv_search_gnutls_global_init=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gnutls_global_init" >&5 -$as_echo "$ac_cv_search_gnutls_global_init" >&6; } -ac_res=$ac_cv_search_gnutls_global_init -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - FOUND=yes -else - FOUND=no -fi - - if test "$FOUND" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcrypt is needed" >&5 -$as_echo_n "checking whether gcrypt is needed... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #if GNUTLS_VERSION_NUMBER <= 0x020b00 - compile error - #endif -int -main () -{ -int a; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - GCRYPT=no -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - GCRYPT=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$GCRYPT" = "yes"; then - ac_fn_cxx_check_header_mongrel "$LINENO" "gcrypt.h" "ac_cv_header_gcrypt_h" "$ac_includes_default" -if test "x$ac_cv_header_gcrypt_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gcry_control" >&5 -$as_echo_n "checking for library containing gcry_control... " >&6; } -if ${ac_cv_search_gcry_control+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gcry_control (); -int -main () -{ -return gcry_control (); - ; - return 0; -} -_ACEOF -for ac_lib in '' gnutls gcrypt; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_gcry_control=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_gcry_control+:} false; then : - break -fi -done -if ${ac_cv_search_gcry_control+:} false; then : - -else - ac_cv_search_gcry_control=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gcry_control" >&5 -$as_echo "$ac_cv_search_gcry_control" >&6; } -ac_res=$ac_cv_search_gcry_control -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - FOUND=yes -else - FOUND=no -fi - -else - FOUND=yes -fi - - - fi - fi - if test "$FOUND" = "no" -a "$TLSLIB" = "GnuTLS"; then - as_fn_error $? "Couldn't find GnuTLS library" "$LINENO" 5 - fi - if test "$FOUND" = "yes"; then - TLSLIB="GnuTLS" - -$as_echo "#define HAVE_LIBGNUTLS 1" >>confdefs.h - - fi - fi - - if test "$TLSLIB" = "GnuTLS"; then - -# Check whether --with-libnettle_includes was given. -if test "${with_libnettle_includes+set}" = set; then : - withval=$with_libnettle_includes; CPPFLAGS="${CPPFLAGS} -I${withval}" - INCVAL="yes" -else - INCVAL="no" -fi - - -# Check whether --with-libnettle_libraries was given. -if test "${with_libnettle_libraries+set}" = set; then : - withval=$with_libnettle_libraries; LDFLAGS="${LDFLAGS} -L${withval}" - LIBVAL="yes" -else - LIBVAL="no" -fi - - if test "$INCVAL" = "no" -o "$LIBVAL" = "no"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle" >&5 -$as_echo_n "checking for nettle... " >&6; } - -if test -n "$nettle_CFLAGS"; then - pkg_cv_nettle_CFLAGS="$nettle_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"nettle\""; } >&5 - ($PKG_CONFIG --exists --print-errors "nettle") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_nettle_CFLAGS=`$PKG_CONFIG --cflags "nettle" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$nettle_LIBS"; then - pkg_cv_nettle_LIBS="$nettle_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"nettle\""; } >&5 - ($PKG_CONFIG --exists --print-errors "nettle") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_nettle_LIBS=`$PKG_CONFIG --libs "nettle" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - nettle_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "nettle" 2>&1` - else - nettle_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "nettle" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$nettle_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (nettle) were not met: - -$nettle_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables nettle_CFLAGS -and nettle_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables nettle_CFLAGS -and nettle_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - nettle_CFLAGS=$pkg_cv_nettle_CFLAGS - nettle_LIBS=$pkg_cv_nettle_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBS="${LIBS} $nettle_LIBS" - CPPFLAGS="${CPPFLAGS} $nettle_CFLAGS" -fi - fi - ac_fn_cxx_check_header_mongrel "$LINENO" "nettle/sha.h" "ac_cv_header_nettle_sha_h" "$ac_includes_default" -if test "x$ac_cv_header_nettle_sha_h" = xyes; then : - FOUND=yes -else - FOUND=no -fi - - - if test "$FOUND" = "no"; then - as_fn_error $? "Couldn't find Nettle headers (sha.h)" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nettle_pbkdf2_hmac_sha256" >&5 -$as_echo_n "checking for library containing nettle_pbkdf2_hmac_sha256... " >&6; } -if ${ac_cv_search_nettle_pbkdf2_hmac_sha256+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char nettle_pbkdf2_hmac_sha256 (); -int -main () -{ -return nettle_pbkdf2_hmac_sha256 (); - ; - return 0; -} -_ACEOF -for ac_lib in '' nettle; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_nettle_pbkdf2_hmac_sha256=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_nettle_pbkdf2_hmac_sha256+:} false; then : - break -fi -done -if ${ac_cv_search_nettle_pbkdf2_hmac_sha256+:} false; then : - -else - ac_cv_search_nettle_pbkdf2_hmac_sha256=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nettle_pbkdf2_hmac_sha256" >&5 -$as_echo "$ac_cv_search_nettle_pbkdf2_hmac_sha256" >&6; } -ac_res=$ac_cv_search_nettle_pbkdf2_hmac_sha256 -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - FOUND=yes -else - FOUND=no -fi - - if test "$FOUND" = "no"; then - as_fn_error $? "Couldn't find Nettle library, required when using GnuTLS" "$LINENO" 5 - fi - if test "$FOUND" = "yes"; then - -$as_echo "#define HAVE_NETTLE 1" >>confdefs.h - - fi - fi - fi - - if test "$TLSLIB" = ""; then - if test "$TLSHEADERS" = ""; then - as_fn_error $? "Couldn't find neither OpenSSL nor GnuTLS headers (ssl.h or gnutls.h)" "$LINENO" 5 - else - as_fn_error $? "Couldn't find neither OpenSSL nor GnuTLS library" "$LINENO" 5 - fi - fi -else - -$as_echo "#define DISABLE_TLS 1" >>confdefs.h - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use gzip" >&5 -$as_echo_n "checking whether to use gzip... " >&6; } -# Check whether --enable-gzip was given. -if test "${enable_gzip+set}" = set; then : - enableval=$enable_gzip; USEZLIB=$enableval -else - USEZLIB=yes -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USEZLIB" >&5 -$as_echo "$USEZLIB" >&6; } -if test "$USEZLIB" = "yes"; then - -# Check whether --with-zlib_includes was given. -if test "${with_zlib_includes+set}" = set; then : - withval=$with_zlib_includes; CPPFLAGS="${CPPFLAGS} -I${withval}" - INCVAL="yes" -else - INCVAL="no" -fi - - -# Check whether --with-zlib_libraries was given. -if test "${with_zlib_libraries+set}" = set; then : - withval=$with_zlib_libraries; LDFLAGS="${LDFLAGS} -L${withval}" - LIBVAL="yes" -else - LIBVAL="no" -fi - - if test "$INCVAL" = "no" -o "$LIBVAL" = "no"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib" >&5 -$as_echo_n "checking for zlib... " >&6; } - -if test -n "$zlib_CFLAGS"; then - pkg_cv_zlib_CFLAGS="$zlib_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib\""; } >&5 - ($PKG_CONFIG --exists --print-errors "zlib") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_zlib_CFLAGS=`$PKG_CONFIG --cflags "zlib" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$zlib_LIBS"; then - pkg_cv_zlib_LIBS="$zlib_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib\""; } >&5 - ($PKG_CONFIG --exists --print-errors "zlib") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_zlib_LIBS=`$PKG_CONFIG --libs "zlib" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - zlib_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "zlib" 2>&1` - else - zlib_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "zlib" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$zlib_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (zlib) were not met: - -$zlib_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables zlib_CFLAGS -and zlib_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables zlib_CFLAGS -and zlib_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - zlib_CFLAGS=$pkg_cv_zlib_CFLAGS - zlib_LIBS=$pkg_cv_zlib_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBS="${LIBS} $zlib_LIBS" - CPPFLAGS="${CPPFLAGS} $zlib_CFLAGS" -fi - fi - - ac_fn_cxx_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = xyes; then : - -else - as_fn_error $? "\"zlib header files not found\"" "$LINENO" 5 -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing deflateBound" >&5 -$as_echo_n "checking for library containing deflateBound... " >&6; } -if ${ac_cv_search_deflateBound+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char deflateBound (); -int -main () -{ -return deflateBound (); - ; - return 0; -} -_ACEOF -for ac_lib in '' z; 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_cxx_try_link "$LINENO"; then : - ac_cv_search_deflateBound=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_deflateBound+:} false; then : - break -fi -done -if ${ac_cv_search_deflateBound+:} false; then : - -else - ac_cv_search_deflateBound=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_deflateBound" >&5 -$as_echo "$ac_cv_search_deflateBound" >&6; } -ac_res=$ac_cv_search_deflateBound -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -else - as_fn_error $? "\"zlib library not found\"" "$LINENO" 5 -fi - -else - -$as_echo "#define DISABLE_GZIP 1" >>confdefs.h - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use SIMD-optimized routines" >&5 -$as_echo_n "checking whether to use SIMD-optimized routines... " >&6; } -USE_SIMD=no -case $host_cpu in - i?86|x86_64) - SSE2_CXXFLAGS="-msse2" - SSSE3_CXXFLAGS="-mssse3" - PCLMUL_CXXFLAGS="-msse4.1 -mpclmul" - USE_SIMD=yes - ;; - arm*) - NEON_CXXFLAGS="-mfpu=neon" - ACLECRC_CXXFLAGS="-march=armv8-a+crc -fpermissive" - USE_SIMD=yes - ;; - aarch64) - ACLECRC_CXXFLAGS="-march=armv8-a+crc -fpermissive" - USE_SIMD=yes - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_SIMD" >&5 -$as_echo "$USE_SIMD" >&6; } - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use an empty SIGCHLD handler" >&5 -$as_echo_n "checking whether to use an empty SIGCHLD handler... " >&6; } -# Check whether --enable-sigchld-handler was given. -if test "${enable_sigchld_handler+set}" = set; then : - enableval=$enable_sigchld_handler; SIGCHLDHANDLER=$enableval -else - SIGCHLDHANDLER=yes -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SIGCHLDHANDLER" >&5 -$as_echo "$SIGCHLDHANDLER" >&6; } -if test "$SIGCHLDHANDLER" = "yes"; then - -$as_echo "#define SIGCHLD_HANDLER 1" >>confdefs.h - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include all debugging code" >&5 -$as_echo_n "checking whether to include all debugging code... " >&6; } -# Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : - enableval=$enable_debug; ENABLEDEBUG=$enableval -else - ENABLEDEBUG=no -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLEDEBUG" >&5 -$as_echo "$ENABLEDEBUG" >&6; } - - -if test "$ENABLEDEBUG" = "yes"; then - - - -$as_echo "#define DEBUG 1" >>confdefs.h - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for macro returning current function name" >&5 -$as_echo_n "checking for macro returning current function name... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -printf("%s\n", __FUNCTION__); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: __FUNCTION__" >&5 -$as_echo "__FUNCTION__" >&6; } - FUNCTION_MACRO_NAME=__FUNCTION__ -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -printf("%s\n", __func__); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: __func__" >&5 -$as_echo "__func__" >&6; } - FUNCTION_MACRO_NAME=__func__ -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -if test "$FUNCTION_MACRO_NAME" != ""; then - -cat >>confdefs.h <<_ACEOF -#define FUNCTION_MACRO_NAME $FUNCTION_MACRO_NAME -_ACEOF - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for variadic macros" >&5 -$as_echo_n "checking for variadic macros... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - #define macro(...) macrofunc(__VA_ARGS__) - int macrofunc(int a, int b) { return a + b; } -int -main () -{ - int a=macro(1, 2); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_VARIADIC_MACROS 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace" >&5 -$as_echo_n "checking for backtrace... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include - #include -int -main () -{ - void *array[100]; size_t size; char **strings; - size = backtrace(array, 100); - strings = backtrace_symbols(array, size); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - FOUND=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_BACKTRACE 1" >>confdefs.h - -else - FOUND=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rdynamic linker flag" >&5 -$as_echo_n "checking for rdynamic linker flag... " >&6; } - old_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -rdynamic" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$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; } - LDFLAGS="$old_LDFLAGS" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -else - -$as_echo "#define NDEBUG 1" >>confdefs.h - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable unit and integration tests" >&5 -$as_echo_n "checking whether to enable unit and integration tests... " >&6; } -# Check whether --enable-tests was given. -if test "${enable_tests+set}" = set; then : - enableval=$enable_tests; ENABLETESTS=$enableval -else - ENABLETESTS=no -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLETESTS" >&5 -$as_echo "$ENABLETESTS" >&6; } -if test "$ENABLETESTS" = "yes"; then - -$as_echo "#define ENABLE_TESTS 1" >>confdefs.h - - if true; then - WITH_TESTS_TRUE= - WITH_TESTS_FALSE='#' -else - WITH_TESTS_TRUE='#' - WITH_TESTS_FALSE= -fi - -else - if false; then - WITH_TESTS_TRUE= - WITH_TESTS_FALSE='#' -else - WITH_TESTS_TRUE='#' - WITH_TESTS_FALSE= -fi - -fi - -ac_config_files="$ac_config_files Makefile" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - 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;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -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"` - # 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" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_PAR2_TRUE}" && test -z "${WITH_PAR2_FALSE}"; then - as_fn_error $? "conditional \"WITH_PAR2\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_PAR2_TRUE}" && test -z "${WITH_PAR2_FALSE}"; then - as_fn_error $? "conditional \"WITH_PAR2\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_TESTS_TRUE}" && test -z "${WITH_TESTS_FALSE}"; then - as_fn_error $? "conditional \"WITH_TESTS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_TESTS_TRUE}" && test -z "${WITH_TESTS_FALSE}"; then - as_fn_error $? "conditional \"WITH_TESTS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -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;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (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 - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -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 - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; 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 || - PATH_SEPARATOR=';' - } -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 #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -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 - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$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] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -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 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -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 : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# 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 : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$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" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by nzbget $as_me 22.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -nzbget config.status 22.0 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -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 ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$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"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -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 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# 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_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # 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' - `' 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;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$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" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$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|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -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;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -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' -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' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && 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;} - 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 */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $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;} -fi - diff --git a/configure.ac b/configure.ac index b32d1d91..5b6e3838 100644 --- a/configure.ac +++ b/configure.ac @@ -21,12 +21,13 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.65) -AC_INIT(nzbget, 22.0, nzbget@nzbget.com) +AC_INIT(nzbget, 22.0, https://github.com/nzbgetcom/nzbget/issues) AC_CONFIG_AUX_DIR(posix) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([foreign subdir-objects]) AC_CONFIG_SRCDIR([daemon/main/nzbget.cpp]) AC_CONFIG_HEADERS([config.h]) +AC_DEFINE(HAVE_CONFIG_H, 1, [Define to 1 use config.h]) AM_MAINTAINER_MODE m4_include([posix/ax_cxx_compile_stdcxx.m4]) @@ -681,22 +682,5 @@ else AC_DEFINE([NDEBUG],1,Define to 1 to exclude debug-code) fi - -dnl -dnl Enable test suite. Deafult: no. -dnl -AC_MSG_CHECKING(whether to enable unit and integration tests) -AC_ARG_ENABLE(tests, - [AS_HELP_STRING([--enable-tests], [enable unit and integration tests])], - [ ENABLETESTS=$enableval ], - [ ENABLETESTS=no] ) -AC_MSG_RESULT($ENABLETESTS) -if test "$ENABLETESTS" = "yes"; then - AC_DEFINE([ENABLE_TESTS],1,[Define to 1 to enable unit and integration tests]) - AM_CONDITIONAL(WITH_TESTS, true) -else - AM_CONDITIONAL(WITH_TESTS, false) -fi - AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/daemon/main/nzbget.cpp b/daemon/main/nzbget.cpp index 5c1fe0a1..d1fc55db 100644 --- a/daemon/main/nzbget.cpp +++ b/daemon/main/nzbget.cpp @@ -59,9 +59,6 @@ #include "WinConsole.h" #include "WebDownloader.h" #endif -#ifdef ENABLE_TESTS -#include "TestMain.h" -#endif #ifndef DISABLE_NSERV #include "NServMain.h" #endif @@ -121,20 +118,6 @@ int main(int argc, char *argv[], char *argp[]) g_Arguments = (char*(*)[])argv; g_EnvironmentVariables = (char*(*)[])argp; - if (argc > 1 && (!strcmp(argv[1], "-tests") || !strcmp(argv[1], "--tests"))) - { -#ifdef ENABLE_TESTS - return TestMain(argc, argv); -#else - printf("ERROR: Could not start tests, the program was compiled without tests\n"); - return 1; -#endif - } - -#ifdef ENABLE_TESTS - TestCleanup(); -#endif - if (argc > 1 && (!strcmp(argv[1], "--nserv"))) { #ifndef DISABLE_NSERV diff --git a/daemon/main/nzbget.h b/daemon/main/nzbget.h index eed5d1ca..aecab84b 100644 --- a/daemon/main/nzbget.h +++ b/daemon/main/nzbget.h @@ -21,6 +21,10 @@ #ifndef NZBGET_H #define NZBGET_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + /***************** DEFINES FOR WINDOWS *****************/ #ifdef WIN32 @@ -152,8 +156,6 @@ using namespace MSXML; // POSIX INCLUDES -#include "config.h" - #include #include #include @@ -275,9 +277,6 @@ typedef int pid_t; #include #include #include -#ifdef HAVE_MEMORY_H -# include -#endif #endif /* NOT DISABLE_PARCHECK */ @@ -287,7 +286,6 @@ typedef int pid_t; // WINDOWS -#define snprintf _snprintf #ifndef strdup #define strdup _strdup #endif @@ -298,8 +296,8 @@ typedef int pid_t; #define strerror_r(errnum, buffer, size) strerror_s(buffer, size, errnum) #define mkdir(dir, flags) _mkdir(dir) #define rmdir _rmdir -#define strcasecmp(a, b) _stricmp(a, b) -#define strncasecmp(a, b, c) _strnicmp(a, b, c) +#define strcasecmp(a, b) stricmp(a, b) +#define strncasecmp(a, b, c) strnicmp(a, b, c) #define __S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask)) #define S_ISDIR(mode) __S_ISTYPE((mode), _S_IFDIR) #define S_ISREG(mode) __S_ISTYPE((mode), _S_IFREG) @@ -335,8 +333,6 @@ typedef int pid_t; #endif #ifdef HAVE_OPENSSL -FILE _iob[] = {*stdin, *stdout, *stderr}; -extern "C" FILE * __cdecl __iob_func(void) { return _iob; } // For static linking of OpenSSL libraries: #pragma comment (lib, "legacy_stdio_definitions.lib") #endif /* HAVE_OPENSSL */ diff --git a/daemon/util/NString.cpp b/daemon/util/NString.cpp index ad1c0710..584b1320 100644 --- a/daemon/util/NString.cpp +++ b/daemon/util/NString.cpp @@ -93,13 +93,13 @@ int BString::FormatV(const char* format, va_list ap) return len; } -bool CString::operator==(const CString& other) +bool CString::operator==(const CString& other) const { return (!m_data && !other.m_data) || (m_data && other.m_data && !strcmp(m_data, other.m_data)); } -bool CString::operator==(const char* other) +bool CString::operator==(const char* other) const { return (!m_data && !other) || (m_data && other && !strcmp(m_data, other)); diff --git a/daemon/util/NString.h b/daemon/util/NString.h index fa5adbbe..59d58923 100644 --- a/daemon/util/NString.h +++ b/daemon/util/NString.h @@ -65,10 +65,11 @@ class CString CString(const char* str, int len = 0) { Set(str, len); } CString(CString&& other) noexcept { m_data = other.m_data; other.m_data = nullptr; } CString(CString& other) = delete; - CString& operator=(CString&& other) { free(m_data); m_data = other.m_data; other.m_data = nullptr; return *this; } + CString& operator=(const CString& other) = delete; + CString& operator=(CString&& other) noexcept { free(m_data); m_data = other.m_data; other.m_data = nullptr; return *this; } CString& operator=(const char* str) { Set(str); return *this; } - bool operator==(const CString& other); - bool operator==(const char* other); + bool operator==(const CString& other) const; + bool operator==(const char* other) const; static CString FormatStr(const char* format, ...); operator char*() const { return m_data; } char* operator*() const { return m_data; } diff --git a/docker/Dockerfile b/docker/Dockerfile index d03d0ca2..6a533a76 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,12 +8,13 @@ ARG MAKE_JOBS=1 RUN \ echo "**** install build packages ****" && \ - apk add g++ gcc git libxml2-dev libxslt-dev make ncurses-dev openssl-dev curl && \ + apk add autoconf automake g++ gcc git libxml2-dev libxslt-dev make ncurses-dev openssl-dev curl && \ echo "**** build nzbget ****" && \ mkdir -p /app/nzbget && \ git clone https://github.com/nzbgetcom/nzbget.git nzbget && \ cd nzbget/ && \ git checkout ${NZBGET_RELEASE} && \ + autoreconf --install && \ ./configure bindir='${exec_prefix}' && \ make -j ${MAKE_JOBS} && \ make prefix=/app/nzbget install && \ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt new file mode 100644 index 00000000..c879cc88 --- /dev/null +++ b/lib/CMakeLists.txt @@ -0,0 +1,45 @@ +add_library(Yencode STATIC + ${CMAKE_CURRENT_SOURCE_DIR}/yencode/SimdInit.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/yencode/SimdDecoder.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/yencode/ScalarDecoder.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/yencode/Sse2Decoder.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/yencode/Ssse3Decoder.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/yencode/PclmulCrc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/yencode/NeonDecoder.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/yencode/AcleCrc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/yencode/SliceCrc.cpp +) +target_include_directories(Yencode PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/yencode + ${CMAKE_SOURCE_DIR}/daemon/main + ${ZLIB_INCLUDE_DIR} + ${OPENSSL_INCLUDE_DIR} +) + +add_library(Par2 STATIC + ${CMAKE_CURRENT_SOURCE_DIR}/par2/commandline.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/crc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/creatorpacket.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/criticalpacket.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/datablock.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/descriptionpacket.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/diskfile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/filechecksummer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/galois.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/mainpacket.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/md5.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/par2fileformat.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/par2repairer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/par2repairersourcefile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/parheaders.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/recoverypacket.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/reedsolomon.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/verificationhashtable.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/par2/verificationpacket.cpp +) +target_include_directories(Par2 PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/par2 + ${CMAKE_SOURCE_DIR}/daemon/main + ${CMAKE_SOURCE_DIR}/daemon/util + ${OPENSSL_INCLUDE_DIR} +) diff --git a/lib/catch/catch.h b/lib/catch/catch.h deleted file mode 100644 index 447263e4..00000000 --- a/lib/catch/catch.h +++ /dev/null @@ -1,9427 +0,0 @@ -/* - * CATCH v1.1 build 14 (develop branch) - * Generated: 2015-03-04 18:32:24.627737 - * ---------------------------------------------------------- - * This file has been merged from multiple headers. Please don't edit it directly - * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. - * - * Distributed under the Boost Software License, Version 1.0. (See accompanying - * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - */ -#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED -#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED - -#define TWOBLUECUBES_CATCH_HPP_INCLUDED - -// #included from: internal/catch_suppress_warnings.h - -#define TWOBLUECUBES_CATCH_SUPPRESS_WARNINGS_H_INCLUDED - -#ifdef __clang__ -# ifdef __ICC // icpc defines the __clang__ macro -# pragma warning(push) -# pragma warning(disable: 161 1682) -# else // __ICC -# pragma clang diagnostic ignored "-Wglobal-constructors" -# pragma clang diagnostic ignored "-Wvariadic-macros" -# pragma clang diagnostic ignored "-Wc99-extensions" -# pragma clang diagnostic ignored "-Wunused-variable" -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wc++98-compat" -# pragma clang diagnostic ignored "-Wc++98-compat-pedantic" -# endif -#elif defined __GNUC__ -# pragma GCC diagnostic ignored "-Wvariadic-macros" -# pragma GCC diagnostic ignored "-Wunused-variable" -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wpadded" -#endif - -#if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER) -# define CATCH_IMPL -#endif - -#ifdef CATCH_IMPL -# ifndef CLARA_CONFIG_MAIN -# define CLARA_CONFIG_MAIN_NOT_DEFINED -# define CLARA_CONFIG_MAIN -# endif -#endif - -// #included from: internal/catch_notimplemented_exception.h -#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_H_INCLUDED - -// #included from: catch_common.h -#define TWOBLUECUBES_CATCH_COMMON_H_INCLUDED - -#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line -#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) -#define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) - -#define INTERNAL_CATCH_STRINGIFY2( expr ) #expr -#define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr ) - -#include -#include -#include - -// #included from: catch_compiler_capabilities.h -#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED - -// Much of the following code is based on Boost (1.53) - -#ifdef __clang__ - -# if __has_feature(cxx_nullptr) -# define CATCH_CONFIG_CPP11_NULLPTR -# endif - -# if __has_feature(cxx_noexcept) -# define CATCH_CONFIG_CPP11_NOEXCEPT -# endif - -#endif // __clang__ - -//////////////////////////////////////////////////////////////////////////////// -// Borland -#ifdef __BORLANDC__ - -#if (__BORLANDC__ > 0x582 ) -//#define CATCH_CONFIG_SFINAE // Not confirmed -#endif - -#endif // __BORLANDC__ - -//////////////////////////////////////////////////////////////////////////////// -// EDG -#ifdef __EDG_VERSION__ - -#if (__EDG_VERSION__ > 238 ) -//#define CATCH_CONFIG_SFINAE // Not confirmed -#endif - -#endif // __EDG_VERSION__ - -//////////////////////////////////////////////////////////////////////////////// -// Digital Mars -#ifdef __DMC__ - -#if (__DMC__ > 0x840 ) -//#define CATCH_CONFIG_SFINAE // Not confirmed -#endif - -#endif // __DMC__ - -//////////////////////////////////////////////////////////////////////////////// -// GCC -#ifdef __GNUC__ - -#if __GNUC__ < 3 - -#if (__GNUC_MINOR__ >= 96 ) -//#define CATCH_CONFIG_SFINAE -#endif - -#elif __GNUC__ >= 3 - -// #define CATCH_CONFIG_SFINAE // Taking this out completely for now - -#endif // __GNUC__ < 3 - -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__) ) - -#define CATCH_CONFIG_CPP11_NULLPTR -#endif - -#endif // __GNUC__ - -//////////////////////////////////////////////////////////////////////////////// -// Visual C++ -#ifdef _MSC_VER - -#if (_MSC_VER >= 1600) -#define CATCH_CONFIG_CPP11_NULLPTR -#endif - -#if (_MSC_VER >= 1310 ) // (VC++ 7.0+) -//#define CATCH_CONFIG_SFINAE // Not confirmed -#endif - -#endif // _MSC_VER - -// Use variadic macros if the compiler supports them -#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \ - ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ - ( defined __GNUC__ && __GNUC__ >= 3 ) || \ - ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) - -#ifndef CATCH_CONFIG_NO_VARIADIC_MACROS -#define CATCH_CONFIG_VARIADIC_MACROS -#endif - -#endif - -//////////////////////////////////////////////////////////////////////////////// -// C++ language feature support - -// detect language version: -#if (__cplusplus == 201103L) -# define CATCH_CPP11 -# define CATCH_CPP11_OR_GREATER -#elif (__cplusplus >= 201103L) -# define CATCH_CPP11_OR_GREATER -#endif - -// noexcept support: -#if defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_NOEXCEPT) -# define CATCH_NOEXCEPT noexcept -# define CATCH_NOEXCEPT_IS(x) noexcept(x) -#else -# define CATCH_NOEXCEPT throw() -# define CATCH_NOEXCEPT_IS(x) -#endif - -namespace Catch { - - class NonCopyable { -#ifdef CATCH_CPP11_OR_GREATER - NonCopyable( NonCopyable const& ) = delete; - NonCopyable( NonCopyable && ) = delete; - NonCopyable& operator = ( NonCopyable const& ) = delete; - NonCopyable& operator = ( NonCopyable && ) = delete; -#else - NonCopyable( NonCopyable const& info ); - NonCopyable& operator = ( NonCopyable const& ); -#endif - - protected: - NonCopyable() {} - virtual ~NonCopyable(); - }; - - class SafeBool { - public: - typedef void (SafeBool::*type)() const; - - static type makeSafe( bool value ) { - return value ? &SafeBool::trueValue : 0; - } - private: - void trueValue() const {} - }; - - template - inline void deleteAll( ContainerT& container ) { - typename ContainerT::const_iterator it = container.begin(); - typename ContainerT::const_iterator itEnd = container.end(); - for(; it != itEnd; ++it ) - delete *it; - } - template - inline void deleteAllValues( AssociativeContainerT& container ) { - typename AssociativeContainerT::const_iterator it = container.begin(); - typename AssociativeContainerT::const_iterator itEnd = container.end(); - for(; it != itEnd; ++it ) - delete it->second; - } - - bool startsWith( std::string const& s, std::string const& prefix ); - bool endsWith( std::string const& s, std::string const& suffix ); - bool contains( std::string const& s, std::string const& infix ); - void toLowerInPlace( std::string& s ); - std::string toLower( std::string const& s ); - std::string trim( std::string const& str ); - bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ); - - struct pluralise { - pluralise( std::size_t count, std::string const& label ); - - friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ); - - std::size_t m_count; - std::string m_label; - }; - - struct SourceLineInfo { - - SourceLineInfo(); - SourceLineInfo( char const* _file, std::size_t _line ); - SourceLineInfo( SourceLineInfo const& other ); -# ifdef CATCH_CPP11_OR_GREATER - SourceLineInfo( SourceLineInfo && ) = default; - SourceLineInfo& operator = ( SourceLineInfo const& ) = default; - SourceLineInfo& operator = ( SourceLineInfo && ) = default; -# endif - bool empty() const; - bool operator == ( SourceLineInfo const& other ) const; - bool operator < ( SourceLineInfo const& other ) const; - - std::string file; - std::size_t line; - }; - - std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ); - - // This is just here to avoid compiler warnings with macro constants and boolean literals - inline bool isTrue( bool value ){ return value; } - inline bool alwaysTrue() { return true; } - inline bool alwaysFalse() { return false; } - - void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ); - - // Use this in variadic streaming macros to allow - // >> +StreamEndStop - // as well as - // >> stuff +StreamEndStop - struct StreamEndStop { - std::string operator+() { - return std::string(); - } - }; - template - T const& operator + ( T const& value, StreamEndStop ) { - return value; - } -} - -#define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) -#define CATCH_INTERNAL_ERROR( msg ) ::Catch::throwLogicError( msg, CATCH_INTERNAL_LINEINFO ); - -#include - -namespace Catch { - - class NotImplementedException : public std::exception - { - public: - NotImplementedException( SourceLineInfo const& lineInfo ); - NotImplementedException( NotImplementedException const& ) {} - - virtual ~NotImplementedException() CATCH_NOEXCEPT {} - - virtual const char* what() const CATCH_NOEXCEPT; - - private: - std::string m_what; - SourceLineInfo m_lineInfo; - }; - -} // end namespace Catch - -/////////////////////////////////////////////////////////////////////////////// -#define CATCH_NOT_IMPLEMENTED throw Catch::NotImplementedException( CATCH_INTERNAL_LINEINFO ) - -// #included from: internal/catch_context.h -#define TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED - -// #included from: catch_interfaces_generators.h -#define TWOBLUECUBES_CATCH_INTERFACES_GENERATORS_H_INCLUDED - -#include - -namespace Catch { - - struct IGeneratorInfo { - virtual ~IGeneratorInfo(); - virtual bool moveNext() = 0; - virtual std::size_t getCurrentIndex() const = 0; - }; - - struct IGeneratorsForTest { - virtual ~IGeneratorsForTest(); - - virtual IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) = 0; - virtual bool moveNext() = 0; - }; - - IGeneratorsForTest* createGeneratorsForTest(); - -} // end namespace Catch - -// #included from: catch_ptr.hpp -#define TWOBLUECUBES_CATCH_PTR_HPP_INCLUDED - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wpadded" -#endif - -namespace Catch { - - // An intrusive reference counting smart pointer. - // T must implement addRef() and release() methods - // typically implementing the IShared interface - template - class Ptr { - public: - Ptr() : m_p( NULL ){} - Ptr( T* p ) : m_p( p ){ - if( m_p ) - m_p->addRef(); - } - Ptr( Ptr const& other ) : m_p( other.m_p ){ - if( m_p ) - m_p->addRef(); - } - ~Ptr(){ - if( m_p ) - m_p->release(); - } - void reset() { - if( m_p ) - m_p->release(); - m_p = NULL; - } - Ptr& operator = ( T* p ){ - Ptr temp( p ); - swap( temp ); - return *this; - } - Ptr& operator = ( Ptr const& other ){ - Ptr temp( other ); - swap( temp ); - return *this; - } - void swap( Ptr& other ) { std::swap( m_p, other.m_p ); } - T* get() { return m_p; } - const T* get() const{ return m_p; } - T& operator*() const { return *m_p; } - T* operator->() const { return m_p; } - bool operator !() const { return m_p == NULL; } - operator SafeBool::type() const { return SafeBool::makeSafe( m_p != NULL ); } - - private: - T* m_p; - }; - - struct IShared : NonCopyable { - virtual ~IShared(); - virtual void addRef() const = 0; - virtual void release() const = 0; - }; - - template - struct SharedImpl : T { - - SharedImpl() : m_rc( 0 ){} - - virtual void addRef() const { - ++m_rc; - } - virtual void release() const { - if( --m_rc == 0 ) - delete this; - } - - mutable unsigned int m_rc; - }; - -} // end namespace Catch - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - -#include -#include -#include - -namespace Catch { - - class TestCase; - class Stream; - struct IResultCapture; - struct IRunner; - struct IGeneratorsForTest; - struct IConfig; - - struct IContext - { - virtual ~IContext(); - - virtual IResultCapture* getResultCapture() = 0; - virtual IRunner* getRunner() = 0; - virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0; - virtual bool advanceGeneratorsForCurrentTest() = 0; - virtual Ptr getConfig() const = 0; - }; - - struct IMutableContext : IContext - { - virtual ~IMutableContext(); - virtual void setResultCapture( IResultCapture* resultCapture ) = 0; - virtual void setRunner( IRunner* runner ) = 0; - virtual void setConfig( Ptr const& config ) = 0; - }; - - IContext& getCurrentContext(); - IMutableContext& getCurrentMutableContext(); - void cleanUpContext(); - Stream createStream( std::string const& streamName ); - -} - -// #included from: internal/catch_test_registry.hpp -#define TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED - -// #included from: catch_interfaces_testcase.h -#define TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED - -#include - -namespace Catch { - - class TestSpec; - - struct ITestCase : IShared { - virtual void invoke () const = 0; - protected: - virtual ~ITestCase(); - }; - - class TestCase; - struct IConfig; - - struct ITestCaseRegistry { - virtual ~ITestCaseRegistry(); - virtual std::vector const& getAllTests() const = 0; - virtual void getFilteredTests( TestSpec const& testSpec, IConfig const& config, std::vector& matchingTestCases, bool negated = false ) const = 0; - - }; -} - -namespace Catch { - -template -class MethodTestCase : public SharedImpl { - -public: - MethodTestCase( void (C::*method)() ) : m_method( method ) {} - - virtual void invoke() const { - C obj; - (obj.*m_method)(); - } - -private: - virtual ~MethodTestCase() {} - - void (C::*m_method)(); -}; - -typedef void(*TestFunction)(); - -struct NameAndDesc { - NameAndDesc( const char* _name = "", const char* _description= "" ) - : name( _name ), description( _description ) - {} - - const char* name; - const char* description; -}; - -struct AutoReg { - - AutoReg( TestFunction function, - SourceLineInfo const& lineInfo, - NameAndDesc const& nameAndDesc ); - - template - AutoReg( void (C::*method)(), - char const* className, - NameAndDesc const& nameAndDesc, - SourceLineInfo const& lineInfo ) { - registerTestCase( new MethodTestCase( method ), - className, - nameAndDesc, - lineInfo ); - } - - void registerTestCase( ITestCase* testCase, - char const* className, - NameAndDesc const& nameAndDesc, - SourceLineInfo const& lineInfo ); - - ~AutoReg(); - -private: - AutoReg( AutoReg const& ); - void operator= ( AutoReg const& ); -}; - -} // end namespace Catch - -#ifdef CATCH_CONFIG_VARIADIC_MACROS - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_TESTCASE( ... ) \ - static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )(); \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ - static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )() - - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); } - - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... )\ - namespace{ \ - struct INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) : ClassName{ \ - void test(); \ - }; \ - Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); \ - } \ - void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test() - -#else - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_TESTCASE( Name, Desc ) \ - static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )(); \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ - static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )() - - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( Name, Desc ), CATCH_INTERNAL_LINEINFO ); } - - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, TestName, Desc )\ - namespace{ \ - struct INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) : ClassName{ \ - void test(); \ - }; \ - Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); \ - } \ - void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test() - -#endif - -// #included from: internal/catch_capture.hpp -#define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED - -// #included from: catch_result_builder.h -#define TWOBLUECUBES_CATCH_RESULT_BUILDER_H_INCLUDED - -// #included from: catch_result_type.h -#define TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED - -namespace Catch { - - // ResultWas::OfType enum - struct ResultWas { enum OfType { - Unknown = -1, - Ok = 0, - Info = 1, - Warning = 2, - - FailureBit = 0x10, - - ExpressionFailed = FailureBit | 1, - ExplicitFailure = FailureBit | 2, - - Exception = 0x100 | FailureBit, - - ThrewException = Exception | 1, - DidntThrowException = Exception | 2, - - FatalErrorCondition = 0x200 | FailureBit - - }; }; - - inline bool isOk( ResultWas::OfType resultType ) { - return ( resultType & ResultWas::FailureBit ) == 0; - } - inline bool isJustInfo( int flags ) { - return flags == ResultWas::Info; - } - - // ResultDisposition::Flags enum - struct ResultDisposition { enum Flags { - Normal = 0x00, - - ContinueOnFailure = 0x01, // Failures fail test, but execution continues - FalseTest = 0x02, // Prefix expression with ! - SuppressFail = 0x04 // Failures are reported but do not fail the test - }; }; - - inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { - return static_cast( static_cast( lhs ) | static_cast( rhs ) ); - } - - inline bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; } - inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; } - inline bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; } - -} // end namespace Catch - -// #included from: catch_assertionresult.h -#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED - -#include - -namespace Catch { - - struct AssertionInfo - { - AssertionInfo() {} - AssertionInfo( std::string const& _macroName, - SourceLineInfo const& _lineInfo, - std::string const& _capturedExpression, - ResultDisposition::Flags _resultDisposition ); - - std::string macroName; - SourceLineInfo lineInfo; - std::string capturedExpression; - ResultDisposition::Flags resultDisposition; - }; - - struct AssertionResultData - { - AssertionResultData() : resultType( ResultWas::Unknown ) {} - - std::string reconstructedExpression; - std::string message; - ResultWas::OfType resultType; - }; - - class AssertionResult { - public: - AssertionResult(); - AssertionResult( AssertionInfo const& info, AssertionResultData const& data ); - ~AssertionResult(); -# ifdef CATCH_CPP11_OR_GREATER - AssertionResult( AssertionResult const& ) = default; - AssertionResult( AssertionResult && ) = default; - AssertionResult& operator = ( AssertionResult const& ) = default; - AssertionResult& operator = ( AssertionResult && ) = default; -# endif - - bool isOk() const; - bool succeeded() const; - ResultWas::OfType getResultType() const; - bool hasExpression() const; - bool hasMessage() const; - std::string getExpression() const; - std::string getExpressionInMacro() const; - bool hasExpandedExpression() const; - std::string getExpandedExpression() const; - std::string getMessage() const; - SourceLineInfo getSourceInfo() const; - std::string getTestMacroName() const; - - protected: - AssertionInfo m_info; - AssertionResultData m_resultData; - }; - -} // end namespace Catch - -namespace Catch { - - struct TestFailureException{}; - - template class ExpressionLhs; - - struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; - - struct CopyableStream { - CopyableStream() {} - CopyableStream( CopyableStream const& other ) { - oss << other.oss.str(); - } - CopyableStream& operator=( CopyableStream const& other ) { - oss.str(""); - oss << other.oss.str(); - return *this; - } - std::ostringstream oss; - }; - - class ResultBuilder { - public: - ResultBuilder( char const* macroName, - SourceLineInfo const& lineInfo, - char const* capturedExpression, - ResultDisposition::Flags resultDisposition ); - - template - ExpressionLhs operator->* ( T const& operand ); - ExpressionLhs operator->* ( bool value ); - - template - ResultBuilder& operator << ( T const& value ) { - m_stream.oss << value; - return *this; - } - - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( RhsT const& ); - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( RhsT const& ); - - ResultBuilder& setResultType( ResultWas::OfType result ); - ResultBuilder& setResultType( bool result ); - ResultBuilder& setLhs( std::string const& lhs ); - ResultBuilder& setRhs( std::string const& rhs ); - ResultBuilder& setOp( std::string const& op ); - - void endExpression(); - - std::string reconstructExpression() const; - AssertionResult build() const; - - void useActiveException( ResultDisposition::Flags resultDisposition = ResultDisposition::Normal ); - void captureResult( ResultWas::OfType resultType ); - void captureExpression(); - void react(); - bool shouldDebugBreak() const; - bool allowThrows() const; - - private: - AssertionInfo m_assertionInfo; - AssertionResultData m_data; - struct ExprComponents { - ExprComponents() : testFalse( false ) {} - bool testFalse; - std::string lhs, rhs, op; - } m_exprComponents; - CopyableStream m_stream; - - bool m_shouldDebugBreak; - bool m_shouldThrow; - }; - -} // namespace Catch - -// Include after due to circular dependency: -// #included from: catch_expression_lhs.hpp -#define TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED - -// #included from: catch_evaluate.hpp -#define TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4389) // '==' : signed/unsigned mismatch -#endif - -#include - -namespace Catch { -namespace Internal { - - enum Operator { - IsEqualTo, - IsNotEqualTo, - IsLessThan, - IsGreaterThan, - IsLessThanOrEqualTo, - IsGreaterThanOrEqualTo - }; - - template struct OperatorTraits { static const char* getName(){ return "*error*"; } }; - template<> struct OperatorTraits { static const char* getName(){ return "=="; } }; - template<> struct OperatorTraits { static const char* getName(){ return "!="; } }; - template<> struct OperatorTraits { static const char* getName(){ return "<"; } }; - template<> struct OperatorTraits { static const char* getName(){ return ">"; } }; - template<> struct OperatorTraits { static const char* getName(){ return "<="; } }; - template<> struct OperatorTraits{ static const char* getName(){ return ">="; } }; - - template - inline T& opCast(T const& t) { return const_cast(t); } - -// nullptr_t support based on pull request #154 from Konstantin Baumann -#ifdef CATCH_CONFIG_CPP11_NULLPTR - inline std::nullptr_t opCast(std::nullptr_t) { return nullptr; } -#endif // CATCH_CONFIG_CPP11_NULLPTR - - // So the compare overloads can be operator agnostic we convey the operator as a template - // enum, which is used to specialise an Evaluator for doing the comparison. - template - class Evaluator{}; - - template - struct Evaluator { - static bool evaluate( T1 const& lhs, T2 const& rhs) { - return opCast( lhs ) == opCast( rhs ); - } - }; - template - struct Evaluator { - static bool evaluate( T1 const& lhs, T2 const& rhs ) { - return opCast( lhs ) != opCast( rhs ); - } - }; - template - struct Evaluator { - static bool evaluate( T1 const& lhs, T2 const& rhs ) { - return opCast( lhs ) < opCast( rhs ); - } - }; - template - struct Evaluator { - static bool evaluate( T1 const& lhs, T2 const& rhs ) { - return opCast( lhs ) > opCast( rhs ); - } - }; - template - struct Evaluator { - static bool evaluate( T1 const& lhs, T2 const& rhs ) { - return opCast( lhs ) >= opCast( rhs ); - } - }; - template - struct Evaluator { - static bool evaluate( T1 const& lhs, T2 const& rhs ) { - return opCast( lhs ) <= opCast( rhs ); - } - }; - - template - bool applyEvaluator( T1 const& lhs, T2 const& rhs ) { - return Evaluator::evaluate( lhs, rhs ); - } - - // This level of indirection allows us to specialise for integer types - // to avoid signed/ unsigned warnings - - // "base" overload - template - bool compare( T1 const& lhs, T2 const& rhs ) { - return Evaluator::evaluate( lhs, rhs ); - } - - // unsigned X to int - template bool compare( unsigned int lhs, int rhs ) { - return applyEvaluator( lhs, static_cast( rhs ) ); - } - template bool compare( unsigned long lhs, int rhs ) { - return applyEvaluator( lhs, static_cast( rhs ) ); - } - template bool compare( unsigned char lhs, int rhs ) { - return applyEvaluator( lhs, static_cast( rhs ) ); - } - - // unsigned X to long - template bool compare( unsigned int lhs, long rhs ) { - return applyEvaluator( lhs, static_cast( rhs ) ); - } - template bool compare( unsigned long lhs, long rhs ) { - return applyEvaluator( lhs, static_cast( rhs ) ); - } - template bool compare( unsigned char lhs, long rhs ) { - return applyEvaluator( lhs, static_cast( rhs ) ); - } - - // int to unsigned X - template bool compare( int lhs, unsigned int rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - template bool compare( int lhs, unsigned long rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - template bool compare( int lhs, unsigned char rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - - // long to unsigned X - template bool compare( long lhs, unsigned int rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - template bool compare( long lhs, unsigned long rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - template bool compare( long lhs, unsigned char rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - - // pointer to long (when comparing against NULL) - template bool compare( long lhs, T* rhs ) { - return Evaluator::evaluate( reinterpret_cast( lhs ), rhs ); - } - template bool compare( T* lhs, long rhs ) { - return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); - } - - // pointer to int (when comparing against NULL) - template bool compare( int lhs, T* rhs ) { - return Evaluator::evaluate( reinterpret_cast( lhs ), rhs ); - } - template bool compare( T* lhs, int rhs ) { - return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); - } - -#ifdef CATCH_CONFIG_CPP11_NULLPTR - // pointer to nullptr_t (when comparing against nullptr) - template bool compare( std::nullptr_t, T* rhs ) { - return Evaluator::evaluate( NULL, rhs ); - } - template bool compare( T* lhs, std::nullptr_t ) { - return Evaluator::evaluate( lhs, NULL ); - } -#endif // CATCH_CONFIG_CPP11_NULLPTR - -} // end of namespace Internal -} // end of namespace Catch - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -// #included from: catch_tostring.h -#define TWOBLUECUBES_CATCH_TOSTRING_H_INCLUDED - -// #included from: catch_sfinae.hpp -#define TWOBLUECUBES_CATCH_SFINAE_HPP_INCLUDED - -// Try to detect if the current compiler supports SFINAE - -namespace Catch { - - struct TrueType { - static const bool value = true; - typedef void Enable; - char sizer[1]; - }; - struct FalseType { - static const bool value = false; - typedef void Disable; - char sizer[2]; - }; - -#ifdef CATCH_CONFIG_SFINAE - - template struct NotABooleanExpression; - - template struct If : NotABooleanExpression {}; - template<> struct If : TrueType {}; - template<> struct If : FalseType {}; - - template struct SizedIf; - template<> struct SizedIf : TrueType {}; - template<> struct SizedIf : FalseType {}; - -#endif // CATCH_CONFIG_SFINAE - -} // end namespace Catch - -#include -#include -#include -#include -#include - -#ifdef __OBJC__ -// #included from: catch_objc_arc.hpp -#define TWOBLUECUBES_CATCH_OBJC_ARC_HPP_INCLUDED - -#import - -#ifdef __has_feature -#define CATCH_ARC_ENABLED __has_feature(objc_arc) -#else -#define CATCH_ARC_ENABLED 0 -#endif - -void arcSafeRelease( NSObject* obj ); -id performOptionalSelector( id obj, SEL sel ); - -#if !CATCH_ARC_ENABLED -inline void arcSafeRelease( NSObject* obj ) { - [obj release]; -} -inline id performOptionalSelector( id obj, SEL sel ) { - if( [obj respondsToSelector: sel] ) - return [obj performSelector: sel]; - return nil; -} -#define CATCH_UNSAFE_UNRETAINED -#define CATCH_ARC_STRONG -#else -inline void arcSafeRelease( NSObject* ){} -inline id performOptionalSelector( id obj, SEL sel ) { -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Warc-performSelector-leaks" -#endif - if( [obj respondsToSelector: sel] ) - return [obj performSelector: sel]; -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - return nil; -} -#define CATCH_UNSAFE_UNRETAINED __unsafe_unretained -#define CATCH_ARC_STRONG __strong -#endif - -#endif - -#ifdef CATCH_CPP11_OR_GREATER -#include -#include -#endif - -namespace Catch { - -// Why we're here. -template -std::string toString( T const& value ); - -// Built in overloads - -std::string toString( std::string const& value ); -std::string toString( std::wstring const& value ); -std::string toString( const char* const value ); -std::string toString( char* const value ); -std::string toString( const wchar_t* const value ); -std::string toString( wchar_t* const value ); -std::string toString( int value ); -std::string toString( unsigned long value ); -std::string toString( unsigned int value ); -std::string toString( const double value ); -std::string toString( const float value ); -std::string toString( bool value ); -std::string toString( char value ); -std::string toString( signed char value ); -std::string toString( unsigned char value ); - -#ifdef CATCH_CONFIG_CPP11_NULLPTR -std::string toString( std::nullptr_t ); -#endif - -#ifdef __OBJC__ - std::string toString( NSString const * const& nsstring ); - std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ); - std::string toString( NSObject* const& nsObject ); -#endif - -namespace Detail { - - extern std::string unprintableString; - -// SFINAE is currently disabled by default for all compilers. -// If the non SFINAE version of IsStreamInsertable is ambiguous for you -// and your compiler supports SFINAE, try #defining CATCH_CONFIG_SFINAE -#ifdef CATCH_CONFIG_SFINAE - - template - class IsStreamInsertableHelper { - template struct TrueIfSizeable : TrueType {}; - - template - static TrueIfSizeable dummy(T2*); - static FalseType dummy(...); - - public: - typedef SizedIf type; - }; - - template - struct IsStreamInsertable : IsStreamInsertableHelper::type {}; - -#else - - struct BorgType { - template BorgType( T const& ); - }; - - TrueType& testStreamable( std::ostream& ); - FalseType testStreamable( FalseType ); - - FalseType operator<<( std::ostream const&, BorgType const& ); - - template - struct IsStreamInsertable { - static std::ostream &s; - static T const&t; - enum { value = sizeof( testStreamable(s << t) ) == sizeof( TrueType ) }; - }; - -#endif - -#if defined(CATCH_CPP11_OR_GREATER) - template::value - > - struct EnumStringMaker - { - static std::string convert( T const& ) { return unprintableString; } - }; - - template - struct EnumStringMaker - { - static std::string convert( T const& v ) - { - return ::Catch::toString( - static_cast::type>(v) - ); - } - }; -#endif - template - struct StringMakerBase { -#if defined(CATCH_CPP11_OR_GREATER) - template - static std::string convert( T const& v ) - { - return EnumStringMaker::convert( v ); - } -#else - template - static std::string convert( T const& ) { return unprintableString; } -#endif - }; - - template<> - struct StringMakerBase { - template - static std::string convert( T const& _value ) { - std::ostringstream oss; - oss << _value; - return oss.str(); - } - }; - - std::string rawMemoryToString( const void *object, std::size_t size ); - - template - inline std::string rawMemoryToString( const T& object ) { - return rawMemoryToString( &object, sizeof(object) ); - } - -} // end namespace Detail - -template -struct StringMaker : - Detail::StringMakerBase::value> {}; - -template -struct StringMaker { - template - static std::string convert( U* p ) { - if( !p ) - return INTERNAL_CATCH_STRINGIFY( NULL ); - else - return Detail::rawMemoryToString( p ); - } -}; - -template -struct StringMaker { - static std::string convert( R C::* p ) { - if( !p ) - return INTERNAL_CATCH_STRINGIFY( NULL ); - else - return Detail::rawMemoryToString( p ); - } -}; - -namespace Detail { - template - std::string rangeToString( InputIterator first, InputIterator last ); -} - -//template -//struct StringMaker > { -// static std::string convert( std::vector const& v ) { -// return Detail::rangeToString( v.begin(), v.end() ); -// } -//}; - -template -std::string toString( std::vector const& v ) { - return Detail::rangeToString( v.begin(), v.end() ); -} - -#ifdef CATCH_CPP11_OR_GREATER - -// toString for tuples -namespace TupleDetail { - template< - typename Tuple, - std::size_t N = 0, - bool = (N < std::tuple_size::value) - > - struct ElementPrinter { - static void print( const Tuple& tuple, std::ostream& os ) - { - os << ( N ? ", " : " " ) - << Catch::toString(std::get(tuple)); - ElementPrinter::print(tuple,os); - } - }; - - template< - typename Tuple, - std::size_t N - > - struct ElementPrinter { - static void print( const Tuple&, std::ostream& ) {} - }; - -} - -template -struct StringMaker> { - - static std::string convert( const std::tuple& tuple ) - { - std::ostringstream os; - os << '{'; - TupleDetail::ElementPrinter>::print( tuple, os ); - os << " }"; - return os.str(); - } -}; -#endif - -namespace Detail { - template - std::string makeString( T const& value ) { - return StringMaker::convert( value ); - } -} // end namespace Detail - -/// \brief converts any type to a string -/// -/// The default template forwards on to ostringstream - except when an -/// ostringstream overload does not exist - in which case it attempts to detect -/// that and writes {?}. -/// Overload (not specialise) this template for custom typs that you don't want -/// to provide an ostream overload for. -template -std::string toString( T const& value ) { - return StringMaker::convert( value ); -} - - namespace Detail { - template - std::string rangeToString( InputIterator first, InputIterator last ) { - std::ostringstream oss; - oss << "{ "; - if( first != last ) { - oss << Catch::toString( *first ); - for( ++first ; first != last ; ++first ) - oss << ", " << Catch::toString( *first ); - } - oss << " }"; - return oss.str(); - } -} - -} // end namespace Catch - -namespace Catch { - -// Wraps the LHS of an expression and captures the operator and RHS (if any) - -// wrapping them all in a ResultBuilder object -template -class ExpressionLhs { - ExpressionLhs& operator = ( ExpressionLhs const& ); -# ifdef CATCH_CPP11_OR_GREATER - ExpressionLhs& operator = ( ExpressionLhs && ) = delete; -# endif - -public: - ExpressionLhs( ResultBuilder& rb, T lhs ) : m_rb( rb ), m_lhs( lhs ) {} -# ifdef CATCH_CPP11_OR_GREATER - ExpressionLhs( ExpressionLhs const& ) = default; - ExpressionLhs( ExpressionLhs && ) = default; -# endif - - template - ResultBuilder& operator == ( RhsT const& rhs ) { - return captureExpression( rhs ); - } - - template - ResultBuilder& operator != ( RhsT const& rhs ) { - return captureExpression( rhs ); - } - - template - ResultBuilder& operator < ( RhsT const& rhs ) { - return captureExpression( rhs ); - } - - template - ResultBuilder& operator > ( RhsT const& rhs ) { - return captureExpression( rhs ); - } - - template - ResultBuilder& operator <= ( RhsT const& rhs ) { - return captureExpression( rhs ); - } - - template - ResultBuilder& operator >= ( RhsT const& rhs ) { - return captureExpression( rhs ); - } - - ResultBuilder& operator == ( bool rhs ) { - return captureExpression( rhs ); - } - - ResultBuilder& operator != ( bool rhs ) { - return captureExpression( rhs ); - } - - void endExpression() { - bool value = m_lhs ? true : false; - m_rb - .setLhs( Catch::toString( value ) ) - .setResultType( value ) - .endExpression(); - } - - // Only simple binary expressions are allowed on the LHS. - // If more complex compositions are required then place the sub expression in parentheses - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( RhsT const& ); - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator - ( RhsT const& ); - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator / ( RhsT const& ); - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator * ( RhsT const& ); - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( RhsT const& ); - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( RhsT const& ); - -private: - template - ResultBuilder& captureExpression( RhsT const& rhs ) { - return m_rb - .setResultType( Internal::compare( m_lhs, rhs ) ) - .setLhs( Catch::toString( m_lhs ) ) - .setRhs( Catch::toString( rhs ) ) - .setOp( Internal::OperatorTraits::getName() ); - } - -private: - ResultBuilder& m_rb; - T m_lhs; -}; - -} // end namespace Catch - - -namespace Catch { - - template - inline ExpressionLhs ResultBuilder::operator->* ( T const& operand ) { - return ExpressionLhs( *this, operand ); - } - - inline ExpressionLhs ResultBuilder::operator->* ( bool value ) { - return ExpressionLhs( *this, value ); - } - -} // namespace Catch - -// #included from: catch_message.h -#define TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED - -#include - -namespace Catch { - - struct MessageInfo { - MessageInfo( std::string const& _macroName, - SourceLineInfo const& _lineInfo, - ResultWas::OfType _type ); - - std::string macroName; - SourceLineInfo lineInfo; - ResultWas::OfType type; - std::string message; - unsigned int sequence; - - bool operator == ( MessageInfo const& other ) const { - return sequence == other.sequence; - } - bool operator < ( MessageInfo const& other ) const { - return sequence < other.sequence; - } - private: - static unsigned int globalCount; - }; - - struct MessageBuilder { - MessageBuilder( std::string const& macroName, - SourceLineInfo const& lineInfo, - ResultWas::OfType type ) - : m_info( macroName, lineInfo, type ) - {} - - template - MessageBuilder& operator << ( T const& value ) { - m_stream << value; - return *this; - } - - MessageInfo m_info; - std::ostringstream m_stream; - }; - - class ScopedMessage { - public: - ScopedMessage( MessageBuilder const& builder ); - ScopedMessage( ScopedMessage const& other ); - ~ScopedMessage(); - - MessageInfo m_info; - }; - -} // end namespace Catch - -// #included from: catch_interfaces_capture.h -#define TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED - -#include - -namespace Catch { - - class TestCase; - class AssertionResult; - struct AssertionInfo; - struct SectionInfo; - struct MessageInfo; - class ScopedMessageBuilder; - struct Counts; - - struct IResultCapture { - - virtual ~IResultCapture(); - - virtual void assertionEnded( AssertionResult const& result ) = 0; - virtual bool sectionStarted( SectionInfo const& sectionInfo, - Counts& assertions ) = 0; - virtual void sectionEnded( SectionInfo const& name, Counts const& assertions, double _durationInSeconds ) = 0; - virtual void pushScopedMessage( MessageInfo const& message ) = 0; - virtual void popScopedMessage( MessageInfo const& message ) = 0; - - virtual std::string getCurrentTestName() const = 0; - virtual const AssertionResult* getLastResult() const = 0; - - virtual void handleFatalErrorCondition( std::string const& message ) = 0; - }; - - IResultCapture& getResultCapture(); -} - -// #included from: catch_debugger.h -#define TWOBLUECUBES_CATCH_DEBUGGER_H_INCLUDED - -// #included from: catch_platform.h -#define TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED - -#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) -#define CATCH_PLATFORM_MAC -#elif defined(__IPHONE_OS_VERSION_MIN_REQUIRED) -#define CATCH_PLATFORM_IPHONE -#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) -#define CATCH_PLATFORM_WINDOWS -#endif - -#include - -namespace Catch{ - - bool isDebuggerActive(); - void writeToDebugConsole( std::string const& text ); -} - -#ifdef CATCH_PLATFORM_MAC - - // The following code snippet based on: - // http://cocoawithlove.com/2008/03/break-into-debugger.html - #ifdef DEBUG - #if defined(__ppc64__) || defined(__ppc__) - #define CATCH_BREAK_INTO_DEBUGGER() \ - if( Catch::isDebuggerActive() ) { \ - __asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" \ - : : : "memory","r0","r3","r4" ); \ - } - #else - #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) {__asm__("int $3\n" : : );} - #endif - #endif - -#elif defined(_MSC_VER) - #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) { __debugbreak(); } -#elif defined(__MINGW32__) - extern "C" __declspec(dllimport) void __stdcall DebugBreak(); - #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) { DebugBreak(); } -#endif - -#ifndef CATCH_BREAK_INTO_DEBUGGER -#define CATCH_BREAK_INTO_DEBUGGER() Catch::alwaysTrue(); -#endif - -// #included from: catch_interfaces_runner.h -#define TWOBLUECUBES_CATCH_INTERFACES_RUNNER_H_INCLUDED - -namespace Catch { - class TestCase; - - struct IRunner { - virtual ~IRunner(); - virtual bool aborting() const = 0; - }; -} - -/////////////////////////////////////////////////////////////////////////////// -// In the event of a failure works out if the debugger needs to be invoked -// and/or an exception thrown and takes appropriate action. -// This needs to be done as a macro so the debugger will stop in the user -// source code rather than in Catch library code -#define INTERNAL_CATCH_REACT( resultBuilder ) \ - if( resultBuilder.shouldDebugBreak() ) CATCH_BREAK_INTO_DEBUGGER(); \ - resultBuilder.react(); - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ) \ - do { \ - Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \ - try { \ - ( __catchResult->*expr ).endExpression(); \ - } \ - catch( ... ) { \ - __catchResult.useActiveException( Catch::ResultDisposition::Normal ); \ - } \ - INTERNAL_CATCH_REACT( __catchResult ) \ - } while( Catch::isTrue( false && (expr) ) ) // expr here is never evaluated at runtime but it forces the compiler to give it a look - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_IF( expr, resultDisposition, macroName ) \ - INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ - if( Catch::getResultCapture().getLastResult()->succeeded() ) - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ELSE( expr, resultDisposition, macroName ) \ - INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ - if( !Catch::getResultCapture().getLastResult()->succeeded() ) - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_NO_THROW( expr, resultDisposition, macroName ) \ - do { \ - Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \ - try { \ - expr; \ - __catchResult.captureResult( Catch::ResultWas::Ok ); \ - } \ - catch( ... ) { \ - __catchResult.useActiveException( resultDisposition ); \ - } \ - INTERNAL_CATCH_REACT( __catchResult ) \ - } while( Catch::alwaysFalse() ) - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_THROWS( expr, resultDisposition, macroName ) \ - do { \ - Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \ - if( __catchResult.allowThrows() ) \ - try { \ - expr; \ - __catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \ - } \ - catch( ... ) { \ - __catchResult.captureResult( Catch::ResultWas::Ok ); \ - } \ - else \ - __catchResult.captureResult( Catch::ResultWas::Ok ); \ - INTERNAL_CATCH_REACT( __catchResult ) \ - } while( Catch::alwaysFalse() ) - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_THROWS_AS( expr, exceptionType, resultDisposition, macroName ) \ - do { \ - Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \ - if( __catchResult.allowThrows() ) \ - try { \ - expr; \ - __catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \ - } \ - catch( exceptionType ) { \ - __catchResult.captureResult( Catch::ResultWas::Ok ); \ - } \ - catch( ... ) { \ - __catchResult.useActiveException( resultDisposition ); \ - } \ - else \ - __catchResult.captureResult( Catch::ResultWas::Ok ); \ - INTERNAL_CATCH_REACT( __catchResult ) \ - } while( Catch::alwaysFalse() ) - -/////////////////////////////////////////////////////////////////////////////// -#ifdef CATCH_CONFIG_VARIADIC_MACROS - #define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, ... ) \ - do { \ - Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \ - __catchResult << __VA_ARGS__ + ::Catch::StreamEndStop(); \ - __catchResult.captureResult( messageType ); \ - INTERNAL_CATCH_REACT( __catchResult ) \ - } while( Catch::alwaysFalse() ) -#else - #define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, log ) \ - do { \ - Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \ - __catchResult << log + ::Catch::StreamEndStop(); \ - __catchResult.captureResult( messageType ); \ - INTERNAL_CATCH_REACT( __catchResult ) \ - } while( Catch::alwaysFalse() ) -#endif - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_INFO( log, macroName ) \ - Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage ) = Catch::MessageBuilder( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log; - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CHECK_THAT( arg, matcher, resultDisposition, macroName ) \ - do { \ - Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #arg " " #matcher, resultDisposition ); \ - try { \ - std::string matcherAsString = ::Catch::Matchers::matcher.toString(); \ - __catchResult \ - .setLhs( Catch::toString( arg ) ) \ - .setRhs( matcherAsString == Catch::Detail::unprintableString ? #matcher : matcherAsString ) \ - .setOp( "matches" ) \ - .setResultType( ::Catch::Matchers::matcher.match( arg ) ); \ - __catchResult.captureExpression(); \ - } catch( ... ) { \ - __catchResult.useActiveException( resultDisposition | Catch::ResultDisposition::ContinueOnFailure ); \ - } \ - INTERNAL_CATCH_REACT( __catchResult ) \ - } while( Catch::alwaysFalse() ) - -// #included from: internal/catch_section.h -#define TWOBLUECUBES_CATCH_SECTION_H_INCLUDED - -// #included from: catch_section_info.h -#define TWOBLUECUBES_CATCH_SECTION_INFO_H_INCLUDED - -namespace Catch { - - struct SectionInfo { - SectionInfo - ( SourceLineInfo const& _lineInfo, - std::string const& _name, - std::string const& _description = std::string() ); - - std::string name; - std::string description; - SourceLineInfo lineInfo; - }; - -} // end namespace Catch - -// #included from: catch_totals.hpp -#define TWOBLUECUBES_CATCH_TOTALS_HPP_INCLUDED - -#include - -namespace Catch { - - struct Counts { - Counts() : passed( 0 ), failed( 0 ), failedButOk( 0 ) {} - - Counts operator - ( Counts const& other ) const { - Counts diff; - diff.passed = passed - other.passed; - diff.failed = failed - other.failed; - diff.failedButOk = failedButOk - other.failedButOk; - return diff; - } - Counts& operator += ( Counts const& other ) { - passed += other.passed; - failed += other.failed; - failedButOk += other.failedButOk; - return *this; - } - - std::size_t total() const { - return passed + failed + failedButOk; - } - bool allPassed() const { - return failed == 0 && failedButOk == 0; - } - bool allOk() const { - return failed == 0; - } - - std::size_t passed; - std::size_t failed; - std::size_t failedButOk; - }; - - struct Totals { - - Totals operator - ( Totals const& other ) const { - Totals diff; - diff.assertions = assertions - other.assertions; - diff.testCases = testCases - other.testCases; - return diff; - } - - Totals delta( Totals const& prevTotals ) const { - Totals diff = *this - prevTotals; - if( diff.assertions.failed > 0 ) - ++diff.testCases.failed; - else if( diff.assertions.failedButOk > 0 ) - ++diff.testCases.failedButOk; - else - ++diff.testCases.passed; - return diff; - } - - Totals& operator += ( Totals const& other ) { - assertions += other.assertions; - testCases += other.testCases; - return *this; - } - - Counts assertions; - Counts testCases; - }; -} - -// #included from: catch_timer.h -#define TWOBLUECUBES_CATCH_TIMER_H_INCLUDED - -#ifdef CATCH_PLATFORM_WINDOWS -typedef unsigned long long uint64_t; -#else -#include -#endif - -namespace Catch { - - class Timer { - public: - Timer() : m_ticks( 0 ) {} - void start(); - unsigned int getElapsedMicroseconds() const; - unsigned int getElapsedMilliseconds() const; - double getElapsedSeconds() const; - - private: - uint64_t m_ticks; - }; - -} // namespace Catch - -#include - -namespace Catch { - - class Section : NonCopyable { - public: - Section( SectionInfo const& info ); - ~Section(); - - // This indicates whether the section should be executed or not - operator bool() const; - - private: - SectionInfo m_info; - - std::string m_name; - Counts m_assertions; - bool m_sectionIncluded; - Timer m_timer; - }; - -} // end namespace Catch - -#ifdef CATCH_CONFIG_VARIADIC_MACROS - #define INTERNAL_CATCH_SECTION( ... ) \ - if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) ) -#else - #define INTERNAL_CATCH_SECTION( name, desc ) \ - if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, name, desc ) ) -#endif - -// #included from: internal/catch_generators.hpp -#define TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED - -#include -#include -#include -#include - -namespace Catch { - -template -struct IGenerator { - virtual ~IGenerator() {} - virtual T getValue( std::size_t index ) const = 0; - virtual std::size_t size () const = 0; -}; - -template -class BetweenGenerator : public IGenerator { -public: - BetweenGenerator( T from, T to ) : m_from( from ), m_to( to ){} - - virtual T getValue( std::size_t index ) const { - return m_from+static_cast( index ); - } - - virtual std::size_t size() const { - return static_cast( 1+m_to-m_from ); - } - -private: - - T m_from; - T m_to; -}; - -template -class ValuesGenerator : public IGenerator { -public: - ValuesGenerator(){} - - void add( T value ) { - m_values.push_back( value ); - } - - virtual T getValue( std::size_t index ) const { - return m_values[index]; - } - - virtual std::size_t size() const { - return m_values.size(); - } - -private: - std::vector m_values; -}; - -template -class CompositeGenerator { -public: - CompositeGenerator() : m_totalSize( 0 ) {} - - // *** Move semantics, similar to auto_ptr *** - CompositeGenerator( CompositeGenerator& other ) - : m_fileInfo( other.m_fileInfo ), - m_totalSize( 0 ) - { - move( other ); - } - - CompositeGenerator& setFileInfo( const char* fileInfo ) { - m_fileInfo = fileInfo; - return *this; - } - - ~CompositeGenerator() { - deleteAll( m_composed ); - } - - operator T () const { - size_t overallIndex = getCurrentContext().getGeneratorIndex( m_fileInfo, m_totalSize ); - - typename std::vector*>::const_iterator it = m_composed.begin(); - typename std::vector*>::const_iterator itEnd = m_composed.end(); - for( size_t index = 0; it != itEnd; ++it ) - { - const IGenerator* generator = *it; - if( overallIndex >= index && overallIndex < index + generator->size() ) - { - return generator->getValue( overallIndex-index ); - } - index += generator->size(); - } - CATCH_INTERNAL_ERROR( "Indexed past end of generated range" ); - return T(); // Suppress spurious "not all control paths return a value" warning in Visual Studio - if you know how to fix this please do so - } - - void add( const IGenerator* generator ) { - m_totalSize += generator->size(); - m_composed.push_back( generator ); - } - - CompositeGenerator& then( CompositeGenerator& other ) { - move( other ); - return *this; - } - - CompositeGenerator& then( T value ) { - ValuesGenerator* valuesGen = new ValuesGenerator(); - valuesGen->add( value ); - add( valuesGen ); - return *this; - } - -private: - - void move( CompositeGenerator& other ) { - std::copy( other.m_composed.begin(), other.m_composed.end(), std::back_inserter( m_composed ) ); - m_totalSize += other.m_totalSize; - other.m_composed.clear(); - } - - std::vector*> m_composed; - std::string m_fileInfo; - size_t m_totalSize; -}; - -namespace Generators -{ - template - CompositeGenerator between( T from, T to ) { - CompositeGenerator generators; - generators.add( new BetweenGenerator( from, to ) ); - return generators; - } - - template - CompositeGenerator values( T val1, T val2 ) { - CompositeGenerator generators; - ValuesGenerator* valuesGen = new ValuesGenerator(); - valuesGen->add( val1 ); - valuesGen->add( val2 ); - generators.add( valuesGen ); - return generators; - } - - template - CompositeGenerator values( T val1, T val2, T val3 ){ - CompositeGenerator generators; - ValuesGenerator* valuesGen = new ValuesGenerator(); - valuesGen->add( val1 ); - valuesGen->add( val2 ); - valuesGen->add( val3 ); - generators.add( valuesGen ); - return generators; - } - - template - CompositeGenerator values( T val1, T val2, T val3, T val4 ) { - CompositeGenerator generators; - ValuesGenerator* valuesGen = new ValuesGenerator(); - valuesGen->add( val1 ); - valuesGen->add( val2 ); - valuesGen->add( val3 ); - valuesGen->add( val4 ); - generators.add( valuesGen ); - return generators; - } - -} // end namespace Generators - -using namespace Generators; - -} // end namespace Catch - -#define INTERNAL_CATCH_LINESTR2( line ) #line -#define INTERNAL_CATCH_LINESTR( line ) INTERNAL_CATCH_LINESTR2( line ) - -#define INTERNAL_CATCH_GENERATE( expr ) expr.setFileInfo( __FILE__ "(" INTERNAL_CATCH_LINESTR( __LINE__ ) ")" ) - -// #included from: internal/catch_interfaces_exception.h -#define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED - -#include -// #included from: catch_interfaces_registry_hub.h -#define TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED - -#include - -namespace Catch { - - class TestCase; - struct ITestCaseRegistry; - struct IExceptionTranslatorRegistry; - struct IExceptionTranslator; - struct IReporterRegistry; - struct IReporterFactory; - - struct IRegistryHub { - virtual ~IRegistryHub(); - - virtual IReporterRegistry const& getReporterRegistry() const = 0; - virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0; - virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() = 0; - }; - - struct IMutableRegistryHub { - virtual ~IMutableRegistryHub(); - virtual void registerReporter( std::string const& name, IReporterFactory* factory ) = 0; - virtual void registerTest( TestCase const& testInfo ) = 0; - virtual void registerTranslator( const IExceptionTranslator* translator ) = 0; - }; - - IRegistryHub& getRegistryHub(); - IMutableRegistryHub& getMutableRegistryHub(); - void cleanUp(); - std::string translateActiveException(); - -} - - -namespace Catch { - - typedef std::string(*exceptionTranslateFunction)(); - - struct IExceptionTranslator { - virtual ~IExceptionTranslator(); - virtual std::string translate() const = 0; - }; - - struct IExceptionTranslatorRegistry { - virtual ~IExceptionTranslatorRegistry(); - - virtual std::string translateActiveException() const = 0; - }; - - class ExceptionTranslatorRegistrar { - template - class ExceptionTranslator : public IExceptionTranslator { - public: - - ExceptionTranslator( std::string(*translateFunction)( T& ) ) - : m_translateFunction( translateFunction ) - {} - - virtual std::string translate() const { - try { - throw; - } - catch( T& ex ) { - return m_translateFunction( ex ); - } - } - - protected: - std::string(*m_translateFunction)( T& ); - }; - - public: - template - ExceptionTranslatorRegistrar( std::string(*translateFunction)( T& ) ) { - getMutableRegistryHub().registerTranslator - ( new ExceptionTranslator( translateFunction ) ); - } - }; -} - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) \ - static std::string INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator )( signature ); \ - namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ) ); }\ - static std::string INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator )( signature ) - -// #included from: internal/catch_approx.hpp -#define TWOBLUECUBES_CATCH_APPROX_HPP_INCLUDED - -#include -#include - -namespace Catch { -namespace Detail { - - class Approx { - public: - explicit Approx ( double value ) - : m_epsilon( std::numeric_limits::epsilon()*100 ), - m_scale( 1.0 ), - m_value( value ) - {} - - Approx( Approx const& other ) - : m_epsilon( other.m_epsilon ), - m_scale( other.m_scale ), - m_value( other.m_value ) - {} - - static Approx custom() { - return Approx( 0 ); - } - - Approx operator()( double value ) { - Approx approx( value ); - approx.epsilon( m_epsilon ); - approx.scale( m_scale ); - return approx; - } - - friend bool operator == ( double lhs, Approx const& rhs ) { - // Thanks to Richard Harris for his help refining this formula - return fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs), fabs(rhs.m_value) ) ); - } - - friend bool operator == ( Approx const& lhs, double rhs ) { - return operator==( rhs, lhs ); - } - - friend bool operator != ( double lhs, Approx const& rhs ) { - return !operator==( lhs, rhs ); - } - - friend bool operator != ( Approx const& lhs, double rhs ) { - return !operator==( rhs, lhs ); - } - - Approx& epsilon( double newEpsilon ) { - m_epsilon = newEpsilon; - return *this; - } - - Approx& scale( double newScale ) { - m_scale = newScale; - return *this; - } - - std::string toString() const { - std::ostringstream oss; - oss << "Approx( " << Catch::toString( m_value ) << " )"; - return oss.str(); - } - - private: - double m_epsilon; - double m_scale; - double m_value; - }; -} - -template<> -inline std::string toString( Detail::Approx const& value ) { - return value.toString(); -} - -} // end namespace Catch - -// #included from: internal/catch_matchers.hpp -#define TWOBLUECUBES_CATCH_MATCHERS_HPP_INCLUDED - -namespace Catch { -namespace Matchers { - namespace Impl { - - template - struct Matcher : SharedImpl - { - typedef ExpressionT ExpressionType; - - virtual ~Matcher() {} - virtual Ptr clone() const = 0; - virtual bool match( ExpressionT const& expr ) const = 0; - virtual std::string toString() const = 0; - }; - - template - struct MatcherImpl : Matcher { - - virtual Ptr > clone() const { - return Ptr >( new DerivedT( static_cast( *this ) ) ); - } - }; - - namespace Generic { - - template - class AllOf : public MatcherImpl, ExpressionT> { - public: - - AllOf() {} - AllOf( AllOf const& other ) : m_matchers( other.m_matchers ) {} - - AllOf& add( Matcher const& matcher ) { - m_matchers.push_back( matcher.clone() ); - return *this; - } - virtual bool match( ExpressionT const& expr ) const - { - for( std::size_t i = 0; i < m_matchers.size(); ++i ) - if( !m_matchers[i]->match( expr ) ) - return false; - return true; - } - virtual std::string toString() const { - std::ostringstream oss; - oss << "( "; - for( std::size_t i = 0; i < m_matchers.size(); ++i ) { - if( i != 0 ) - oss << " and "; - oss << m_matchers[i]->toString(); - } - oss << " )"; - return oss.str(); - } - - private: - std::vector > > m_matchers; - }; - - template - class AnyOf : public MatcherImpl, ExpressionT> { - public: - - AnyOf() {} - AnyOf( AnyOf const& other ) : m_matchers( other.m_matchers ) {} - - AnyOf& add( Matcher const& matcher ) { - m_matchers.push_back( matcher.clone() ); - return *this; - } - virtual bool match( ExpressionT const& expr ) const - { - for( std::size_t i = 0; i < m_matchers.size(); ++i ) - if( m_matchers[i]->match( expr ) ) - return true; - return false; - } - virtual std::string toString() const { - std::ostringstream oss; - oss << "( "; - for( std::size_t i = 0; i < m_matchers.size(); ++i ) { - if( i != 0 ) - oss << " or "; - oss << m_matchers[i]->toString(); - } - oss << " )"; - return oss.str(); - } - - private: - std::vector > > m_matchers; - }; - - } - - namespace StdString { - - inline std::string makeString( std::string const& str ) { return str; } - inline std::string makeString( const char* str ) { return str ? std::string( str ) : std::string(); } - - struct Equals : MatcherImpl { - Equals( std::string const& str ) : m_str( str ){} - Equals( Equals const& other ) : m_str( other.m_str ){} - - virtual ~Equals(); - - virtual bool match( std::string const& expr ) const { - return m_str == expr; - } - virtual std::string toString() const { - return "equals: \"" + m_str + "\""; - } - - std::string m_str; - }; - - struct Contains : MatcherImpl { - Contains( std::string const& substr ) : m_substr( substr ){} - Contains( Contains const& other ) : m_substr( other.m_substr ){} - - virtual ~Contains(); - - virtual bool match( std::string const& expr ) const { - return expr.find( m_substr ) != std::string::npos; - } - virtual std::string toString() const { - return "contains: \"" + m_substr + "\""; - } - - std::string m_substr; - }; - - struct StartsWith : MatcherImpl { - StartsWith( std::string const& substr ) : m_substr( substr ){} - StartsWith( StartsWith const& other ) : m_substr( other.m_substr ){} - - virtual ~StartsWith(); - - virtual bool match( std::string const& expr ) const { - return expr.find( m_substr ) == 0; - } - virtual std::string toString() const { - return "starts with: \"" + m_substr + "\""; - } - - std::string m_substr; - }; - - struct EndsWith : MatcherImpl { - EndsWith( std::string const& substr ) : m_substr( substr ){} - EndsWith( EndsWith const& other ) : m_substr( other.m_substr ){} - - virtual ~EndsWith(); - - virtual bool match( std::string const& expr ) const { - return expr.find( m_substr ) == expr.size() - m_substr.size(); - } - virtual std::string toString() const { - return "ends with: \"" + m_substr + "\""; - } - - std::string m_substr; - }; - } // namespace StdString - } // namespace Impl - - // The following functions create the actual matcher objects. - // This allows the types to be inferred - template - inline Impl::Generic::AllOf AllOf( Impl::Matcher const& m1, - Impl::Matcher const& m2 ) { - return Impl::Generic::AllOf().add( m1 ).add( m2 ); - } - template - inline Impl::Generic::AllOf AllOf( Impl::Matcher const& m1, - Impl::Matcher const& m2, - Impl::Matcher const& m3 ) { - return Impl::Generic::AllOf().add( m1 ).add( m2 ).add( m3 ); - } - template - inline Impl::Generic::AnyOf AnyOf( Impl::Matcher const& m1, - Impl::Matcher const& m2 ) { - return Impl::Generic::AnyOf().add( m1 ).add( m2 ); - } - template - inline Impl::Generic::AnyOf AnyOf( Impl::Matcher const& m1, - Impl::Matcher const& m2, - Impl::Matcher const& m3 ) { - return Impl::Generic::AnyOf().add( m1 ).add( m2 ).add( m3 ); - } - - inline Impl::StdString::Equals Equals( std::string const& str ) { - return Impl::StdString::Equals( str ); - } - inline Impl::StdString::Equals Equals( const char* str ) { - return Impl::StdString::Equals( Impl::StdString::makeString( str ) ); - } - inline Impl::StdString::Contains Contains( std::string const& substr ) { - return Impl::StdString::Contains( substr ); - } - inline Impl::StdString::Contains Contains( const char* substr ) { - return Impl::StdString::Contains( Impl::StdString::makeString( substr ) ); - } - inline Impl::StdString::StartsWith StartsWith( std::string const& substr ) { - return Impl::StdString::StartsWith( substr ); - } - inline Impl::StdString::StartsWith StartsWith( const char* substr ) { - return Impl::StdString::StartsWith( Impl::StdString::makeString( substr ) ); - } - inline Impl::StdString::EndsWith EndsWith( std::string const& substr ) { - return Impl::StdString::EndsWith( substr ); - } - inline Impl::StdString::EndsWith EndsWith( const char* substr ) { - return Impl::StdString::EndsWith( Impl::StdString::makeString( substr ) ); - } - -} // namespace Matchers - -using namespace Matchers; - -} // namespace Catch - -// #included from: internal/catch_interfaces_tag_alias_registry.h -#define TWOBLUECUBES_CATCH_INTERFACES_TAG_ALIAS_REGISTRY_H_INCLUDED - -// #included from: catch_tag_alias.h -#define TWOBLUECUBES_CATCH_TAG_ALIAS_H_INCLUDED - -#include - -namespace Catch { - - struct TagAlias { - TagAlias( std::string _tag, SourceLineInfo _lineInfo ) : tag( _tag ), lineInfo( _lineInfo ) {} - - std::string tag; - SourceLineInfo lineInfo; - }; - - struct RegistrarForTagAliases { - RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ); - }; - -} // end namespace Catch - -#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } -// #included from: catch_option.hpp -#define TWOBLUECUBES_CATCH_OPTION_HPP_INCLUDED - -namespace Catch { - - // An optional type - template - class Option { - public: - Option() : nullableValue( NULL ) {} - Option( T const& _value ) - : nullableValue( new( storage ) T( _value ) ) - {} - Option( Option const& _other ) - : nullableValue( _other ? new( storage ) T( *_other ) : NULL ) - {} - - ~Option() { - reset(); - } - - Option& operator= ( Option const& _other ) { - if( &_other != this ) { - reset(); - if( _other ) - nullableValue = new( storage ) T( *_other ); - } - return *this; - } - Option& operator = ( T const& _value ) { - reset(); - nullableValue = new( storage ) T( _value ); - return *this; - } - - void reset() { - if( nullableValue ) - nullableValue->~T(); - nullableValue = NULL; - } - - T& operator*() { return *nullableValue; } - T const& operator*() const { return *nullableValue; } - T* operator->() { return nullableValue; } - const T* operator->() const { return nullableValue; } - - T valueOr( T const& defaultValue ) const { - return nullableValue ? *nullableValue : defaultValue; - } - - bool some() const { return nullableValue != NULL; } - bool none() const { return nullableValue == NULL; } - - bool operator !() const { return nullableValue == NULL; } - operator SafeBool::type() const { - return SafeBool::makeSafe( some() ); - } - - private: - T* nullableValue; - char storage[sizeof(T)]; - }; - -} // end namespace Catch - -namespace Catch { - - struct ITagAliasRegistry { - virtual ~ITagAliasRegistry(); - virtual Option find( std::string const& alias ) const = 0; - virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const = 0; - - static ITagAliasRegistry const& get(); - }; - -} // end namespace Catch - -// These files are included here so the single_include script doesn't put them -// in the conditionally compiled sections -// #included from: internal/catch_test_case_info.h -#define TWOBLUECUBES_CATCH_TEST_CASE_INFO_H_INCLUDED - -#include -#include - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wpadded" -#endif - -namespace Catch { - - struct ITestCase; - - struct TestCaseInfo { - enum SpecialProperties{ - None = 0, - IsHidden = 1 << 1, - ShouldFail = 1 << 2, - MayFail = 1 << 3, - Throws = 1 << 4 - }; - - TestCaseInfo( std::string const& _name, - std::string const& _className, - std::string const& _description, - std::set const& _tags, - SourceLineInfo const& _lineInfo ); - - TestCaseInfo( TestCaseInfo const& other ); - - bool isHidden() const; - bool throws() const; - bool okToFail() const; - bool expectedToFail() const; - - std::string name; - std::string className; - std::string description; - std::set tags; - std::set lcaseTags; - std::string tagsAsString; - SourceLineInfo lineInfo; - SpecialProperties properties; - }; - - class TestCase : public TestCaseInfo { - public: - - TestCase( ITestCase* testCase, TestCaseInfo const& info ); - TestCase( TestCase const& other ); - - TestCase withName( std::string const& _newName ) const; - - void invoke() const; - - TestCaseInfo const& getTestCaseInfo() const; - - void swap( TestCase& other ); - bool operator == ( TestCase const& other ) const; - bool operator < ( TestCase const& other ) const; - TestCase& operator = ( TestCase const& other ); - - private: - Ptr test; - }; - - TestCase makeTestCase( ITestCase* testCase, - std::string const& className, - std::string const& name, - std::string const& description, - SourceLineInfo const& lineInfo ); -} - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - - -#ifdef __OBJC__ -// #included from: internal/catch_objc.hpp -#define TWOBLUECUBES_CATCH_OBJC_HPP_INCLUDED - -#import - -#include - -// NB. Any general catch headers included here must be included -// in catch.hpp first to make sure they are included by the single -// header for non obj-usage - -/////////////////////////////////////////////////////////////////////////////// -// This protocol is really only here for (self) documenting purposes, since -// all its methods are optional. -@protocol OcFixture - -@optional - --(void) setUp; --(void) tearDown; - -@end - -namespace Catch { - - class OcMethod : public SharedImpl { - - public: - OcMethod( Class cls, SEL sel ) : m_cls( cls ), m_sel( sel ) {} - - virtual void invoke() const { - id obj = [[m_cls alloc] init]; - - performOptionalSelector( obj, @selector(setUp) ); - performOptionalSelector( obj, m_sel ); - performOptionalSelector( obj, @selector(tearDown) ); - - arcSafeRelease( obj ); - } - private: - virtual ~OcMethod() {} - - Class m_cls; - SEL m_sel; - }; - - namespace Detail{ - - inline std::string getAnnotation( Class cls, - std::string const& annotationName, - std::string const& testCaseName ) { - NSString* selStr = [[NSString alloc] initWithFormat:@"Catch_%s_%s", annotationName.c_str(), testCaseName.c_str()]; - SEL sel = NSSelectorFromString( selStr ); - arcSafeRelease( selStr ); - id value = performOptionalSelector( cls, sel ); - if( value ) - return [(NSString*)value UTF8String]; - return ""; - } - } - - inline size_t registerTestMethods() { - size_t noTestMethods = 0; - int noClasses = objc_getClassList( NULL, 0 ); - - Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses); - objc_getClassList( classes, noClasses ); - - for( int c = 0; c < noClasses; c++ ) { - Class cls = classes[c]; - { - u_int count; - Method* methods = class_copyMethodList( cls, &count ); - for( u_int m = 0; m < count ; m++ ) { - SEL selector = method_getName(methods[m]); - std::string methodName = sel_getName(selector); - if( startsWith( methodName, "Catch_TestCase_" ) ) { - std::string testCaseName = methodName.substr( 15 ); - std::string name = Detail::getAnnotation( cls, "Name", testCaseName ); - std::string desc = Detail::getAnnotation( cls, "Description", testCaseName ); - const char* className = class_getName( cls ); - - getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, name.c_str(), desc.c_str(), SourceLineInfo() ) ); - noTestMethods++; - } - } - free(methods); - } - } - return noTestMethods; - } - - namespace Matchers { - namespace Impl { - namespace NSStringMatchers { - - template - struct StringHolder : MatcherImpl{ - StringHolder( NSString* substr ) : m_substr( [substr copy] ){} - StringHolder( StringHolder const& other ) : m_substr( [other.m_substr copy] ){} - StringHolder() { - arcSafeRelease( m_substr ); - } - - NSString* m_substr; - }; - - struct Equals : StringHolder { - Equals( NSString* substr ) : StringHolder( substr ){} - - virtual bool match( ExpressionType const& str ) const { - return (str != nil || m_substr == nil ) && - [str isEqualToString:m_substr]; - } - - virtual std::string toString() const { - return "equals string: " + Catch::toString( m_substr ); - } - }; - - struct Contains : StringHolder { - Contains( NSString* substr ) : StringHolder( substr ){} - - virtual bool match( ExpressionType const& str ) const { - return (str != nil || m_substr == nil ) && - [str rangeOfString:m_substr].location != NSNotFound; - } - - virtual std::string toString() const { - return "contains string: " + Catch::toString( m_substr ); - } - }; - - struct StartsWith : StringHolder { - StartsWith( NSString* substr ) : StringHolder( substr ){} - - virtual bool match( ExpressionType const& str ) const { - return (str != nil || m_substr == nil ) && - [str rangeOfString:m_substr].location == 0; - } - - virtual std::string toString() const { - return "starts with: " + Catch::toString( m_substr ); - } - }; - struct EndsWith : StringHolder { - EndsWith( NSString* substr ) : StringHolder( substr ){} - - virtual bool match( ExpressionType const& str ) const { - return (str != nil || m_substr == nil ) && - [str rangeOfString:m_substr].location == [str length] - [m_substr length]; - } - - virtual std::string toString() const { - return "ends with: " + Catch::toString( m_substr ); - } - }; - - } // namespace NSStringMatchers - } // namespace Impl - - inline Impl::NSStringMatchers::Equals - Equals( NSString* substr ){ return Impl::NSStringMatchers::Equals( substr ); } - - inline Impl::NSStringMatchers::Contains - Contains( NSString* substr ){ return Impl::NSStringMatchers::Contains( substr ); } - - inline Impl::NSStringMatchers::StartsWith - StartsWith( NSString* substr ){ return Impl::NSStringMatchers::StartsWith( substr ); } - - inline Impl::NSStringMatchers::EndsWith - EndsWith( NSString* substr ){ return Impl::NSStringMatchers::EndsWith( substr ); } - - } // namespace Matchers - - using namespace Matchers; - -} // namespace Catch - -/////////////////////////////////////////////////////////////////////////////// -#define OC_TEST_CASE( name, desc )\ -+(NSString*) INTERNAL_CATCH_UNIQUE_NAME( Catch_Name_test ) \ -{\ -return @ name; \ -}\ -+(NSString*) INTERNAL_CATCH_UNIQUE_NAME( Catch_Description_test ) \ -{ \ -return @ desc; \ -} \ --(void) INTERNAL_CATCH_UNIQUE_NAME( Catch_TestCase_test ) - -#endif - -#ifdef CATCH_IMPL -// #included from: internal/catch_impl.hpp -#define TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED - -// Collect all the implementation files together here -// These are the equivalent of what would usually be cpp files - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wweak-vtables" -#endif - -// #included from: ../catch_runner.hpp -#define TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED - -// #included from: internal/catch_commandline.hpp -#define TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED - -// #included from: catch_config.hpp -#define TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED - -// #included from: catch_test_spec_parser.hpp -#define TWOBLUECUBES_CATCH_TEST_SPEC_PARSER_HPP_INCLUDED - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wpadded" -#endif - -// #included from: catch_test_spec.hpp -#define TWOBLUECUBES_CATCH_TEST_SPEC_HPP_INCLUDED - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wpadded" -#endif - -#include -#include - -namespace Catch { - - class TestSpec { - struct Pattern : SharedImpl<> { - virtual ~Pattern(); - virtual bool matches( TestCaseInfo const& testCase ) const = 0; - }; - class NamePattern : public Pattern { - enum WildcardPosition { - NoWildcard = 0, - WildcardAtStart = 1, - WildcardAtEnd = 2, - WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd - }; - - public: - NamePattern( std::string const& name ) : m_name( toLower( name ) ), m_wildcard( NoWildcard ) { - if( startsWith( m_name, "*" ) ) { - m_name = m_name.substr( 1 ); - m_wildcard = WildcardAtStart; - } - if( endsWith( m_name, "*" ) ) { - m_name = m_name.substr( 0, m_name.size()-1 ); - m_wildcard = static_cast( m_wildcard | WildcardAtEnd ); - } - } - virtual ~NamePattern(); - virtual bool matches( TestCaseInfo const& testCase ) const { - switch( m_wildcard ) { - case NoWildcard: - return m_name == toLower( testCase.name ); - case WildcardAtStart: - return endsWith( toLower( testCase.name ), m_name ); - case WildcardAtEnd: - return startsWith( toLower( testCase.name ), m_name ); - case WildcardAtBothEnds: - return contains( toLower( testCase.name ), m_name ); - } - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunreachable-code" -#endif - throw std::logic_error( "Unknown enum" ); -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - } - private: - std::string m_name; - WildcardPosition m_wildcard; - }; - class TagPattern : public Pattern { - public: - TagPattern( std::string const& tag ) : m_tag( toLower( tag ) ) {} - virtual ~TagPattern(); - virtual bool matches( TestCaseInfo const& testCase ) const { - return testCase.lcaseTags.find( m_tag ) != testCase.lcaseTags.end(); - } - private: - std::string m_tag; - }; - class ExcludedPattern : public Pattern { - public: - ExcludedPattern( Ptr const& underlyingPattern ) : m_underlyingPattern( underlyingPattern ) {} - virtual ~ExcludedPattern(); - virtual bool matches( TestCaseInfo const& testCase ) const { return !m_underlyingPattern->matches( testCase ); } - private: - Ptr m_underlyingPattern; - }; - - struct Filter { - std::vector > m_patterns; - - bool matches( TestCaseInfo const& testCase ) const { - // All patterns in a filter must match for the filter to be a match - for( std::vector >::const_iterator it = m_patterns.begin(), itEnd = m_patterns.end(); it != itEnd; ++it ) - if( !(*it)->matches( testCase ) ) - return false; - return true; - } - }; - - public: - bool hasFilters() const { - return !m_filters.empty(); - } - bool matches( TestCaseInfo const& testCase ) const { - // A TestSpec matches if any filter matches - for( std::vector::const_iterator it = m_filters.begin(), itEnd = m_filters.end(); it != itEnd; ++it ) - if( it->matches( testCase ) ) - return true; - return false; - } - - private: - std::vector m_filters; - - friend class TestSpecParser; - }; -} - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - -namespace Catch { - - class TestSpecParser { - enum Mode{ None, Name, QuotedName, Tag }; - Mode m_mode; - bool m_exclusion; - std::size_t m_start, m_pos; - std::string m_arg; - TestSpec::Filter m_currentFilter; - TestSpec m_testSpec; - ITagAliasRegistry const* m_tagAliases; - - public: - TestSpecParser( ITagAliasRegistry const& tagAliases ) : m_tagAliases( &tagAliases ) {} - - TestSpecParser& parse( std::string const& arg ) { - m_mode = None; - m_exclusion = false; - m_start = std::string::npos; - m_arg = m_tagAliases->expandAliases( arg ); - for( m_pos = 0; m_pos < m_arg.size(); ++m_pos ) - visitChar( m_arg[m_pos] ); - if( m_mode == Name ) - addPattern(); - return *this; - } - TestSpec testSpec() { - addFilter(); - return m_testSpec; - } - private: - void visitChar( char c ) { - if( m_mode == None ) { - switch( c ) { - case ' ': return; - case '~': m_exclusion = true; return; - case '[': return startNewMode( Tag, ++m_pos ); - case '"': return startNewMode( QuotedName, ++m_pos ); - default: startNewMode( Name, m_pos ); break; - } - } - if( m_mode == Name ) { - if( c == ',' ) { - addPattern(); - addFilter(); - } - else if( c == '[' ) { - if( subString() == "exclude:" ) - m_exclusion = true; - else - addPattern(); - startNewMode( Tag, ++m_pos ); - } - } - else if( m_mode == QuotedName && c == '"' ) - addPattern(); - else if( m_mode == Tag && c == ']' ) - addPattern(); - } - void startNewMode( Mode mode, std::size_t start ) { - m_mode = mode; - m_start = start; - } - std::string subString() const { return m_arg.substr( m_start, m_pos - m_start ); } - template - void addPattern() { - std::string token = subString(); - if( startsWith( token, "exclude:" ) ) { - m_exclusion = true; - token = token.substr( 8 ); - } - if( !token.empty() ) { - Ptr pattern = new T( token ); - if( m_exclusion ) - pattern = new TestSpec::ExcludedPattern( pattern ); - m_currentFilter.m_patterns.push_back( pattern ); - } - m_exclusion = false; - m_mode = None; - } - void addFilter() { - if( !m_currentFilter.m_patterns.empty() ) { - m_testSpec.m_filters.push_back( m_currentFilter ); - m_currentFilter = TestSpec::Filter(); - } - } - }; - inline TestSpec parseTestSpec( std::string const& arg ) { - return TestSpecParser( ITagAliasRegistry::get() ).parse( arg ).testSpec(); - } - -} // namespace Catch - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - -// #included from: catch_interfaces_config.h -#define TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED - -#include -#include -#include - -namespace Catch { - - struct Verbosity { enum Level { - NoOutput = 0, - Quiet, - Normal - }; }; - - struct WarnAbout { enum What { - Nothing = 0x00, - NoAssertions = 0x01 - }; }; - - struct ShowDurations { enum OrNot { - DefaultForReporter, - Always, - Never - }; }; - struct RunTests { enum InWhatOrder { - InDeclarationOrder, - InLexicographicalOrder, - InRandomOrder - }; }; - - class TestSpec; - - struct IConfig : IShared { - - virtual ~IConfig(); - - virtual bool allowThrows() const = 0; - virtual std::ostream& stream() const = 0; - virtual std::string name() const = 0; - virtual bool includeSuccessfulResults() const = 0; - virtual bool shouldDebugBreak() const = 0; - virtual bool warnAboutMissingAssertions() const = 0; - virtual int abortAfter() const = 0; - virtual bool showInvisibles() const = 0; - virtual ShowDurations::OrNot showDurations() const = 0; - virtual TestSpec const& testSpec() const = 0; - virtual RunTests::InWhatOrder runOrder() const = 0; - virtual unsigned int rngSeed() const = 0; - virtual bool forceColour() const = 0; - }; -} - -// #included from: catch_stream.h -#define TWOBLUECUBES_CATCH_STREAM_H_INCLUDED - -#include - -#ifdef __clang__ -#pragma clang diagnostic ignored "-Wpadded" -#endif - -namespace Catch { - - class Stream { - public: - Stream(); - Stream( std::streambuf* _streamBuf, bool _isOwned ); - void release(); - - std::streambuf* streamBuf; - - private: - bool isOwned; - }; - - std::ostream& cout(); - std::ostream& cerr(); -} - -#include -#include -#include -#include -#include - -#ifndef CATCH_CONFIG_CONSOLE_WIDTH -#define CATCH_CONFIG_CONSOLE_WIDTH 80 -#endif - -namespace Catch { - - struct ConfigData { - - ConfigData() - : listTests( false ), - listTags( false ), - listReporters( false ), - listTestNamesOnly( false ), - showSuccessfulTests( false ), - shouldDebugBreak( false ), - noThrow( false ), - showHelp( false ), - showInvisibles( false ), - forceColour( false ), - abortAfter( -1 ), - rngSeed( 0 ), - verbosity( Verbosity::Normal ), - warnings( WarnAbout::Nothing ), - showDurations( ShowDurations::DefaultForReporter ), - runOrder( RunTests::InDeclarationOrder ) - {} - - bool listTests; - bool listTags; - bool listReporters; - bool listTestNamesOnly; - - bool showSuccessfulTests; - bool shouldDebugBreak; - bool noThrow; - bool showHelp; - bool showInvisibles; - bool forceColour; - - int abortAfter; - unsigned int rngSeed; - - Verbosity::Level verbosity; - WarnAbout::What warnings; - ShowDurations::OrNot showDurations; - RunTests::InWhatOrder runOrder; - - std::string reporterName; - std::string outputFilename; - std::string name; - std::string processName; - - std::vector testsOrTags; - }; - - class Config : public SharedImpl { - private: - Config( Config const& other ); - Config& operator = ( Config const& other ); - virtual void dummy(); - public: - - Config() - : m_os( Catch::cout().rdbuf() ) - {} - - Config( ConfigData const& data ) - : m_data( data ), - m_os( Catch::cout().rdbuf() ) - { - if( !data.testsOrTags.empty() ) { - TestSpecParser parser( ITagAliasRegistry::get() ); - for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) - parser.parse( data.testsOrTags[i] ); - m_testSpec = parser.testSpec(); - } - } - - virtual ~Config() { - m_os.rdbuf( Catch::cout().rdbuf() ); - m_stream.release(); - } - - void setFilename( std::string const& filename ) { - m_data.outputFilename = filename; - } - - std::string const& getFilename() const { - return m_data.outputFilename ; - } - - bool listTests() const { return m_data.listTests; } - bool listTestNamesOnly() const { return m_data.listTestNamesOnly; } - bool listTags() const { return m_data.listTags; } - bool listReporters() const { return m_data.listReporters; } - - std::string getProcessName() const { return m_data.processName; } - - bool shouldDebugBreak() const { return m_data.shouldDebugBreak; } - - void setStreamBuf( std::streambuf* buf ) { - m_os.rdbuf( buf ? buf : Catch::cout().rdbuf() ); - } - - void useStream( std::string const& streamName ) { - Stream stream = createStream( streamName ); - setStreamBuf( stream.streamBuf ); - m_stream.release(); - m_stream = stream; - } - - std::string getReporterName() const { return m_data.reporterName; } - - int abortAfter() const { return m_data.abortAfter; } - - TestSpec const& testSpec() const { return m_testSpec; } - - bool showHelp() const { return m_data.showHelp; } - bool showInvisibles() const { return m_data.showInvisibles; } - - // IConfig interface - virtual bool allowThrows() const { return !m_data.noThrow; } - virtual std::ostream& stream() const { return m_os; } - virtual std::string name() const { return m_data.name.empty() ? m_data.processName : m_data.name; } - virtual bool includeSuccessfulResults() const { return m_data.showSuccessfulTests; } - virtual bool warnAboutMissingAssertions() const { return m_data.warnings & WarnAbout::NoAssertions; } - virtual ShowDurations::OrNot showDurations() const { return m_data.showDurations; } - virtual RunTests::InWhatOrder runOrder() const { return m_data.runOrder; } - virtual unsigned int rngSeed() const { return m_data.rngSeed; } - virtual bool forceColour() const { return m_data.forceColour; } - - private: - ConfigData m_data; - - Stream m_stream; - mutable std::ostream m_os; - TestSpec m_testSpec; - }; - -} // end namespace Catch - -// #included from: catch_clara.h -#define TWOBLUECUBES_CATCH_CLARA_H_INCLUDED - -// Use Catch's value for console width (store Clara's off to the side, if present) -#ifdef CLARA_CONFIG_CONSOLE_WIDTH -#define CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH CLARA_CONFIG_CONSOLE_WIDTH -#undef CLARA_CONFIG_CONSOLE_WIDTH -#endif -#define CLARA_CONFIG_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH - -// Declare Clara inside the Catch namespace -#define STITCH_CLARA_OPEN_NAMESPACE namespace Catch { -// #included from: ../external/clara.h - -// Only use header guard if we are not using an outer namespace -#if !defined(TWOBLUECUBES_CLARA_H_INCLUDED) || defined(STITCH_CLARA_OPEN_NAMESPACE) - -#ifndef STITCH_CLARA_OPEN_NAMESPACE -#define TWOBLUECUBES_CLARA_H_INCLUDED -#define STITCH_CLARA_OPEN_NAMESPACE -#define STITCH_CLARA_CLOSE_NAMESPACE -#else -#define STITCH_CLARA_CLOSE_NAMESPACE } -#endif - -#define STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE STITCH_CLARA_OPEN_NAMESPACE - -// ----------- #included from tbc_text_format.h ----------- - -// Only use header guard if we are not using an outer namespace -#if !defined(TBC_TEXT_FORMAT_H_INCLUDED) || defined(STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE) -#ifndef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE -#define TBC_TEXT_FORMAT_H_INCLUDED -#endif - -#include -#include -#include - -// Use optional outer namespace -#ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE -namespace STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE { -#endif - -namespace Tbc { - -#ifdef TBC_TEXT_FORMAT_CONSOLE_WIDTH - const unsigned int consoleWidth = TBC_TEXT_FORMAT_CONSOLE_WIDTH; -#else - const unsigned int consoleWidth = 80; -#endif - - struct TextAttributes { - TextAttributes() - : initialIndent( std::string::npos ), - indent( 0 ), - width( consoleWidth-1 ), - tabChar( '\t' ) - {} - - TextAttributes& setInitialIndent( std::size_t _value ) { initialIndent = _value; return *this; } - TextAttributes& setIndent( std::size_t _value ) { indent = _value; return *this; } - TextAttributes& setWidth( std::size_t _value ) { width = _value; return *this; } - TextAttributes& setTabChar( char _value ) { tabChar = _value; return *this; } - - std::size_t initialIndent; // indent of first line, or npos - std::size_t indent; // indent of subsequent lines, or all if initialIndent is npos - std::size_t width; // maximum width of text, including indent. Longer text will wrap - char tabChar; // If this char is seen the indent is changed to current pos - }; - - class Text { - public: - Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() ) - : attr( _attr ) - { - std::string wrappableChars = " [({.,/|\\-"; - std::size_t indent = _attr.initialIndent != std::string::npos - ? _attr.initialIndent - : _attr.indent; - std::string remainder = _str; - - while( !remainder.empty() ) { - if( lines.size() >= 1000 ) { - lines.push_back( "... message truncated due to excessive size" ); - return; - } - std::size_t tabPos = std::string::npos; - std::size_t width = (std::min)( remainder.size(), _attr.width - indent ); - std::size_t pos = remainder.find_first_of( '\n' ); - if( pos <= width ) { - width = pos; - } - pos = remainder.find_last_of( _attr.tabChar, width ); - if( pos != std::string::npos ) { - tabPos = pos; - if( remainder[width] == '\n' ) - width--; - remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 ); - } - - if( width == remainder.size() ) { - spliceLine( indent, remainder, width ); - } - else if( remainder[width] == '\n' ) { - spliceLine( indent, remainder, width ); - if( width <= 1 || remainder.size() != 1 ) - remainder = remainder.substr( 1 ); - indent = _attr.indent; - } - else { - pos = remainder.find_last_of( wrappableChars, width ); - if( pos != std::string::npos && pos > 0 ) { - spliceLine( indent, remainder, pos ); - if( remainder[0] == ' ' ) - remainder = remainder.substr( 1 ); - } - else { - spliceLine( indent, remainder, width-1 ); - lines.back() += "-"; - } - if( lines.size() == 1 ) - indent = _attr.indent; - if( tabPos != std::string::npos ) - indent += tabPos; - } - } - } - - void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) { - lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) ); - _remainder = _remainder.substr( _pos ); - } - - typedef std::vector::const_iterator const_iterator; - - const_iterator begin() const { return lines.begin(); } - const_iterator end() const { return lines.end(); } - std::string const& last() const { return lines.back(); } - std::size_t size() const { return lines.size(); } - std::string const& operator[]( std::size_t _index ) const { return lines[_index]; } - std::string toString() const { - std::ostringstream oss; - oss << *this; - return oss.str(); - } - - inline friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) { - for( Text::const_iterator it = _text.begin(), itEnd = _text.end(); - it != itEnd; ++it ) { - if( it != _text.begin() ) - _stream << "\n"; - _stream << *it; - } - return _stream; - } - - private: - std::string str; - TextAttributes attr; - std::vector lines; - }; - -} // end namespace Tbc - -#ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE -} // end outer namespace -#endif - -#endif // TBC_TEXT_FORMAT_H_INCLUDED - -// ----------- end of #include from tbc_text_format.h ----------- -// ........... back in /Users/philnash/Dev/OSS/Clara/srcs/clara.h - -#undef STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE - -#include -#include -#include -#include - -// Use optional outer namespace -#ifdef STITCH_CLARA_OPEN_NAMESPACE -STITCH_CLARA_OPEN_NAMESPACE -#endif - -namespace Clara { - - struct UnpositionalTag {}; - - extern UnpositionalTag _; - -#ifdef CLARA_CONFIG_MAIN - UnpositionalTag _; -#endif - - namespace Detail { - -#ifdef CLARA_CONSOLE_WIDTH - const unsigned int consoleWidth = CLARA_CONFIG_CONSOLE_WIDTH; -#else - const unsigned int consoleWidth = 80; -#endif - - using namespace Tbc; - - inline bool startsWith( std::string const& str, std::string const& prefix ) { - return str.size() >= prefix.size() && str.substr( 0, prefix.size() ) == prefix; - } - - template struct RemoveConstRef{ typedef T type; }; - template struct RemoveConstRef{ typedef T type; }; - template struct RemoveConstRef{ typedef T type; }; - template struct RemoveConstRef{ typedef T type; }; - - template struct IsBool { static const bool value = false; }; - template<> struct IsBool { static const bool value = true; }; - - template - void convertInto( std::string const& _source, T& _dest ) { - std::stringstream ss; - ss << _source; - ss >> _dest; - if( ss.fail() ) - throw std::runtime_error( "Unable to convert " + _source + " to destination type" ); - } - inline void convertInto( std::string const& _source, std::string& _dest ) { - _dest = _source; - } - inline void convertInto( std::string const& _source, bool& _dest ) { - std::string sourceLC = _source; - std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), ::tolower ); - if( sourceLC == "y" || sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" ) - _dest = true; - else if( sourceLC == "n" || sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" ) - _dest = false; - else - throw std::runtime_error( "Expected a boolean value but did not recognise:\n '" + _source + "'" ); - } - inline void convertInto( bool _source, bool& _dest ) { - _dest = _source; - } - template - inline void convertInto( bool, T& ) { - throw std::runtime_error( "Invalid conversion" ); - } - - template - struct IArgFunction { - virtual ~IArgFunction() {} -# ifdef CATCH_CPP11_OR_GREATER - IArgFunction() = default; - IArgFunction( IArgFunction const& ) = default; -# endif - virtual void set( ConfigT& config, std::string const& value ) const = 0; - virtual void setFlag( ConfigT& config ) const = 0; - virtual bool takesArg() const = 0; - virtual IArgFunction* clone() const = 0; - }; - - template - class BoundArgFunction { - public: - BoundArgFunction() : functionObj( NULL ) {} - BoundArgFunction( IArgFunction* _functionObj ) : functionObj( _functionObj ) {} - BoundArgFunction( BoundArgFunction const& other ) : functionObj( other.functionObj ? other.functionObj->clone() : NULL ) {} - BoundArgFunction& operator = ( BoundArgFunction const& other ) { - IArgFunction* newFunctionObj = other.functionObj ? other.functionObj->clone() : NULL; - delete functionObj; - functionObj = newFunctionObj; - return *this; - } - ~BoundArgFunction() { delete functionObj; } - - void set( ConfigT& config, std::string const& value ) const { - functionObj->set( config, value ); - } - void setFlag( ConfigT& config ) const { - functionObj->setFlag( config ); - } - bool takesArg() const { return functionObj->takesArg(); } - - bool isSet() const { - return functionObj != NULL; - } - private: - IArgFunction* functionObj; - }; - - template - struct NullBinder : IArgFunction{ - virtual void set( C&, std::string const& ) const {} - virtual void setFlag( C& ) const {} - virtual bool takesArg() const { return true; } - virtual IArgFunction* clone() const { return new NullBinder( *this ); } - }; - - template - struct BoundDataMember : IArgFunction{ - BoundDataMember( M C::* _member ) : member( _member ) {} - virtual void set( C& p, std::string const& stringValue ) const { - convertInto( stringValue, p.*member ); - } - virtual void setFlag( C& p ) const { - convertInto( true, p.*member ); - } - virtual bool takesArg() const { return !IsBool::value; } - virtual IArgFunction* clone() const { return new BoundDataMember( *this ); } - M C::* member; - }; - template - struct BoundUnaryMethod : IArgFunction{ - BoundUnaryMethod( void (C::*_member)( M ) ) : member( _member ) {} - virtual void set( C& p, std::string const& stringValue ) const { - typename RemoveConstRef::type value; - convertInto( stringValue, value ); - (p.*member)( value ); - } - virtual void setFlag( C& p ) const { - typename RemoveConstRef::type value; - convertInto( true, value ); - (p.*member)( value ); - } - virtual bool takesArg() const { return !IsBool::value; } - virtual IArgFunction* clone() const { return new BoundUnaryMethod( *this ); } - void (C::*member)( M ); - }; - template - struct BoundNullaryMethod : IArgFunction{ - BoundNullaryMethod( void (C::*_member)() ) : member( _member ) {} - virtual void set( C& p, std::string const& stringValue ) const { - bool value; - convertInto( stringValue, value ); - if( value ) - (p.*member)(); - } - virtual void setFlag( C& p ) const { - (p.*member)(); - } - virtual bool takesArg() const { return false; } - virtual IArgFunction* clone() const { return new BoundNullaryMethod( *this ); } - void (C::*member)(); - }; - - template - struct BoundUnaryFunction : IArgFunction{ - BoundUnaryFunction( void (*_function)( C& ) ) : function( _function ) {} - virtual void set( C& obj, std::string const& stringValue ) const { - bool value; - convertInto( stringValue, value ); - if( value ) - function( obj ); - } - virtual void setFlag( C& p ) const { - function( p ); - } - virtual bool takesArg() const { return false; } - virtual IArgFunction* clone() const { return new BoundUnaryFunction( *this ); } - void (*function)( C& ); - }; - - template - struct BoundBinaryFunction : IArgFunction{ - BoundBinaryFunction( void (*_function)( C&, T ) ) : function( _function ) {} - virtual void set( C& obj, std::string const& stringValue ) const { - typename RemoveConstRef::type value; - convertInto( stringValue, value ); - function( obj, value ); - } - virtual void setFlag( C& obj ) const { - typename RemoveConstRef::type value; - convertInto( true, value ); - function( obj, value ); - } - virtual bool takesArg() const { return !IsBool::value; } - virtual IArgFunction* clone() const { return new BoundBinaryFunction( *this ); } - void (*function)( C&, T ); - }; - - } // namespace Detail - - struct Parser { - Parser() : separators( " \t=:" ) {} - - struct Token { - enum Type { Positional, ShortOpt, LongOpt }; - Token( Type _type, std::string const& _data ) : type( _type ), data( _data ) {} - Type type; - std::string data; - }; - - void parseIntoTokens( int argc, char const * const * argv, std::vector& tokens ) const { - const std::string doubleDash = "--"; - for( int i = 1; i < argc && argv[i] != doubleDash; ++i ) - parseIntoTokens( argv[i] , tokens); - } - void parseIntoTokens( std::string arg, std::vector& tokens ) const { - while( !arg.empty() ) { - Parser::Token token( Parser::Token::Positional, arg ); - arg = ""; - if( token.data[0] == '-' ) { - if( token.data.size() > 1 && token.data[1] == '-' ) { - token = Parser::Token( Parser::Token::LongOpt, token.data.substr( 2 ) ); - } - else { - token = Parser::Token( Parser::Token::ShortOpt, token.data.substr( 1 ) ); - if( token.data.size() > 1 && separators.find( token.data[1] ) == std::string::npos ) { - arg = "-" + token.data.substr( 1 ); - token.data = token.data.substr( 0, 1 ); - } - } - } - if( token.type != Parser::Token::Positional ) { - std::size_t pos = token.data.find_first_of( separators ); - if( pos != std::string::npos ) { - arg = token.data.substr( pos+1 ); - token.data = token.data.substr( 0, pos ); - } - } - tokens.push_back( token ); - } - } - std::string separators; - }; - - template - struct CommonArgProperties { - CommonArgProperties() {} - CommonArgProperties( Detail::BoundArgFunction const& _boundField ) : boundField( _boundField ) {} - - Detail::BoundArgFunction boundField; - std::string description; - std::string detail; - std::string placeholder; // Only value if boundField takes an arg - - bool takesArg() const { - return !placeholder.empty(); - } - void validate() const { - if( !boundField.isSet() ) - throw std::logic_error( "option not bound" ); - } - }; - struct OptionArgProperties { - std::vector shortNames; - std::string longName; - - bool hasShortName( std::string const& shortName ) const { - return std::find( shortNames.begin(), shortNames.end(), shortName ) != shortNames.end(); - } - bool hasLongName( std::string const& _longName ) const { - return _longName == longName; - } - }; - struct PositionalArgProperties { - PositionalArgProperties() : position( -1 ) {} - int position; // -1 means non-positional (floating) - - bool isFixedPositional() const { - return position != -1; - } - }; - - template - class CommandLine { - - struct Arg : CommonArgProperties, OptionArgProperties, PositionalArgProperties { - Arg() {} - Arg( Detail::BoundArgFunction const& _boundField ) : CommonArgProperties( _boundField ) {} - - using CommonArgProperties::placeholder; // !TBD - - std::string dbgName() const { - if( !longName.empty() ) - return "--" + longName; - if( !shortNames.empty() ) - return "-" + shortNames[0]; - return "positional args"; - } - std::string commands() const { - std::ostringstream oss; - bool first = true; - std::vector::const_iterator it = shortNames.begin(), itEnd = shortNames.end(); - for(; it != itEnd; ++it ) { - if( first ) - first = false; - else - oss << ", "; - oss << "-" << *it; - } - if( !longName.empty() ) { - if( !first ) - oss << ", "; - oss << "--" << longName; - } - if( !placeholder.empty() ) - oss << " <" << placeholder << ">"; - return oss.str(); - } - }; - - // NOTE: std::auto_ptr is deprecated in c++11/c++0x -#if defined(__cplusplus) && __cplusplus > 199711L - typedef std::unique_ptr ArgAutoPtr; -#else - typedef std::auto_ptr ArgAutoPtr; -#endif - - friend void addOptName( Arg& arg, std::string const& optName ) - { - if( optName.empty() ) - return; - if( Detail::startsWith( optName, "--" ) ) { - if( !arg.longName.empty() ) - throw std::logic_error( "Only one long opt may be specified. '" - + arg.longName - + "' already specified, now attempting to add '" - + optName + "'" ); - arg.longName = optName.substr( 2 ); - } - else if( Detail::startsWith( optName, "-" ) ) - arg.shortNames.push_back( optName.substr( 1 ) ); - else - throw std::logic_error( "option must begin with - or --. Option was: '" + optName + "'" ); - } - friend void setPositionalArg( Arg& arg, int position ) - { - arg.position = position; - } - - class ArgBuilder { - public: - ArgBuilder( Arg* arg ) : m_arg( arg ) {} - - // Bind a non-boolean data member (requires placeholder string) - template - void bind( M C::* field, std::string const& placeholder ) { - m_arg->boundField = new Detail::BoundDataMember( field ); - m_arg->placeholder = placeholder; - } - // Bind a boolean data member (no placeholder required) - template - void bind( bool C::* field ) { - m_arg->boundField = new Detail::BoundDataMember( field ); - } - - // Bind a method taking a single, non-boolean argument (requires a placeholder string) - template - void bind( void (C::* unaryMethod)( M ), std::string const& placeholder ) { - m_arg->boundField = new Detail::BoundUnaryMethod( unaryMethod ); - m_arg->placeholder = placeholder; - } - - // Bind a method taking a single, boolean argument (no placeholder string required) - template - void bind( void (C::* unaryMethod)( bool ) ) { - m_arg->boundField = new Detail::BoundUnaryMethod( unaryMethod ); - } - - // Bind a method that takes no arguments (will be called if opt is present) - template - void bind( void (C::* nullaryMethod)() ) { - m_arg->boundField = new Detail::BoundNullaryMethod( nullaryMethod ); - } - - // Bind a free function taking a single argument - the object to operate on (no placeholder string required) - template - void bind( void (* unaryFunction)( C& ) ) { - m_arg->boundField = new Detail::BoundUnaryFunction( unaryFunction ); - } - - // Bind a free function taking a single argument - the object to operate on (requires a placeholder string) - template - void bind( void (* binaryFunction)( C&, T ), std::string const& placeholder ) { - m_arg->boundField = new Detail::BoundBinaryFunction( binaryFunction ); - m_arg->placeholder = placeholder; - } - - ArgBuilder& describe( std::string const& description ) { - m_arg->description = description; - return *this; - } - ArgBuilder& detail( std::string const& detail ) { - m_arg->detail = detail; - return *this; - } - - protected: - Arg* m_arg; - }; - - class OptBuilder : public ArgBuilder { - public: - OptBuilder( Arg* arg ) : ArgBuilder( arg ) {} - OptBuilder( OptBuilder& other ) : ArgBuilder( other ) {} - - OptBuilder& operator[]( std::string const& optName ) { - addOptName( *ArgBuilder::m_arg, optName ); - return *this; - } - }; - - public: - - CommandLine() - : m_boundProcessName( new Detail::NullBinder() ), - m_highestSpecifiedArgPosition( 0 ), - m_throwOnUnrecognisedTokens( false ) - {} - CommandLine( CommandLine const& other ) - : m_boundProcessName( other.m_boundProcessName ), - m_options ( other.m_options ), - m_positionalArgs( other.m_positionalArgs ), - m_highestSpecifiedArgPosition( other.m_highestSpecifiedArgPosition ), - m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens ) - { - if( other.m_floatingArg.get() ) - m_floatingArg.reset( new Arg( *other.m_floatingArg ) ); - } - - CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) { - m_throwOnUnrecognisedTokens = shouldThrow; - return *this; - } - - OptBuilder operator[]( std::string const& optName ) { - m_options.push_back( Arg() ); - addOptName( m_options.back(), optName ); - OptBuilder builder( &m_options.back() ); - return builder; - } - - ArgBuilder operator[]( int position ) { - m_positionalArgs.insert( std::make_pair( position, Arg() ) ); - if( position > m_highestSpecifiedArgPosition ) - m_highestSpecifiedArgPosition = position; - setPositionalArg( m_positionalArgs[position], position ); - ArgBuilder builder( &m_positionalArgs[position] ); - return builder; - } - - // Invoke this with the _ instance - ArgBuilder operator[]( UnpositionalTag ) { - if( m_floatingArg.get() ) - throw std::logic_error( "Only one unpositional argument can be added" ); - m_floatingArg.reset( new Arg() ); - ArgBuilder builder( m_floatingArg.get() ); - return builder; - } - - template - void bindProcessName( M C::* field ) { - m_boundProcessName = new Detail::BoundDataMember( field ); - } - template - void bindProcessName( void (C::*_unaryMethod)( M ) ) { - m_boundProcessName = new Detail::BoundUnaryMethod( _unaryMethod ); - } - - void optUsage( std::ostream& os, std::size_t indent = 0, std::size_t width = Detail::consoleWidth ) const { - typename std::vector::const_iterator itBegin = m_options.begin(), itEnd = m_options.end(), it; - std::size_t maxWidth = 0; - for( it = itBegin; it != itEnd; ++it ) - maxWidth = (std::max)( maxWidth, it->commands().size() ); - - for( it = itBegin; it != itEnd; ++it ) { - Detail::Text usage( it->commands(), Detail::TextAttributes() - .setWidth( maxWidth+indent ) - .setIndent( indent ) ); - Detail::Text desc( it->description, Detail::TextAttributes() - .setWidth( width - maxWidth - 3 ) ); - - for( std::size_t i = 0; i < (std::max)( usage.size(), desc.size() ); ++i ) { - std::string usageCol = i < usage.size() ? usage[i] : ""; - os << usageCol; - - if( i < desc.size() && !desc[i].empty() ) - os << std::string( indent + 2 + maxWidth - usageCol.size(), ' ' ) - << desc[i]; - os << "\n"; - } - } - } - std::string optUsage() const { - std::ostringstream oss; - optUsage( oss ); - return oss.str(); - } - - void argSynopsis( std::ostream& os ) const { - for( int i = 1; i <= m_highestSpecifiedArgPosition; ++i ) { - if( i > 1 ) - os << " "; - typename std::map::const_iterator it = m_positionalArgs.find( i ); - if( it != m_positionalArgs.end() ) - os << "<" << it->second.placeholder << ">"; - else if( m_floatingArg.get() ) - os << "<" << m_floatingArg->placeholder << ">"; - else - throw std::logic_error( "non consecutive positional arguments with no floating args" ); - } - // !TBD No indication of mandatory args - if( m_floatingArg.get() ) { - if( m_highestSpecifiedArgPosition > 1 ) - os << " "; - os << "[<" << m_floatingArg->placeholder << "> ...]"; - } - } - std::string argSynopsis() const { - std::ostringstream oss; - argSynopsis( oss ); - return oss.str(); - } - - void usage( std::ostream& os, std::string const& procName ) const { - validate(); - os << "usage:\n " << procName << " "; - argSynopsis( os ); - if( !m_options.empty() ) { - os << " [options]\n\nwhere options are: \n"; - optUsage( os, 2 ); - } - os << "\n"; - } - std::string usage( std::string const& procName ) const { - std::ostringstream oss; - usage( oss, procName ); - return oss.str(); - } - - ConfigT parse( int argc, char const * const * argv ) const { - ConfigT config; - parseInto( argc, argv, config ); - return config; - } - - std::vector parseInto( int argc, char const * const * argv, ConfigT& config ) const { - std::string processName = argv[0]; - std::size_t lastSlash = processName.find_last_of( "/\\" ); - if( lastSlash != std::string::npos ) - processName = processName.substr( lastSlash+1 ); - m_boundProcessName.set( config, processName ); - std::vector tokens; - Parser parser; - parser.parseIntoTokens( argc, argv, tokens ); - return populate( tokens, config ); - } - - std::vector populate( std::vector const& tokens, ConfigT& config ) const { - validate(); - std::vector unusedTokens = populateOptions( tokens, config ); - unusedTokens = populateFixedArgs( unusedTokens, config ); - unusedTokens = populateFloatingArgs( unusedTokens, config ); - return unusedTokens; - } - - std::vector populateOptions( std::vector const& tokens, ConfigT& config ) const { - std::vector unusedTokens; - std::vector errors; - for( std::size_t i = 0; i < tokens.size(); ++i ) { - Parser::Token const& token = tokens[i]; - typename std::vector::const_iterator it = m_options.begin(), itEnd = m_options.end(); - for(; it != itEnd; ++it ) { - Arg const& arg = *it; - - try { - if( ( token.type == Parser::Token::ShortOpt && arg.hasShortName( token.data ) ) || - ( token.type == Parser::Token::LongOpt && arg.hasLongName( token.data ) ) ) { - if( arg.takesArg() ) { - if( i == tokens.size()-1 || tokens[i+1].type != Parser::Token::Positional ) - errors.push_back( "Expected argument to option: " + token.data ); - else - arg.boundField.set( config, tokens[++i].data ); - } - else { - arg.boundField.setFlag( config ); - } - break; - } - } - catch( std::exception& ex ) { - errors.push_back( std::string( ex.what() ) + "\n- while parsing: (" + arg.commands() + ")" ); - } - } - if( it == itEnd ) { - if( token.type == Parser::Token::Positional || !m_throwOnUnrecognisedTokens ) - unusedTokens.push_back( token ); - else if( errors.empty() && m_throwOnUnrecognisedTokens ) - errors.push_back( "unrecognised option: " + token.data ); - } - } - if( !errors.empty() ) { - std::ostringstream oss; - for( std::vector::const_iterator it = errors.begin(), itEnd = errors.end(); - it != itEnd; - ++it ) { - if( it != errors.begin() ) - oss << "\n"; - oss << *it; - } - throw std::runtime_error( oss.str() ); - } - return unusedTokens; - } - std::vector populateFixedArgs( std::vector const& tokens, ConfigT& config ) const { - std::vector unusedTokens; - int position = 1; - for( std::size_t i = 0; i < tokens.size(); ++i ) { - Parser::Token const& token = tokens[i]; - typename std::map::const_iterator it = m_positionalArgs.find( position ); - if( it != m_positionalArgs.end() ) - it->second.boundField.set( config, token.data ); - else - unusedTokens.push_back( token ); - if( token.type == Parser::Token::Positional ) - position++; - } - return unusedTokens; - } - std::vector populateFloatingArgs( std::vector const& tokens, ConfigT& config ) const { - if( !m_floatingArg.get() ) - return tokens; - std::vector unusedTokens; - for( std::size_t i = 0; i < tokens.size(); ++i ) { - Parser::Token const& token = tokens[i]; - if( token.type == Parser::Token::Positional ) - m_floatingArg->boundField.set( config, token.data ); - else - unusedTokens.push_back( token ); - } - return unusedTokens; - } - - void validate() const - { - if( m_options.empty() && m_positionalArgs.empty() && !m_floatingArg.get() ) - throw std::logic_error( "No options or arguments specified" ); - - for( typename std::vector::const_iterator it = m_options.begin(), - itEnd = m_options.end(); - it != itEnd; ++it ) - it->validate(); - } - - private: - Detail::BoundArgFunction m_boundProcessName; - std::vector m_options; - std::map m_positionalArgs; - ArgAutoPtr m_floatingArg; - int m_highestSpecifiedArgPosition; - bool m_throwOnUnrecognisedTokens; - }; - -} // end namespace Clara - -STITCH_CLARA_CLOSE_NAMESPACE -#undef STITCH_CLARA_OPEN_NAMESPACE -#undef STITCH_CLARA_CLOSE_NAMESPACE - -#endif // TWOBLUECUBES_CLARA_H_INCLUDED -#undef STITCH_CLARA_OPEN_NAMESPACE - -// Restore Clara's value for console width, if present -#ifdef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH -#define CLARA_CONFIG_CONSOLE_WIDTH CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH -#undef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH -#endif - -#include - -namespace Catch { - - inline void abortAfterFirst( ConfigData& config ) { config.abortAfter = 1; } - inline void abortAfterX( ConfigData& config, int x ) { - if( x < 1 ) - throw std::runtime_error( "Value after -x or --abortAfter must be greater than zero" ); - config.abortAfter = x; - } - inline void addTestOrTags( ConfigData& config, std::string const& _testSpec ) { config.testsOrTags.push_back( _testSpec ); } - - inline void addWarning( ConfigData& config, std::string const& _warning ) { - if( _warning == "NoAssertions" ) - config.warnings = static_cast( config.warnings | WarnAbout::NoAssertions ); - else - throw std::runtime_error( "Unrecognised warning: '" + _warning + "'" ); - } - inline void setOrder( ConfigData& config, std::string const& order ) { - if( startsWith( "declared", order ) ) - config.runOrder = RunTests::InDeclarationOrder; - else if( startsWith( "lexical", order ) ) - config.runOrder = RunTests::InLexicographicalOrder; - else if( startsWith( "random", order ) ) - config.runOrder = RunTests::InRandomOrder; - else - throw std::runtime_error( "Unrecognised ordering: '" + order + "'" ); - } - inline void setRngSeed( ConfigData& config, std::string const& seed ) { - if( seed == "time" ) { - config.rngSeed = static_cast( std::time(0) ); - } - else { - std::stringstream ss; - ss << seed; - ss >> config.rngSeed; - if( ss.fail() ) - throw std::runtime_error( "Argment to --rng-seed should be the word 'time' or a number" ); - } - } - inline void setVerbosity( ConfigData& config, int level ) { - // !TBD: accept strings? - config.verbosity = static_cast( level ); - } - inline void setShowDurations( ConfigData& config, bool _showDurations ) { - config.showDurations = _showDurations - ? ShowDurations::Always - : ShowDurations::Never; - } - inline void loadTestNamesFromFile( ConfigData& config, std::string const& _filename ) { - std::ifstream f( _filename.c_str() ); - if( !f.is_open() ) - throw std::domain_error( "Unable to load input file: " + _filename ); - - std::string line; - while( std::getline( f, line ) ) { - line = trim(line); - if( !line.empty() && !startsWith( line, "#" ) ) - addTestOrTags( config, "\"" + line + "\"," ); - } - } - - inline Clara::CommandLine makeCommandLineParser() { - - using namespace Clara; - CommandLine cli; - - cli.bindProcessName( &ConfigData::processName ); - - cli["-?"]["-h"]["--help"] - .describe( "display usage information" ) - .bind( &ConfigData::showHelp ); - - cli["-l"]["--list-tests"] - .describe( "list all/matching test cases" ) - .bind( &ConfigData::listTests ); - - cli["-t"]["--list-tags"] - .describe( "list all/matching tags" ) - .bind( &ConfigData::listTags ); - - cli["-s"]["--success"] - .describe( "include successful tests in output" ) - .bind( &ConfigData::showSuccessfulTests ); - - cli["-b"]["--break"] - .describe( "break into debugger on failure" ) - .bind( &ConfigData::shouldDebugBreak ); - - cli["-e"]["--nothrow"] - .describe( "skip exception tests" ) - .bind( &ConfigData::noThrow ); - - cli["-i"]["--invisibles"] - .describe( "show invisibles (tabs, newlines)" ) - .bind( &ConfigData::showInvisibles ); - - cli["-o"]["--out"] - .describe( "output filename" ) - .bind( &ConfigData::outputFilename, "filename" ); - - cli["-r"]["--reporter"] -// .placeholder( "name[:filename]" ) - .describe( "reporter to use (defaults to console)" ) - .bind( &ConfigData::reporterName, "name" ); - - cli["-n"]["--name"] - .describe( "suite name" ) - .bind( &ConfigData::name, "name" ); - - cli["-a"]["--abort"] - .describe( "abort at first failure" ) - .bind( &abortAfterFirst ); - - cli["-x"]["--abortx"] - .describe( "abort after x failures" ) - .bind( &abortAfterX, "no. failures" ); - - cli["-w"]["--warn"] - .describe( "enable warnings" ) - .bind( &addWarning, "warning name" ); - -// - needs updating if reinstated -// cli.into( &setVerbosity ) -// .describe( "level of verbosity (0=no output)" ) -// .shortOpt( "v") -// .longOpt( "verbosity" ) -// .placeholder( "level" ); - - cli[_] - .describe( "which test or tests to use" ) - .bind( &addTestOrTags, "test name, pattern or tags" ); - - cli["-d"]["--durations"] - .describe( "show test durations" ) - .bind( &setShowDurations, "yes/no" ); - - cli["-f"]["--input-file"] - .describe( "load test names to run from a file" ) - .bind( &loadTestNamesFromFile, "filename" ); - - // Less common commands which don't have a short form - cli["--list-test-names-only"] - .describe( "list all/matching test cases names only" ) - .bind( &ConfigData::listTestNamesOnly ); - - cli["--list-reporters"] - .describe( "list all reporters" ) - .bind( &ConfigData::listReporters ); - - cli["--order"] - .describe( "test case order (defaults to decl)" ) - .bind( &setOrder, "decl|lex|rand" ); - - cli["--rng-seed"] - .describe( "set a specific seed for random numbers" ) - .bind( &setRngSeed, "'time'|number" ); - - cli["--force-colour"] - .describe( "force colourised output" ) - .bind( &ConfigData::forceColour ); - - return cli; - } - -} // end namespace Catch - -// #included from: internal/catch_list.hpp -#define TWOBLUECUBES_CATCH_LIST_HPP_INCLUDED - -// #included from: catch_text.h -#define TWOBLUECUBES_CATCH_TEXT_H_INCLUDED - -#define TBC_TEXT_FORMAT_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH - -#define CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE Catch -// #included from: ../external/tbc_text_format.h -// Only use header guard if we are not using an outer namespace -#ifndef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE -# ifdef TWOBLUECUBES_TEXT_FORMAT_H_INCLUDED -# ifndef TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED -# define TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED -# endif -# else -# define TWOBLUECUBES_TEXT_FORMAT_H_INCLUDED -# endif -#endif -#ifndef TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED -#include -#include -#include - -// Use optional outer namespace -#ifdef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE -namespace CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE { -#endif - -namespace Tbc { - -#ifdef TBC_TEXT_FORMAT_CONSOLE_WIDTH - const unsigned int consoleWidth = TBC_TEXT_FORMAT_CONSOLE_WIDTH; -#else - const unsigned int consoleWidth = 80; -#endif - - struct TextAttributes { - TextAttributes() - : initialIndent( std::string::npos ), - indent( 0 ), - width( consoleWidth-1 ), - tabChar( '\t' ) - {} - - TextAttributes& setInitialIndent( std::size_t _value ) { initialIndent = _value; return *this; } - TextAttributes& setIndent( std::size_t _value ) { indent = _value; return *this; } - TextAttributes& setWidth( std::size_t _value ) { width = _value; return *this; } - TextAttributes& setTabChar( char _value ) { tabChar = _value; return *this; } - - std::size_t initialIndent; // indent of first line, or npos - std::size_t indent; // indent of subsequent lines, or all if initialIndent is npos - std::size_t width; // maximum width of text, including indent. Longer text will wrap - char tabChar; // If this char is seen the indent is changed to current pos - }; - - class Text { - public: - Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() ) - : attr( _attr ) - { - std::string wrappableChars = " [({.,/|\\-"; - std::size_t indent = _attr.initialIndent != std::string::npos - ? _attr.initialIndent - : _attr.indent; - std::string remainder = _str; - - while( !remainder.empty() ) { - if( lines.size() >= 1000 ) { - lines.push_back( "... message truncated due to excessive size" ); - return; - } - std::size_t tabPos = std::string::npos; - std::size_t width = (std::min)( remainder.size(), _attr.width - indent ); - std::size_t pos = remainder.find_first_of( '\n' ); - if( pos <= width ) { - width = pos; - } - pos = remainder.find_last_of( _attr.tabChar, width ); - if( pos != std::string::npos ) { - tabPos = pos; - if( remainder[width] == '\n' ) - width--; - remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 ); - } - - if( width == remainder.size() ) { - spliceLine( indent, remainder, width ); - } - else if( remainder[width] == '\n' ) { - spliceLine( indent, remainder, width ); - if( width <= 1 || remainder.size() != 1 ) - remainder = remainder.substr( 1 ); - indent = _attr.indent; - } - else { - pos = remainder.find_last_of( wrappableChars, width ); - if( pos != std::string::npos && pos > 0 ) { - spliceLine( indent, remainder, pos ); - if( remainder[0] == ' ' ) - remainder = remainder.substr( 1 ); - } - else { - spliceLine( indent, remainder, width-1 ); - lines.back() += "-"; - } - if( lines.size() == 1 ) - indent = _attr.indent; - if( tabPos != std::string::npos ) - indent += tabPos; - } - } - } - - void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) { - lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) ); - _remainder = _remainder.substr( _pos ); - } - - typedef std::vector::const_iterator const_iterator; - - const_iterator begin() const { return lines.begin(); } - const_iterator end() const { return lines.end(); } - std::string const& last() const { return lines.back(); } - std::size_t size() const { return lines.size(); } - std::string const& operator[]( std::size_t _index ) const { return lines[_index]; } - std::string toString() const { - std::ostringstream oss; - oss << *this; - return oss.str(); - } - - inline friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) { - for( Text::const_iterator it = _text.begin(), itEnd = _text.end(); - it != itEnd; ++it ) { - if( it != _text.begin() ) - _stream << "\n"; - _stream << *it; - } - return _stream; - } - - private: - std::string str; - TextAttributes attr; - std::vector lines; - }; - -} // end namespace Tbc - -#ifdef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE -} // end outer namespace -#endif - -#endif // TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED -#undef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE - -namespace Catch { - using Tbc::Text; - using Tbc::TextAttributes; -} - -// #included from: catch_console_colour.hpp -#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED - -namespace Catch { - - struct Colour { - enum Code { - None = 0, - - White, - Red, - Green, - Blue, - Cyan, - Yellow, - Grey, - - Bright = 0x10, - - BrightRed = Bright | Red, - BrightGreen = Bright | Green, - LightGrey = Bright | Grey, - BrightWhite = Bright | White, - - // By intention - FileName = LightGrey, - Warning = Yellow, - ResultError = BrightRed, - ResultSuccess = BrightGreen, - ResultExpectedFailure = Warning, - - Error = BrightRed, - Success = Green, - - OriginalExpression = Cyan, - ReconstructedExpression = Yellow, - - SecondaryText = LightGrey, - Headers = White - }; - - // Use constructed object for RAII guard - Colour( Code _colourCode ); - Colour( Colour const& other ); - ~Colour(); - - // Use static method for one-shot changes - static void use( Code _colourCode ); - - private: - bool m_moved; - }; - - inline std::ostream& operator << ( std::ostream& os, Colour const& ) { return os; } - -} // end namespace Catch - -// #included from: catch_interfaces_reporter.h -#define TWOBLUECUBES_CATCH_INTERFACES_REPORTER_H_INCLUDED - -#include -#include -#include -#include - -namespace Catch -{ - struct ReporterConfig { - explicit ReporterConfig( Ptr const& _fullConfig ) - : m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {} - - ReporterConfig( Ptr const& _fullConfig, std::ostream& _stream ) - : m_stream( &_stream ), m_fullConfig( _fullConfig ) {} - - std::ostream& stream() const { return *m_stream; } - Ptr fullConfig() const { return m_fullConfig; } - - private: - std::ostream* m_stream; - Ptr m_fullConfig; - }; - - struct ReporterPreferences { - ReporterPreferences() - : shouldRedirectStdOut( false ) - {} - - bool shouldRedirectStdOut; - }; - - template - struct LazyStat : Option { - LazyStat() : used( false ) {} - LazyStat& operator=( T const& _value ) { - Option::operator=( _value ); - used = false; - return *this; - } - void reset() { - Option::reset(); - used = false; - } - bool used; - }; - - struct TestRunInfo { - TestRunInfo( std::string const& _name ) : name( _name ) {} - std::string name; - }; - struct GroupInfo { - GroupInfo( std::string const& _name, - std::size_t _groupIndex, - std::size_t _groupsCount ) - : name( _name ), - groupIndex( _groupIndex ), - groupsCounts( _groupsCount ) - {} - - std::string name; - std::size_t groupIndex; - std::size_t groupsCounts; - }; - - struct AssertionStats { - AssertionStats( AssertionResult const& _assertionResult, - std::vector const& _infoMessages, - Totals const& _totals ) - : assertionResult( _assertionResult ), - infoMessages( _infoMessages ), - totals( _totals ) - { - if( assertionResult.hasMessage() ) { - // Copy message into messages list. - // !TBD This should have been done earlier, somewhere - MessageBuilder builder( assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType() ); - builder << assertionResult.getMessage(); - builder.m_info.message = builder.m_stream.str(); - - infoMessages.push_back( builder.m_info ); - } - } - virtual ~AssertionStats(); - -# ifdef CATCH_CPP11_OR_GREATER - AssertionStats( AssertionStats const& ) = default; - AssertionStats( AssertionStats && ) = default; - AssertionStats& operator = ( AssertionStats const& ) = default; - AssertionStats& operator = ( AssertionStats && ) = default; -# endif - - AssertionResult assertionResult; - std::vector infoMessages; - Totals totals; - }; - - struct SectionStats { - SectionStats( SectionInfo const& _sectionInfo, - Counts const& _assertions, - double _durationInSeconds, - bool _missingAssertions ) - : sectionInfo( _sectionInfo ), - assertions( _assertions ), - durationInSeconds( _durationInSeconds ), - missingAssertions( _missingAssertions ) - {} - virtual ~SectionStats(); -# ifdef CATCH_CPP11_OR_GREATER - SectionStats( SectionStats const& ) = default; - SectionStats( SectionStats && ) = default; - SectionStats& operator = ( SectionStats const& ) = default; - SectionStats& operator = ( SectionStats && ) = default; -# endif - - SectionInfo sectionInfo; - Counts assertions; - double durationInSeconds; - bool missingAssertions; - }; - - struct TestCaseStats { - TestCaseStats( TestCaseInfo const& _testInfo, - Totals const& _totals, - std::string const& _stdOut, - std::string const& _stdErr, - bool _aborting ) - : testInfo( _testInfo ), - totals( _totals ), - stdOut( _stdOut ), - stdErr( _stdErr ), - aborting( _aborting ) - {} - virtual ~TestCaseStats(); - -# ifdef CATCH_CPP11_OR_GREATER - TestCaseStats( TestCaseStats const& ) = default; - TestCaseStats( TestCaseStats && ) = default; - TestCaseStats& operator = ( TestCaseStats const& ) = default; - TestCaseStats& operator = ( TestCaseStats && ) = default; -# endif - - TestCaseInfo testInfo; - Totals totals; - std::string stdOut; - std::string stdErr; - bool aborting; - }; - - struct TestGroupStats { - TestGroupStats( GroupInfo const& _groupInfo, - Totals const& _totals, - bool _aborting ) - : groupInfo( _groupInfo ), - totals( _totals ), - aborting( _aborting ) - {} - TestGroupStats( GroupInfo const& _groupInfo ) - : groupInfo( _groupInfo ), - aborting( false ) - {} - virtual ~TestGroupStats(); - -# ifdef CATCH_CPP11_OR_GREATER - TestGroupStats( TestGroupStats const& ) = default; - TestGroupStats( TestGroupStats && ) = default; - TestGroupStats& operator = ( TestGroupStats const& ) = default; - TestGroupStats& operator = ( TestGroupStats && ) = default; -# endif - - GroupInfo groupInfo; - Totals totals; - bool aborting; - }; - - struct TestRunStats { - TestRunStats( TestRunInfo const& _runInfo, - Totals const& _totals, - bool _aborting ) - : runInfo( _runInfo ), - totals( _totals ), - aborting( _aborting ) - {} - virtual ~TestRunStats(); - -# ifndef CATCH_CPP11_OR_GREATER - TestRunStats( TestRunStats const& _other ) - : runInfo( _other.runInfo ), - totals( _other.totals ), - aborting( _other.aborting ) - {} -# else - TestRunStats( TestRunStats const& ) = default; - TestRunStats( TestRunStats && ) = default; - TestRunStats& operator = ( TestRunStats const& ) = default; - TestRunStats& operator = ( TestRunStats && ) = default; -# endif - - TestRunInfo runInfo; - Totals totals; - bool aborting; - }; - - struct IStreamingReporter : IShared { - virtual ~IStreamingReporter(); - - // Implementing class must also provide the following static method: - // static std::string getDescription(); - - virtual ReporterPreferences getPreferences() const = 0; - - virtual void noMatchingTestCases( std::string const& spec ) = 0; - - virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0; - virtual void testGroupStarting( GroupInfo const& groupInfo ) = 0; - - virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0; - virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0; - - virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; - - // The return value indicates if the messages buffer should be cleared: - virtual bool assertionEnded( AssertionStats const& assertionStats ) = 0; - virtual void sectionEnded( SectionStats const& sectionStats ) = 0; - virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0; - virtual void testRunEnded( TestRunStats const& testRunStats ) = 0; - - virtual void skipTest( TestCaseInfo const& testInfo ) = 0; - }; - - struct IReporterFactory { - virtual ~IReporterFactory(); - virtual IStreamingReporter* create( ReporterConfig const& config ) const = 0; - virtual std::string getDescription() const = 0; - }; - - struct IReporterRegistry { - typedef std::map FactoryMap; - - virtual ~IReporterRegistry(); - virtual IStreamingReporter* create( std::string const& name, Ptr const& config ) const = 0; - virtual FactoryMap const& getFactories() const = 0; - }; - -} - -#include -#include - -namespace Catch { - - inline std::size_t listTests( Config const& config ) { - - TestSpec testSpec = config.testSpec(); - if( config.testSpec().hasFilters() ) - Catch::cout() << "Matching test cases:\n"; - else { - Catch::cout() << "All available test cases:\n"; - testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec(); - } - - std::size_t matchedTests = 0; - TextAttributes nameAttr, tagsAttr; - nameAttr.setInitialIndent( 2 ).setIndent( 4 ); - tagsAttr.setIndent( 6 ); - - std::vector matchedTestCases; - getRegistryHub().getTestCaseRegistry().getFilteredTests( testSpec, config, matchedTestCases ); - for( std::vector::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end(); - it != itEnd; - ++it ) { - matchedTests++; - TestCaseInfo const& testCaseInfo = it->getTestCaseInfo(); - Colour::Code colour = testCaseInfo.isHidden() - ? Colour::SecondaryText - : Colour::None; - Colour colourGuard( colour ); - - Catch::cout() << Text( testCaseInfo.name, nameAttr ) << std::endl; - if( !testCaseInfo.tags.empty() ) - Catch::cout() << Text( testCaseInfo.tagsAsString, tagsAttr ) << std::endl; - } - - if( !config.testSpec().hasFilters() ) - Catch::cout() << pluralise( matchedTests, "test case" ) << "\n" << std::endl; - else - Catch::cout() << pluralise( matchedTests, "matching test case" ) << "\n" << std::endl; - return matchedTests; - } - - inline std::size_t listTestsNamesOnly( Config const& config ) { - TestSpec testSpec = config.testSpec(); - if( !config.testSpec().hasFilters() ) - testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec(); - std::size_t matchedTests = 0; - std::vector matchedTestCases; - getRegistryHub().getTestCaseRegistry().getFilteredTests( testSpec, config, matchedTestCases ); - for( std::vector::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end(); - it != itEnd; - ++it ) { - matchedTests++; - TestCaseInfo const& testCaseInfo = it->getTestCaseInfo(); - Catch::cout() << testCaseInfo.name << std::endl; - } - return matchedTests; - } - - struct TagInfo { - TagInfo() : count ( 0 ) {} - void add( std::string const& spelling ) { - ++count; - spellings.insert( spelling ); - } - std::string all() const { - std::string out; - for( std::set::const_iterator it = spellings.begin(), itEnd = spellings.end(); - it != itEnd; - ++it ) - out += "[" + *it + "]"; - return out; - } - std::set spellings; - std::size_t count; - }; - - inline std::size_t listTags( Config const& config ) { - TestSpec testSpec = config.testSpec(); - if( config.testSpec().hasFilters() ) - Catch::cout() << "Tags for matching test cases:\n"; - else { - Catch::cout() << "All available tags:\n"; - testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec(); - } - - std::map tagCounts; - - std::vector matchedTestCases; - getRegistryHub().getTestCaseRegistry().getFilteredTests( testSpec, config, matchedTestCases ); - for( std::vector::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end(); - it != itEnd; - ++it ) { - for( std::set::const_iterator tagIt = it->getTestCaseInfo().tags.begin(), - tagItEnd = it->getTestCaseInfo().tags.end(); - tagIt != tagItEnd; - ++tagIt ) { - std::string tagName = *tagIt; - std::string lcaseTagName = toLower( tagName ); - std::map::iterator countIt = tagCounts.find( lcaseTagName ); - if( countIt == tagCounts.end() ) - countIt = tagCounts.insert( std::make_pair( lcaseTagName, TagInfo() ) ).first; - countIt->second.add( tagName ); - } - } - - for( std::map::const_iterator countIt = tagCounts.begin(), - countItEnd = tagCounts.end(); - countIt != countItEnd; - ++countIt ) { - std::ostringstream oss; - oss << " " << std::setw(2) << countIt->second.count << " "; - Text wrapper( countIt->second.all(), TextAttributes() - .setInitialIndent( 0 ) - .setIndent( oss.str().size() ) - .setWidth( CATCH_CONFIG_CONSOLE_WIDTH-10 ) ); - Catch::cout() << oss.str() << wrapper << "\n"; - } - Catch::cout() << pluralise( tagCounts.size(), "tag" ) << "\n" << std::endl; - return tagCounts.size(); - } - - inline std::size_t listReporters( Config const& /*config*/ ) { - Catch::cout() << "Available reporters:\n"; - IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); - IReporterRegistry::FactoryMap::const_iterator itBegin = factories.begin(), itEnd = factories.end(), it; - std::size_t maxNameLen = 0; - for(it = itBegin; it != itEnd; ++it ) - maxNameLen = (std::max)( maxNameLen, it->first.size() ); - - for(it = itBegin; it != itEnd; ++it ) { - Text wrapper( it->second->getDescription(), TextAttributes() - .setInitialIndent( 0 ) - .setIndent( 7+maxNameLen ) - .setWidth( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen-8 ) ); - Catch::cout() << " " - << it->first - << ":" - << std::string( maxNameLen - it->first.size() + 2, ' ' ) - << wrapper << "\n"; - } - Catch::cout() << std::endl; - return factories.size(); - } - - inline Option list( Config const& config ) { - Option listedCount; - if( config.listTests() ) - listedCount = listedCount.valueOr(0) + listTests( config ); - if( config.listTestNamesOnly() ) - listedCount = listedCount.valueOr(0) + listTestsNamesOnly( config ); - if( config.listTags() ) - listedCount = listedCount.valueOr(0) + listTags( config ); - if( config.listReporters() ) - listedCount = listedCount.valueOr(0) + listReporters( config ); - return listedCount; - } - -} // end namespace Catch - -// #included from: internal/catch_runner_impl.hpp -#define TWOBLUECUBES_CATCH_RUNNER_IMPL_HPP_INCLUDED - -// #included from: catch_test_case_tracker.hpp -#define TWOBLUECUBES_CATCH_TEST_CASE_TRACKER_HPP_INCLUDED - -#include -#include -#include - -namespace Catch { -namespace SectionTracking { - - class TrackedSection { - - typedef std::map TrackedSections; - - public: - enum RunState { - NotStarted, - Executing, - ExecutingChildren, - Completed - }; - - TrackedSection( std::string const& name, TrackedSection* parent ) - : m_name( name ), m_runState( NotStarted ), m_parent( parent ) - {} - - RunState runState() const { return m_runState; } - - TrackedSection* findChild( std::string const& childName ) { - TrackedSections::iterator it = m_children.find( childName ); - return it != m_children.end() - ? &it->second - : NULL; - } - TrackedSection* acquireChild( std::string const& childName ) { - if( TrackedSection* child = findChild( childName ) ) - return child; - m_children.insert( std::make_pair( childName, TrackedSection( childName, this ) ) ); - return findChild( childName ); - } - void enter() { - if( m_runState == NotStarted ) - m_runState = Executing; - } - void leave() { - for( TrackedSections::const_iterator it = m_children.begin(), itEnd = m_children.end(); - it != itEnd; - ++it ) - if( it->second.runState() != Completed ) { - m_runState = ExecutingChildren; - return; - } - m_runState = Completed; - } - TrackedSection* getParent() { - return m_parent; - } - bool hasChildren() const { - return !m_children.empty(); - } - - private: - std::string m_name; - RunState m_runState; - TrackedSections m_children; - TrackedSection* m_parent; - - }; - - class TestCaseTracker { - public: - TestCaseTracker( std::string const& testCaseName ) - : m_testCase( testCaseName, NULL ), - m_currentSection( &m_testCase ), - m_completedASectionThisRun( false ) - {} - - bool enterSection( std::string const& name ) { - TrackedSection* child = m_currentSection->acquireChild( name ); - if( m_completedASectionThisRun || child->runState() == TrackedSection::Completed ) - return false; - - m_currentSection = child; - m_currentSection->enter(); - return true; - } - void leaveSection() { - m_currentSection->leave(); - m_currentSection = m_currentSection->getParent(); - assert( m_currentSection != NULL ); - m_completedASectionThisRun = true; - } - - bool currentSectionHasChildren() const { - return m_currentSection->hasChildren(); - } - bool isCompleted() const { - return m_testCase.runState() == TrackedSection::Completed; - } - - class Guard { - public: - Guard( TestCaseTracker& tracker ) : m_tracker( tracker ) { - m_tracker.enterTestCase(); - } - ~Guard() { - m_tracker.leaveTestCase(); - } - private: - Guard( Guard const& ); - void operator = ( Guard const& ); - TestCaseTracker& m_tracker; - }; - - private: - void enterTestCase() { - m_currentSection = &m_testCase; - m_completedASectionThisRun = false; - m_testCase.enter(); - } - void leaveTestCase() { - m_testCase.leave(); - } - - TrackedSection m_testCase; - TrackedSection* m_currentSection; - bool m_completedASectionThisRun; - }; - -} // namespace SectionTracking - -using SectionTracking::TestCaseTracker; - -} // namespace Catch - -// #included from: catch_fatal_condition.hpp -#define TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED - -namespace Catch { - - // Report the error condition then exit the process - inline void fatal( std::string const& message, int exitCode ) { - IContext& context = Catch::getCurrentContext(); - IResultCapture* resultCapture = context.getResultCapture(); - resultCapture->handleFatalErrorCondition( message ); - - if( Catch::alwaysTrue() ) // avoids "no return" warnings - exit( exitCode ); - } - -} // namespace Catch - -#if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// - -namespace Catch { - - struct FatalConditionHandler { - void reset() {} - }; - -} // namespace Catch - -#else // Not Windows - assumed to be POSIX compatible ////////////////////////// - -#include - -namespace Catch { - - struct SignalDefs { int id; const char* name; }; - extern SignalDefs signalDefs[]; - SignalDefs signalDefs[] = { - { SIGINT, "SIGINT - Terminal interrupt signal" }, - { SIGILL, "SIGILL - Illegal instruction signal" }, - { SIGFPE, "SIGFPE - Floating point error signal" }, - { SIGSEGV, "SIGSEGV - Segmentation violation signal" }, - { SIGTERM, "SIGTERM - Termination request signal" }, - { SIGABRT, "SIGABRT - Abort (abnormal termination) signal" } - }; - - struct FatalConditionHandler { - - static void handleSignal( int sig ) { - for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) - if( sig == signalDefs[i].id ) - fatal( signalDefs[i].name, -sig ); - fatal( "", -sig ); - } - - FatalConditionHandler() : m_isSet( true ) { - for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) - signal( signalDefs[i].id, handleSignal ); - } - ~FatalConditionHandler() { - reset(); - } - void reset() { - if( m_isSet ) { - for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) - signal( signalDefs[i].id, SIG_DFL ); - m_isSet = false; - } - } - - bool m_isSet; - }; - -} // namespace Catch - -#endif // not Windows - -#include -#include - -namespace Catch { - - class StreamRedirect { - - public: - StreamRedirect( std::ostream& stream, std::string& targetString ) - : m_stream( stream ), - m_prevBuf( stream.rdbuf() ), - m_targetString( targetString ) - { - stream.rdbuf( m_oss.rdbuf() ); - } - - ~StreamRedirect() { - m_targetString += m_oss.str(); - m_stream.rdbuf( m_prevBuf ); - } - - private: - std::ostream& m_stream; - std::streambuf* m_prevBuf; - std::ostringstream m_oss; - std::string& m_targetString; - }; - - /////////////////////////////////////////////////////////////////////////// - - class RunContext : public IResultCapture, public IRunner { - - RunContext( RunContext const& ); - void operator =( RunContext const& ); - - public: - - explicit RunContext( Ptr const& config, Ptr const& reporter ) - : m_runInfo( config->name() ), - m_context( getCurrentMutableContext() ), - m_activeTestCase( NULL ), - m_config( config ), - m_reporter( reporter ), - m_prevRunner( m_context.getRunner() ), - m_prevResultCapture( m_context.getResultCapture() ), - m_prevConfig( m_context.getConfig() ) - { - m_context.setRunner( this ); - m_context.setConfig( m_config ); - m_context.setResultCapture( this ); - m_reporter->testRunStarting( m_runInfo ); - } - - virtual ~RunContext() { - m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, aborting() ) ); - m_context.setRunner( m_prevRunner ); - m_context.setConfig( NULL ); - m_context.setResultCapture( m_prevResultCapture ); - m_context.setConfig( m_prevConfig ); - } - - void testGroupStarting( std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount ) { - m_reporter->testGroupStarting( GroupInfo( testSpec, groupIndex, groupsCount ) ); - } - void testGroupEnded( std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount ) { - m_reporter->testGroupEnded( TestGroupStats( GroupInfo( testSpec, groupIndex, groupsCount ), totals, aborting() ) ); - } - - Totals runTest( TestCase const& testCase ) { - Totals prevTotals = m_totals; - - std::string redirectedCout; - std::string redirectedCerr; - - TestCaseInfo testInfo = testCase.getTestCaseInfo(); - - m_reporter->testCaseStarting( testInfo ); - - m_activeTestCase = &testCase; - m_testCaseTracker = TestCaseTracker( testInfo.name ); - - do { - do { - runCurrentTest( redirectedCout, redirectedCerr ); - } - while( !m_testCaseTracker->isCompleted() && !aborting() ); - } - while( getCurrentContext().advanceGeneratorsForCurrentTest() && !aborting() ); - - Totals deltaTotals = m_totals.delta( prevTotals ); - m_totals.testCases += deltaTotals.testCases; - m_reporter->testCaseEnded( TestCaseStats( testInfo, - deltaTotals, - redirectedCout, - redirectedCerr, - aborting() ) ); - - m_activeTestCase = NULL; - m_testCaseTracker.reset(); - - return deltaTotals; - } - - Ptr config() const { - return m_config; - } - - private: // IResultCapture - - virtual void assertionEnded( AssertionResult const& result ) { - if( result.getResultType() == ResultWas::Ok ) { - m_totals.assertions.passed++; - } - else if( !result.isOk() ) { - m_totals.assertions.failed++; - } - - if( m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ) ) - m_messages.clear(); - - // Reset working state - m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after the reported line}" , m_lastAssertionInfo.resultDisposition ); - m_lastResult = result; - } - - virtual bool sectionStarted ( - SectionInfo const& sectionInfo, - Counts& assertions - ) - { - std::ostringstream oss; - oss << sectionInfo.name << "@" << sectionInfo.lineInfo; - - if( !m_testCaseTracker->enterSection( oss.str() ) ) - return false; - - m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo; - - m_reporter->sectionStarting( sectionInfo ); - - assertions = m_totals.assertions; - - return true; - } - bool testForMissingAssertions( Counts& assertions ) { - if( assertions.total() != 0 || - !m_config->warnAboutMissingAssertions() || - m_testCaseTracker->currentSectionHasChildren() ) - return false; - m_totals.assertions.failed++; - assertions.failed++; - return true; - } - - virtual void sectionEnded( SectionInfo const& info, Counts const& prevAssertions, double _durationInSeconds ) { - if( std::uncaught_exception() ) { - m_unfinishedSections.push_back( UnfinishedSections( info, prevAssertions, _durationInSeconds ) ); - return; - } - - Counts assertions = m_totals.assertions - prevAssertions; - bool missingAssertions = testForMissingAssertions( assertions ); - - m_testCaseTracker->leaveSection(); - - m_reporter->sectionEnded( SectionStats( info, assertions, _durationInSeconds, missingAssertions ) ); - m_messages.clear(); - } - - virtual void pushScopedMessage( MessageInfo const& message ) { - m_messages.push_back( message ); - } - - virtual void popScopedMessage( MessageInfo const& message ) { - m_messages.erase( std::remove( m_messages.begin(), m_messages.end(), message ), m_messages.end() ); - } - - virtual std::string getCurrentTestName() const { - return m_activeTestCase - ? m_activeTestCase->getTestCaseInfo().name - : ""; - } - - virtual const AssertionResult* getLastResult() const { - return &m_lastResult; - } - - virtual void handleFatalErrorCondition( std::string const& message ) { - ResultBuilder resultBuilder = makeUnexpectedResultBuilder(); - resultBuilder.setResultType( ResultWas::FatalErrorCondition ); - resultBuilder << message; - resultBuilder.captureExpression(); - - handleUnfinishedSections(); - - // Recreate section for test case (as we will lose the one that was in scope) - TestCaseInfo const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); - SectionInfo testCaseSection( testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description ); - - Counts assertions; - assertions.failed = 1; - SectionStats testCaseSectionStats( testCaseSection, assertions, 0, false ); - m_reporter->sectionEnded( testCaseSectionStats ); - - TestCaseInfo testInfo = m_activeTestCase->getTestCaseInfo(); - - Totals deltaTotals; - deltaTotals.testCases.failed = 1; - m_reporter->testCaseEnded( TestCaseStats( testInfo, - deltaTotals, - "", - "", - false ) ); - m_totals.testCases.failed++; - testGroupEnded( "", m_totals, 1, 1 ); - m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, false ) ); - } - - public: - // !TBD We need to do this another way! - bool aborting() const { - return m_totals.assertions.failed == static_cast( m_config->abortAfter() ); - } - - private: - - void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) { - TestCaseInfo const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); - SectionInfo testCaseSection( testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description ); - m_reporter->sectionStarting( testCaseSection ); - Counts prevAssertions = m_totals.assertions; - double duration = 0; - try { - m_lastAssertionInfo = AssertionInfo( "TEST_CASE", testCaseInfo.lineInfo, "", ResultDisposition::Normal ); - TestCaseTracker::Guard guard( *m_testCaseTracker ); - - Timer timer; - timer.start(); - if( m_reporter->getPreferences().shouldRedirectStdOut ) { - StreamRedirect coutRedir( Catch::cout(), redirectedCout ); - StreamRedirect cerrRedir( Catch::cerr(), redirectedCerr ); - invokeActiveTestCase(); - } - else { - invokeActiveTestCase(); - } - duration = timer.getElapsedSeconds(); - } - catch( TestFailureException& ) { - // This just means the test was aborted due to failure - } - catch(...) { - makeUnexpectedResultBuilder().useActiveException(); - } - handleUnfinishedSections(); - m_messages.clear(); - - Counts assertions = m_totals.assertions - prevAssertions; - bool missingAssertions = testForMissingAssertions( assertions ); - - if( testCaseInfo.okToFail() ) { - std::swap( assertions.failedButOk, assertions.failed ); - m_totals.assertions.failed -= assertions.failedButOk; - m_totals.assertions.failedButOk += assertions.failedButOk; - } - - SectionStats testCaseSectionStats( testCaseSection, assertions, duration, missingAssertions ); - m_reporter->sectionEnded( testCaseSectionStats ); - } - - void invokeActiveTestCase() { - FatalConditionHandler fatalConditionHandler; // Handle signals - m_activeTestCase->invoke(); - fatalConditionHandler.reset(); - } - - private: - - ResultBuilder makeUnexpectedResultBuilder() const { - return ResultBuilder( m_lastAssertionInfo.macroName.c_str(), - m_lastAssertionInfo.lineInfo, - m_lastAssertionInfo.capturedExpression.c_str(), - m_lastAssertionInfo.resultDisposition ); - } - - void handleUnfinishedSections() { - // If sections ended prematurely due to an exception we stored their - // infos here so we can tear them down outside the unwind process. - for( std::vector::const_reverse_iterator it = m_unfinishedSections.rbegin(), - itEnd = m_unfinishedSections.rend(); - it != itEnd; - ++it ) - sectionEnded( it->info, it->prevAssertions, it->durationInSeconds ); - m_unfinishedSections.clear(); - } - - struct UnfinishedSections { - UnfinishedSections( SectionInfo const& _info, Counts const& _prevAssertions, double _durationInSeconds ) - : info( _info ), prevAssertions( _prevAssertions ), durationInSeconds( _durationInSeconds ) - {} - - SectionInfo info; - Counts prevAssertions; - double durationInSeconds; - }; - - TestRunInfo m_runInfo; - IMutableContext& m_context; - TestCase const* m_activeTestCase; - Option m_testCaseTracker; - AssertionResult m_lastResult; - - Ptr m_config; - Totals m_totals; - Ptr m_reporter; - std::vector m_messages; - IRunner* m_prevRunner; - IResultCapture* m_prevResultCapture; - Ptr m_prevConfig; - AssertionInfo m_lastAssertionInfo; - std::vector m_unfinishedSections; - }; - - IResultCapture& getResultCapture() { - if( IResultCapture* capture = getCurrentContext().getResultCapture() ) - return *capture; - else - throw std::logic_error( "No result capture instance" ); - } - -} // end namespace Catch - -// #included from: internal/catch_version.h -#define TWOBLUECUBES_CATCH_VERSION_H_INCLUDED - -namespace Catch { - - // Versioning information - struct Version { - Version( unsigned int _majorVersion, - unsigned int _minorVersion, - unsigned int _buildNumber, - char const* const _branchName ) - : majorVersion( _majorVersion ), - minorVersion( _minorVersion ), - buildNumber( _buildNumber ), - branchName( _branchName ) - {} - - unsigned int const majorVersion; - unsigned int const minorVersion; - unsigned int const buildNumber; - char const* const branchName; - - private: - void operator=( Version const& ); - }; - - extern Version libraryVersion; -} - -#include -#include -#include - -namespace Catch { - - class Runner { - - public: - Runner( Ptr const& config ) - : m_config( config ) - { - openStream(); - makeReporter(); - } - - Totals runTests() { - - RunContext context( m_config.get(), m_reporter ); - - Totals totals; - - context.testGroupStarting( "all tests", 1, 1 ); // deprecated? - - TestSpec testSpec = m_config->testSpec(); - if( !testSpec.hasFilters() ) - testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "~[.]" ).testSpec(); // All not hidden tests - - std::vector testCases; - getRegistryHub().getTestCaseRegistry().getFilteredTests( testSpec, *m_config, testCases ); - - int testsRunForGroup = 0; - for( std::vector::const_iterator it = testCases.begin(), itEnd = testCases.end(); - it != itEnd; - ++it ) { - testsRunForGroup++; - if( m_testsAlreadyRun.find( *it ) == m_testsAlreadyRun.end() ) { - - if( context.aborting() ) - break; - - totals += context.runTest( *it ); - m_testsAlreadyRun.insert( *it ); - } - } - std::vector skippedTestCases; - getRegistryHub().getTestCaseRegistry().getFilteredTests( testSpec, *m_config, skippedTestCases, true ); - - for( std::vector::const_iterator it = skippedTestCases.begin(), itEnd = skippedTestCases.end(); - it != itEnd; - ++it ) - m_reporter->skipTest( *it ); - - context.testGroupEnded( "all tests", totals, 1, 1 ); - return totals; - } - - private: - void openStream() { - // Open output file, if specified - if( !m_config->getFilename().empty() ) { - m_ofs.open( m_config->getFilename().c_str() ); - if( m_ofs.fail() ) { - std::ostringstream oss; - oss << "Unable to open file: '" << m_config->getFilename() << "'"; - throw std::domain_error( oss.str() ); - } - m_config->setStreamBuf( m_ofs.rdbuf() ); - } - } - void makeReporter() { - std::string reporterName = m_config->getReporterName().empty() - ? "console" - : m_config->getReporterName(); - - m_reporter = getRegistryHub().getReporterRegistry().create( reporterName, m_config.get() ); - if( !m_reporter ) { - std::ostringstream oss; - oss << "No reporter registered with name: '" << reporterName << "'"; - throw std::domain_error( oss.str() ); - } - } - - private: - Ptr m_config; - std::ofstream m_ofs; - Ptr m_reporter; - std::set m_testsAlreadyRun; - }; - - class Session : NonCopyable { - static bool alreadyInstantiated; - - public: - - struct OnUnusedOptions { enum DoWhat { Ignore, Fail }; }; - - Session() - : m_cli( makeCommandLineParser() ) { - if( alreadyInstantiated ) { - std::string msg = "Only one instance of Catch::Session can ever be used"; - Catch::cerr() << msg << std::endl; - throw std::logic_error( msg ); - } - alreadyInstantiated = true; - } - ~Session() { - Catch::cleanUp(); - } - - void showHelp( std::string const& processName ) { - Catch::cout() << "\nCatch v" << libraryVersion.majorVersion << "." - << libraryVersion.minorVersion << " build " - << libraryVersion.buildNumber; - if( libraryVersion.branchName != std::string( "master" ) ) - Catch::cout() << " (" << libraryVersion.branchName << " branch)"; - Catch::cout() << "\n"; - - m_cli.usage( Catch::cout(), processName ); - Catch::cout() << "For more detail usage please see the project docs\n" << std::endl; - } - - int applyCommandLine( int argc, char* const argv[], OnUnusedOptions::DoWhat unusedOptionBehaviour = OnUnusedOptions::Fail ) { - try { - m_cli.setThrowOnUnrecognisedTokens( unusedOptionBehaviour == OnUnusedOptions::Fail ); - m_unusedTokens = m_cli.parseInto( argc, argv, m_configData ); - if( m_configData.showHelp ) - showHelp( m_configData.processName ); - m_config.reset(); - } - catch( std::exception& ex ) { - { - Colour colourGuard( Colour::Red ); - Catch::cerr() << "\nError(s) in input:\n" - << Text( ex.what(), TextAttributes().setIndent(2) ) - << "\n\n"; - } - m_cli.usage( Catch::cout(), m_configData.processName ); - return (std::numeric_limits::max)(); - } - return 0; - } - - void useConfigData( ConfigData const& _configData ) { - m_configData = _configData; - m_config.reset(); - } - - int run( int argc, char* const argv[] ) { - - int returnCode = applyCommandLine( argc, argv ); - if( returnCode == 0 ) - returnCode = run(); - return returnCode; - } - - int run() { - if( m_configData.showHelp ) - return 0; - - try - { - config(); // Force config to be constructed - - std::srand( m_configData.rngSeed ); - - Runner runner( m_config ); - - // Handle list request - if( Option listed = list( config() ) ) - return static_cast( *listed ); - - return static_cast( runner.runTests().assertions.failed ); - } - catch( std::exception& ex ) { - Catch::cerr() << ex.what() << std::endl; - return (std::numeric_limits::max)(); - } - } - - Clara::CommandLine const& cli() const { - return m_cli; - } - std::vector const& unusedTokens() const { - return m_unusedTokens; - } - ConfigData& configData() { - return m_configData; - } - Config& config() { - if( !m_config ) - m_config = new Config( m_configData ); - return *m_config; - } - - private: - Clara::CommandLine m_cli; - std::vector m_unusedTokens; - ConfigData m_configData; - Ptr m_config; - }; - - bool Session::alreadyInstantiated = false; - -} // end namespace Catch - -// #included from: catch_registry_hub.hpp -#define TWOBLUECUBES_CATCH_REGISTRY_HUB_HPP_INCLUDED - -// #included from: catch_test_case_registry_impl.hpp -#define TWOBLUECUBES_CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED - -#include -#include -#include -#include -#include - -namespace Catch { - - class TestRegistry : public ITestCaseRegistry { - struct LexSort { - bool operator() (TestCase i,TestCase j) const { return (i const& getAllTests() const { - return m_functionsInOrder; - } - - virtual std::vector const& getAllNonHiddenTests() const { - return m_nonHiddenFunctions; - } - - virtual void getFilteredTests( TestSpec const& testSpec, IConfig const& config, std::vector& matchingTestCases, bool negated = false ) const { - - for( std::vector::const_iterator it = m_functionsInOrder.begin(), - itEnd = m_functionsInOrder.end(); - it != itEnd; - ++it ) { - bool includeTest = testSpec.matches( *it ) && ( config.allowThrows() || !it->throws() ); - if( includeTest != negated ) - matchingTestCases.push_back( *it ); - } - sortTests( config, matchingTestCases ); - } - - private: - - static void sortTests( IConfig const& config, std::vector& matchingTestCases ) { - - switch( config.runOrder() ) { - case RunTests::InLexicographicalOrder: - std::sort( matchingTestCases.begin(), matchingTestCases.end(), LexSort() ); - break; - case RunTests::InRandomOrder: - { - RandomNumberGenerator rng; - std::random_shuffle( matchingTestCases.begin(), matchingTestCases.end(), rng ); - } - break; - case RunTests::InDeclarationOrder: - // already in declaration order - break; - } - } - std::set m_functions; - std::vector m_functionsInOrder; - std::vector m_nonHiddenFunctions; - size_t m_unnamedCount; - }; - - /////////////////////////////////////////////////////////////////////////// - - class FreeFunctionTestCase : public SharedImpl { - public: - - FreeFunctionTestCase( TestFunction fun ) : m_fun( fun ) {} - - virtual void invoke() const { - m_fun(); - } - - private: - virtual ~FreeFunctionTestCase(); - - TestFunction m_fun; - }; - - inline std::string extractClassName( std::string const& classOrQualifiedMethodName ) { - std::string className = classOrQualifiedMethodName; - if( startsWith( className, "&" ) ) - { - std::size_t lastColons = className.rfind( "::" ); - std::size_t penultimateColons = className.rfind( "::", lastColons-1 ); - if( penultimateColons == std::string::npos ) - penultimateColons = 1; - className = className.substr( penultimateColons, lastColons-penultimateColons ); - } - return className; - } - - /////////////////////////////////////////////////////////////////////////// - - AutoReg::AutoReg( TestFunction function, - SourceLineInfo const& lineInfo, - NameAndDesc const& nameAndDesc ) { - registerTestCase( new FreeFunctionTestCase( function ), "", nameAndDesc, lineInfo ); - } - - AutoReg::~AutoReg() {} - - void AutoReg::registerTestCase( ITestCase* testCase, - char const* classOrQualifiedMethodName, - NameAndDesc const& nameAndDesc, - SourceLineInfo const& lineInfo ) { - - getMutableRegistryHub().registerTest - ( makeTestCase( testCase, - extractClassName( classOrQualifiedMethodName ), - nameAndDesc.name, - nameAndDesc.description, - lineInfo ) ); - } - -} // end namespace Catch - -// #included from: catch_reporter_registry.hpp -#define TWOBLUECUBES_CATCH_REPORTER_REGISTRY_HPP_INCLUDED - -#include - -namespace Catch { - - class ReporterRegistry : public IReporterRegistry { - - public: - - virtual ~ReporterRegistry() { - deleteAllValues( m_factories ); - } - - virtual IStreamingReporter* create( std::string const& name, Ptr const& config ) const { - FactoryMap::const_iterator it = m_factories.find( name ); - if( it == m_factories.end() ) - return NULL; - return it->second->create( ReporterConfig( config ) ); - } - - void registerReporter( std::string const& name, IReporterFactory* factory ) { - m_factories.insert( std::make_pair( name, factory ) ); - } - - FactoryMap const& getFactories() const { - return m_factories; - } - - private: - FactoryMap m_factories; - }; -} - -// #included from: catch_exception_translator_registry.hpp -#define TWOBLUECUBES_CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED - -#ifdef __OBJC__ -#import "Foundation/Foundation.h" -#endif - -namespace Catch { - - class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry { - public: - ~ExceptionTranslatorRegistry() { - deleteAll( m_translators ); - } - - virtual void registerTranslator( const IExceptionTranslator* translator ) { - m_translators.push_back( translator ); - } - - virtual std::string translateActiveException() const { - try { -#ifdef __OBJC__ - // In Objective-C try objective-c exceptions first - @try { - throw; - } - @catch (NSException *exception) { - return Catch::toString( [exception description] ); - } -#else - throw; -#endif - } - catch( TestFailureException& ) { - throw; - } - catch( std::exception& ex ) { - return ex.what(); - } - catch( std::string& msg ) { - return msg; - } - catch( const char* msg ) { - return msg; - } - catch(...) { - return tryTranslators( m_translators.begin() ); - } - } - - std::string tryTranslators( std::vector::const_iterator it ) const { - if( it == m_translators.end() ) - return "Unknown exception"; - - try { - return (*it)->translate(); - } - catch(...) { - return tryTranslators( it+1 ); - } - } - - private: - std::vector m_translators; - }; -} - -namespace Catch { - - namespace { - - class RegistryHub : public IRegistryHub, public IMutableRegistryHub { - - RegistryHub( RegistryHub const& ); - void operator=( RegistryHub const& ); - - public: // IRegistryHub - RegistryHub() { - } - virtual IReporterRegistry const& getReporterRegistry() const { - return m_reporterRegistry; - } - virtual ITestCaseRegistry const& getTestCaseRegistry() const { - return m_testCaseRegistry; - } - virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() { - return m_exceptionTranslatorRegistry; - } - - public: // IMutableRegistryHub - virtual void registerReporter( std::string const& name, IReporterFactory* factory ) { - m_reporterRegistry.registerReporter( name, factory ); - } - virtual void registerTest( TestCase const& testInfo ) { - m_testCaseRegistry.registerTest( testInfo ); - } - virtual void registerTranslator( const IExceptionTranslator* translator ) { - m_exceptionTranslatorRegistry.registerTranslator( translator ); - } - - private: - TestRegistry m_testCaseRegistry; - ReporterRegistry m_reporterRegistry; - ExceptionTranslatorRegistry m_exceptionTranslatorRegistry; - }; - - // Single, global, instance - inline RegistryHub*& getTheRegistryHub() { - static RegistryHub* theRegistryHub = NULL; - if( !theRegistryHub ) - theRegistryHub = new RegistryHub(); - return theRegistryHub; - } - } - - IRegistryHub& getRegistryHub() { - return *getTheRegistryHub(); - } - IMutableRegistryHub& getMutableRegistryHub() { - return *getTheRegistryHub(); - } - void cleanUp() { - delete getTheRegistryHub(); - getTheRegistryHub() = NULL; - cleanUpContext(); - } - std::string translateActiveException() { - return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException(); - } - -} // end namespace Catch - -// #included from: catch_notimplemented_exception.hpp -#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_HPP_INCLUDED - -#include - -namespace Catch { - - NotImplementedException::NotImplementedException( SourceLineInfo const& lineInfo ) - : m_lineInfo( lineInfo ) { - std::ostringstream oss; - oss << lineInfo << ": function "; - oss << "not implemented"; - m_what = oss.str(); - } - - const char* NotImplementedException::what() const CATCH_NOEXCEPT { - return m_what.c_str(); - } - -} // end namespace Catch - -// #included from: catch_context_impl.hpp -#define TWOBLUECUBES_CATCH_CONTEXT_IMPL_HPP_INCLUDED - -// #included from: catch_stream.hpp -#define TWOBLUECUBES_CATCH_STREAM_HPP_INCLUDED - -// #included from: catch_streambuf.h -#define TWOBLUECUBES_CATCH_STREAMBUF_H_INCLUDED - -#include - -namespace Catch { - - class StreamBufBase : public std::streambuf { - public: - virtual ~StreamBufBase() CATCH_NOEXCEPT; - }; -} - -#include -#include -#include - -namespace Catch { - - template - class StreamBufImpl : public StreamBufBase { - char data[bufferSize]; - WriterF m_writer; - - public: - StreamBufImpl() { - setp( data, data + sizeof(data) ); - } - - ~StreamBufImpl() CATCH_NOEXCEPT { - sync(); - } - - private: - int overflow( int c ) { - sync(); - - if( c != EOF ) { - if( pbase() == epptr() ) - m_writer( std::string( 1, static_cast( c ) ) ); - else - sputc( static_cast( c ) ); - } - return 0; - } - - int sync() { - if( pbase() != pptr() ) { - m_writer( std::string( pbase(), static_cast( pptr() - pbase() ) ) ); - setp( pbase(), epptr() ); - } - return 0; - } - }; - - /////////////////////////////////////////////////////////////////////////// - - struct OutputDebugWriter { - - void operator()( std::string const&str ) { - writeToDebugConsole( str ); - } - }; - - Stream::Stream() - : streamBuf( NULL ), isOwned( false ) - {} - - Stream::Stream( std::streambuf* _streamBuf, bool _isOwned ) - : streamBuf( _streamBuf ), isOwned( _isOwned ) - {} - - void Stream::release() { - if( isOwned ) { - delete streamBuf; - streamBuf = NULL; - isOwned = false; - } - } - -#ifndef CATCH_CONFIG_NOSTDOUT // If you #define this you must implement this functions - std::ostream& cout() { - return std::cout; - } - std::ostream& cerr() { - return std::cerr; - } -#endif -} - -namespace Catch { - - class Context : public IMutableContext { - - Context() : m_config( NULL ), m_runner( NULL ), m_resultCapture( NULL ) {} - Context( Context const& ); - void operator=( Context const& ); - - public: // IContext - virtual IResultCapture* getResultCapture() { - return m_resultCapture; - } - virtual IRunner* getRunner() { - return m_runner; - } - virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) { - return getGeneratorsForCurrentTest() - .getGeneratorInfo( fileInfo, totalSize ) - .getCurrentIndex(); - } - virtual bool advanceGeneratorsForCurrentTest() { - IGeneratorsForTest* generators = findGeneratorsForCurrentTest(); - return generators && generators->moveNext(); - } - - virtual Ptr getConfig() const { - return m_config; - } - - public: // IMutableContext - virtual void setResultCapture( IResultCapture* resultCapture ) { - m_resultCapture = resultCapture; - } - virtual void setRunner( IRunner* runner ) { - m_runner = runner; - } - virtual void setConfig( Ptr const& config ) { - m_config = config; - } - - friend IMutableContext& getCurrentMutableContext(); - - private: - IGeneratorsForTest* findGeneratorsForCurrentTest() { - std::string testName = getResultCapture()->getCurrentTestName(); - - std::map::const_iterator it = - m_generatorsByTestName.find( testName ); - return it != m_generatorsByTestName.end() - ? it->second - : NULL; - } - - IGeneratorsForTest& getGeneratorsForCurrentTest() { - IGeneratorsForTest* generators = findGeneratorsForCurrentTest(); - if( !generators ) { - std::string testName = getResultCapture()->getCurrentTestName(); - generators = createGeneratorsForTest(); - m_generatorsByTestName.insert( std::make_pair( testName, generators ) ); - } - return *generators; - } - - private: - Ptr m_config; - IRunner* m_runner; - IResultCapture* m_resultCapture; - std::map m_generatorsByTestName; - }; - - namespace { - Context* currentContext = NULL; - } - IMutableContext& getCurrentMutableContext() { - if( !currentContext ) - currentContext = new Context(); - return *currentContext; - } - IContext& getCurrentContext() { - return getCurrentMutableContext(); - } - - Stream createStream( std::string const& streamName ) { - if( streamName == "stdout" ) return Stream( Catch::cout().rdbuf(), false ); - if( streamName == "stderr" ) return Stream( Catch::cerr().rdbuf(), false ); - if( streamName == "debug" ) return Stream( new StreamBufImpl, true ); - - throw std::domain_error( "Unknown stream: " + streamName ); - } - - void cleanUpContext() { - delete currentContext; - currentContext = NULL; - } -} - -// #included from: catch_console_colour_impl.hpp -#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED - -namespace Catch { - namespace { - - struct IColourImpl { - virtual ~IColourImpl() {} - virtual void use( Colour::Code _colourCode ) = 0; - }; - - struct NoColourImpl : IColourImpl { - void use( Colour::Code ) {} - - static IColourImpl* instance() { - static NoColourImpl s_instance; - return &s_instance; - } - }; - - } // anon namespace -} // namespace Catch - -#if !defined( CATCH_CONFIG_COLOUR_NONE ) && !defined( CATCH_CONFIG_COLOUR_WINDOWS ) && !defined( CATCH_CONFIG_COLOUR_ANSI ) -# ifdef CATCH_PLATFORM_WINDOWS -# define CATCH_CONFIG_COLOUR_WINDOWS -# else -# define CATCH_CONFIG_COLOUR_ANSI -# endif -#endif - -#if defined ( CATCH_CONFIG_COLOUR_WINDOWS ) ///////////////////////////////////////// - -#ifndef NOMINMAX -#define NOMINMAX -#endif - -#ifdef __AFXDLL -#include -#else -#include -#endif - -namespace Catch { -namespace { - - class Win32ColourImpl : public IColourImpl { - public: - Win32ColourImpl() : stdoutHandle( GetStdHandle(STD_OUTPUT_HANDLE) ) - { - CONSOLE_SCREEN_BUFFER_INFO csbiInfo; - GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo ); - originalAttributes = csbiInfo.wAttributes; - } - - virtual void use( Colour::Code _colourCode ) { - switch( _colourCode ) { - case Colour::None: return setTextAttribute( originalAttributes ); - case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE ); - case Colour::Red: return setTextAttribute( FOREGROUND_RED ); - case Colour::Green: return setTextAttribute( FOREGROUND_GREEN ); - case Colour::Blue: return setTextAttribute( FOREGROUND_BLUE ); - case Colour::Cyan: return setTextAttribute( FOREGROUND_BLUE | FOREGROUND_GREEN ); - case Colour::Yellow: return setTextAttribute( FOREGROUND_RED | FOREGROUND_GREEN ); - case Colour::Grey: return setTextAttribute( 0 ); - - case Colour::LightGrey: return setTextAttribute( FOREGROUND_INTENSITY ); - case Colour::BrightRed: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED ); - case Colour::BrightGreen: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN ); - case Colour::BrightWhite: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE ); - - case Colour::Bright: throw std::logic_error( "not a colour" ); - } - } - - private: - void setTextAttribute( WORD _textAttribute ) { - SetConsoleTextAttribute( stdoutHandle, _textAttribute ); - } - HANDLE stdoutHandle; - WORD originalAttributes; - }; - - IColourImpl* platformColourInstance() { - static Win32ColourImpl s_instance; - return &s_instance; - } - -} // end anon namespace -} // end namespace Catch - -#elif defined( CATCH_CONFIG_COLOUR_ANSI ) ////////////////////////////////////// - -#include - -namespace Catch { -namespace { - - // use POSIX/ ANSI console terminal codes - // Thanks to Adam Strzelecki for original contribution - // (http://github.com/nanoant) - // https://github.com/philsquared/Catch/pull/131 - class PosixColourImpl : public IColourImpl { - public: - virtual void use( Colour::Code _colourCode ) { - switch( _colourCode ) { - case Colour::None: - case Colour::White: return setColour( "[0m" ); - case Colour::Red: return setColour( "[0;31m" ); - case Colour::Green: return setColour( "[0;32m" ); - case Colour::Blue: return setColour( "[0:34m" ); - case Colour::Cyan: return setColour( "[0;36m" ); - case Colour::Yellow: return setColour( "[0;33m" ); - case Colour::Grey: return setColour( "[1;30m" ); - - case Colour::LightGrey: return setColour( "[0;37m" ); - case Colour::BrightRed: return setColour( "[1;31m" ); - case Colour::BrightGreen: return setColour( "[1;32m" ); - case Colour::BrightWhite: return setColour( "[1;37m" ); - - case Colour::Bright: throw std::logic_error( "not a colour" ); - } - } - static IColourImpl* instance() { - static PosixColourImpl s_instance; - return &s_instance; - } - - private: - void setColour( const char* _escapeCode ) { - Catch::cout() << '\033' << _escapeCode; - } - }; - - IColourImpl* platformColourInstance() { - Ptr config = getCurrentContext().getConfig(); - return (config && config->forceColour()) || isatty(STDOUT_FILENO) - ? PosixColourImpl::instance() - : NoColourImpl::instance(); - } - -} // end anon namespace -} // end namespace Catch - -#else // not Windows or ANSI /////////////////////////////////////////////// - -namespace Catch { - - static IColourImpl* platformColourInstance() { return NoColourImpl::instance(); } - -} // end namespace Catch - -#endif // Windows/ ANSI/ None - -namespace Catch { - - Colour::Colour( Code _colourCode ) : m_moved( false ) { use( _colourCode ); } - Colour::Colour( Colour const& _other ) : m_moved( false ) { const_cast( _other ).m_moved = true; } - Colour::~Colour(){ if( !m_moved ) use( None ); } - - void Colour::use( Code _colourCode ) { - static IColourImpl* impl = isDebuggerActive() - ? NoColourImpl::instance() - : platformColourInstance(); - impl->use( _colourCode ); - } - -} // end namespace Catch - -// #included from: catch_generators_impl.hpp -#define TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED - -#include -#include -#include - -namespace Catch { - - struct GeneratorInfo : IGeneratorInfo { - - GeneratorInfo( std::size_t size ) - : m_size( size ), - m_currentIndex( 0 ) - {} - - bool moveNext() { - if( ++m_currentIndex == m_size ) { - m_currentIndex = 0; - return false; - } - return true; - } - - std::size_t getCurrentIndex() const { - return m_currentIndex; - } - - std::size_t m_size; - std::size_t m_currentIndex; - }; - - /////////////////////////////////////////////////////////////////////////// - - class GeneratorsForTest : public IGeneratorsForTest { - - public: - ~GeneratorsForTest() { - deleteAll( m_generatorsInOrder ); - } - - IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) { - std::map::const_iterator it = m_generatorsByName.find( fileInfo ); - if( it == m_generatorsByName.end() ) { - IGeneratorInfo* info = new GeneratorInfo( size ); - m_generatorsByName.insert( std::make_pair( fileInfo, info ) ); - m_generatorsInOrder.push_back( info ); - return *info; - } - return *it->second; - } - - bool moveNext() { - std::vector::const_iterator it = m_generatorsInOrder.begin(); - std::vector::const_iterator itEnd = m_generatorsInOrder.end(); - for(; it != itEnd; ++it ) { - if( (*it)->moveNext() ) - return true; - } - return false; - } - - private: - std::map m_generatorsByName; - std::vector m_generatorsInOrder; - }; - - IGeneratorsForTest* createGeneratorsForTest() - { - return new GeneratorsForTest(); - } - -} // end namespace Catch - -// #included from: catch_assertionresult.hpp -#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED - -namespace Catch { - - AssertionInfo::AssertionInfo( std::string const& _macroName, - SourceLineInfo const& _lineInfo, - std::string const& _capturedExpression, - ResultDisposition::Flags _resultDisposition ) - : macroName( _macroName ), - lineInfo( _lineInfo ), - capturedExpression( _capturedExpression ), - resultDisposition( _resultDisposition ) - {} - - AssertionResult::AssertionResult() {} - - AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data ) - : m_info( info ), - m_resultData( data ) - {} - - AssertionResult::~AssertionResult() {} - - // Result was a success - bool AssertionResult::succeeded() const { - return Catch::isOk( m_resultData.resultType ); - } - - // Result was a success, or failure is suppressed - bool AssertionResult::isOk() const { - return Catch::isOk( m_resultData.resultType ) || shouldSuppressFailure( m_info.resultDisposition ); - } - - ResultWas::OfType AssertionResult::getResultType() const { - return m_resultData.resultType; - } - - bool AssertionResult::hasExpression() const { - return !m_info.capturedExpression.empty(); - } - - bool AssertionResult::hasMessage() const { - return !m_resultData.message.empty(); - } - - std::string AssertionResult::getExpression() const { - if( isFalseTest( m_info.resultDisposition ) ) - return "!" + m_info.capturedExpression; - else - return m_info.capturedExpression; - } - std::string AssertionResult::getExpressionInMacro() const { - if( m_info.macroName.empty() ) - return m_info.capturedExpression; - else - return m_info.macroName + "( " + m_info.capturedExpression + " )"; - } - - bool AssertionResult::hasExpandedExpression() const { - return hasExpression() && getExpandedExpression() != getExpression(); - } - - std::string AssertionResult::getExpandedExpression() const { - return m_resultData.reconstructedExpression; - } - - std::string AssertionResult::getMessage() const { - return m_resultData.message; - } - SourceLineInfo AssertionResult::getSourceInfo() const { - return m_info.lineInfo; - } - - std::string AssertionResult::getTestMacroName() const { - return m_info.macroName; - } - -} // end namespace Catch - -// #included from: catch_test_case_info.hpp -#define TWOBLUECUBES_CATCH_TEST_CASE_INFO_HPP_INCLUDED - -namespace Catch { - - inline TestCaseInfo::SpecialProperties parseSpecialTag( std::string const& tag ) { - if( startsWith( tag, "." ) || - tag == "hide" || - tag == "!hide" ) - return TestCaseInfo::IsHidden; - else if( tag == "!throws" ) - return TestCaseInfo::Throws; - else if( tag == "!shouldfail" ) - return TestCaseInfo::ShouldFail; - else if( tag == "!mayfail" ) - return TestCaseInfo::MayFail; - else - return TestCaseInfo::None; - } - inline bool isReservedTag( std::string const& tag ) { - return TestCaseInfo::None && tag.size() > 0 && !isalnum( tag[0] ); - } - inline void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) { - if( isReservedTag( tag ) ) { - { - Colour colourGuard( Colour::Red ); - Catch::cerr() - << "Tag name [" << tag << "] not allowed.\n" - << "Tag names starting with non alpha-numeric characters are reserved\n"; - } - { - Colour colourGuard( Colour::FileName ); - Catch::cerr() << _lineInfo << std::endl; - } - exit(1); - } - } - - TestCase makeTestCase( ITestCase* _testCase, - std::string const& _className, - std::string const& _name, - std::string const& _descOrTags, - SourceLineInfo const& _lineInfo ) - { - bool isHidden( startsWith( _name, "./" ) ); // Legacy support - - // Parse out tags - std::set tags; - std::string desc, tag; - bool inTag = false; - for( std::size_t i = 0; i < _descOrTags.size(); ++i ) { - char c = _descOrTags[i]; - if( !inTag ) { - if( c == '[' ) - inTag = true; - else - desc += c; - } - else { - if( c == ']' ) { - TestCaseInfo::SpecialProperties prop = parseSpecialTag( tag ); - if( prop == TestCaseInfo::IsHidden ) - isHidden = true; - else if( prop == TestCaseInfo::None ) - enforceNotReservedTag( tag, _lineInfo ); - - tags.insert( tag ); - tag.clear(); - inTag = false; - } - else - tag += c; - } - } - if( isHidden ) { - tags.insert( "hide" ); - tags.insert( "." ); - } - - TestCaseInfo info( _name, _className, desc, tags, _lineInfo ); - return TestCase( _testCase, info ); - } - - TestCaseInfo::TestCaseInfo( std::string const& _name, - std::string const& _className, - std::string const& _description, - std::set const& _tags, - SourceLineInfo const& _lineInfo ) - : name( _name ), - className( _className ), - description( _description ), - tags( _tags ), - lineInfo( _lineInfo ), - properties( None ) - { - std::ostringstream oss; - for( std::set::const_iterator it = _tags.begin(), itEnd = _tags.end(); it != itEnd; ++it ) { - oss << "[" << *it << "]"; - std::string lcaseTag = toLower( *it ); - properties = static_cast( properties | parseSpecialTag( lcaseTag ) ); - lcaseTags.insert( lcaseTag ); - } - tagsAsString = oss.str(); - } - - TestCaseInfo::TestCaseInfo( TestCaseInfo const& other ) - : name( other.name ), - className( other.className ), - description( other.description ), - tags( other.tags ), - lcaseTags( other.lcaseTags ), - tagsAsString( other.tagsAsString ), - lineInfo( other.lineInfo ), - properties( other.properties ) - {} - - bool TestCaseInfo::isHidden() const { - return ( properties & IsHidden ) != 0; - } - bool TestCaseInfo::throws() const { - return ( properties & Throws ) != 0; - } - bool TestCaseInfo::okToFail() const { - return ( properties & (ShouldFail | MayFail ) ) != 0; - } - bool TestCaseInfo::expectedToFail() const { - return ( properties & (ShouldFail ) ) != 0; - } - - TestCase::TestCase( ITestCase* testCase, TestCaseInfo const& info ) : TestCaseInfo( info ), test( testCase ) {} - - TestCase::TestCase( TestCase const& other ) - : TestCaseInfo( other ), - test( other.test ) - {} - - TestCase TestCase::withName( std::string const& _newName ) const { - TestCase other( *this ); - other.name = _newName; - return other; - } - - void TestCase::swap( TestCase& other ) { - test.swap( other.test ); - name.swap( other.name ); - className.swap( other.className ); - description.swap( other.description ); - tags.swap( other.tags ); - lcaseTags.swap( other.lcaseTags ); - tagsAsString.swap( other.tagsAsString ); - std::swap( TestCaseInfo::properties, static_cast( other ).properties ); - std::swap( lineInfo, other.lineInfo ); - } - - void TestCase::invoke() const { - test->invoke(); - } - - bool TestCase::operator == ( TestCase const& other ) const { - return test.get() == other.test.get() && - name == other.name && - className == other.className; - } - - bool TestCase::operator < ( TestCase const& other ) const { - return name < other.name; - } - TestCase& TestCase::operator = ( TestCase const& other ) { - TestCase temp( other ); - swap( temp ); - return *this; - } - - TestCaseInfo const& TestCase::getTestCaseInfo() const - { - return *this; - } - -} // end namespace Catch - -// #included from: catch_version.hpp -#define TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED - -namespace Catch { - - // These numbers are maintained by a script - Version libraryVersion( 1, 1, 14, "develop" ); -} - -// #included from: catch_message.hpp -#define TWOBLUECUBES_CATCH_MESSAGE_HPP_INCLUDED - -namespace Catch { - - MessageInfo::MessageInfo( std::string const& _macroName, - SourceLineInfo const& _lineInfo, - ResultWas::OfType _type ) - : macroName( _macroName ), - lineInfo( _lineInfo ), - type( _type ), - sequence( ++globalCount ) - {} - - // This may need protecting if threading support is added - unsigned int MessageInfo::globalCount = 0; - - //////////////////////////////////////////////////////////////////////////// - - ScopedMessage::ScopedMessage( MessageBuilder const& builder ) - : m_info( builder.m_info ) - { - m_info.message = builder.m_stream.str(); - getResultCapture().pushScopedMessage( m_info ); - } - ScopedMessage::ScopedMessage( ScopedMessage const& other ) - : m_info( other.m_info ) - {} - - ScopedMessage::~ScopedMessage() { - getResultCapture().popScopedMessage( m_info ); - } - -} // end namespace Catch - -// #included from: catch_legacy_reporter_adapter.hpp -#define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_HPP_INCLUDED - -// #included from: catch_legacy_reporter_adapter.h -#define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_H_INCLUDED - -namespace Catch -{ - // Deprecated - struct IReporter : IShared { - virtual ~IReporter(); - - virtual bool shouldRedirectStdout() const = 0; - - virtual void StartTesting() = 0; - virtual void EndTesting( Totals const& totals ) = 0; - virtual void StartGroup( std::string const& groupName ) = 0; - virtual void EndGroup( std::string const& groupName, Totals const& totals ) = 0; - virtual void StartTestCase( TestCaseInfo const& testInfo ) = 0; - virtual void EndTestCase( TestCaseInfo const& testInfo, Totals const& totals, std::string const& stdOut, std::string const& stdErr ) = 0; - virtual void StartSection( std::string const& sectionName, std::string const& description ) = 0; - virtual void EndSection( std::string const& sectionName, Counts const& assertions ) = 0; - virtual void NoAssertionsInSection( std::string const& sectionName ) = 0; - virtual void NoAssertionsInTestCase( std::string const& testName ) = 0; - virtual void Aborted() = 0; - virtual void Result( AssertionResult const& result ) = 0; - }; - - class LegacyReporterAdapter : public SharedImpl - { - public: - LegacyReporterAdapter( Ptr const& legacyReporter ); - virtual ~LegacyReporterAdapter(); - - virtual ReporterPreferences getPreferences() const; - virtual void noMatchingTestCases( std::string const& ); - virtual void testRunStarting( TestRunInfo const& ); - virtual void testGroupStarting( GroupInfo const& groupInfo ); - virtual void testCaseStarting( TestCaseInfo const& testInfo ); - virtual void sectionStarting( SectionInfo const& sectionInfo ); - virtual void assertionStarting( AssertionInfo const& ); - virtual bool assertionEnded( AssertionStats const& assertionStats ); - virtual void sectionEnded( SectionStats const& sectionStats ); - virtual void testCaseEnded( TestCaseStats const& testCaseStats ); - virtual void testGroupEnded( TestGroupStats const& testGroupStats ); - virtual void testRunEnded( TestRunStats const& testRunStats ); - virtual void skipTest( TestCaseInfo const& ); - - private: - Ptr m_legacyReporter; - }; -} - -namespace Catch -{ - LegacyReporterAdapter::LegacyReporterAdapter( Ptr const& legacyReporter ) - : m_legacyReporter( legacyReporter ) - {} - LegacyReporterAdapter::~LegacyReporterAdapter() {} - - ReporterPreferences LegacyReporterAdapter::getPreferences() const { - ReporterPreferences prefs; - prefs.shouldRedirectStdOut = m_legacyReporter->shouldRedirectStdout(); - return prefs; - } - - void LegacyReporterAdapter::noMatchingTestCases( std::string const& ) {} - void LegacyReporterAdapter::testRunStarting( TestRunInfo const& ) { - m_legacyReporter->StartTesting(); - } - void LegacyReporterAdapter::testGroupStarting( GroupInfo const& groupInfo ) { - m_legacyReporter->StartGroup( groupInfo.name ); - } - void LegacyReporterAdapter::testCaseStarting( TestCaseInfo const& testInfo ) { - m_legacyReporter->StartTestCase( testInfo ); - } - void LegacyReporterAdapter::sectionStarting( SectionInfo const& sectionInfo ) { - m_legacyReporter->StartSection( sectionInfo.name, sectionInfo.description ); - } - void LegacyReporterAdapter::assertionStarting( AssertionInfo const& ) { - // Not on legacy interface - } - - bool LegacyReporterAdapter::assertionEnded( AssertionStats const& assertionStats ) { - if( assertionStats.assertionResult.getResultType() != ResultWas::Ok ) { - for( std::vector::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end(); - it != itEnd; - ++it ) { - if( it->type == ResultWas::Info ) { - ResultBuilder rb( it->macroName.c_str(), it->lineInfo, "", ResultDisposition::Normal ); - rb << it->message; - rb.setResultType( ResultWas::Info ); - AssertionResult result = rb.build(); - m_legacyReporter->Result( result ); - } - } - } - m_legacyReporter->Result( assertionStats.assertionResult ); - return true; - } - void LegacyReporterAdapter::sectionEnded( SectionStats const& sectionStats ) { - if( sectionStats.missingAssertions ) - m_legacyReporter->NoAssertionsInSection( sectionStats.sectionInfo.name ); - m_legacyReporter->EndSection( sectionStats.sectionInfo.name, sectionStats.assertions ); - } - void LegacyReporterAdapter::testCaseEnded( TestCaseStats const& testCaseStats ) { - m_legacyReporter->EndTestCase - ( testCaseStats.testInfo, - testCaseStats.totals, - testCaseStats.stdOut, - testCaseStats.stdErr ); - } - void LegacyReporterAdapter::testGroupEnded( TestGroupStats const& testGroupStats ) { - if( testGroupStats.aborting ) - m_legacyReporter->Aborted(); - m_legacyReporter->EndGroup( testGroupStats.groupInfo.name, testGroupStats.totals ); - } - void LegacyReporterAdapter::testRunEnded( TestRunStats const& testRunStats ) { - m_legacyReporter->EndTesting( testRunStats.totals ); - } - void LegacyReporterAdapter::skipTest( TestCaseInfo const& ) { - } -} - -// #included from: catch_timer.hpp - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wc++11-long-long" -#endif - -#ifdef CATCH_PLATFORM_WINDOWS -#include -#else -#include -#endif - -namespace Catch { - - namespace { -#ifdef CATCH_PLATFORM_WINDOWS - uint64_t getCurrentTicks() { - static uint64_t hz=0, hzo=0; - if (!hz) { - QueryPerformanceFrequency((LARGE_INTEGER*)&hz); - QueryPerformanceCounter((LARGE_INTEGER*)&hzo); - } - uint64_t t; - QueryPerformanceCounter((LARGE_INTEGER*)&t); - return ((t-hzo)*1000000)/hz; - } -#else - uint64_t getCurrentTicks() { - timeval t; - gettimeofday(&t,NULL); - return static_cast( t.tv_sec ) * 1000000ull + static_cast( t.tv_usec ); - } -#endif - } - - void Timer::start() { - m_ticks = getCurrentTicks(); - } - unsigned int Timer::getElapsedMicroseconds() const { - return static_cast(getCurrentTicks() - m_ticks); - } - unsigned int Timer::getElapsedMilliseconds() const { - return static_cast(getElapsedMicroseconds()/1000); - } - double Timer::getElapsedSeconds() const { - return getElapsedMicroseconds()/1000000.0; - } - -} // namespace Catch - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -// #included from: catch_common.hpp -#define TWOBLUECUBES_CATCH_COMMON_HPP_INCLUDED - -namespace Catch { - - bool startsWith( std::string const& s, std::string const& prefix ) { - return s.size() >= prefix.size() && s.substr( 0, prefix.size() ) == prefix; - } - bool endsWith( std::string const& s, std::string const& suffix ) { - return s.size() >= suffix.size() && s.substr( s.size()-suffix.size(), suffix.size() ) == suffix; - } - bool contains( std::string const& s, std::string const& infix ) { - return s.find( infix ) != std::string::npos; - } - void toLowerInPlace( std::string& s ) { - std::transform( s.begin(), s.end(), s.begin(), ::tolower ); - } - std::string toLower( std::string const& s ) { - std::string lc = s; - toLowerInPlace( lc ); - return lc; - } - std::string trim( std::string const& str ) { - static char const* whitespaceChars = "\n\r\t "; - std::string::size_type start = str.find_first_not_of( whitespaceChars ); - std::string::size_type end = str.find_last_not_of( whitespaceChars ); - - return start != std::string::npos ? str.substr( start, 1+end-start ) : ""; - } - - bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) { - bool replaced = false; - std::size_t i = str.find( replaceThis ); - while( i != std::string::npos ) { - replaced = true; - str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() ); - if( i < str.size()-withThis.size() ) - i = str.find( replaceThis, i+withThis.size() ); - else - i = std::string::npos; - } - return replaced; - } - - pluralise::pluralise( std::size_t count, std::string const& label ) - : m_count( count ), - m_label( label ) - {} - - std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ) { - os << pluraliser.m_count << " " << pluraliser.m_label; - if( pluraliser.m_count != 1 ) - os << "s"; - return os; - } - - SourceLineInfo::SourceLineInfo() : line( 0 ){} - SourceLineInfo::SourceLineInfo( char const* _file, std::size_t _line ) - : file( _file ), - line( _line ) - {} - SourceLineInfo::SourceLineInfo( SourceLineInfo const& other ) - : file( other.file ), - line( other.line ) - {} - bool SourceLineInfo::empty() const { - return file.empty(); - } - bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const { - return line == other.line && file == other.file; - } - bool SourceLineInfo::operator < ( SourceLineInfo const& other ) const { - return line < other.line || ( line == other.line && file < other.file ); - } - - std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) { -#ifndef __GNUG__ - os << info.file << "(" << info.line << ")"; -#else - os << info.file << ":" << info.line; -#endif - return os; - } - - void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ) { - std::ostringstream oss; - oss << locationInfo << ": Internal Catch error: '" << message << "'"; - if( alwaysTrue() ) - throw std::logic_error( oss.str() ); - } -} - -// #included from: catch_section.hpp -#define TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED - -namespace Catch { - - SectionInfo::SectionInfo - ( SourceLineInfo const& _lineInfo, - std::string const& _name, - std::string const& _description ) - : name( _name ), - description( _description ), - lineInfo( _lineInfo ) - {} - - Section::Section( SectionInfo const& info ) - : m_info( info ), - m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) ) - { - m_timer.start(); - } - - Section::~Section() { - if( m_sectionIncluded ) - getResultCapture().sectionEnded( m_info, m_assertions, m_timer.getElapsedSeconds() ); - } - - // This indicates whether the section should be executed or not - Section::operator bool() const { - return m_sectionIncluded; - } - -} // end namespace Catch - -// #included from: catch_debugger.hpp -#define TWOBLUECUBES_CATCH_DEBUGGER_HPP_INCLUDED - -#include - -#ifdef CATCH_PLATFORM_MAC - - #include - #include - #include - #include - #include - - namespace Catch{ - - // The following function is taken directly from the following technical note: - // http://developer.apple.com/library/mac/#qa/qa2004/qa1361.html - - // Returns true if the current process is being debugged (either - // running under the debugger or has a debugger attached post facto). - bool isDebuggerActive(){ - - int mib[4]; - struct kinfo_proc info; - size_t size; - - // Initialize the flags so that, if sysctl fails for some bizarre - // reason, we get a predictable result. - - info.kp_proc.p_flag = 0; - - // Initialize mib, which tells sysctl the info we want, in this case - // we're looking for information about a specific process ID. - - mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_PID; - mib[3] = getpid(); - - // Call sysctl. - - size = sizeof(info); - if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0) != 0 ) { - Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl; - return false; - } - - // We're being debugged if the P_TRACED flag is set. - - return ( (info.kp_proc.p_flag & P_TRACED) != 0 ); - } - } // namespace Catch - -#elif defined(_MSC_VER) - extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent(); - namespace Catch { - bool isDebuggerActive() { - return IsDebuggerPresent() != 0; - } - } -#elif defined(__MINGW32__) - extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent(); - namespace Catch { - bool isDebuggerActive() { - return IsDebuggerPresent() != 0; - } - } -#else - namespace Catch { - inline bool isDebuggerActive() { return false; } - } -#endif // Platform - -#ifdef CATCH_PLATFORM_WINDOWS - extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA( const char* ); - namespace Catch { - void writeToDebugConsole( std::string const& text ) { - ::OutputDebugStringA( text.c_str() ); - } - } -#else - namespace Catch { - void writeToDebugConsole( std::string const& text ) { - // !TBD: Need a version for Mac/ XCode and other IDEs - Catch::cout() << text; - } - } -#endif // Platform - -// #included from: catch_tostring.hpp -#define TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED - -namespace Catch { - -namespace Detail { - - std::string unprintableString = "{?}"; - - namespace { - struct Endianness { - enum Arch { Big, Little }; - - static Arch which() { - union _{ - int asInt; - char asChar[sizeof (int)]; - } u; - - u.asInt = 1; - return ( u.asChar[sizeof(int)-1] == 1 ) ? Big : Little; - } - }; - } - - std::string rawMemoryToString( const void *object, std::size_t size ) - { - // Reverse order for little endian architectures - int i = 0, end = static_cast( size ), inc = 1; - if( Endianness::which() == Endianness::Little ) { - i = end-1; - end = inc = -1; - } - - unsigned char const *bytes = static_cast(object); - std::ostringstream os; - os << "0x" << std::setfill('0') << std::hex; - for( ; i != end; i += inc ) - os << std::setw(2) << static_cast(bytes[i]); - return os.str(); - } -} - -std::string toString( std::string const& value ) { - std::string s = value; - if( getCurrentContext().getConfig()->showInvisibles() ) { - for(size_t i = 0; i < s.size(); ++i ) { - std::string subs; - switch( s[i] ) { - case '\n': subs = "\\n"; break; - case '\t': subs = "\\t"; break; - default: break; - } - if( !subs.empty() ) { - s = s.substr( 0, i ) + subs + s.substr( i+1 ); - ++i; - } - } - } - return "\"" + s + "\""; -} -std::string toString( std::wstring const& value ) { - - std::string s; - s.reserve( value.size() ); - for(size_t i = 0; i < value.size(); ++i ) - s += value[i] <= 0xff ? static_cast( value[i] ) : '?'; - return Catch::toString( s ); -} - -std::string toString( const char* const value ) { - return value ? Catch::toString( std::string( value ) ) : std::string( "{null string}" ); -} - -std::string toString( char* const value ) { - return Catch::toString( static_cast( value ) ); -} - -std::string toString( const wchar_t* const value ) -{ - return value ? Catch::toString( std::wstring(value) ) : std::string( "{null string}" ); -} - -std::string toString( wchar_t* const value ) -{ - return Catch::toString( static_cast( value ) ); -} - -std::string toString( int value ) { - std::ostringstream oss; - if( value > 8192 ) - oss << "0x" << std::hex << value; - else - oss << value; - return oss.str(); -} - -std::string toString( unsigned long value ) { - std::ostringstream oss; - if( value > 8192 ) - oss << "0x" << std::hex << value; - else - oss << value; - return oss.str(); -} - -std::string toString( unsigned int value ) { - return Catch::toString( static_cast( value ) ); -} - -template -std::string fpToString( T value, int precision ) { - std::ostringstream oss; - oss << std::setprecision( precision ) - << std::fixed - << value; - std::string d = oss.str(); - std::size_t i = d.find_last_not_of( '0' ); - if( i != std::string::npos && i != d.size()-1 ) { - if( d[i] == '.' ) - i++; - d = d.substr( 0, i+1 ); - } - return d; -} - -std::string toString( const double value ) { - return fpToString( value, 10 ); -} -std::string toString( const float value ) { - return fpToString( value, 5 ) + "f"; -} - -std::string toString( bool value ) { - return value ? "true" : "false"; -} - -std::string toString( char value ) { - return value < ' ' - ? toString( static_cast( value ) ) - : Detail::makeString( value ); -} - -std::string toString( signed char value ) { - return toString( static_cast( value ) ); -} - -std::string toString( unsigned char value ) { - return toString( static_cast( value ) ); -} - -#ifdef CATCH_CONFIG_CPP11_NULLPTR -std::string toString( std::nullptr_t ) { - return "nullptr"; -} -#endif - -#ifdef __OBJC__ - std::string toString( NSString const * const& nsstring ) { - if( !nsstring ) - return "nil"; - return "@" + toString([nsstring UTF8String]); - } - std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ) { - if( !nsstring ) - return "nil"; - return "@" + toString([nsstring UTF8String]); - } - std::string toString( NSObject* const& nsObject ) { - return toString( [nsObject description] ); - } -#endif - -} // end namespace Catch - -// #included from: catch_result_builder.hpp -#define TWOBLUECUBES_CATCH_RESULT_BUILDER_HPP_INCLUDED - -namespace Catch { - - ResultBuilder::ResultBuilder( char const* macroName, - SourceLineInfo const& lineInfo, - char const* capturedExpression, - ResultDisposition::Flags resultDisposition ) - : m_assertionInfo( macroName, lineInfo, capturedExpression, resultDisposition ), - m_shouldDebugBreak( false ), - m_shouldThrow( false ) - {} - - ResultBuilder& ResultBuilder::setResultType( ResultWas::OfType result ) { - m_data.resultType = result; - return *this; - } - ResultBuilder& ResultBuilder::setResultType( bool result ) { - m_data.resultType = result ? ResultWas::Ok : ResultWas::ExpressionFailed; - return *this; - } - ResultBuilder& ResultBuilder::setLhs( std::string const& lhs ) { - m_exprComponents.lhs = lhs; - return *this; - } - ResultBuilder& ResultBuilder::setRhs( std::string const& rhs ) { - m_exprComponents.rhs = rhs; - return *this; - } - ResultBuilder& ResultBuilder::setOp( std::string const& op ) { - m_exprComponents.op = op; - return *this; - } - - void ResultBuilder::endExpression() { - m_exprComponents.testFalse = isFalseTest( m_assertionInfo.resultDisposition ); - captureExpression(); - } - - void ResultBuilder::useActiveException( ResultDisposition::Flags resultDisposition ) { - m_assertionInfo.resultDisposition = resultDisposition; - m_stream.oss << Catch::translateActiveException(); - captureResult( ResultWas::ThrewException ); - } - - void ResultBuilder::captureResult( ResultWas::OfType resultType ) { - setResultType( resultType ); - captureExpression(); - } - - void ResultBuilder::captureExpression() { - AssertionResult result = build(); - getResultCapture().assertionEnded( result ); - - if( !result.isOk() ) { - if( getCurrentContext().getConfig()->shouldDebugBreak() ) - m_shouldDebugBreak = true; - if( getCurrentContext().getRunner()->aborting() || m_assertionInfo.resultDisposition == ResultDisposition::Normal ) - m_shouldThrow = true; - } - } - void ResultBuilder::react() { - if( m_shouldThrow ) - throw Catch::TestFailureException(); - } - - bool ResultBuilder::shouldDebugBreak() const { return m_shouldDebugBreak; } - bool ResultBuilder::allowThrows() const { return getCurrentContext().getConfig()->allowThrows(); } - - AssertionResult ResultBuilder::build() const - { - assert( m_data.resultType != ResultWas::Unknown ); - - AssertionResultData data = m_data; - - // Flip bool results if testFalse is set - if( m_exprComponents.testFalse ) { - if( data.resultType == ResultWas::Ok ) - data.resultType = ResultWas::ExpressionFailed; - else if( data.resultType == ResultWas::ExpressionFailed ) - data.resultType = ResultWas::Ok; - } - - data.message = m_stream.oss.str(); - data.reconstructedExpression = reconstructExpression(); - if( m_exprComponents.testFalse ) { - if( m_exprComponents.op == "" ) - data.reconstructedExpression = "!" + data.reconstructedExpression; - else - data.reconstructedExpression = "!(" + data.reconstructedExpression + ")"; - } - return AssertionResult( m_assertionInfo, data ); - } - std::string ResultBuilder::reconstructExpression() const { - if( m_exprComponents.op == "" ) - return m_exprComponents.lhs.empty() ? m_assertionInfo.capturedExpression : m_exprComponents.op + m_exprComponents.lhs; - else if( m_exprComponents.op == "matches" ) - return m_exprComponents.lhs + " " + m_exprComponents.rhs; - else if( m_exprComponents.op != "!" ) { - if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 40 && - m_exprComponents.lhs.find("\n") == std::string::npos && - m_exprComponents.rhs.find("\n") == std::string::npos ) - return m_exprComponents.lhs + " " + m_exprComponents.op + " " + m_exprComponents.rhs; - else - return m_exprComponents.lhs + "\n" + m_exprComponents.op + "\n" + m_exprComponents.rhs; - } - else - return "{can't expand - use " + m_assertionInfo.macroName + "_FALSE( " + m_assertionInfo.capturedExpression.substr(1) + " ) instead of " + m_assertionInfo.macroName + "( " + m_assertionInfo.capturedExpression + " ) for better diagnostics}"; - } - -} // end namespace Catch - -// #included from: catch_tag_alias_registry.hpp -#define TWOBLUECUBES_CATCH_TAG_ALIAS_REGISTRY_HPP_INCLUDED - -// #included from: catch_tag_alias_registry.h -#define TWOBLUECUBES_CATCH_TAG_ALIAS_REGISTRY_H_INCLUDED - -#include - -namespace Catch { - - class TagAliasRegistry : public ITagAliasRegistry { - public: - virtual ~TagAliasRegistry(); - virtual Option find( std::string const& alias ) const; - virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const; - void add( char const* alias, char const* tag, SourceLineInfo const& lineInfo ); - static TagAliasRegistry& get(); - - private: - std::map m_registry; - }; - -} // end namespace Catch - -#include -#include - -namespace Catch { - - TagAliasRegistry::~TagAliasRegistry() {} - - Option TagAliasRegistry::find( std::string const& alias ) const { - std::map::const_iterator it = m_registry.find( alias ); - if( it != m_registry.end() ) - return it->second; - else - return Option(); - } - - std::string TagAliasRegistry::expandAliases( std::string const& unexpandedTestSpec ) const { - std::string expandedTestSpec = unexpandedTestSpec; - for( std::map::const_iterator it = m_registry.begin(), itEnd = m_registry.end(); - it != itEnd; - ++it ) { - std::size_t pos = expandedTestSpec.find( it->first ); - if( pos != std::string::npos ) { - expandedTestSpec = expandedTestSpec.substr( 0, pos ) + - it->second.tag + - expandedTestSpec.substr( pos + it->first.size() ); - } - } - return expandedTestSpec; - } - - void TagAliasRegistry::add( char const* alias, char const* tag, SourceLineInfo const& lineInfo ) { - - if( !startsWith( alias, "[@" ) || !endsWith( alias, "]" ) ) { - std::ostringstream oss; - oss << "error: tag alias, \"" << alias << "\" is not of the form [@alias name].\n" << lineInfo; - throw std::domain_error( oss.str().c_str() ); - } - if( !m_registry.insert( std::make_pair( alias, TagAlias( tag, lineInfo ) ) ).second ) { - std::ostringstream oss; - oss << "error: tag alias, \"" << alias << "\" already registered.\n" - << "\tFirst seen at " << find(alias)->lineInfo << "\n" - << "\tRedefined at " << lineInfo; - throw std::domain_error( oss.str().c_str() ); - } - } - - TagAliasRegistry& TagAliasRegistry::get() { - static TagAliasRegistry instance; - return instance; - - } - - ITagAliasRegistry::~ITagAliasRegistry() {} - ITagAliasRegistry const& ITagAliasRegistry::get() { return TagAliasRegistry::get(); } - - RegistrarForTagAliases::RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ) { - try { - TagAliasRegistry::get().add( alias, tag, lineInfo ); - } - catch( std::exception& ex ) { - Colour colourGuard( Colour::Red ); - Catch::cerr() << ex.what() << std::endl; - exit(1); - } - } - -} // end namespace Catch - -// #included from: ../reporters/catch_reporter_xml.hpp -#define TWOBLUECUBES_CATCH_REPORTER_XML_HPP_INCLUDED - -// #included from: catch_reporter_bases.hpp -#define TWOBLUECUBES_CATCH_REPORTER_BASES_HPP_INCLUDED - -#include - -namespace Catch { - - struct StreamingReporterBase : SharedImpl { - - StreamingReporterBase( ReporterConfig const& _config ) - : m_config( _config.fullConfig() ), - stream( _config.stream() ) - {} - - virtual ~StreamingReporterBase(); - - virtual void noMatchingTestCases( std::string const& ) {} - - virtual void testRunStarting( TestRunInfo const& _testRunInfo ) { - currentTestRunInfo = _testRunInfo; - } - virtual void testGroupStarting( GroupInfo const& _groupInfo ) { - currentGroupInfo = _groupInfo; - } - - virtual void testCaseStarting( TestCaseInfo const& _testInfo ) { - currentTestCaseInfo = _testInfo; - } - virtual void sectionStarting( SectionInfo const& _sectionInfo ) { - m_sectionStack.push_back( _sectionInfo ); - } - - virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) { - m_sectionStack.pop_back(); - } - virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) { - currentTestCaseInfo.reset(); - } - virtual void testGroupEnded( TestGroupStats const& /* _testGroupStats */ ) { - currentGroupInfo.reset(); - } - virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) { - currentTestCaseInfo.reset(); - currentGroupInfo.reset(); - currentTestRunInfo.reset(); - } - - virtual void skipTest( TestCaseInfo const& ) { - // Don't do anything with this by default. - // It can optionally be overridden in the derived class. - } - - Ptr m_config; - std::ostream& stream; - - LazyStat currentTestRunInfo; - LazyStat currentGroupInfo; - LazyStat currentTestCaseInfo; - - std::vector m_sectionStack; - }; - - struct CumulativeReporterBase : SharedImpl { - template - struct Node : SharedImpl<> { - explicit Node( T const& _value ) : value( _value ) {} - virtual ~Node() {} - - typedef std::vector > ChildNodes; - T value; - ChildNodes children; - }; - struct SectionNode : SharedImpl<> { - explicit SectionNode( SectionStats const& _stats ) : stats( _stats ) {} - virtual ~SectionNode(); - - bool operator == ( SectionNode const& other ) const { - return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo; - } - bool operator == ( Ptr const& other ) const { - return operator==( *other ); - } - - SectionStats stats; - typedef std::vector > ChildSections; - typedef std::vector Assertions; - ChildSections childSections; - Assertions assertions; - std::string stdOut; - std::string stdErr; - }; - - struct BySectionInfo { - BySectionInfo( SectionInfo const& other ) : m_other( other ) {} - BySectionInfo( BySectionInfo const& other ) : m_other( other.m_other ) {} - bool operator() ( Ptr const& node ) const { - return node->stats.sectionInfo.lineInfo == m_other.lineInfo; - } - private: - void operator=( BySectionInfo const& ); - SectionInfo const& m_other; - }; - - typedef Node TestCaseNode; - typedef Node TestGroupNode; - typedef Node TestRunNode; - - CumulativeReporterBase( ReporterConfig const& _config ) - : m_config( _config.fullConfig() ), - stream( _config.stream() ) - {} - ~CumulativeReporterBase(); - - virtual void testRunStarting( TestRunInfo const& ) {} - virtual void testGroupStarting( GroupInfo const& ) {} - - virtual void testCaseStarting( TestCaseInfo const& ) {} - - virtual void sectionStarting( SectionInfo const& sectionInfo ) { - SectionStats incompleteStats( sectionInfo, Counts(), 0, false ); - Ptr node; - if( m_sectionStack.empty() ) { - if( !m_rootSection ) - m_rootSection = new SectionNode( incompleteStats ); - node = m_rootSection; - } - else { - SectionNode& parentNode = *m_sectionStack.back(); - SectionNode::ChildSections::const_iterator it = - std::find_if( parentNode.childSections.begin(), - parentNode.childSections.end(), - BySectionInfo( sectionInfo ) ); - if( it == parentNode.childSections.end() ) { - node = new SectionNode( incompleteStats ); - parentNode.childSections.push_back( node ); - } - else - node = *it; - } - m_sectionStack.push_back( node ); - m_deepestSection = node; - } - - virtual void assertionStarting( AssertionInfo const& ) {} - - virtual bool assertionEnded( AssertionStats const& assertionStats ) { - assert( !m_sectionStack.empty() ); - SectionNode& sectionNode = *m_sectionStack.back(); - sectionNode.assertions.push_back( assertionStats ); - return true; - } - virtual void sectionEnded( SectionStats const& sectionStats ) { - assert( !m_sectionStack.empty() ); - SectionNode& node = *m_sectionStack.back(); - node.stats = sectionStats; - m_sectionStack.pop_back(); - } - virtual void testCaseEnded( TestCaseStats const& testCaseStats ) { - Ptr node = new TestCaseNode( testCaseStats ); - assert( m_sectionStack.size() == 0 ); - node->children.push_back( m_rootSection ); - m_testCases.push_back( node ); - m_rootSection.reset(); - - assert( m_deepestSection ); - m_deepestSection->stdOut = testCaseStats.stdOut; - m_deepestSection->stdErr = testCaseStats.stdErr; - } - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) { - Ptr node = new TestGroupNode( testGroupStats ); - node->children.swap( m_testCases ); - m_testGroups.push_back( node ); - } - virtual void testRunEnded( TestRunStats const& testRunStats ) { - Ptr node = new TestRunNode( testRunStats ); - node->children.swap( m_testGroups ); - m_testRuns.push_back( node ); - testRunEndedCumulative(); - } - virtual void testRunEndedCumulative() = 0; - - virtual void skipTest( TestCaseInfo const& ) {} - - Ptr m_config; - std::ostream& stream; - std::vector m_assertions; - std::vector > > m_sections; - std::vector > m_testCases; - std::vector > m_testGroups; - - std::vector > m_testRuns; - - Ptr m_rootSection; - Ptr m_deepestSection; - std::vector > m_sectionStack; - - }; - - template - char const* getLineOfChars() { - static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0}; - if( !*line ) { - memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 ); - line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0; - } - return line; - } - -} // end namespace Catch - -// #included from: ../internal/catch_reporter_registrars.hpp -#define TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED - -namespace Catch { - - template - class LegacyReporterRegistrar { - - class ReporterFactory : public IReporterFactory { - virtual IStreamingReporter* create( ReporterConfig const& config ) const { - return new LegacyReporterAdapter( new T( config ) ); - } - - virtual std::string getDescription() const { - return T::getDescription(); - } - }; - - public: - - LegacyReporterRegistrar( std::string const& name ) { - getMutableRegistryHub().registerReporter( name, new ReporterFactory() ); - } - }; - - template - class ReporterRegistrar { - - class ReporterFactory : public IReporterFactory { - - // *** Please Note ***: - // - If you end up here looking at a compiler error because it's trying to register - // your custom reporter class be aware that the native reporter interface has changed - // to IStreamingReporter. The "legacy" interface, IReporter, is still supported via - // an adapter. Just use REGISTER_LEGACY_REPORTER to take advantage of the adapter. - // However please consider updating to the new interface as the old one is now - // deprecated and will probably be removed quite soon! - // Please contact me via github if you have any questions at all about this. - // In fact, ideally, please contact me anyway to let me know you've hit this - as I have - // no idea who is actually using custom reporters at all (possibly no-one!). - // The new interface is designed to minimise exposure to interface changes in the future. - virtual IStreamingReporter* create( ReporterConfig const& config ) const { - return new T( config ); - } - - virtual std::string getDescription() const { - return T::getDescription(); - } - }; - - public: - - ReporterRegistrar( std::string const& name ) { - getMutableRegistryHub().registerReporter( name, new ReporterFactory() ); - } - }; -} - -#define INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) \ - namespace{ Catch::LegacyReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); } -#define INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) \ - namespace{ Catch::ReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); } - -// #included from: ../internal/catch_xmlwriter.hpp -#define TWOBLUECUBES_CATCH_XMLWRITER_HPP_INCLUDED - -#include -#include -#include - -namespace Catch { - - class XmlWriter { - public: - - class ScopedElement { - public: - ScopedElement( XmlWriter* writer ) - : m_writer( writer ) - {} - - ScopedElement( ScopedElement const& other ) - : m_writer( other.m_writer ){ - other.m_writer = NULL; - } - - ~ScopedElement() { - if( m_writer ) - m_writer->endElement(); - } - - ScopedElement& writeText( std::string const& text, bool indent = true ) { - m_writer->writeText( text, indent ); - return *this; - } - - template - ScopedElement& writeAttribute( std::string const& name, T const& attribute ) { - m_writer->writeAttribute( name, attribute ); - return *this; - } - - private: - mutable XmlWriter* m_writer; - }; - - XmlWriter() - : m_tagIsOpen( false ), - m_needsNewline( false ), - m_os( &Catch::cout() ) - {} - - XmlWriter( std::ostream& os ) - : m_tagIsOpen( false ), - m_needsNewline( false ), - m_os( &os ) - {} - - ~XmlWriter() { - while( !m_tags.empty() ) - endElement(); - } - -//# ifndef CATCH_CPP11_OR_GREATER -// XmlWriter& operator = ( XmlWriter const& other ) { -// XmlWriter temp( other ); -// swap( temp ); -// return *this; -// } -//# else -// XmlWriter( XmlWriter const& ) = default; -// XmlWriter( XmlWriter && ) = default; -// XmlWriter& operator = ( XmlWriter const& ) = default; -// XmlWriter& operator = ( XmlWriter && ) = default; -//# endif -// -// void swap( XmlWriter& other ) { -// std::swap( m_tagIsOpen, other.m_tagIsOpen ); -// std::swap( m_needsNewline, other.m_needsNewline ); -// std::swap( m_tags, other.m_tags ); -// std::swap( m_indent, other.m_indent ); -// std::swap( m_os, other.m_os ); -// } - - XmlWriter& startElement( std::string const& name ) { - ensureTagClosed(); - newlineIfNecessary(); - stream() << m_indent << "<" << name; - m_tags.push_back( name ); - m_indent += " "; - m_tagIsOpen = true; - return *this; - } - - ScopedElement scopedElement( std::string const& name ) { - ScopedElement scoped( this ); - startElement( name ); - return scoped; - } - - XmlWriter& endElement() { - newlineIfNecessary(); - m_indent = m_indent.substr( 0, m_indent.size()-2 ); - if( m_tagIsOpen ) { - stream() << "/>\n"; - m_tagIsOpen = false; - } - else { - stream() << m_indent << "\n"; - } - m_tags.pop_back(); - return *this; - } - - XmlWriter& writeAttribute( std::string const& name, std::string const& attribute ) { - if( !name.empty() && !attribute.empty() ) { - stream() << " " << name << "=\""; - writeEncodedText( attribute ); - stream() << "\""; - } - return *this; - } - - XmlWriter& writeAttribute( std::string const& name, bool attribute ) { - stream() << " " << name << "=\"" << ( attribute ? "true" : "false" ) << "\""; - return *this; - } - - template - XmlWriter& writeAttribute( std::string const& name, T const& attribute ) { - if( !name.empty() ) - stream() << " " << name << "=\"" << attribute << "\""; - return *this; - } - - XmlWriter& writeText( std::string const& text, bool indent = true ) { - if( !text.empty() ){ - bool tagWasOpen = m_tagIsOpen; - ensureTagClosed(); - if( tagWasOpen && indent ) - stream() << m_indent; - writeEncodedText( text ); - m_needsNewline = true; - } - return *this; - } - - XmlWriter& writeComment( std::string const& text ) { - ensureTagClosed(); - stream() << m_indent << ""; - m_needsNewline = true; - return *this; - } - - XmlWriter& writeBlankLine() { - ensureTagClosed(); - stream() << "\n"; - return *this; - } - - void setStream( std::ostream& os ) { - m_os = &os; - } - - private: - XmlWriter( XmlWriter const& ); - void operator=( XmlWriter const& ); - - std::ostream& stream() { - return *m_os; - } - - void ensureTagClosed() { - if( m_tagIsOpen ) { - stream() << ">\n"; - m_tagIsOpen = false; - } - } - - void newlineIfNecessary() { - if( m_needsNewline ) { - stream() << "\n"; - m_needsNewline = false; - } - } - - void writeEncodedText( std::string const& text ) { - static const char* charsToEncode = "<&\""; - std::string mtext = text; - std::string::size_type pos = mtext.find_first_of( charsToEncode ); - while( pos != std::string::npos ) { - stream() << mtext.substr( 0, pos ); - - switch( mtext[pos] ) { - case '<': - stream() << "<"; - break; - case '&': - stream() << "&"; - break; - case '\"': - stream() << """; - break; - } - mtext = mtext.substr( pos+1 ); - pos = mtext.find_first_of( charsToEncode ); - } - stream() << mtext; - } - - bool m_tagIsOpen; - bool m_needsNewline; - std::vector m_tags; - std::string m_indent; - std::ostream* m_os; - }; - -} -namespace Catch { - class XmlReporter : public StreamingReporterBase { - public: - XmlReporter( ReporterConfig const& _config ) - : StreamingReporterBase( _config ), - m_sectionDepth( 0 ) - {} - - virtual ~XmlReporter(); - - static std::string getDescription() { - return "Reports test results as an XML document"; - } - - public: // StreamingReporterBase - virtual ReporterPreferences getPreferences() const { - ReporterPreferences prefs; - prefs.shouldRedirectStdOut = true; - return prefs; - } - - virtual void noMatchingTestCases( std::string const& s ) { - StreamingReporterBase::noMatchingTestCases( s ); - } - - virtual void testRunStarting( TestRunInfo const& testInfo ) { - StreamingReporterBase::testRunStarting( testInfo ); - m_xml.setStream( stream ); - m_xml.startElement( "Catch" ); - if( !m_config->name().empty() ) - m_xml.writeAttribute( "name", m_config->name() ); - } - - virtual void testGroupStarting( GroupInfo const& groupInfo ) { - StreamingReporterBase::testGroupStarting( groupInfo ); - m_xml.startElement( "Group" ) - .writeAttribute( "name", groupInfo.name ); - } - - virtual void testCaseStarting( TestCaseInfo const& testInfo ) { - StreamingReporterBase::testCaseStarting(testInfo); - m_xml.startElement( "TestCase" ).writeAttribute( "name", trim( testInfo.name ) ); - - if ( m_config->showDurations() == ShowDurations::Always ) - m_testCaseTimer.start(); - } - - virtual void sectionStarting( SectionInfo const& sectionInfo ) { - StreamingReporterBase::sectionStarting( sectionInfo ); - if( m_sectionDepth++ > 0 ) { - m_xml.startElement( "Section" ) - .writeAttribute( "name", trim( sectionInfo.name ) ) - .writeAttribute( "description", sectionInfo.description ); - } - } - - virtual void assertionStarting( AssertionInfo const& ) { } - - virtual bool assertionEnded( AssertionStats const& assertionStats ) { - const AssertionResult& assertionResult = assertionStats.assertionResult; - - // Print any info messages in tags. - if( assertionStats.assertionResult.getResultType() != ResultWas::Ok ) { - for( std::vector::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end(); - it != itEnd; - ++it ) { - if( it->type == ResultWas::Info ) { - m_xml.scopedElement( "Info" ) - .writeText( it->message ); - } else if ( it->type == ResultWas::Warning ) { - m_xml.scopedElement( "Warning" ) - .writeText( it->message ); - } - } - } - - // Drop out if result was successful but we're not printing them. - if( !m_config->includeSuccessfulResults() && isOk(assertionResult.getResultType()) ) - return true; - - // Print the expression if there is one. - if( assertionResult.hasExpression() ) { - m_xml.startElement( "Expression" ) - .writeAttribute( "success", assertionResult.succeeded() ) - .writeAttribute( "type", assertionResult.getTestMacroName() ) - .writeAttribute( "filename", assertionResult.getSourceInfo().file ) - .writeAttribute( "line", assertionResult.getSourceInfo().line ); - - m_xml.scopedElement( "Original" ) - .writeText( assertionResult.getExpression() ); - m_xml.scopedElement( "Expanded" ) - .writeText( assertionResult.getExpandedExpression() ); - } - - // And... Print a result applicable to each result type. - switch( assertionResult.getResultType() ) { - case ResultWas::ThrewException: - m_xml.scopedElement( "Exception" ) - .writeAttribute( "filename", assertionResult.getSourceInfo().file ) - .writeAttribute( "line", assertionResult.getSourceInfo().line ) - .writeText( assertionResult.getMessage() ); - break; - case ResultWas::FatalErrorCondition: - m_xml.scopedElement( "Fatal Error Condition" ) - .writeAttribute( "filename", assertionResult.getSourceInfo().file ) - .writeAttribute( "line", assertionResult.getSourceInfo().line ) - .writeText( assertionResult.getMessage() ); - break; - case ResultWas::Info: - m_xml.scopedElement( "Info" ) - .writeText( assertionResult.getMessage() ); - break; - case ResultWas::Warning: - // Warning will already have been written - break; - case ResultWas::ExplicitFailure: - m_xml.scopedElement( "Failure" ) - .writeText( assertionResult.getMessage() ); - break; - default: - break; - } - - if( assertionResult.hasExpression() ) - m_xml.endElement(); - - return true; - } - - virtual void sectionEnded( SectionStats const& sectionStats ) { - StreamingReporterBase::sectionEnded( sectionStats ); - if( --m_sectionDepth > 0 ) { - XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResults" ); - e.writeAttribute( "successes", sectionStats.assertions.passed ); - e.writeAttribute( "failures", sectionStats.assertions.failed ); - e.writeAttribute( "expectedFailures", sectionStats.assertions.failedButOk ); - - if ( m_config->showDurations() == ShowDurations::Always ) - e.writeAttribute( "durationInSeconds", sectionStats.durationInSeconds ); - - m_xml.endElement(); - } - } - - virtual void testCaseEnded( TestCaseStats const& testCaseStats ) { - StreamingReporterBase::testCaseEnded( testCaseStats ); - XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResult" ); - e.writeAttribute( "success", testCaseStats.totals.assertions.allOk() ); - - if ( m_config->showDurations() == ShowDurations::Always ) - e.writeAttribute( "durationInSeconds", m_testCaseTimer.getElapsedSeconds() ); - - m_xml.endElement(); - } - - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) { - StreamingReporterBase::testGroupEnded( testGroupStats ); - // TODO: Check testGroupStats.aborting and act accordingly. - m_xml.scopedElement( "OverallResults" ) - .writeAttribute( "successes", testGroupStats.totals.assertions.passed ) - .writeAttribute( "failures", testGroupStats.totals.assertions.failed ) - .writeAttribute( "expectedFailures", testGroupStats.totals.assertions.failedButOk ); - m_xml.endElement(); - } - - virtual void testRunEnded( TestRunStats const& testRunStats ) { - StreamingReporterBase::testRunEnded( testRunStats ); - m_xml.scopedElement( "OverallResults" ) - .writeAttribute( "successes", testRunStats.totals.assertions.passed ) - .writeAttribute( "failures", testRunStats.totals.assertions.failed ) - .writeAttribute( "expectedFailures", testRunStats.totals.assertions.failedButOk ); - m_xml.endElement(); - } - - private: - Timer m_testCaseTimer; - XmlWriter m_xml; - int m_sectionDepth; - }; - - INTERNAL_CATCH_REGISTER_REPORTER( "xml", XmlReporter ) - -} // end namespace Catch - -// #included from: ../reporters/catch_reporter_junit.hpp -#define TWOBLUECUBES_CATCH_REPORTER_JUNIT_HPP_INCLUDED - -#include - -namespace Catch { - - class JunitReporter : public CumulativeReporterBase { - public: - JunitReporter( ReporterConfig const& _config ) - : CumulativeReporterBase( _config ), - xml( _config.stream() ) - {} - - ~JunitReporter(); - - static std::string getDescription() { - return "Reports test results in an XML format that looks like Ant's junitreport target"; - } - - virtual void noMatchingTestCases( std::string const& /*spec*/ ) {} - - virtual ReporterPreferences getPreferences() const { - ReporterPreferences prefs; - prefs.shouldRedirectStdOut = true; - return prefs; - } - - virtual void testRunStarting( TestRunInfo const& runInfo ) { - CumulativeReporterBase::testRunStarting( runInfo ); - xml.startElement( "testsuites" ); - } - - virtual void testGroupStarting( GroupInfo const& groupInfo ) { - suiteTimer.start(); - stdOutForSuite.str(""); - stdErrForSuite.str(""); - unexpectedExceptions = 0; - CumulativeReporterBase::testGroupStarting( groupInfo ); - } - - virtual bool assertionEnded( AssertionStats const& assertionStats ) { - if( assertionStats.assertionResult.getResultType() == ResultWas::ThrewException ) - unexpectedExceptions++; - return CumulativeReporterBase::assertionEnded( assertionStats ); - } - - virtual void testCaseEnded( TestCaseStats const& testCaseStats ) { - stdOutForSuite << testCaseStats.stdOut; - stdErrForSuite << testCaseStats.stdErr; - CumulativeReporterBase::testCaseEnded( testCaseStats ); - } - - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) { - double suiteTime = suiteTimer.getElapsedSeconds(); - CumulativeReporterBase::testGroupEnded( testGroupStats ); - writeGroup( *m_testGroups.back(), suiteTime ); - } - - virtual void testRunEndedCumulative() { - xml.endElement(); - } - - void writeGroup( TestGroupNode const& groupNode, double suiteTime ) { - XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" ); - TestGroupStats const& stats = groupNode.value; - xml.writeAttribute( "name", stats.groupInfo.name ); - xml.writeAttribute( "errors", unexpectedExceptions ); - xml.writeAttribute( "failures", stats.totals.assertions.failed-unexpectedExceptions ); - xml.writeAttribute( "tests", stats.totals.assertions.total() ); - xml.writeAttribute( "hostname", "tbd" ); // !TBD - if( m_config->showDurations() == ShowDurations::Never ) - xml.writeAttribute( "time", "" ); - else - xml.writeAttribute( "time", suiteTime ); - xml.writeAttribute( "timestamp", "tbd" ); // !TBD - - // Write test cases - for( TestGroupNode::ChildNodes::const_iterator - it = groupNode.children.begin(), itEnd = groupNode.children.end(); - it != itEnd; - ++it ) - writeTestCase( **it ); - - xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite.str() ), false ); - xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite.str() ), false ); - } - - void writeTestCase( TestCaseNode const& testCaseNode ) { - TestCaseStats const& stats = testCaseNode.value; - - // All test cases have exactly one section - which represents the - // test case itself. That section may have 0-n nested sections - assert( testCaseNode.children.size() == 1 ); - SectionNode const& rootSection = *testCaseNode.children.front(); - - std::string className = stats.testInfo.className; - - if( className.empty() ) { - if( rootSection.childSections.empty() ) - className = "global"; - } - writeSection( className, "", rootSection ); - } - - void writeSection( std::string const& className, - std::string const& rootName, - SectionNode const& sectionNode ) { - std::string name = trim( sectionNode.stats.sectionInfo.name ); - if( !rootName.empty() ) - name = rootName + "/" + name; - - if( !sectionNode.assertions.empty() || - !sectionNode.stdOut.empty() || - !sectionNode.stdErr.empty() ) { - XmlWriter::ScopedElement e = xml.scopedElement( "testcase" ); - if( className.empty() ) { - xml.writeAttribute( "classname", name ); - xml.writeAttribute( "name", "root" ); - } - else { - xml.writeAttribute( "classname", className ); - xml.writeAttribute( "name", name ); - } - xml.writeAttribute( "time", Catch::toString( sectionNode.stats.durationInSeconds ) ); - - writeAssertions( sectionNode ); - - if( !sectionNode.stdOut.empty() ) - xml.scopedElement( "system-out" ).writeText( trim( sectionNode.stdOut ), false ); - if( !sectionNode.stdErr.empty() ) - xml.scopedElement( "system-err" ).writeText( trim( sectionNode.stdErr ), false ); - } - for( SectionNode::ChildSections::const_iterator - it = sectionNode.childSections.begin(), - itEnd = sectionNode.childSections.end(); - it != itEnd; - ++it ) - if( className.empty() ) - writeSection( name, "", **it ); - else - writeSection( className, name, **it ); - } - - void writeAssertions( SectionNode const& sectionNode ) { - for( SectionNode::Assertions::const_iterator - it = sectionNode.assertions.begin(), itEnd = sectionNode.assertions.end(); - it != itEnd; - ++it ) - writeAssertion( *it ); - } - void writeAssertion( AssertionStats const& stats ) { - AssertionResult const& result = stats.assertionResult; - if( !result.isOk() ) { - std::string elementName; - switch( result.getResultType() ) { - case ResultWas::ThrewException: - case ResultWas::FatalErrorCondition: - elementName = "error"; - break; - case ResultWas::ExplicitFailure: - elementName = "failure"; - break; - case ResultWas::ExpressionFailed: - elementName = "failure"; - break; - case ResultWas::DidntThrowException: - elementName = "failure"; - break; - - // We should never see these here: - case ResultWas::Info: - case ResultWas::Warning: - case ResultWas::Ok: - case ResultWas::Unknown: - case ResultWas::FailureBit: - case ResultWas::Exception: - elementName = "internalError"; - break; - } - - XmlWriter::ScopedElement e = xml.scopedElement( elementName ); - - xml.writeAttribute( "message", result.getExpandedExpression() ); - xml.writeAttribute( "type", result.getTestMacroName() ); - - std::ostringstream oss; - if( !result.getMessage().empty() ) - oss << result.getMessage() << "\n"; - for( std::vector::const_iterator - it = stats.infoMessages.begin(), - itEnd = stats.infoMessages.end(); - it != itEnd; - ++it ) - if( it->type == ResultWas::Info ) - oss << it->message << "\n"; - - oss << "at " << result.getSourceInfo(); - xml.writeText( oss.str(), false ); - } - } - - XmlWriter xml; - Timer suiteTimer; - std::ostringstream stdOutForSuite; - std::ostringstream stdErrForSuite; - unsigned int unexpectedExceptions; - }; - - INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter ) - -} // end namespace Catch - -// #included from: ../reporters/catch_reporter_console.hpp -#define TWOBLUECUBES_CATCH_REPORTER_CONSOLE_HPP_INCLUDED - -namespace Catch { - - struct ConsoleReporter : StreamingReporterBase { - ConsoleReporter( ReporterConfig const& _config ) - : StreamingReporterBase( _config ), - m_headerPrinted( false ) - {} - - virtual ~ConsoleReporter(); - static std::string getDescription() { - return "Reports test results as plain lines of text"; - } - virtual ReporterPreferences getPreferences() const { - ReporterPreferences prefs; - prefs.shouldRedirectStdOut = false; - return prefs; - } - - virtual void noMatchingTestCases( std::string const& spec ) { - stream << "No test cases matched '" << spec << "'" << std::endl; - } - - virtual void assertionStarting( AssertionInfo const& ) { - } - - virtual bool assertionEnded( AssertionStats const& _assertionStats ) { - AssertionResult const& result = _assertionStats.assertionResult; - - bool printInfoMessages = true; - - // Drop out if result was successful and we're not printing those - if( !m_config->includeSuccessfulResults() && result.isOk() ) { - if( result.getResultType() != ResultWas::Warning ) - return false; - printInfoMessages = false; - } - - lazyPrint(); - - AssertionPrinter printer( stream, _assertionStats, printInfoMessages ); - printer.print(); - stream << std::endl; - return true; - } - - virtual void sectionStarting( SectionInfo const& _sectionInfo ) { - m_headerPrinted = false; - StreamingReporterBase::sectionStarting( _sectionInfo ); - } - virtual void sectionEnded( SectionStats const& _sectionStats ) { - if( _sectionStats.missingAssertions ) { - lazyPrint(); - Colour colour( Colour::ResultError ); - if( m_sectionStack.size() > 1 ) - stream << "\nNo assertions in section"; - else - stream << "\nNo assertions in test case"; - stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; - } - if( m_headerPrinted ) { - if( m_config->showDurations() == ShowDurations::Always ) - stream << "Completed in " << _sectionStats.durationInSeconds << "s" << std::endl; - m_headerPrinted = false; - } - else { - if( m_config->showDurations() == ShowDurations::Always ) - stream << _sectionStats.sectionInfo.name << " completed in " << _sectionStats.durationInSeconds << "s" << std::endl; - } - StreamingReporterBase::sectionEnded( _sectionStats ); - } - - virtual void testCaseEnded( TestCaseStats const& _testCaseStats ) { - StreamingReporterBase::testCaseEnded( _testCaseStats ); - m_headerPrinted = false; - } - virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) { - if( currentGroupInfo.used ) { - printSummaryDivider(); - stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n"; - printTotals( _testGroupStats.totals ); - stream << "\n" << std::endl; - } - StreamingReporterBase::testGroupEnded( _testGroupStats ); - } - virtual void testRunEnded( TestRunStats const& _testRunStats ) { - printTotalsDivider( _testRunStats.totals ); - printTotals( _testRunStats.totals ); - stream << std::endl; - StreamingReporterBase::testRunEnded( _testRunStats ); - } - - private: - - class AssertionPrinter { - void operator= ( AssertionPrinter const& ); - public: - AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages ) - : stream( _stream ), - stats( _stats ), - result( _stats.assertionResult ), - colour( Colour::None ), - message( result.getMessage() ), - messages( _stats.infoMessages ), - printInfoMessages( _printInfoMessages ) - { - switch( result.getResultType() ) { - case ResultWas::Ok: - colour = Colour::Success; - passOrFail = "PASSED"; - //if( result.hasMessage() ) - if( _stats.infoMessages.size() == 1 ) - messageLabel = "with message"; - if( _stats.infoMessages.size() > 1 ) - messageLabel = "with messages"; - break; - case ResultWas::ExpressionFailed: - if( result.isOk() ) { - colour = Colour::Success; - passOrFail = "FAILED - but was ok"; - } - else { - colour = Colour::Error; - passOrFail = "FAILED"; - } - if( _stats.infoMessages.size() == 1 ) - messageLabel = "with message"; - if( _stats.infoMessages.size() > 1 ) - messageLabel = "with messages"; - break; - case ResultWas::ThrewException: - colour = Colour::Error; - passOrFail = "FAILED"; - messageLabel = "due to unexpected exception with message"; - break; - case ResultWas::FatalErrorCondition: - colour = Colour::Error; - passOrFail = "FAILED"; - messageLabel = "due to a fatal error condition"; - break; - case ResultWas::DidntThrowException: - colour = Colour::Error; - passOrFail = "FAILED"; - messageLabel = "because no exception was thrown where one was expected"; - break; - case ResultWas::Info: - messageLabel = "info"; - break; - case ResultWas::Warning: - messageLabel = "warning"; - break; - case ResultWas::ExplicitFailure: - passOrFail = "FAILED"; - colour = Colour::Error; - if( _stats.infoMessages.size() == 1 ) - messageLabel = "explicitly with message"; - if( _stats.infoMessages.size() > 1 ) - messageLabel = "explicitly with messages"; - break; - // These cases are here to prevent compiler warnings - case ResultWas::Unknown: - case ResultWas::FailureBit: - case ResultWas::Exception: - passOrFail = "** internal error **"; - colour = Colour::Error; - break; - } - } - - void print() const { - printSourceInfo(); - if( stats.totals.assertions.total() > 0 ) { - if( result.isOk() ) - stream << "\n"; - printResultType(); - printOriginalExpression(); - printReconstructedExpression(); - } - else { - stream << "\n"; - } - printMessage(); - } - - private: - void printResultType() const { - if( !passOrFail.empty() ) { - Colour colourGuard( colour ); - stream << passOrFail << ":\n"; - } - } - void printOriginalExpression() const { - if( result.hasExpression() ) { - Colour colourGuard( Colour::OriginalExpression ); - stream << " "; - stream << result.getExpressionInMacro(); - stream << "\n"; - } - } - void printReconstructedExpression() const { - if( result.hasExpandedExpression() ) { - stream << "with expansion:\n"; - Colour colourGuard( Colour::ReconstructedExpression ); - stream << Text( result.getExpandedExpression(), TextAttributes().setIndent(2) ) << "\n"; - } - } - void printMessage() const { - if( !messageLabel.empty() ) - stream << messageLabel << ":" << "\n"; - for( std::vector::const_iterator it = messages.begin(), itEnd = messages.end(); - it != itEnd; - ++it ) { - // If this assertion is a warning ignore any INFO messages - if( printInfoMessages || it->type != ResultWas::Info ) - stream << Text( it->message, TextAttributes().setIndent(2) ) << "\n"; - } - } - void printSourceInfo() const { - Colour colourGuard( Colour::FileName ); - stream << result.getSourceInfo() << ": "; - } - - std::ostream& stream; - AssertionStats const& stats; - AssertionResult const& result; - Colour::Code colour; - std::string passOrFail; - std::string messageLabel; - std::string message; - std::vector messages; - bool printInfoMessages; - }; - - void lazyPrint() { - - if( !currentTestRunInfo.used ) - lazyPrintRunInfo(); - if( !currentGroupInfo.used ) - lazyPrintGroupInfo(); - - if( !m_headerPrinted ) { - printTestCaseAndSectionHeader(); - m_headerPrinted = true; - } - } - void lazyPrintRunInfo() { - stream << "\n" << getLineOfChars<'~'>() << "\n"; - Colour colour( Colour::SecondaryText ); - stream << currentTestRunInfo->name - << " is a Catch v" << libraryVersion.majorVersion << "." - << libraryVersion.minorVersion << " b" - << libraryVersion.buildNumber; - if( libraryVersion.branchName != std::string( "master" ) ) - stream << " (" << libraryVersion.branchName << ")"; - stream << " host application.\n" - << "Run with -? for options\n\n"; - - if( m_config->rngSeed() != 0 ) - stream << "Randomness seeded to: " << m_config->rngSeed() << "\n\n"; - - currentTestRunInfo.used = true; - } - void lazyPrintGroupInfo() { - if( !currentGroupInfo->name.empty() && currentGroupInfo->groupsCounts > 1 ) { - printClosedHeader( "Group: " + currentGroupInfo->name ); - currentGroupInfo.used = true; - } - } - void printTestCaseAndSectionHeader() { - assert( !m_sectionStack.empty() ); - printOpenHeader( currentTestCaseInfo->name ); - - if( m_sectionStack.size() > 1 ) { - Colour colourGuard( Colour::Headers ); - - std::vector::const_iterator - it = m_sectionStack.begin()+1, // Skip first section (test case) - itEnd = m_sectionStack.end(); - for( ; it != itEnd; ++it ) - printHeaderString( it->name, 2 ); - } - - SourceLineInfo lineInfo = m_sectionStack.front().lineInfo; - - if( !lineInfo.empty() ){ - stream << getLineOfChars<'-'>() << "\n"; - Colour colourGuard( Colour::FileName ); - stream << lineInfo << "\n"; - } - stream << getLineOfChars<'.'>() << "\n" << std::endl; - } - - void printClosedHeader( std::string const& _name ) { - printOpenHeader( _name ); - stream << getLineOfChars<'.'>() << "\n"; - } - void printOpenHeader( std::string const& _name ) { - stream << getLineOfChars<'-'>() << "\n"; - { - Colour colourGuard( Colour::Headers ); - printHeaderString( _name ); - } - } - - // if string has a : in first line will set indent to follow it on - // subsequent lines - void printHeaderString( std::string const& _string, std::size_t indent = 0 ) { - std::size_t i = _string.find( ": " ); - if( i != std::string::npos ) - i+=2; - else - i = 0; - stream << Text( _string, TextAttributes() - .setIndent( indent+i) - .setInitialIndent( indent ) ) << "\n"; - } - - struct SummaryColumn { - - SummaryColumn( std::string const& _label, Colour::Code _colour ) - : label( _label ), - colour( _colour ) - {} - SummaryColumn addRow( std::size_t count ) { - std::ostringstream oss; - oss << count; - std::string row = oss.str(); - for( std::vector::iterator it = rows.begin(); it != rows.end(); ++it ) { - while( it->size() < row.size() ) - *it = " " + *it; - while( it->size() > row.size() ) - row = " " + row; - } - rows.push_back( row ); - return *this; - } - - std::string label; - Colour::Code colour; - std::vector rows; - - }; - - void printTotals( Totals const& totals ) { - if( totals.testCases.total() == 0 ) { - stream << Colour( Colour::Warning ) << "No tests ran\n"; - } - else if( totals.assertions.total() > 0 && totals.assertions.allPassed() ) { - stream << Colour( Colour::ResultSuccess ) << "All tests passed"; - stream << " (" - << pluralise( totals.assertions.passed, "assertion" ) << " in " - << pluralise( totals.testCases.passed, "test case" ) << ")" - << "\n"; - } - else { - - std::vector columns; - columns.push_back( SummaryColumn( "", Colour::None ) - .addRow( totals.testCases.total() ) - .addRow( totals.assertions.total() ) ); - columns.push_back( SummaryColumn( "passed", Colour::Success ) - .addRow( totals.testCases.passed ) - .addRow( totals.assertions.passed ) ); - columns.push_back( SummaryColumn( "failed", Colour::ResultError ) - .addRow( totals.testCases.failed ) - .addRow( totals.assertions.failed ) ); - columns.push_back( SummaryColumn( "failed as expected", Colour::ResultExpectedFailure ) - .addRow( totals.testCases.failedButOk ) - .addRow( totals.assertions.failedButOk ) ); - - printSummaryRow( "test cases", columns, 0 ); - printSummaryRow( "assertions", columns, 1 ); - } - } - void printSummaryRow( std::string const& label, std::vector const& cols, std::size_t row ) { - for( std::vector::const_iterator it = cols.begin(); it != cols.end(); ++it ) { - std::string value = it->rows[row]; - if( it->label.empty() ) { - stream << label << ": "; - if( value != "0" ) - stream << value; - else - stream << Colour( Colour::Warning ) << "- none -"; - } - else if( value != "0" ) { - stream << Colour( Colour::LightGrey ) << " | "; - stream << Colour( it->colour ) - << value << " " << it->label; - } - } - stream << "\n"; - } - - static std::size_t makeRatio( std::size_t number, std::size_t total ) { - std::size_t ratio = total > 0 ? CATCH_CONFIG_CONSOLE_WIDTH * number/ total : 0; - return ( ratio == 0 && number > 0 ) ? 1 : ratio; - } - static std::size_t& findMax( std::size_t& i, std::size_t& j, std::size_t& k ) { - if( i > j && i > k ) - return i; - else if( j > k ) - return j; - else - return k; - } - - void printTotalsDivider( Totals const& totals ) { - if( totals.testCases.total() > 0 ) { - std::size_t failedRatio = makeRatio( totals.testCases.failed, totals.testCases.total() ); - std::size_t failedButOkRatio = makeRatio( totals.testCases.failedButOk, totals.testCases.total() ); - std::size_t passedRatio = makeRatio( totals.testCases.passed, totals.testCases.total() ); - while( failedRatio + failedButOkRatio + passedRatio < CATCH_CONFIG_CONSOLE_WIDTH-1 ) - findMax( failedRatio, failedButOkRatio, passedRatio )++; - while( failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH-1 ) - findMax( failedRatio, failedButOkRatio, passedRatio )--; - - stream << Colour( Colour::Error ) << std::string( failedRatio, '=' ); - stream << Colour( Colour::ResultExpectedFailure ) << std::string( failedButOkRatio, '=' ); - if( totals.testCases.allPassed() ) - stream << Colour( Colour::ResultSuccess ) << std::string( passedRatio, '=' ); - else - stream << Colour( Colour::Success ) << std::string( passedRatio, '=' ); - } - else { - stream << Colour( Colour::Warning ) << std::string( CATCH_CONFIG_CONSOLE_WIDTH-1, '=' ); - } - stream << "\n"; - } - void printSummaryDivider() { - stream << getLineOfChars<'-'>() << "\n"; - } - - private: - bool m_headerPrinted; - }; - - INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter ) - -} // end namespace Catch - -// #included from: ../reporters/catch_reporter_compact.hpp -#define TWOBLUECUBES_CATCH_REPORTER_COMPACT_HPP_INCLUDED - -namespace Catch { - - struct CompactReporter : StreamingReporterBase { - - CompactReporter( ReporterConfig const& _config ) - : StreamingReporterBase( _config ) - {} - - virtual ~CompactReporter(); - - static std::string getDescription() { - return "Reports test results on a single line, suitable for IDEs"; - } - - virtual ReporterPreferences getPreferences() const { - ReporterPreferences prefs; - prefs.shouldRedirectStdOut = false; - return prefs; - } - - virtual void noMatchingTestCases( std::string const& spec ) { - stream << "No test cases matched '" << spec << "'" << std::endl; - } - - virtual void assertionStarting( AssertionInfo const& ) { - } - - virtual bool assertionEnded( AssertionStats const& _assertionStats ) { - AssertionResult const& result = _assertionStats.assertionResult; - - bool printInfoMessages = true; - - // Drop out if result was successful and we're not printing those - if( !m_config->includeSuccessfulResults() && result.isOk() ) { - if( result.getResultType() != ResultWas::Warning ) - return false; - printInfoMessages = false; - } - - AssertionPrinter printer( stream, _assertionStats, printInfoMessages ); - printer.print(); - - stream << std::endl; - return true; - } - - virtual void testRunEnded( TestRunStats const& _testRunStats ) { - printTotals( _testRunStats.totals ); - stream << "\n" << std::endl; - StreamingReporterBase::testRunEnded( _testRunStats ); - } - - private: - class AssertionPrinter { - void operator= ( AssertionPrinter const& ); - public: - AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages ) - : stream( _stream ) - , stats( _stats ) - , result( _stats.assertionResult ) - , messages( _stats.infoMessages ) - , itMessage( _stats.infoMessages.begin() ) - , printInfoMessages( _printInfoMessages ) - {} - - void print() { - printSourceInfo(); - - itMessage = messages.begin(); - - switch( result.getResultType() ) { - case ResultWas::Ok: - printResultType( Colour::ResultSuccess, passedString() ); - printOriginalExpression(); - printReconstructedExpression(); - if ( ! result.hasExpression() ) - printRemainingMessages( Colour::None ); - else - printRemainingMessages(); - break; - case ResultWas::ExpressionFailed: - if( result.isOk() ) - printResultType( Colour::ResultSuccess, failedString() + std::string( " - but was ok" ) ); - else - printResultType( Colour::Error, failedString() ); - printOriginalExpression(); - printReconstructedExpression(); - printRemainingMessages(); - break; - case ResultWas::ThrewException: - printResultType( Colour::Error, failedString() ); - printIssue( "unexpected exception with message:" ); - printMessage(); - printExpressionWas(); - printRemainingMessages(); - break; - case ResultWas::FatalErrorCondition: - printResultType( Colour::Error, failedString() ); - printIssue( "fatal error condition with message:" ); - printMessage(); - printExpressionWas(); - printRemainingMessages(); - break; - case ResultWas::DidntThrowException: - printResultType( Colour::Error, failedString() ); - printIssue( "expected exception, got none" ); - printExpressionWas(); - printRemainingMessages(); - break; - case ResultWas::Info: - printResultType( Colour::None, "info" ); - printMessage(); - printRemainingMessages(); - break; - case ResultWas::Warning: - printResultType( Colour::None, "warning" ); - printMessage(); - printRemainingMessages(); - break; - case ResultWas::ExplicitFailure: - printResultType( Colour::Error, failedString() ); - printIssue( "explicitly" ); - printRemainingMessages( Colour::None ); - break; - // These cases are here to prevent compiler warnings - case ResultWas::Unknown: - case ResultWas::FailureBit: - case ResultWas::Exception: - printResultType( Colour::Error, "** internal error **" ); - break; - } - } - - private: - // Colour::LightGrey - - static Colour::Code dimColour() { return Colour::FileName; } - -#ifdef CATCH_PLATFORM_MAC - static const char* failedString() { return "FAILED"; } - static const char* passedString() { return "PASSED"; } -#else - static const char* failedString() { return "failed"; } - static const char* passedString() { return "passed"; } -#endif - - void printSourceInfo() const { - Colour colourGuard( Colour::FileName ); - stream << result.getSourceInfo() << ":"; - } - - void printResultType( Colour::Code colour, std::string passOrFail ) const { - if( !passOrFail.empty() ) { - { - Colour colourGuard( colour ); - stream << " " << passOrFail; - } - stream << ":"; - } - } - - void printIssue( std::string issue ) const { - stream << " " << issue; - } - - void printExpressionWas() { - if( result.hasExpression() ) { - stream << ";"; - { - Colour colour( dimColour() ); - stream << " expression was:"; - } - printOriginalExpression(); - } - } - - void printOriginalExpression() const { - if( result.hasExpression() ) { - stream << " " << result.getExpression(); - } - } - - void printReconstructedExpression() const { - if( result.hasExpandedExpression() ) { - { - Colour colour( dimColour() ); - stream << " for: "; - } - stream << result.getExpandedExpression(); - } - } - - void printMessage() { - if ( itMessage != messages.end() ) { - stream << " '" << itMessage->message << "'"; - ++itMessage; - } - } - - void printRemainingMessages( Colour::Code colour = dimColour() ) { - if ( itMessage == messages.end() ) - return; - - // using messages.end() directly yields compilation error: - std::vector::const_iterator itEnd = messages.end(); - const std::size_t N = static_cast( std::distance( itMessage, itEnd ) ); - - { - Colour colourGuard( colour ); - stream << " with " << pluralise( N, "message" ) << ":"; - } - - for(; itMessage != itEnd; ) { - // If this assertion is a warning ignore any INFO messages - if( printInfoMessages || itMessage->type != ResultWas::Info ) { - stream << " '" << itMessage->message << "'"; - if ( ++itMessage != itEnd ) { - Colour colourGuard( dimColour() ); - stream << " and"; - } - } - } - } - - private: - std::ostream& stream; - AssertionStats const& stats; - AssertionResult const& result; - std::vector messages; - std::vector::const_iterator itMessage; - bool printInfoMessages; - }; - - // Colour, message variants: - // - white: No tests ran. - // - red: Failed [both/all] N test cases, failed [both/all] M assertions. - // - white: Passed [both/all] N test cases (no assertions). - // - red: Failed N tests cases, failed M assertions. - // - green: Passed [both/all] N tests cases with M assertions. - - std::string bothOrAll( std::size_t count ) const { - return count == 1 ? "" : count == 2 ? "both " : "all " ; - } - - void printTotals( const Totals& totals ) const { - if( totals.testCases.total() == 0 ) { - stream << "No tests ran."; - } - else if( totals.testCases.failed == totals.testCases.total() ) { - Colour colour( Colour::ResultError ); - const std::string qualify_assertions_failed = - totals.assertions.failed == totals.assertions.total() ? - bothOrAll( totals.assertions.failed ) : ""; - stream << - "Failed " << bothOrAll( totals.testCases.failed ) - << pluralise( totals.testCases.failed, "test case" ) << ", " - "failed " << qualify_assertions_failed << - pluralise( totals.assertions.failed, "assertion" ) << "."; - } - else if( totals.assertions.total() == 0 ) { - stream << - "Passed " << bothOrAll( totals.testCases.total() ) - << pluralise( totals.testCases.total(), "test case" ) - << " (no assertions)."; - } - else if( totals.assertions.failed ) { - Colour colour( Colour::ResultError ); - stream << - "Failed " << pluralise( totals.testCases.failed, "test case" ) << ", " - "failed " << pluralise( totals.assertions.failed, "assertion" ) << "."; - } - else { - Colour colour( Colour::ResultSuccess ); - stream << - "Passed " << bothOrAll( totals.testCases.passed ) - << pluralise( totals.testCases.passed, "test case" ) << - " with " << pluralise( totals.assertions.passed, "assertion" ) << "."; - } - } - }; - - INTERNAL_CATCH_REGISTER_REPORTER( "compact", CompactReporter ) - -} // end namespace Catch - -namespace Catch { - NonCopyable::~NonCopyable() {} - IShared::~IShared() {} - StreamBufBase::~StreamBufBase() CATCH_NOEXCEPT {} - IContext::~IContext() {} - IResultCapture::~IResultCapture() {} - ITestCase::~ITestCase() {} - ITestCaseRegistry::~ITestCaseRegistry() {} - IRegistryHub::~IRegistryHub() {} - IMutableRegistryHub::~IMutableRegistryHub() {} - IExceptionTranslator::~IExceptionTranslator() {} - IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() {} - IReporter::~IReporter() {} - IReporterFactory::~IReporterFactory() {} - IReporterRegistry::~IReporterRegistry() {} - IStreamingReporter::~IStreamingReporter() {} - AssertionStats::~AssertionStats() {} - SectionStats::~SectionStats() {} - TestCaseStats::~TestCaseStats() {} - TestGroupStats::~TestGroupStats() {} - TestRunStats::~TestRunStats() {} - CumulativeReporterBase::SectionNode::~SectionNode() {} - CumulativeReporterBase::~CumulativeReporterBase() {} - - StreamingReporterBase::~StreamingReporterBase() {} - ConsoleReporter::~ConsoleReporter() {} - CompactReporter::~CompactReporter() {} - IRunner::~IRunner() {} - IMutableContext::~IMutableContext() {} - IConfig::~IConfig() {} - XmlReporter::~XmlReporter() {} - JunitReporter::~JunitReporter() {} - TestRegistry::~TestRegistry() {} - FreeFunctionTestCase::~FreeFunctionTestCase() {} - IGeneratorInfo::~IGeneratorInfo() {} - IGeneratorsForTest::~IGeneratorsForTest() {} - TestSpec::Pattern::~Pattern() {} - TestSpec::NamePattern::~NamePattern() {} - TestSpec::TagPattern::~TagPattern() {} - TestSpec::ExcludedPattern::~ExcludedPattern() {} - - Matchers::Impl::StdString::Equals::~Equals() {} - Matchers::Impl::StdString::Contains::~Contains() {} - Matchers::Impl::StdString::StartsWith::~StartsWith() {} - Matchers::Impl::StdString::EndsWith::~EndsWith() {} - - void Config::dummy() {} -} - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - -#endif - -#ifdef CATCH_CONFIG_MAIN -// #included from: internal/catch_default_main.hpp -#define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED - -#ifndef __OBJC__ - -// Standard C/C++ main entry point -int main (int argc, char * const argv[]) { - return Catch::Session().run( argc, argv ); -} - -#else // __OBJC__ - -// Objective-C entry point -int main (int argc, char * const argv[]) { -#if !CATCH_ARC_ENABLED - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; -#endif - - Catch::registerTestMethods(); - int result = Catch::Session().run( argc, (char* const*)argv ); - -#if !CATCH_ARC_ENABLED - [pool drain]; -#endif - - return result; -} - -#endif // __OBJC__ - -#endif - -#ifdef CLARA_CONFIG_MAIN_NOT_DEFINED -# undef CLARA_CONFIG_MAIN -#endif - -////// - -// If this config identifier is defined then all CATCH macros are prefixed with CATCH_ -#ifdef CATCH_CONFIG_PREFIX_ALL - -#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" ) -#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "CATCH_REQUIRE_FALSE" ) - -#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS" ) -#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" ) -#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" ) - -#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" ) -#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CATCH_CHECK_FALSE" ) -#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" ) -#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_ELSE" ) -#define CATCH_CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CATCH_CHECK_NOFAIL" ) - -#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" ) -#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" ) -#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" ) - -#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THAT" ) -#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THAT" ) - -#define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( msg, "CATCH_INFO" ) -#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "CATCH_WARN", msg ) -#define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( msg, "CATCH_INFO" ) -#define CATCH_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CATCH_CAPTURE" ) -#define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CATCH_CAPTURE" ) - -#ifdef CATCH_CONFIG_VARIADIC_MACROS - #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) - #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ ) - #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) - #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) - #define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", __VA_ARGS__ ) - #define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED", __VA_ARGS__ ) -#else - #define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) - #define CATCH_TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description ) - #define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) - #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) - #define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", msg ) - #define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED", msg ) -#endif -#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" ) - -#define CATCH_REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) -#define CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) - -#define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) - -// "BDD-style" convenience wrappers -#ifdef CATCH_CONFIG_VARIADIC_MACROS -#define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ ) -#define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ ) -#else -#define CATCH_SCENARIO( name, tags ) CATCH_TEST_CASE( "Scenario: " name, tags ) -#define CATCH_SCENARIO_METHOD( className, name, tags ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " name, tags ) -#endif -#define CATCH_GIVEN( desc ) CATCH_SECTION( "Given: " desc, "" ) -#define CATCH_WHEN( desc ) CATCH_SECTION( " When: " desc, "" ) -#define CATCH_AND_WHEN( desc ) CATCH_SECTION( " And: " desc, "" ) -#define CATCH_THEN( desc ) CATCH_SECTION( " Then: " desc, "" ) -#define CATCH_AND_THEN( desc ) CATCH_SECTION( " And: " desc, "" ) - -// If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required -#else - -#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "REQUIRE" ) -#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" ) - -#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "REQUIRE_THROWS" ) -#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" ) -#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" ) - -#define CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK" ) -#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CHECK_FALSE" ) -#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" ) -#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" ) -#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" ) - -#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" ) -#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" ) -#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" ) - -#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THAT" ) -#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "REQUIRE_THAT" ) - -#define INFO( msg ) INTERNAL_CATCH_INFO( msg, "INFO" ) -#define WARN( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "WARN", msg ) -#define SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( msg, "INFO" ) -#define CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" ) -#define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" ) - -#ifdef CATCH_CONFIG_VARIADIC_MACROS - #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) - #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ ) - #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) - #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) - #define FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL", __VA_ARGS__ ) - #define SUCCEED( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED", __VA_ARGS__ ) -#else - #define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) - #define TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description ) - #define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) - #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) - #define FAIL( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL", msg ) - #define SUCCEED( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED", msg ) -#endif -#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" ) - -#define REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) -#define REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) - -#define GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) - -#endif - -#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) - -// "BDD-style" convenience wrappers -#ifdef CATCH_CONFIG_VARIADIC_MACROS -#define SCENARIO( ... ) TEST_CASE( "Scenario: " __VA_ARGS__ ) -#define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ ) -#else -#define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags ) -#define SCENARIO_METHOD( className, name, tags ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " name, tags ) -#endif -#define GIVEN( desc ) SECTION( " Given: " desc, "" ) -#define WHEN( desc ) SECTION( " When: " desc, "" ) -#define AND_WHEN( desc ) SECTION( "And when: " desc, "" ) -#define THEN( desc ) SECTION( " Then: " desc, "" ) -#define AND_THEN( desc ) SECTION( " And: " desc, "" ) - -using Catch::Detail::Approx; - -// #included from: internal/catch_reenable_warnings.h - -#define TWOBLUECUBES_CATCH_REENABLE_WARNINGS_H_INCLUDED - -#ifdef __clang__ -# ifdef __ICC // icpc defines the __clang__ macro -# pragma warning(pop) -# else -# pragma clang diagnostic pop -# endif -#elif defined __GNUC__ -# pragma GCC diagnostic pop -#endif - -#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED - diff --git a/lib/par2/diskfile.cpp b/lib/par2/diskfile.cpp index bd65fe78..b457d245 100644 --- a/lib/par2/diskfile.cpp +++ b/lib/par2/diskfile.cpp @@ -880,7 +880,7 @@ string DiskFile::ErrorMessage(DWORD error) else { char message[40]; - _snprintf(message, sizeof(message), "Unknown error code (%d)", error); + snprintf(message, sizeof(message), "Unknown error code (%d)", error); result = message; } diff --git a/lib/par2/par2cmdline.h b/lib/par2/par2cmdline.h index 4c75cdc6..5240f094 100644 --- a/lib/par2/par2cmdline.h +++ b/lib/par2/par2cmdline.h @@ -22,7 +22,6 @@ #ifdef WIN32 -//#define snprintf _snprintf #define stat _stat namespace Par2 diff --git a/lib/regex/regex.c b/lib/regex/regex.c index 6a1b9acf..f30a6aec 100644 --- a/lib/regex/regex.c +++ b/lib/regex/regex.c @@ -52,8 +52,8 @@ # include "../locale/localeinfo.h" #endif -#define strncasecmp _strnicmp -#define strcasecmp _stricmp +#define strncasecmp strnicmp +#define strcasecmp stricmp /* On some systems, limits.h sets RE_DUP_MAX to a lower value than GNU regex allows. Include it before , which correctly diff --git a/linux/build-nzbget b/linux/build-nzbget index 5ecad36e..94253341 100755 --- a/linux/build-nzbget +++ b/linux/build-nzbget @@ -594,6 +594,7 @@ ConstructOutputFilename # Building mkdir -p $OUTPUTDIR CleanupIfNecessary +autoreconf --install BUILDTARGETS=$TARGETS diff --git a/osx/build-nzbget.sh b/osx/build-nzbget.sh old mode 100644 new mode 100755 index 72faa7f4..e2494263 --- a/osx/build-nzbget.sh +++ b/osx/build-nzbget.sh @@ -143,6 +143,7 @@ Make_universal() Build() { + autoreconf --install Compile_x86_64 Compile_arm Make_universal diff --git a/posix/ax_cxx_compile_stdcxx.m4 b/posix/ax_cxx_compile_stdcxx.m4 index f387b873..7c8e6123 100644 --- a/posix/ax_cxx_compile_stdcxx.m4 +++ b/posix/ax_cxx_compile_stdcxx.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html # =========================================================================== # # SYNOPSIS @@ -9,14 +9,14 @@ # DESCRIPTION # # Check for baseline language coverage in the compiler for the specified -# version of the C++ standard. If necessary, add switches to CXXFLAGS to -# enable support. VERSION may be '11' (for the C++11 standard) or '14' -# (for the C++14 standard). +# version of the C++ standard. If necessary, add switches to CXX and +# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for +# the respective C++ standard version. # # The second argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. # -std=c++11). If neither is specified, you get whatever works, with -# preference for an extended mode. +# preference for no added switch, and then for an extended mode. # # The third argument, if specified 'mandatory' or if left unspecified, # indicates that baseline support for the specified C++ standard is @@ -33,21 +33,26 @@ # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler +# Copyright (c) 2016, 2018 Krzesimir Nowak +# Copyright (c) 2019 Enji Cooper +# Copyright (c) 2020 Jason Merrill +# Copyright (c) 2021 Jörn Heusipp # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 1 +#serial 18 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl - m4_if([$1], [11], [], - [$1], [14], [], - [$1], [17], [m4_fatal([support for C++17 not yet implemented in AX_CXX_COMPILE_STDCXX])], + m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], + [$1], [14], [ax_cxx_compile_alternatives="14 1y"], + [$1], [17], [ax_cxx_compile_alternatives="17 1z"], + [$1], [20], [ax_cxx_compile_alternatives="20"], [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$2], [], [], [$2], [ext], [], @@ -59,75 +64,95 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) AC_LANG_PUSH([C++])dnl ac_success=no - AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, - ax_cv_cxx_compile_cxx$1, - [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [ax_cv_cxx_compile_cxx$1=yes], - [ax_cv_cxx_compile_cxx$1=no])]) - if test x$ax_cv_cxx_compile_cxx$1 = xyes; then - ac_success=yes - fi - m4_if([$2], [ext], [], [dnl + m4_if([$2], [], [dnl + AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, + ax_cv_cxx_compile_cxx$1, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [ax_cv_cxx_compile_cxx$1=yes], + [ax_cv_cxx_compile_cxx$1=no])]) + if test x$ax_cv_cxx_compile_cxx$1 = xyes; then + ac_success=yes + fi]) + + m4_if([$2], [noext], [], [dnl if test x$ac_success = xno; then - dnl HP's aCC needs +std=c++11 according to: - dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf - dnl Cray's crayCC needs "-h std=c++11" - for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, - [ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $switch" + [ac_save_CXX="$CXX" + CXX="$CXX $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [eval $cachevar=yes], [eval $cachevar=no]) - CXXFLAGS="$ac_save_CXXFLAGS"]) + CXX="$ac_save_CXX"]) if eval test x\$$cachevar = xyes; then - CXXFLAGS="$CXXFLAGS $switch" + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi ac_success=yes break fi done fi]) - m4_if([$2], [noext], [], [dnl + m4_if([$2], [ext], [], [dnl if test x$ac_success = xno; then - for switch in -std=gnu++$1 -std=gnu++0x; do - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - [ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXXFLAGS="$ac_save_CXXFLAGS"]) - if eval test x\$$cachevar = xyes; then - CXXFLAGS="$CXXFLAGS $switch" - ac_success=yes + dnl HP's aCC needs +std=c++11 according to: + dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf + dnl Cray's crayCC needs "-h std=c++11" + dnl MSVC needs -std:c++NN for C++17 and later (default is C++14) + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do + if test x"$switch" = xMSVC; then + dnl AS_TR_SH maps both `:` and `=` to `_` so -std:c++17 would collide + dnl with -std=c++17. We suffix the cache variable name with _MSVC to + dnl avoid this. + switch=-std:c++${alternative} + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_${switch}_MSVC]) + else + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + fi + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then break fi done fi]) - AC_LANG_POP([C++]) if test x$ax_cxx_compile_cxx$1_required = xtrue; then if test x$ac_success = xno; then AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) fi + fi + if test x$ac_success = xno; then + HAVE_CXX$1=0 + AC_MSG_NOTICE([No compiler with C++$1 support was found]) else - if test x$ac_success = xno; then - HAVE_CXX$1=0 - AC_MSG_NOTICE([No compiler with C++$1 support was found]) - else - HAVE_CXX$1=1 - AC_DEFINE(HAVE_CXX$1,1, - [define if the compiler supports basic C++$1 syntax]) - fi - - AC_SUBST(HAVE_CXX$1) + HAVE_CXX$1=1 + AC_DEFINE(HAVE_CXX$1,1, + [define if the compiler supports basic C++$1 syntax]) fi + AC_SUBST(HAVE_CXX$1) ]) @@ -137,7 +162,6 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ) - dnl Test body for checking C++14 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], @@ -145,6 +169,23 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ) +dnl Test body for checking C++17 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 +) + +dnl Test body for checking C++20 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 +) + dnl Tests for new features in C++11 @@ -157,7 +198,11 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -182,11 +227,13 @@ namespace cxx11 struct Base { + virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { + virtual ~Derived() override {} virtual void f() override {} }; @@ -446,11 +493,7 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ #error "This is not a C++ compiler" -//check for full C++14 support (disabed) -//#elif __cplusplus < 201402L - -// check for partial C++14 support (accept gcc 4.9) -#elif __cplusplus < 201300L +#elif __cplusplus < 201402L && !defined _MSC_VER #error "This is not a C++14 compiler" @@ -485,7 +528,6 @@ namespace cxx14 } -/* namespace test_generalized_constexpr { @@ -505,7 +547,6 @@ namespace cxx14 static_assert(strlen_c("another\0test") == 7UL, ""); } -*/ namespace test_lambda_init_capture { @@ -521,7 +562,7 @@ namespace cxx14 } - namespace test_digit_seperators + namespace test_digit_separators { constexpr auto ten_million = 100'000'000; @@ -563,3 +604,415 @@ namespace cxx14 #endif // __cplusplus >= 201402L ]]) + + +dnl Tests for new features in C++17 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L && !defined _MSC_VER + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L && !defined _MSC_VER + +]]) + + +dnl Tests for new features in C++20 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[ + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 202002L && !defined _MSC_VER + +#error "This is not a C++20 compiler" + +#else + +#include + +namespace cxx20 +{ + +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx20 + +#endif // __cplusplus < 202002L && !defined _MSC_VER + +]]) \ No newline at end of file diff --git a/posix/config.guess b/posix/config.guess deleted file mode 100755 index 6c32c864..00000000 --- a/posix/config.guess +++ /dev/null @@ -1,1421 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. - -timestamp='2014-11-04' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -# -# Please send patches to . - - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -case "${UNAME_SYSTEM}" in -Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu - - eval $set_cc_for_build - cat <<-EOF > $dummy.c - #include - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #else - LIBC=gnu - #endif - EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` - ;; -esac - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi - else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } - ;; - openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} - exit ;; - or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; - x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - fi - elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 - fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; - x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; -esac - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/posix/config.sub b/posix/config.sub deleted file mode 100755 index 7ffe3737..00000000 --- a/posix/config.sub +++ /dev/null @@ -1,1807 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2014 Free Software Foundation, Inc. - -timestamp='2014-12-03' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches to . -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2014 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - c8051-*) - os=-elf - ;; - hexagon-*) - os=-elf - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/posix/depcomp b/posix/depcomp deleted file mode 100755 index fc98710e..00000000 --- a/posix/depcomp +++ /dev/null @@ -1,791 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2013-05-30.07; # UTC - -# Copyright (C) 1999-2014 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by 'PROGRAMS ARGS'. - object Object file output by 'PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputting dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -# Get the directory component of the given path, and save it in the -# global variables '$dir'. Note that this directory component will -# be either empty or ending with a '/' character. This is deliberate. -set_dir_from () -{ - case $1 in - */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; - *) dir=;; - esac -} - -# Get the suffix-stripped basename of the given path, and save it the -# global variable '$base'. -set_base_from () -{ - base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` -} - -# If no dependency file was actually created by the compiler invocation, -# we still have to create a dummy depfile, to avoid errors with the -# Makefile "include basename.Plo" scheme. -make_dummy_depfile () -{ - echo "#dummy" > "$depfile" -} - -# Factor out some common post-processing of the generated depfile. -# Requires the auxiliary global variable '$tmpdepfile' to be set. -aix_post_process_depfile () -{ - # If the compiler actually managed to produce a dependency file, - # post-process it. - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependency.h'. - # Do two passes, one to just change these to - # $object: dependency.h - # and one to simply output - # dependency.h: - # which is needed to avoid the deleted-header problem. - { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" - sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" - } > "$depfile" - rm -f "$tmpdepfile" - else - make_dummy_depfile - fi -} - -# A tabulation character. -tab=' ' -# A newline character. -nl=' -' -# Character ranges might be problematic outside the C locale. -# These definitions help. -upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ -lower=abcdefghijklmnopqrstuvwxyz -digits=0123456789 -alpha=${upper}${lower} - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Avoid interferences from the environment. -gccflag= dashmflag= - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp -fi - -if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 -fi - -if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. - gccflag=-qmakedep=gcc,-MF - depmode=gcc -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. -## (see the conditional assignment to $gccflag above). -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). Also, it might not be -## supported by the other compilers which use the 'gcc' depmode. -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The second -e expression handles DOS-style file names with drive - # letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the "deleted header file" problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. -## Some versions of gcc put a space before the ':'. On the theory -## that the space means something, we add a space to the output as -## well. hp depmode also adds that space, but also prefixes the VPATH -## to the object. Take care to not repeat it in the output. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like '#:fec' to the end of the - # dependency line. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ - | tr "$nl" ' ' >> "$depfile" - echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" - ;; - -xlc) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts '$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - aix_post_process_depfile - ;; - -tcc) - # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 - # FIXME: That version still under development at the moment of writing. - # Make that this statement remains true also for stable, released - # versions. - # It will wrap lines (doesn't matter whether long or short) with a - # trailing '\', as in: - # - # foo.o : \ - # foo.c \ - # foo.h \ - # - # It will put a trailing '\' even on the last line, and will use leading - # spaces rather than leading tabs (at least since its commit 0394caf7 - # "Emit spaces for -MD"). - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. - # We have to change lines of the first kind to '$object: \'. - sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" - # And for each line of the second kind, we have to emit a 'dep.h:' - # dummy dependency, to avoid the deleted-header problem. - sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" - rm -f "$tmpdepfile" - ;; - -## The order of this option in the case statement is important, since the -## shell code in configure will try each of these formats in the order -## listed in this file. A plain '-MD' option would be understood by many -## compilers, so we must ensure this comes after the gcc and icc options. -pgcc) - # Portland's C compiler understands '-MD'. - # Will always output deps to 'file.d' where file is the root name of the - # source file under compilation, even if file resides in a subdirectory. - # The object file name does not affect the name of the '.d' file. - # pgcc 10.2 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\' : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - set_dir_from "$object" - # Use the source, not the object, to determine the base name, since - # that's sadly what pgcc will do too. - set_base_from "$source" - tmpdepfile=$base.d - - # For projects that build the same source file twice into different object - # files, the pgcc approach of using the *source* file root name can cause - # problems in parallel builds. Use a locking strategy to avoid stomping on - # the same $tmpdepfile. - lockdir=$base.d-lock - trap " - echo '$0: caught signal, cleaning up...' >&2 - rmdir '$lockdir' - exit 1 - " 1 2 13 15 - numtries=100 - i=$numtries - while test $i -gt 0; do - # mkdir is a portable test-and-set. - if mkdir "$lockdir" 2>/dev/null; then - # This process acquired the lock. - "$@" -MD - stat=$? - # Release the lock. - rmdir "$lockdir" - break - else - # If the lock is being held by a different process, wait - # until the winning process is done or we timeout. - while test -d "$lockdir" && test $i -gt 0; do - sleep 1 - i=`expr $i - 1` - done - fi - i=`expr $i - 1` - done - trap - 1 2 13 15 - if test $i -le 0; then - echo "$0: failed to acquire lock after $numtries attempts" >&2 - echo "$0: check lockdir '$lockdir'" >&2 - exit 1 - fi - - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" - # Add 'dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - set_dir_from "$object" - set_base_from "$object" - - if test "$libtool" = yes; then - # Libtool generates 2 separate objects for the 2 libraries. These - # two compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir$base.o.d # libtool 1.5 - tmpdepfile2=$dir.libs/$base.o.d # Likewise. - tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - # Same post-processing that is required for AIX mode. - aix_post_process_depfile - ;; - -msvc7) - if test "$libtool" = yes; then - showIncludes=-Wc,-showIncludes - else - showIncludes=-showIncludes - fi - "$@" $showIncludes > "$tmpdepfile" - stat=$? - grep -v '^Note: including file: ' "$tmpdepfile" - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The first sed program below extracts the file names and escapes - # backslashes for cygpath. The second sed program outputs the file - # name when reading, but also accumulates all include files in the - # hold buffer in order to output them again at the end. This only - # works with sed implementations that can handle large buffers. - sed < "$tmpdepfile" -n ' -/^Note: including file: *\(.*\)/ { - s//\1/ - s/\\/\\\\/g - p -}' | $cygpath_u | sort -u | sed -n ' -s/ /\\ /g -s/\(.*\)/'"$tab"'\1 \\/p -s/.\(.*\) \\/\1:/ -H -$ { - s/.*/'"$tab"'/ - G - p -}' >> "$depfile" - echo >> "$depfile" # make sure the fragment doesn't end with a backslash - rm -f "$tmpdepfile" - ;; - -msvc7msys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for ':' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. - "$@" $dashmflag | - sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this sed invocation - # correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - # makedepend may prepend the VPATH from the source file name to the object. - # No need to regex-escape $object, excess matching of '.' is harmless. - sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process the last invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed '1,2d' "$tmpdepfile" \ - | tr ' ' "$nl" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E \ - | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - | sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" - echo "$tab" >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/posix/install-sh b/posix/install-sh deleted file mode 100755 index 0b0fdcbb..00000000 --- a/posix/install-sh +++ /dev/null @@ -1,501 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2013-12-25.23; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# 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 -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -tab=' ' -nl=' -' -IFS=" $tab$nl" - -# Set DOITPROG to "echo" to test this script. - -doit=${DOITPROG-} -doit_exec=${doit:-exec} - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -is_target_a_directory=possibly - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) - is_target_a_directory=always - dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) is_target_a_directory=never;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -# We allow the use of options -d and -T together, by making -d -# take the precedence; this is for compatibility with GNU install. - -if test -n "$dir_arg"; then - if test -n "$dst_arg"; then - echo "$0: target directory not allowed when installing a directory." >&2 - exit 1 - fi -fi - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call 'install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - if test $# -gt 1 || test "$is_target_a_directory" = always; then - if test ! -d "$dst_arg"; then - echo "$0: $dst_arg: Is not a directory." >&2 - exit 1 - fi - fi -fi - -if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names problematic for 'test' and other utilities. - case $src in - -* | [=\(\)!]) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - dst=$dst_arg - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test "$is_target_a_directory" = never; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - dstdir=`dirname "$dst"` - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; - esac - - oIFS=$IFS - IFS=/ - set -f - set fnord $dstdir - shift - set +f - IFS=$oIFS - - prefixes= - - for d - do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - set +f && - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/posix/missing b/posix/missing deleted file mode 100755 index f62bbae3..00000000 --- a/posix/missing +++ /dev/null @@ -1,215 +0,0 @@ -#! /bin/sh -# Common wrapper for a few potentially missing GNU programs. - -scriptversion=2013-10-28.13; # UTC - -# Copyright (C) 1996-2014 Free Software Foundation, Inc. -# Originally written by Fran,cois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try '$0 --help' for more information" - exit 1 -fi - -case $1 in - - --is-lightweight) - # Used by our autoconf macros to check whether the available missing - # script is modern enough. - exit 0 - ;; - - --run) - # Back-compat with the calling convention used by older automake. - shift - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due -to PROGRAM being missing or too old. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal autoconf autoheader autom4te automake makeinfo - bison yacc flex lex help2man - -Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and -'g' are ignored when checking the name. - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: unknown '$1' option" - echo 1>&2 "Try '$0 --help' for more information" - exit 1 - ;; - -esac - -# Run the given program, remember its exit status. -"$@"; st=$? - -# If it succeeded, we are done. -test $st -eq 0 && exit 0 - -# Also exit now if we it failed (or wasn't found), and '--version' was -# passed; such an option is passed most likely to detect whether the -# program is present and works. -case $2 in --version|--help) exit $st;; esac - -# Exit code 63 means version mismatch. This often happens when the user -# tries to use an ancient version of a tool on a file that requires a -# minimum version. -if test $st -eq 63; then - msg="probably too old" -elif test $st -eq 127; then - # Program was missing. - msg="missing on your system" -else - # Program was found and executed, but failed. Give up. - exit $st -fi - -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software - -program_details () -{ - case $1 in - aclocal|automake) - echo "The '$1' program is part of the GNU Automake package:" - echo "<$gnu_software_URL/automake>" - echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/autoconf>" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - autoconf|autom4te|autoheader) - echo "The '$1' program is part of the GNU Autoconf package:" - echo "<$gnu_software_URL/autoconf/>" - echo "It also requires GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - esac -} - -give_advice () -{ - # Normalize program name to check for. - normalized_program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - - printf '%s\n' "'$1' is $msg." - - configure_deps="'configure.ac' or m4 files included by 'configure.ac'" - case $normalized_program in - autoconf*) - echo "You should only need it if you modified 'configure.ac'," - echo "or m4 files included by it." - program_details 'autoconf' - ;; - autoheader*) - echo "You should only need it if you modified 'acconfig.h' or" - echo "$configure_deps." - program_details 'autoheader' - ;; - automake*) - echo "You should only need it if you modified 'Makefile.am' or" - echo "$configure_deps." - program_details 'automake' - ;; - aclocal*) - echo "You should only need it if you modified 'acinclude.m4' or" - echo "$configure_deps." - program_details 'aclocal' - ;; - autom4te*) - echo "You might have modified some maintainer files that require" - echo "the 'autom4te' program to be rebuilt." - program_details 'autom4te' - ;; - bison*|yacc*) - echo "You should only need it if you modified a '.y' file." - echo "You may want to install the GNU Bison package:" - echo "<$gnu_software_URL/bison/>" - ;; - lex*|flex*) - echo "You should only need it if you modified a '.l' file." - echo "You may want to install the Fast Lexical Analyzer package:" - echo "<$flex_URL>" - ;; - help2man*) - echo "You should only need it if you modified a dependency" \ - "of a man page." - echo "You may want to install the GNU Help2man package:" - echo "<$gnu_software_URL/help2man/>" - ;; - makeinfo*) - echo "You should only need it if you modified a '.texi' file, or" - echo "any other file indirectly affecting the aspect of the manual." - echo "You might want to install the Texinfo package:" - echo "<$gnu_software_URL/texinfo/>" - echo "The spurious makeinfo call might also be the consequence of" - echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" - echo "want to install GNU make:" - echo "<$gnu_software_URL/make/>" - ;; - *) - echo "You might have modified some files without having the proper" - echo "tools for further handling them. Check the 'README' file, it" - echo "often tells you about the needed prerequisites for installing" - echo "this package. You may also peek at any GNU archive site, in" - echo "case some other package contains this missing '$1' program." - ;; - esac -} - -give_advice "$1" | sed -e '1s/^/WARNING: /' \ - -e '2,$s/^/ /' >&2 - -# Propagate the correct exit status (expected to be 127 for a program -# not found, 63 for a program that failed due to version mismatch). -exit $st - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000..8d5c3c9f --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,8 @@ +find_package(Boost COMPONENTS unit_test_framework REQUIRED) + +add_subdirectory(util) +add_subdirectory(feed) +add_subdirectory(queue) +#add_subdirectory(nntp) +add_subdirectory(main) +#add_subdirectory(postprocess) diff --git a/tests/feed/CMakeLists.txt b/tests/feed/CMakeLists.txt new file mode 100644 index 00000000..f9a2d866 --- /dev/null +++ b/tests/feed/CMakeLists.txt @@ -0,0 +1,30 @@ +add_executable(FeedFilterTest + FeedFilterTest.cpp + ${CMAKE_SOURCE_DIR}/daemon/feed/FeedFilter.cpp + ${CMAKE_SOURCE_DIR}/daemon/feed/FeedInfo.cpp + ${CMAKE_SOURCE_DIR}/daemon/main/Options.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/NString.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/Util.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/FileSystem.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/Log.cpp + ${CMAKE_SOURCE_DIR}/daemon/queue/DownloadInfo.cpp + ${CMAKE_SOURCE_DIR}/daemon/queue/DiskState.cpp + ${CMAKE_SOURCE_DIR}/daemon/nntp/NewsServer.cpp + ${CMAKE_SOURCE_DIR}/lib/regex/regex.c +) +target_link_libraries(FeedFilterTest PRIVATE + ZLIB::ZLIB + Yencode +) +target_include_directories(FeedFilterTest PRIVATE + ${CMAKE_SOURCE_DIR}/daemon/feed + ${CMAKE_SOURCE_DIR}/daemon/main + ${CMAKE_SOURCE_DIR}/daemon/util + ${CMAKE_SOURCE_DIR}/daemon/queue + ${CMAKE_SOURCE_DIR}/daemon/nntp + ${CMAKE_SOURCE_DIR}/daemon/remote + ${CMAKE_SOURCE_DIR}/lib/regex + ${Boost_INCLUDE_DIR} +) + +add_test(NAME FeedFilterTest COMMAND $ --log_level=message) diff --git a/tests/feed/FeedFilterTest.cpp b/tests/feed/FeedFilterTest.cpp index 5ebf029b..aec44872 100644 --- a/tests/feed/FeedFilterTest.cpp +++ b/tests/feed/FeedFilterTest.cpp @@ -17,12 +17,19 @@ * along with this program. If not, see . */ - #include "nzbget.h" -#include "catch.h" +#define BOOST_TEST_MODULE "FeedFilterTest" +#include #include "FeedFilter.h" +#include "Log.h" +#include "Options.h" +#include "DiskState.h" + +Log* g_Log; +Options* g_Options; +DiskState* g_DiskState; void TestFilter(FeedItemInfo* feedItemInfo, const char* filterDef, FeedItemInfo::EMatchStatus expectedMatch) { @@ -32,11 +39,11 @@ void TestFilter(FeedItemInfo* feedItemInfo, const char* filterDef, FeedItemInfo: FeedFilter filter(filterDef); filter.Match(*feedItemInfo); - INFO(filterDef); - REQUIRE(feedItemInfo->GetMatchStatus() == expectedMatch); + BOOST_TEST_MESSAGE(filterDef); + BOOST_TEST(feedItemInfo->GetMatchStatus() == expectedMatch); } -TEST_CASE("Feed filter: one liners", "[FeedFilter][Quick]") +BOOST_AUTO_TEST_CASE(FeedFilterTest) { FeedItemInfo item; item.SetTitle("Game.of.Clowns.S02E06.REAL.1080p.HDTV.X264-Group.WEB-DL"); diff --git a/tests/main/CMakeLists.txt b/tests/main/CMakeLists.txt new file mode 100644 index 00000000..7280d3a9 --- /dev/null +++ b/tests/main/CMakeLists.txt @@ -0,0 +1,34 @@ +add_executable(MainTests + main.cpp + OptionsTest.cpp + CommandLineParserTest.cpp + ${CMAKE_SOURCE_DIR}/daemon/main/CommandLineParser.cpp + ${CMAKE_SOURCE_DIR}/daemon/main/Options.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/NString.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/FileSystem.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/Util.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/Log.cpp + ${CMAKE_SOURCE_DIR}/daemon/queue/DiskState.cpp + ${CMAKE_SOURCE_DIR}/daemon/queue/DownloadInfo.cpp + ${CMAKE_SOURCE_DIR}/daemon/feed/FeedInfo.cpp + ${CMAKE_SOURCE_DIR}/daemon/nntp/NewsServer.cpp + ${CMAKE_SOURCE_DIR}/lib/regex/regex.c +) +target_link_libraries(MainTests PRIVATE + ZLIB::ZLIB + Yencode +) +target_include_directories(MainTests PRIVATE + ${CMAKE_SOURCE_DIR}/daemon/main + ${CMAKE_SOURCE_DIR}/daemon/util + ${CMAKE_SOURCE_DIR}/daemon/remote + ${CMAKE_SOURCE_DIR}/daemon/queue + ${CMAKE_SOURCE_DIR}/daemon/feed + ${CMAKE_SOURCE_DIR}/daemon/nntp + ${CMAKE_SOURCE_DIR}/lib/yencode + ${CMAKE_SOURCE_DIR}/lib/regex + ${OPENSSL_INCLUDE_DIR} + ${Boost_INCLUDE_DIR} +) + +add_test(NAME MainTests COMMAND $ --log_level=message) diff --git a/tests/main/CommandLineParserTest.cpp b/tests/main/CommandLineParserTest.cpp index e7f8f2ad..5afee6b4 100644 --- a/tests/main/CommandLineParserTest.cpp +++ b/tests/main/CommandLineParserTest.cpp @@ -20,66 +20,73 @@ #include "nzbget.h" -#include "catch.h" +#include #include "CommandLineParser.h" +#include "Log.h" +#include "Options.h" +#include "DiskState.h" -TEST_CASE("Command line parser: initializing without configuration file", "[CommandLineParser][Quick]") +Log* g_Log; +Options* g_Options; +DiskState* g_DiskState; + +BOOST_AUTO_TEST_CASE(InitWithoutConfigurationFileTest) { const char* argv[] = {"nzbget", "-n", "-p", nullptr}; CommandLineParser commandLineParser(3, argv); - REQUIRE(commandLineParser.GetConfigFilename() == nullptr); - REQUIRE(commandLineParser.GetClientOperation() == CommandLineParser::opClientNoOperation); + BOOST_CHECK(commandLineParser.GetConfigFilename() == nullptr); + BOOST_CHECK(commandLineParser.GetClientOperation() == CommandLineParser::opClientNoOperation); } -TEST_CASE("Command line parser: initializing with configuration file", "[CommandLineParser][Quick]") +BOOST_AUTO_TEST_CASE(InitializingWithtConfigurationFile) { const char* argv[] = {"nzbget", "-c", "/home/user/nzbget.conf", "-p", nullptr}; CommandLineParser commandLineParser(4, argv); - REQUIRE(commandLineParser.GetConfigFilename() != nullptr); - REQUIRE(strcmp(commandLineParser.GetConfigFilename(), "/home/user/nzbget.conf") == 0); - REQUIRE(commandLineParser.GetClientOperation() == CommandLineParser::opClientNoOperation); + BOOST_CHECK(commandLineParser.GetConfigFilename() != nullptr); + BOOST_CHECK(strcmp(commandLineParser.GetConfigFilename(), "/home/user/nzbget.conf") == 0); + BOOST_CHECK(commandLineParser.GetClientOperation() == CommandLineParser::opClientNoOperation); } -TEST_CASE("Command line parser: server mode", "[CommandLineParser][Quick]") +BOOST_AUTO_TEST_CASE(ServerMode) { const char* argv[] = {"nzbget", "-n", "-s", nullptr}; CommandLineParser commandLineParser(3, argv); - REQUIRE(commandLineParser.GetServerMode() == true); - REQUIRE(commandLineParser.GetPauseDownload() == false); + BOOST_CHECK(commandLineParser.GetServerMode() == true); + BOOST_CHECK(commandLineParser.GetPauseDownload() == false); } -TEST_CASE("Command line parser: passing pause", "[CommandLineParser][Quick]") +BOOST_AUTO_TEST_CASE(PassingPause) { const char* argv[] = {"nzbget", "-n", "-s", "-P", nullptr}; CommandLineParser commandLineParser(4, argv); - REQUIRE(commandLineParser.GetPauseDownload() == true); + BOOST_CHECK(commandLineParser.GetPauseDownload() == true); } -TEST_CASE("Command line parser: extra option (1)", "[CommandLineParser][Quick]") +BOOST_AUTO_TEST_CASE(ExtraOption1) { const char* argv[] = {"nzbget", "-n", "-o", "myoption1=yes", "-o", "myoption2=no", "-p", nullptr}; CommandLineParser commandLineParser(7, argv); - REQUIRE(commandLineParser.GetOptionList()->size() == 2); - REQUIRE(strcmp(commandLineParser.GetOptionList()->at(0), "myoption1=yes") == 0); - REQUIRE(strcmp(commandLineParser.GetOptionList()->at(0), "myoption2=no") != 0); - REQUIRE(strcmp(commandLineParser.GetOptionList()->at(1), "myoption2=no") == 0); + BOOST_CHECK(commandLineParser.GetOptionList()->size() == 2); + BOOST_CHECK(strcmp(commandLineParser.GetOptionList()->at(0), "myoption1=yes") == 0); + BOOST_CHECK(strcmp(commandLineParser.GetOptionList()->at(0), "myoption2=no") != 0); + BOOST_CHECK(strcmp(commandLineParser.GetOptionList()->at(1), "myoption2=no") == 0); } -TEST_CASE("Command line parser: extra option (2)", "[CommandLineParser][Quick]") +BOOST_AUTO_TEST_CASE(ExtraOption2) { const char* argv[] = {"nzbget", "-n", "-o", "myoption1=yes", "-o", "myoption2=no", "-o", "myoption1=no", "-p", nullptr}; CommandLineParser commandLineParser(9, argv); - REQUIRE(commandLineParser.GetOptionList()->size() == 3); - REQUIRE(strcmp(commandLineParser.GetOptionList()->at(0), "myoption1=yes") == 0); - REQUIRE(strcmp(commandLineParser.GetOptionList()->at(1), "myoption2=no") == 0); - REQUIRE(strcmp(commandLineParser.GetOptionList()->at(2), "myoption1=no") == 0); + BOOST_CHECK(commandLineParser.GetOptionList()->size() == 3); + BOOST_CHECK(strcmp(commandLineParser.GetOptionList()->at(0), "myoption1=yes") == 0); + BOOST_CHECK(strcmp(commandLineParser.GetOptionList()->at(1), "myoption2=no") == 0); + BOOST_CHECK(strcmp(commandLineParser.GetOptionList()->at(2), "myoption1=no") == 0); } // TESTS: Add more tests for: diff --git a/tests/main/OptionsTest.cpp b/tests/main/OptionsTest.cpp index 47703fe6..178ab0b7 100644 --- a/tests/main/OptionsTest.cpp +++ b/tests/main/OptionsTest.cpp @@ -20,7 +20,7 @@ #include "nzbget.h" -#include "catch.h" +#include "boost/test/unit_test.hpp" #include "Options.h" @@ -53,19 +53,19 @@ class OptionsExtenderMock : public Options::Extender } }; -TEST_CASE("Options: initializing without configuration file", "[Options][Quick]") +BOOST_AUTO_TEST_CASE(OptionsInitWithoutConfigurationFileTest) { Options options(nullptr, nullptr); - REQUIRE(options.GetConfigFilename() == nullptr); + BOOST_CHECK(options.GetConfigFilename() == nullptr); #ifdef WIN32 - REQUIRE(strcmp(options.GetTempDir(), "nzbget/tmp") == 0); + BOOST_CHECK(strcmp(options.GetTempDir(), "nzbget/tmp") == 0); #else - REQUIRE(strcmp(options.GetTempDir(), "~/downloads/tmp") == 0); + BOOST_CHECK(strcmp(options.GetTempDir(), "~/downloads/tmp") == 0); #endif } -TEST_CASE("Options: passing command line options", "[Options][Quick]") +BOOST_AUTO_TEST_CASE(PassingCommandLineOptions) { Options::CmdOptList cmdOpts; cmdOpts.push_back("ControlUsername=my-user-name-1"); @@ -73,11 +73,11 @@ TEST_CASE("Options: passing command line options", "[Options][Quick]") Options options(&cmdOpts, nullptr); - REQUIRE(options.GetConfigFilename() == nullptr); - REQUIRE(strcmp(options.GetControlUsername(), "my-user-name-2") == 0); + BOOST_TEST(options.GetConfigFilename() == nullptr); + BOOST_TEST(strcmp(options.GetControlUsername(), "my-user-name-2") == 0); } -TEST_CASE("Options: calling extender", "[Options][Quick]") +BOOST_AUTO_TEST_CASE(CallingExtender) { Options::CmdOptList cmdOpts; cmdOpts.push_back("Server1.Host=news.mynewsserver.com"); @@ -97,7 +97,7 @@ TEST_CASE("Options: calling extender", "[Options][Quick]") OptionsExtenderMock extender; Options options(&cmdOpts, &extender); - REQUIRE(extender.m_newsServers == 2); - REQUIRE(extender.m_feeds == 1); - REQUIRE(extender.m_tasks == 24); + BOOST_TEST(extender.m_newsServers == 2); + BOOST_TEST(extender.m_feeds == 1); + BOOST_TEST(extender.m_tasks == 24); } diff --git a/tests/main/main.cpp b/tests/main/main.cpp new file mode 100644 index 00000000..559faef9 --- /dev/null +++ b/tests/main/main.cpp @@ -0,0 +1,2 @@ +#define BOOST_TEST_MODULE MainTests +#include diff --git a/tests/nntp/CMakeLists.txt b/tests/nntp/CMakeLists.txt new file mode 100644 index 00000000..fcfc0e22 --- /dev/null +++ b/tests/nntp/CMakeLists.txt @@ -0,0 +1,38 @@ +add_executable(ServerPoolTest + ServerPoolTest.cpp + ${CMAKE_SOURCE_DIR}/daemon/nntp/ServerPool.cpp + ${CMAKE_SOURCE_DIR}/daemon/main/Options.cpp + ${CMAKE_SOURCE_DIR}/daemon/nntp/NewsServer.cpp + ${CMAKE_SOURCE_DIR}/daemon/nntp/NntpConnection.cpp + ${CMAKE_SOURCE_DIR}/daemon/queue/DiskState.cpp + ${CMAKE_SOURCE_DIR}/daemon/queue/DownloadInfo.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/Util.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/Log.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/NString.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/FileSystem.cpp + ${CMAKE_SOURCE_DIR}/daemon/feed/FeedInfo.cpp + ${CMAKE_SOURCE_DIR}/daemon/connect/Connection.cpp + ${CMAKE_SOURCE_DIR}/daemon/connect/TlsSocket.cpp + ${CMAKE_SOURCE_DIR}/lib/regex/regex.c +) +target_link_libraries(ServerPoolTest PRIVATE + OpenSSL::SSL + ZLIB::ZLIB + Par2 + Yencode +) +target_include_directories(ServerPoolTest PRIVATE + ${CMAKE_SOURCE_DIR}/daemon/main + ${CMAKE_SOURCE_DIR}/daemon/nntp + ${CMAKE_SOURCE_DIR}/daemon/util + ${CMAKE_SOURCE_DIR}/daemon/connect + ${CMAKE_SOURCE_DIR}/daemon/queue + ${CMAKE_SOURCE_DIR}/daemon/feed + ${CMAKE_SOURCE_DIR}/daemon/remote + ${CMAKE_SOURCE_DIR}/lib/yencode + ${CMAKE_SOURCE_DIR}/lib/par2 + ${OPENSSL_INCLUDE_DIR} + ${Boost_INCLUDE_DIR} +) + +add_test(NAME ServerPoolTest COMMAND $ --log_level=message) diff --git a/tests/nntp/ServerPoolTest.cpp b/tests/nntp/ServerPoolTest.cpp index dc8fb8b5..55d46bec 100644 --- a/tests/nntp/ServerPoolTest.cpp +++ b/tests/nntp/ServerPoolTest.cpp @@ -20,9 +20,17 @@ #include "nzbget.h" -#include "catch.h" +#define BOOST_TEST_MODULE "NNTPTest" +#include #include "ServerPool.h" +#include "Log.h" +#include "Options.h" +#include "DiskState.h" + +Log* g_Log; +Options* g_Options; +DiskState* g_DiskState; void AddTestServer(ServerPool* pool, int id, bool active, int level, bool optional, int group, int connections) { @@ -30,39 +38,130 @@ void AddTestServer(ServerPool* pool, int id, bool active, int level, bool option "", "", false, false, nullptr, connections, 0, level, group, optional)); } -TEST_CASE("Server pool: simple levels", "[ServerPool]") +void TestBlockServers(int group) +{ + ServerPool pool; + AddTestServer(&pool, 1, true, 0, false, group, 2); + AddTestServer(&pool, 2, true, 0, false, group, 2); + AddTestServer(&pool, 3, true, 1, false, 0, 2); + pool.InitConnections(); + pool.SetRetryInterval(60); + + NewsServer* serv1 = pool.GetServers()->at(0).get(); + pool.BlockServer(serv1); + + NntpConnection* con1 = pool.GetConnection(0, nullptr, nullptr); + NntpConnection* con2 = pool.GetConnection(0, nullptr, nullptr); + NntpConnection* con3 = pool.GetConnection(0, nullptr, nullptr); + NntpConnection* con4 = pool.GetConnection(0, nullptr, nullptr); + BOOST_CHECK(con1 != nullptr); + BOOST_CHECK(con2 != nullptr); + BOOST_CHECK(con3 == nullptr); + BOOST_CHECK(con4 == nullptr); + BOOST_CHECK(con1->GetNewsServer()->GetLevel() == 0); + BOOST_CHECK(con2->GetNewsServer()->GetLevel() == 0); + + pool.FreeConnection(con1, false); + pool.FreeConnection(con2, false); + + NewsServer* serv2 = pool.GetServers()->at(1).get(); + pool.BlockServer(serv2); + + con1 = pool.GetConnection(0, nullptr, nullptr); + con2 = pool.GetConnection(0, nullptr, nullptr); + BOOST_CHECK(con1 == nullptr); + BOOST_CHECK(con2 == nullptr); +} + +void TestOptionalBlockServers(int group) +{ + ServerPool pool; + AddTestServer(&pool, 1, true, 0, true, group, 2); + AddTestServer(&pool, 2, true, 0, true, group, 2); + AddTestServer(&pool, 3, true, 1, false, 0, 2); + pool.InitConnections(); + pool.SetRetryInterval(60); + + NewsServer* serv1 = pool.GetServers()->at(0).get(); + NewsServer* serv2 = pool.GetServers()->at(1).get(); + pool.BlockServer(serv1); + pool.BlockServer(serv2); + + NntpConnection* con1 = pool.GetConnection(0, nullptr, nullptr); + NntpConnection* con2 = pool.GetConnection(0, nullptr, nullptr); + NntpConnection* con3 = pool.GetConnection(0, nullptr, nullptr); + NntpConnection* con4 = pool.GetConnection(0, nullptr, nullptr); + + // all servers on level 0 are optional and blocked; + // we should get a connection from level-1 server (server 3) + BOOST_CHECK(con1 != nullptr); + BOOST_CHECK(con2 != nullptr); + BOOST_CHECK(con3 == nullptr); + BOOST_CHECK(con4 == nullptr); + BOOST_CHECK(con1->GetNewsServer()->GetLevel() == 1); + BOOST_CHECK(con2->GetNewsServer()->GetLevel() == 1); +} + +void TestBlockOptionalAndNonOptionalServers(int group) +{ + ServerPool pool; + AddTestServer(&pool, 1, true, 0, true, group, 2); + AddTestServer(&pool, 2, true, 0, false, group, 2); + AddTestServer(&pool, 3, true, 1, false, 0, 2); + pool.InitConnections(); + pool.SetRetryInterval(60); + + NewsServer* serv1 = pool.GetServers()->at(0).get(); + NewsServer* serv2 = pool.GetServers()->at(1).get(); + pool.BlockServer(serv1); + pool.BlockServer(serv2); + + NntpConnection* con1 = pool.GetConnection(0, nullptr, nullptr); + NntpConnection* con2 = pool.GetConnection(0, nullptr, nullptr); + NntpConnection* con3 = pool.GetConnection(0, nullptr, nullptr); + NntpConnection* con4 = pool.GetConnection(0, nullptr, nullptr); + + // all servers on level 0 are blocked but one of them is non-optional + // we should NOT get any connections + BOOST_CHECK(con1 == nullptr); + BOOST_CHECK(con2 == nullptr); + BOOST_CHECK(con3 == nullptr); + BOOST_CHECK(con4 == nullptr); +} + +BOOST_AUTO_TEST_CASE(SimpleLevelsTest) { ServerPool pool; AddTestServer(&pool, 1, true, 2, false, 0, 2); pool.InitConnections(); - REQUIRE(pool.GetMaxNormLevel() == 0); + BOOST_CHECK(pool.GetMaxNormLevel() == 0); AddTestServer(&pool, 2, true, 10, false, 0, 3); pool.InitConnections(); - REQUIRE(pool.GetMaxNormLevel() == 1); + BOOST_CHECK(pool.GetMaxNormLevel() == 1); NntpConnection* con1 = pool.GetConnection(0, nullptr, nullptr); NntpConnection* con2 = pool.GetConnection(0, nullptr, nullptr); NntpConnection* con3 = pool.GetConnection(0, nullptr, nullptr); - REQUIRE(con1 != nullptr); - REQUIRE(con2 != nullptr); - REQUIRE(con3 == nullptr); + BOOST_CHECK(con1 != nullptr); + BOOST_CHECK(con2 != nullptr); + BOOST_CHECK(con3 == nullptr); pool.FreeConnection(con1, false); con3 = pool.GetConnection(0, nullptr, nullptr); - REQUIRE(con3 != nullptr); + BOOST_CHECK(con3 != nullptr); con1 = pool.GetConnection(1, nullptr, nullptr); con2 = pool.GetConnection(1, nullptr, nullptr); con3 = pool.GetConnection(1, nullptr, nullptr); NntpConnection* con4 = pool.GetConnection(1, nullptr, nullptr); - REQUIRE(con1 != nullptr); - REQUIRE(con2 != nullptr); - REQUIRE(con3 != nullptr); - REQUIRE(con4 == nullptr); + BOOST_CHECK(con1 != nullptr); + BOOST_CHECK(con2 != nullptr); + BOOST_CHECK(con3 != nullptr); + BOOST_CHECK(con4 == nullptr); } -TEST_CASE("Server pool: want server", "[ServerPool]") +BOOST_AUTO_TEST_CASE(WantServerTest) { ServerPool pool; AddTestServer(&pool, 1, true, 0, false, 0, 2); @@ -75,12 +174,12 @@ TEST_CASE("Server pool: want server", "[ServerPool]") NntpConnection* con1 = pool.GetConnection(0, nullptr, nullptr); NntpConnection* con2 = pool.GetConnection(0, serv1, nullptr); NntpConnection* con3 = pool.GetConnection(0, serv1, nullptr); - REQUIRE(con1 != nullptr); - REQUIRE(con2 != nullptr); - REQUIRE(con3 == nullptr); + BOOST_CHECK(con1 != nullptr); + BOOST_CHECK(con2 != nullptr); + BOOST_CHECK(con3 == nullptr); } -TEST_CASE("Server pool: active on/off", "[ServerPool]") +BOOST_AUTO_TEST_CASE(ActiveOnOffTest) { ServerPool pool; AddTestServer(&pool, 1, true, 0, false, 0, 2); @@ -91,31 +190,31 @@ TEST_CASE("Server pool: active on/off", "[ServerPool]") NntpConnection* con2 = pool.GetConnection(0, nullptr, nullptr); NntpConnection* con3 = pool.GetConnection(0, nullptr, nullptr); NntpConnection* con4 = pool.GetConnection(0, nullptr, nullptr); - REQUIRE(con1 != nullptr); - REQUIRE(con2 != nullptr); - REQUIRE(con3 != nullptr); - REQUIRE(con4 == nullptr); + BOOST_TEST(con1 != nullptr); + BOOST_TEST(con2 != nullptr); + BOOST_TEST(con3 != nullptr); + BOOST_TEST(con4 == nullptr); pool.FreeConnection(con1, false); pool.FreeConnection(con2, false); pool.FreeConnection(con3, false); - REQUIRE(pool.GetGeneration() == 1); + BOOST_CHECK(pool.GetGeneration() == 1); NewsServer* serv1 = pool.GetServers()->at(0).get(); serv1->SetActive(false); pool.Changed(); - REQUIRE(pool.GetGeneration() == 2); + BOOST_CHECK(pool.GetGeneration() == 2); con1 = pool.GetConnection(0, nullptr, nullptr); con2 = pool.GetConnection(0, nullptr, nullptr); con3 = pool.GetConnection(0, nullptr, nullptr); - REQUIRE(con1 != nullptr); - REQUIRE(con2 == nullptr); - REQUIRE(con3 == nullptr); + BOOST_CHECK(con1 != nullptr); + BOOST_CHECK(con2 == nullptr); + BOOST_CHECK(con3 == nullptr); } -TEST_CASE("Server pool: ignore servers", "[ServerPool]") +BOOST_AUTO_TEST_CASE(IgnoreServers) { ServerPool pool; AddTestServer(&pool, 1, true, 0, false, 0, 2); @@ -131,13 +230,13 @@ TEST_CASE("Server pool: ignore servers", "[ServerPool]") NntpConnection* con3 = pool.GetConnection(0, nullptr, &ignoreServers); NntpConnection* con4 = pool.GetConnection(0, nullptr, &ignoreServers); - REQUIRE(con1 != nullptr); - REQUIRE(con2 != nullptr); - REQUIRE(con3 == nullptr); - REQUIRE(con4 == nullptr); + BOOST_CHECK(con1 != nullptr); + BOOST_CHECK(con2 != nullptr); + BOOST_CHECK(con3 == nullptr); + BOOST_CHECK(con4 == nullptr); } -TEST_CASE("Server pool: ignore servers (grouped)", "[ServerPool]") +BOOST_AUTO_TEST_CASE(IgnoreServersGrouped) { ServerPool pool; AddTestServer(&pool, 1, true, 0, false, 1, 2); @@ -152,10 +251,10 @@ TEST_CASE("Server pool: ignore servers (grouped)", "[ServerPool]") NntpConnection* con2 = pool.GetConnection(0, nullptr, &ignoreServers); NntpConnection* con3 = pool.GetConnection(0, nullptr, &ignoreServers); NntpConnection* con4 = pool.GetConnection(0, nullptr, &ignoreServers); - REQUIRE(con1 == nullptr); - REQUIRE(con2 == nullptr); - REQUIRE(con3 == nullptr); - REQUIRE(con4 == nullptr); + BOOST_CHECK(con1 == nullptr); + BOOST_CHECK(con2 == nullptr); + BOOST_CHECK(con3 == nullptr); + BOOST_CHECK(con4 == nullptr); AddTestServer(&pool, 3, true, 0, false, 2, 2); pool.InitConnections(); @@ -163,110 +262,37 @@ TEST_CASE("Server pool: ignore servers (grouped)", "[ServerPool]") con1 = pool.GetConnection(0, nullptr, &ignoreServers); con2 = pool.GetConnection(0, nullptr, &ignoreServers); con3 = pool.GetConnection(0, nullptr, &ignoreServers); - REQUIRE(con1 != nullptr); - REQUIRE(con2 != nullptr); - REQUIRE(con3 == nullptr); + BOOST_CHECK(con1 != nullptr); + BOOST_CHECK(con2 != nullptr); + BOOST_CHECK(con3 == nullptr); } -TEST_CASE("Server pool: block servers", "[ServerPool]") +BOOST_AUTO_TEST_CASE(BlockServersUngrouped) { - int group; - SECTION("ungrouped") { group = 0; } - SECTION("grouped") { group = 1; } - - ServerPool pool; - AddTestServer(&pool, 1, true, 0, false, group, 2); - AddTestServer(&pool, 2, true, 0, false, group, 2); - AddTestServer(&pool, 3, true, 1, false, 0, 2); - pool.InitConnections(); - pool.SetRetryInterval(60); - - NewsServer* serv1 = pool.GetServers()->at(0).get(); - pool.BlockServer(serv1); - - NntpConnection* con1 = pool.GetConnection(0, nullptr, nullptr); - NntpConnection* con2 = pool.GetConnection(0, nullptr, nullptr); - NntpConnection* con3 = pool.GetConnection(0, nullptr, nullptr); - NntpConnection* con4 = pool.GetConnection(0, nullptr, nullptr); - REQUIRE(con1 != nullptr); - REQUIRE(con2 != nullptr); - REQUIRE(con3 == nullptr); - REQUIRE(con4 == nullptr); - CHECK(con1->GetNewsServer()->GetLevel() == 0); - CHECK(con2->GetNewsServer()->GetLevel() == 0); - - pool.FreeConnection(con1, false); - pool.FreeConnection(con2, false); - - NewsServer* serv2 = pool.GetServers()->at(1).get(); - pool.BlockServer(serv2); - - con1 = pool.GetConnection(0, nullptr, nullptr); - con2 = pool.GetConnection(0, nullptr, nullptr); - REQUIRE(con1 == nullptr); - REQUIRE(con2 == nullptr); + TestBlockServers(0); } -TEST_CASE("Server pool: block optional servers", "[ServerPool]") +BOOST_AUTO_TEST_CASE(BlockServersGrouped) { - int group; - SECTION("ungrouped") { group = 0; } - SECTION("grouped") { group = 1; } - - ServerPool pool; - AddTestServer(&pool, 1, true, 0, true, group, 2); - AddTestServer(&pool, 2, true, 0, true, group, 2); - AddTestServer(&pool, 3, true, 1, false, 0, 2); - pool.InitConnections(); - pool.SetRetryInterval(60); - - NewsServer* serv1 = pool.GetServers()->at(0).get(); - NewsServer* serv2 = pool.GetServers()->at(1).get(); - pool.BlockServer(serv1); - pool.BlockServer(serv2); - - NntpConnection* con1 = pool.GetConnection(0, nullptr, nullptr); - NntpConnection* con2 = pool.GetConnection(0, nullptr, nullptr); - NntpConnection* con3 = pool.GetConnection(0, nullptr, nullptr); - NntpConnection* con4 = pool.GetConnection(0, nullptr, nullptr); - - // all servers on level 0 are optional and blocked; - // we should get a connection from level-1 server (server 3) - REQUIRE(con1 != nullptr); - REQUIRE(con2 != nullptr); - REQUIRE(con3 == nullptr); - REQUIRE(con4 == nullptr); - CHECK(con1->GetNewsServer()->GetLevel() == 1); - CHECK(con2->GetNewsServer()->GetLevel() == 1); + TestBlockServers(1); } -TEST_CASE("Server pool: block optional and non-optional servers", "[ServerPool]") +BOOST_AUTO_TEST_CASE(BlockOptionalServersUngrouped) { - int group; - SECTION("ungrouped") { group = 0; } - SECTION("grouped") { group = 1; } - - ServerPool pool; - AddTestServer(&pool, 1, true, 0, true, group, 2); - AddTestServer(&pool, 2, true, 0, false, group, 2); - AddTestServer(&pool, 3, true, 1, false, 0, 2); - pool.InitConnections(); - pool.SetRetryInterval(60); + TestOptionalBlockServers(0); +} - NewsServer* serv1 = pool.GetServers()->at(0).get(); - NewsServer* serv2 = pool.GetServers()->at(1).get(); - pool.BlockServer(serv1); - pool.BlockServer(serv2); +BOOST_AUTO_TEST_CASE(BlockOptionalServersGrouped) +{ + TestOptionalBlockServers(1); +} - NntpConnection* con1 = pool.GetConnection(0, nullptr, nullptr); - NntpConnection* con2 = pool.GetConnection(0, nullptr, nullptr); - NntpConnection* con3 = pool.GetConnection(0, nullptr, nullptr); - NntpConnection* con4 = pool.GetConnection(0, nullptr, nullptr); +BOOST_AUTO_TEST_CASE(BlockOptionalAndNonOptionalServersUngrouped) +{ + TestBlockOptionalAndNonOptionalServers(0); +} - // all servers on level 0 are blocked but one of them is non-optional - // we should NOT get any connections - REQUIRE(con1 == nullptr); - REQUIRE(con2 == nullptr); - REQUIRE(con3 == nullptr); - REQUIRE(con4 == nullptr); +BOOST_AUTO_TEST_CASE(BlockOptionalAndNonOptionalServersGrouped) +{ + TestBlockOptionalAndNonOptionalServers(1); } diff --git a/tests/postprocess/CMakeLists.txt b/tests/postprocess/CMakeLists.txt new file mode 100644 index 00000000..fa5d711c --- /dev/null +++ b/tests/postprocess/CMakeLists.txt @@ -0,0 +1,55 @@ +file(GLOB PostprocessTestsSrc + main.cpp + DirectUnpackTest.cpp + DupeMatcherTest.cpp + ParCheckerTest.cpp + ParRenamerTest.cpp + RarReaderTest.cpp + ../suite/TestUtil.cpp + ${CMAKE_SOURCE_DIR}/daemon/postprocess/DirectUnpack.cpp + ${CMAKE_SOURCE_DIR}/daemon/postprocess/DupeMatcher.cpp + ${CMAKE_SOURCE_DIR}/daemon/postprocess/ParChecker.cpp + ${CMAKE_SOURCE_DIR}/daemon/postprocess/ParParser.cpp + ${CMAKE_SOURCE_DIR}/daemon/postprocess/ParRenamer.cpp + ${CMAKE_SOURCE_DIR}/daemon/postprocess/RarReader.cpp + ${CMAKE_SOURCE_DIR}/daemon/main/Options.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/NString.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/Util.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/Thread.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/Log.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/Script.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/FileSystem.cpp + ${CMAKE_SOURCE_DIR}/daemon/queue/DownloadInfo.cpp + ${CMAKE_SOURCE_DIR}/daemon/queue/DiskState.cpp + ${CMAKE_SOURCE_DIR}/lib/regex/regex.c +) + +if (NOT WIN32) + set(PostprocessTests ${PostprocessTestsSrc} ${CMAKE_BINARY_DIR}/code_revision.cpp) +endif() + +add_executable(PostprocessTests ${PostprocessTestsSrc}) +target_link_libraries(PostprocessTests PRIVATE + ZLIB::ZLIB + Yencode + Par2 + OpenSSL::SSL + OpenSSL::Crypto +) +target_include_directories(PostprocessTests PRIVATE + ../suite + ${CMAKE_SOURCE_DIR}/daemon/main + ${CMAKE_SOURCE_DIR}/daemon/postprocess + ${CMAKE_SOURCE_DIR}/daemon/util + ${CMAKE_SOURCE_DIR}/daemon/queue + ${CMAKE_SOURCE_DIR}/daemon/feed + ${CMAKE_SOURCE_DIR}/daemon/remote + ${CMAKE_SOURCE_DIR}/daemon/connect + ${CMAKE_SOURCE_DIR}/daemon/nntp + ${CMAKE_SOURCE_DIR}/lib/yencode + ${CMAKE_SOURCE_DIR}/lib/par2 + ${Boost_INCLUDE_DIR} +) + +file(COPY ../testdata/rarrenamer DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME PostprocessTests COMMAND $ --log_level=message) diff --git a/tests/postprocess/DirectUnpackTest.cpp b/tests/postprocess/DirectUnpackTest.cpp index fd9bcde5..3e913fa0 100644 --- a/tests/postprocess/DirectUnpackTest.cpp +++ b/tests/postprocess/DirectUnpackTest.cpp @@ -20,12 +20,13 @@ #include "nzbget.h" -#include "catch.h" +#include +#include -#include "Options.h" #include "DirectUnpack.h" -#include "FileSystem.h" -#include "TestUtil.h" +#include "Log.h" +#include "Options.h" +#include "DiskState.h" class DirectUnpackDownloadQueueMock : public DownloadQueue { @@ -39,7 +40,7 @@ class DirectUnpackDownloadQueueMock : public DownloadQueue virtual void SaveChanged() {} }; -TEST_CASE("Direct-unpack simple", "[Rar][DirectUnpack][Unrar][Slow][TestData]") +BOOST_AUTO_TEST_CASE(DirectUnpackSimpleTest) { Options::CmdOptList cmdOpts; cmdOpts.push_back("WriteLog=none"); @@ -48,23 +49,32 @@ TEST_CASE("Direct-unpack simple", "[Rar][DirectUnpack][Unrar][Slow][TestData]") DirectUnpackDownloadQueueMock downloadQueue; - TestUtil::PrepareWorkingDir("empty"); - - INFO("This test requires working unrar 5 in search path"); - - REQUIRE(FileSystem::CopyFile((TestUtil::TestDataDir() + "/rarrenamer/testfile3.part01.rar").c_str(), - (TestUtil::WorkingDir() + "/testfile3.part01.rar").c_str())); - REQUIRE(FileSystem::CopyFile((TestUtil::TestDataDir() + "/rarrenamer/testfile3.part02.rar").c_str(), - (TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str())); - REQUIRE(FileSystem::CopyFile((TestUtil::TestDataDir() + "/rarrenamer/testfile3.part03.rar").c_str(), - (TestUtil::WorkingDir() + "/testfile3.part03.rar").c_str())); - + BOOST_TEST_MESSAGE("This test requires working unrar 5 in search path"); + + const std::string testDataDir = std::filesystem::current_path().string() + "/rarrenamer"; + const std::string workingDir = testDataDir + "/empty"; + std::filesystem::create_directory(workingDir); + + std::filesystem::copy( + (testDataDir + "/testfile3.part01.rar").c_str(), + (workingDir + "/testfile3.part01.rar").c_str() + ); + + std::filesystem::copy( + (testDataDir + "/testfile3.part02.rar").c_str(), + (workingDir + "/testfile3.part02.rar").c_str() + ); + std::filesystem::copy( + (testDataDir + "/testfile3.part03.rar").c_str(), + (workingDir + "/testfile3.part03.rar").c_str() + ); + std::unique_ptr nzbInfo = std::make_unique(); NzbInfo* nzbPtr = nzbInfo.get(); nzbInfo->SetName("test"); - nzbInfo->SetDestDir(TestUtil::WorkingDir().c_str()); + nzbInfo->SetDestDir(workingDir.c_str()); downloadQueue.GetQueue()->Add(std::move(nzbInfo), false); - + DirectUnpack::StartJob(nzbPtr); while (true) @@ -83,11 +93,12 @@ TEST_CASE("Direct-unpack simple", "[Rar][DirectUnpack][Unrar][Slow][TestData]") Util::Sleep(20); } - REQUIRE(nzbPtr->GetDirectUnpackStatus() == NzbInfo::nsSuccess); - REQUIRE(FileSystem::FileExists((TestUtil::WorkingDir() + "/_unpack/testfile3.dat").c_str())); + BOOST_CHECK(nzbPtr->GetDirectUnpackStatus() == NzbInfo::nsSuccess); + BOOST_CHECK(std::filesystem::exists((workingDir + "/_unpack/testfile3.dat").c_str())); + std::filesystem::remove_all(workingDir); } -TEST_CASE("Direct-unpack two archives", "[Rar][DirectUnpack][Unrar][Slow][TestData]") +BOOST_AUTO_TEST_CASE(DirectUnpackTwoArchives) { Options::CmdOptList cmdOpts; cmdOpts.push_back("WriteLog=none"); @@ -96,28 +107,42 @@ TEST_CASE("Direct-unpack two archives", "[Rar][DirectUnpack][Unrar][Slow][TestDa DirectUnpackDownloadQueueMock downloadQueue; - TestUtil::PrepareWorkingDir("empty"); - - INFO("This test requires working unrar 5 in search path"); - - REQUIRE(FileSystem::CopyFile((TestUtil::TestDataDir() + "/rarrenamer/testfile3.part01.rar").c_str(), - (TestUtil::WorkingDir() + "/testfile3.part01.rar").c_str())); - REQUIRE(FileSystem::CopyFile((TestUtil::TestDataDir() + "/rarrenamer/testfile3.part02.rar").c_str(), - (TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str())); - REQUIRE(FileSystem::CopyFile((TestUtil::TestDataDir() + "/rarrenamer/testfile3.part03.rar").c_str(), - (TestUtil::WorkingDir() + "/testfile3.part03.rar").c_str())); - - REQUIRE(FileSystem::CopyFile((TestUtil::TestDataDir() + "/rarrenamer/testfile5.part01.rar").c_str(), - (TestUtil::WorkingDir() + "/testfile5.part01.rar").c_str())); - REQUIRE(FileSystem::CopyFile((TestUtil::TestDataDir() + "/rarrenamer/testfile5.part02.rar").c_str(), - (TestUtil::WorkingDir() + "/testfile5.part02.rar").c_str())); - REQUIRE(FileSystem::CopyFile((TestUtil::TestDataDir() + "/rarrenamer/testfile5.part03.rar").c_str(), - (TestUtil::WorkingDir() + "/testfile5.part03.rar").c_str())); + BOOST_TEST_MESSAGE("This test requires working unrar 5 in search path"); + + const std::string testDataDir = std::filesystem::current_path().string() + "/testdata"; + const std::string workingDir = testDataDir + "empty"; + std::filesystem::create_directory(workingDir); + + std::filesystem::copy( + (testDataDir + "/testfile3.part01.rar").c_str(), + (workingDir + "/testfile3.part01.rar").c_str() + ); + std::filesystem::copy( + (testDataDir + "/testfile3.part02.rar").c_str(), + (workingDir + "/testfile3.part02.rar").c_str() + ); + std::filesystem::copy( + (testDataDir + "/testfile3.part03.rar").c_str(), + (workingDir + "/testfile3.part03.rar").c_str() + ); + + std::filesystem::copy( + (testDataDir + "/testfile5.part01.rar").c_str(), + (workingDir + "/testfile5.part01.rar").c_str() + ); + std::filesystem::copy( + (testDataDir + "/testfile5.part02.rar").c_str(), + (workingDir + "/testfile5.part02.rar").c_str() + ); + std::filesystem::copy( + (testDataDir + "/testfile5.part03.rar").c_str(), + (workingDir + "/testfile5.part03.rar").c_str() + ); std::unique_ptr nzbInfo = std::make_unique(); NzbInfo* nzbPtr = nzbInfo.get(); nzbInfo->SetName("test"); - nzbInfo->SetDestDir(TestUtil::WorkingDir().c_str()); + nzbInfo->SetDestDir(workingDir.c_str()); downloadQueue.GetQueue()->Add(std::move(nzbInfo), false); DirectUnpack::StartJob(nzbPtr); @@ -138,7 +163,8 @@ TEST_CASE("Direct-unpack two archives", "[Rar][DirectUnpack][Unrar][Slow][TestDa Util::Sleep(20); } - REQUIRE(nzbPtr->GetDirectUnpackStatus() == NzbInfo::nsSuccess); - REQUIRE(FileSystem::FileExists((TestUtil::WorkingDir() + "/_unpack/testfile3.dat").c_str())); - REQUIRE(FileSystem::FileExists((TestUtil::WorkingDir() + "/_unpack/testfile5.dat").c_str())); + BOOST_CHECK(nzbPtr->GetDirectUnpackStatus() == NzbInfo::nsSuccess); + BOOST_CHECK(std::filesystem::exists((workingDir + "/_unpack/testfile3.dat").c_str())); + BOOST_CHECK(std::filesystem::exists((workingDir + "/_unpack/testfile5.dat").c_str())); + std::filesystem::remove_all(workingDir); } diff --git a/tests/postprocess/DupeMatcherTest.cpp b/tests/postprocess/DupeMatcherTest.cpp index 382de20c..7cfbccc1 100644 --- a/tests/postprocess/DupeMatcherTest.cpp +++ b/tests/postprocess/DupeMatcherTest.cpp @@ -20,77 +20,86 @@ #include "nzbget.h" -#include "catch.h" +#include +#include -#include "Options.h" #include "DupeMatcher.h" -#include "FileSystem.h" -#include "TestUtil.h" +#include "Log.h" +#include "Options.h" +#include "DiskState.h" + +Log* g_Log; +Options* g_Options; +DiskState* g_DiskState; +char* (*g_EnvironmentVariables)[] = nullptr; +char* (*g_Arguments)[] = nullptr; -TEST_CASE("Dupe matcher", "[Par][DupeMatcher][Unrar][Slow][TestData]") +BOOST_AUTO_TEST_CASE(DupeMatcherTest) { Options options(nullptr, nullptr); - TestUtil::PrepareWorkingDir("DupeMatcher"); + const std::string testDataDir = std::filesystem::current_path().string() + "/rarrenamer"; + const std::string workingDir = testDataDir + "/DupeMatcher"; + std::filesystem::create_directory(workingDir); CString errmsg; // prepare directories - std::string dupe1(TestUtil::WorkingDir() + "/dupe1"); - REQUIRE(FileSystem::ForceDirectories(dupe1.c_str(), errmsg)); - TestUtil::CopyAllFiles(dupe1, TestUtil::TestDataDir() + "/parchecker"); + std::string dupe1(workingDir + "/dupe1"); + BOOST_CHECK(FileSystem::ForceDirectories(dupe1.c_str(), errmsg)); + std::filesystem::copy(dupe1, testDataDir + "/parchecker"); - std::string dupe2(TestUtil::WorkingDir() + "/dupe2"); - REQUIRE(FileSystem::ForceDirectories(dupe2.c_str(), errmsg)); - TestUtil::CopyAllFiles(dupe2, TestUtil::TestDataDir() + "/parchecker"); + std::string dupe2(workingDir + "/dupe2"); + BOOST_CHECK(FileSystem::ForceDirectories(dupe2.c_str(), errmsg)); + std::filesystem::copy(dupe2, testDataDir + "/parchecker"); FileSystem::DeleteFile((dupe2 + "/testfile.nfo").c_str()); - std::string rardupe1(TestUtil::TestDataDir() + "/dupematcher1"); - std::string rardupe2(TestUtil::TestDataDir() + "/dupematcher2"); + std::string rardupe1(testDataDir + "/dupematcher1"); + std::string rardupe2(testDataDir + "/dupematcher2"); - std::string nondupe(TestUtil::WorkingDir() + "/nondupe"); - REQUIRE(FileSystem::ForceDirectories(nondupe.c_str(), errmsg)); - TestUtil::CopyAllFiles(nondupe, TestUtil::TestDataDir() + "/parchecker"); + std::string nondupe(workingDir + "/nondupe"); + BOOST_CHECK(FileSystem::ForceDirectories(nondupe.c_str(), errmsg)); + std::filesystem::copy(nondupe, testDataDir + "/parchecker"); remove((nondupe + "/testfile.dat").c_str()); // now test int64 expectedSize = FileSystem::FileSize((dupe1 + "/testfile.dat").c_str()); - INFO("This test requires working unrar 5 in search path"); + BOOST_TEST_MESSAGE("This test requires working unrar 5 in search path"); DupeMatcher dupe1Matcher(dupe1.c_str(), expectedSize); - CHECK(dupe1Matcher.Prepare()); - CHECK(dupe1Matcher.MatchDupeContent(dupe2.c_str())); - CHECK(dupe1Matcher.MatchDupeContent(rardupe1.c_str())); - CHECK(dupe1Matcher.MatchDupeContent(rardupe2.c_str())); - CHECK_FALSE(dupe1Matcher.MatchDupeContent(nondupe.c_str())); + BOOST_CHECK(dupe1Matcher.Prepare()); + BOOST_CHECK(dupe1Matcher.MatchDupeContent(dupe2.c_str())); + BOOST_CHECK(dupe1Matcher.MatchDupeContent(rardupe1.c_str())); + BOOST_CHECK(dupe1Matcher.MatchDupeContent(rardupe2.c_str())); + BOOST_CHECK(dupe1Matcher.MatchDupeContent(nondupe.c_str()) == false); DupeMatcher dupe2Matcher(dupe2.c_str(), expectedSize); - CHECK(dupe2Matcher.Prepare()); - CHECK(dupe2Matcher.MatchDupeContent(dupe1.c_str())); - CHECK(dupe2Matcher.MatchDupeContent(rardupe1.c_str())); - CHECK(dupe2Matcher.MatchDupeContent(rardupe2.c_str())); - CHECK_FALSE(dupe2Matcher.MatchDupeContent(nondupe.c_str())); + BOOST_CHECK(dupe2Matcher.Prepare()); + BOOST_CHECK(dupe2Matcher.MatchDupeContent(dupe1.c_str())); + BOOST_CHECK(dupe2Matcher.MatchDupeContent(rardupe1.c_str())); + BOOST_CHECK(dupe2Matcher.MatchDupeContent(rardupe2.c_str())); + BOOST_CHECK(dupe2Matcher.MatchDupeContent(nondupe.c_str()) == false); DupeMatcher nonDupeMatcher(nondupe.c_str(), expectedSize); - CHECK_FALSE(nonDupeMatcher.Prepare()); - CHECK_FALSE(nonDupeMatcher.MatchDupeContent(dupe1.c_str())); - CHECK_FALSE(nonDupeMatcher.MatchDupeContent(dupe2.c_str())); - CHECK_FALSE(nonDupeMatcher.MatchDupeContent(rardupe1.c_str())); - CHECK_FALSE(nonDupeMatcher.MatchDupeContent(rardupe2.c_str())); + BOOST_CHECK(nonDupeMatcher.Prepare() == false); + BOOST_CHECK(nonDupeMatcher.MatchDupeContent(dupe1.c_str()) == false); + BOOST_CHECK(nonDupeMatcher.MatchDupeContent(dupe2.c_str()) == false); + BOOST_CHECK(nonDupeMatcher.MatchDupeContent(rardupe1.c_str()) == false); + BOOST_CHECK(nonDupeMatcher.MatchDupeContent(rardupe2.c_str()) == false); DupeMatcher rardupe1matcher(rardupe1.c_str(), expectedSize); - CHECK(rardupe1matcher.Prepare()); - CHECK(rardupe1matcher.MatchDupeContent(dupe1.c_str())); - CHECK(rardupe1matcher.MatchDupeContent(dupe2.c_str())); - CHECK(rardupe1matcher.MatchDupeContent(rardupe2.c_str())); - CHECK_FALSE(rardupe1matcher.MatchDupeContent(nondupe.c_str())); + BOOST_CHECK(rardupe1matcher.Prepare()); + BOOST_CHECK(rardupe1matcher.MatchDupeContent(dupe1.c_str())); + BOOST_CHECK(rardupe1matcher.MatchDupeContent(dupe2.c_str())); + BOOST_CHECK(rardupe1matcher.MatchDupeContent(rardupe2.c_str())); + BOOST_CHECK(rardupe1matcher.MatchDupeContent(nondupe.c_str()) == false); DupeMatcher rardupe2matcher(rardupe2.c_str(), expectedSize); - CHECK(rardupe2matcher.Prepare()); - CHECK(rardupe2matcher.MatchDupeContent(rardupe1.c_str())); - CHECK(rardupe2matcher.MatchDupeContent(dupe1.c_str())); - CHECK(rardupe2matcher.MatchDupeContent(dupe2.c_str())); - CHECK_FALSE(rardupe2matcher.MatchDupeContent(nondupe.c_str())); + BOOST_CHECK(rardupe2matcher.Prepare()); + BOOST_CHECK(rardupe2matcher.MatchDupeContent(rardupe1.c_str())); + BOOST_CHECK(rardupe2matcher.MatchDupeContent(dupe1.c_str())); + BOOST_CHECK(rardupe2matcher.MatchDupeContent(dupe2.c_str())); + BOOST_CHECK(rardupe2matcher.MatchDupeContent(nondupe.c_str()) == false); } diff --git a/tests/postprocess/ParCheckerTest.cpp b/tests/postprocess/ParCheckerTest.cpp index 7a099682..883143c3 100644 --- a/tests/postprocess/ParCheckerTest.cpp +++ b/tests/postprocess/ParCheckerTest.cpp @@ -20,7 +20,7 @@ #include "nzbget.h" -#include "catch.h" +#include #include "Options.h" #include "ParChecker.h" @@ -59,12 +59,12 @@ void ParCheckerMock::CorruptFile(const char* filename, int offset) std::string fullfilename(TestUtil::WorkingDir() + "/" + filename); FILE* file = fopen(fullfilename.c_str(), FOPEN_RBP); - REQUIRE(file != nullptr); + BOOST_CHECK(file != nullptr); fseek(file, offset, SEEK_SET); char b = 0; int written = fwrite(&b, 1, 1, file); - REQUIRE(written == 1); + BOOST_CHECK(written == 1); fclose(file); } @@ -89,7 +89,7 @@ ParCheckerMock::EFileStatus ParCheckerMock::FindFileCrc(const char* filename, ui uint32 ParCheckerMock::CalcFileCrc(const char* filename) { FILE* infile = fopen(filename, FOPEN_RB); - REQUIRE(infile); + BOOST_CHECK(infile); CharBuffer buffer(1024 * 64); Crc32 downloadCrc; @@ -106,7 +106,7 @@ uint32 ParCheckerMock::CalcFileCrc(const char* filename) return downloadCrc.Finish(); } -TEST_CASE("Par-checker: repair not needed", "[Par][ParChecker][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RepairNoNeedTest) { Options::CmdOptList cmdOpts; cmdOpts.push_back("ParRepair=no"); @@ -115,11 +115,11 @@ TEST_CASE("Par-checker: repair not needed", "[Par][ParChecker][Slow][TestData]") ParCheckerMock parChecker; parChecker.Execute(); - REQUIRE(parChecker.GetStatus() == ParChecker::psRepairNotNeeded); - REQUIRE(parChecker.GetParFull() == true); + BOOST_CHECK(parChecker.GetStatus() == ParChecker::psRepairNotNeeded); + BOOST_CHECK(parChecker.GetParFull() == true); } -TEST_CASE("Par-checker: repair possible", "[Par][ParChecker][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RepairPossibleTest) { Options::CmdOptList cmdOpts; cmdOpts.push_back("ParRepair=no"); @@ -129,11 +129,11 @@ TEST_CASE("Par-checker: repair possible", "[Par][ParChecker][Slow][TestData]") parChecker.CorruptFile("testfile.dat", 20000); parChecker.Execute(); - REQUIRE(parChecker.GetStatus() == ParChecker::psRepairPossible); - REQUIRE(parChecker.GetParFull() == true); + BOOST_CHECK(parChecker.GetStatus() == ParChecker::psRepairPossible); + BOOST_CHECK(parChecker.GetParFull() == true); } -TEST_CASE("Par-checker: repair successful", "[Par][ParChecker][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RepairSuccessfulTest) { Options::CmdOptList cmdOpts; cmdOpts.push_back("ParRepair=yes"); @@ -143,11 +143,11 @@ TEST_CASE("Par-checker: repair successful", "[Par][ParChecker][Slow][TestData]") parChecker.CorruptFile("testfile.dat", 20000); parChecker.Execute(); - REQUIRE(parChecker.GetStatus() == ParChecker::psRepaired); - REQUIRE(parChecker.GetParFull() == true); + BOOST_CHECK(parChecker.GetStatus() == ParChecker::psRepaired); + BOOST_CHECK(parChecker.GetParFull() == true); } -TEST_CASE("Par-checker: repair failed", "[Par][ParChecker][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RepairFailed) { Options::CmdOptList cmdOpts; cmdOpts.push_back("ParRepair=no"); @@ -163,11 +163,11 @@ TEST_CASE("Par-checker: repair failed", "[Par][ParChecker][Slow][TestData]") parChecker.CorruptFile("testfile.dat", 80000); parChecker.Execute(); - REQUIRE(parChecker.GetStatus() == ParChecker::psFailed); - REQUIRE(parChecker.GetParFull() == true); + BOOST_CHECK(parChecker.GetStatus() == ParChecker::psFailed); + BOOST_CHECK(parChecker.GetParFull() == true); } -TEST_CASE("Par-checker: quick verification repair not needed", "[Par][ParChecker][Slow][TestData]") +BOOST_AUTO_TEST_CASE(QuickVerificationRepairNotNeededTest) { Options::CmdOptList cmdOpts; cmdOpts.push_back("ParRepair=no"); @@ -177,11 +177,11 @@ TEST_CASE("Par-checker: quick verification repair not needed", "[Par][ParChecker parChecker.SetParQuick(true); parChecker.Execute(); - REQUIRE(parChecker.GetStatus() == ParChecker::psRepairNotNeeded); - REQUIRE(parChecker.GetParFull() == false); + BOOST_CHECK(parChecker.GetStatus() == ParChecker::psRepairNotNeeded); + BOOST_CHECK(parChecker.GetParFull() == false); } -TEST_CASE("Par-checker: quick verification repair successful", "[Par][ParChecker][Slow][TestData]") +BOOST_AUTO_TEST_CASE(QuickVerificationRepairSuccessfulTest) { Options::CmdOptList cmdOpts; cmdOpts.push_back("ParRepair=yes"); @@ -192,11 +192,11 @@ TEST_CASE("Par-checker: quick verification repair successful", "[Par][ParChecker parChecker.CorruptFile("testfile.dat", 20000); parChecker.Execute(); - REQUIRE(parChecker.GetStatus() == ParChecker::psRepaired); - REQUIRE(parChecker.GetParFull() == false); + BOOST_CHECK(parChecker.GetStatus() == ParChecker::psRepaired); + BOOST_CHECK(parChecker.GetParFull() == false); } -TEST_CASE("Par-checker: quick full verification repair successful", "[Par][ParChecker][Slow][TestData]") +BOOST_AUTO_TEST_CASE(QuickFullVerificationRepairSuccessfulTest) { Options::CmdOptList cmdOpts; cmdOpts.push_back("ParRepair=yes"); @@ -210,28 +210,28 @@ TEST_CASE("Par-checker: quick full verification repair successful", "[Par][ParCh // All files were damaged, the full verification was performed - REQUIRE(parChecker.GetStatus() == ParChecker::psRepaired); - REQUIRE(parChecker.GetParFull() == true); + BOOST_CHECK(parChecker.GetStatus() == ParChecker::psRepaired); + BOOST_CHECK(parChecker.GetParFull() == true); } -TEST_CASE("Par-checker: ignoring extensions", "[Par][ParChecker][Slow][TestData]") +BOOST_AUTO_TEST_CASE(IgnoringExtensionsTest) { Options::CmdOptList cmdOpts; cmdOpts.push_back("ParRepair=yes"); ParChecker::EStatus expectedStatus; - SECTION("ParIgnoreExt") - { - cmdOpts.push_back("ParIgnoreExt=.dat"); - expectedStatus = ParChecker::psRepairNotNeeded; - } + // SECTION("ParIgnoreExt") + // { + // cmdOpts.push_back("ParIgnoreExt=.dat"); + // expectedStatus = ParChecker::psRepairNotNeeded; + // } - SECTION("ExtCleanupDisk") - { - cmdOpts.push_back("ExtCleanupDisk=.dat"); - expectedStatus = ParChecker::psFailed; - } + // SECTION("ExtCleanupDisk") + // { + // cmdOpts.push_back("ExtCleanupDisk=.dat"); + // expectedStatus = ParChecker::psFailed; + // } Options options(&cmdOpts, nullptr); @@ -246,5 +246,5 @@ TEST_CASE("Par-checker: ignoring extensions", "[Par][ParChecker][Slow][TestData] parChecker.Execute(); - REQUIRE(parChecker.GetStatus() == expectedStatus); + BOOST_CHECK(parChecker.GetStatus() == expectedStatus); } diff --git a/tests/postprocess/ParRenamerTest.cpp b/tests/postprocess/ParRenamerTest.cpp index 5b80acba..6eeae41b 100644 --- a/tests/postprocess/ParRenamerTest.cpp +++ b/tests/postprocess/ParRenamerTest.cpp @@ -20,7 +20,7 @@ #include "nzbget.h" -#include "catch.h" +#include #include "Options.h" #include "ParRenamer.h" @@ -47,7 +47,7 @@ void ParRenamerMock::Execute() TestUtil::EnableCout(); } -TEST_CASE("Par-renamer: rename not needed", "[Par][ParRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameNotNeededTest) { Options::CmdOptList cmdOpts; cmdOpts.push_back("ParRename=yes"); @@ -56,10 +56,10 @@ TEST_CASE("Par-renamer: rename not needed", "[Par][ParRenamer][Slow][TestData]") ParRenamerMock parRenamer; parRenamer.Execute(); - REQUIRE(parRenamer.GetRenamedCount() == 0); + BOOST_CHECK(parRenamer.GetRenamedCount() == 0); } -TEST_CASE("Par-renamer: rename successful", "[Par][ParRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameSuccessfulTest) { Options::CmdOptList cmdOpts; cmdOpts.push_back("ParRename=yes"); @@ -69,11 +69,11 @@ TEST_CASE("Par-renamer: rename successful", "[Par][ParRenamer][Slow][TestData]") FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile.dat").c_str(), (TestUtil::WorkingDir() + "/123456").c_str()); parRenamer.Execute(); - REQUIRE(parRenamer.GetRenamedCount() == 1); - REQUIRE_FALSE(parRenamer.HasMissedFiles()); + BOOST_CHECK(parRenamer.GetRenamedCount() == 1); + BOOST_CHECK(parRenamer.HasMissedFiles() == false); } -TEST_CASE("Par-renamer: detecting missing", "[Par][ParRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(DetectingMissingTest) { Options::CmdOptList cmdOpts; cmdOpts.push_back("ParRename=yes"); @@ -82,14 +82,14 @@ TEST_CASE("Par-renamer: detecting missing", "[Par][ParRenamer][Slow][TestData]") ParRenamerMock parRenamer; FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile.dat").c_str(), (TestUtil::WorkingDir() + "/123456").c_str()); parRenamer.SetDetectMissing(true); - REQUIRE(FileSystem::DeleteFile((TestUtil::WorkingDir() + "/testfile.nfo").c_str())); + BOOST_CHECK(FileSystem::DeleteFile((TestUtil::WorkingDir() + "/testfile.nfo").c_str())); parRenamer.Execute(); - REQUIRE(parRenamer.GetRenamedCount() == 1); - REQUIRE(parRenamer.HasMissedFiles()); + BOOST_CHECK(parRenamer.GetRenamedCount() == 1); + BOOST_CHECK(parRenamer.HasMissedFiles()); } -TEST_CASE("Par-renamer: rename dupe par", "[Par][ParRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameDupeParTest) { Options::CmdOptList cmdOpts; cmdOpts.push_back("ParRename=yes"); @@ -101,11 +101,11 @@ TEST_CASE("Par-renamer: rename dupe par", "[Par][ParRenamer][Slow][TestData]") parRenamer.SetDetectMissing(true); parRenamer.Execute(); - REQUIRE(parRenamer.GetRenamedCount() == 5); - REQUIRE_FALSE(parRenamer.HasMissedFiles()); + BOOST_CHECK(parRenamer.GetRenamedCount() == 5); + BOOST_CHECK(parRenamer.HasMissedFiles() == false); } -TEST_CASE("Par-renamer: no par extension", "[Par][ParRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(NoParExtensionTest) { Options::CmdOptList cmdOpts; cmdOpts.push_back("ParRename=yes"); @@ -116,6 +116,6 @@ TEST_CASE("Par-renamer: no par extension", "[Par][ParRenamer][Slow][TestData]") parRenamer.SetDetectMissing(true); parRenamer.Execute(); - REQUIRE(parRenamer.GetRenamedCount() == 4); - REQUIRE_FALSE(parRenamer.HasMissedFiles()); + BOOST_CHECK(parRenamer.GetRenamedCount() == 4); + BOOST_CHECK(parRenamer.HasMissedFiles() == false); } diff --git a/tests/postprocess/RarReaderTest.cpp b/tests/postprocess/RarReaderTest.cpp index 800bede3..52e1eaa6 100644 --- a/tests/postprocess/RarReaderTest.cpp +++ b/tests/postprocess/RarReaderTest.cpp @@ -20,227 +20,227 @@ #include "nzbget.h" -#include "catch.h" +#include #include "RarReader.h" #include "FileSystem.h" #include "TestUtil.h" -TEST_CASE("Rar-reader: rar3", "[Rar][RarReader][Slow][TestData]") +BOOST_AUTO_TEST_CASE(Rar3Test) { { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile3.part01.rar").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 3); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 0); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 3); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 0); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile3.part02.rar").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 3); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 1); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 3); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 1); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile3.part03.rar").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 3); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 2); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 3); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 2); } } -TEST_CASE("Rar-reader: rar5", "[Rar][RarReader][Slow][TestData]") +BOOST_AUTO_TEST_CASE(Rar5Test) { { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile5.part01.rar").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 5); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 0); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 5); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 0); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile5.part02.rar").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 5); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 1); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 5); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 1); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile5.part03.rar").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 5); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 2); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 5); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 2); } } -TEST_CASE("Rar-reader: rar3 old naming", "[Rar][RarReader][Slow][TestData]") +BOOST_AUTO_TEST_CASE(Rar3OldNamingTest) { { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile3oldnam.rar").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 3); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == false); - REQUIRE(volume.GetVolumeNo() == 0); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 3); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == false); + BOOST_CHECK(volume.GetVolumeNo() == 0); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile3oldnam.r00").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 3); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == false); - REQUIRE(volume.GetVolumeNo() == 1); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 3); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == false); + BOOST_CHECK(volume.GetVolumeNo() == 1); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile3oldnam.r01").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 3); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == false); - REQUIRE(volume.GetVolumeNo() == 2); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 3); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == false); + BOOST_CHECK(volume.GetVolumeNo() == 2); } } #ifndef DISABLE_TLS -TEST_CASE("Rar-reader: rar3 encrypted data", "[Rar][RarReader][Slow][TestData]") +BOOST_AUTO_TEST_CASE(Rar3EncryptedDataTest) { { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile3encdata.part01.rar").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 3); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 0); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 3); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 0); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile3encdata.part02.rar").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 3); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 1); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 3); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 1); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile3encdata.part03.rar").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 3); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 2); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 3); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 2); } } -TEST_CASE("Rar-reader: rar5 encrypted data", "[Rar][RarReader][Slow][TestData]") +BOOST_AUTO_TEST_CASE(Rar5EncryptedDataTest) { { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile5encdata.part01.rar").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 5); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 0); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 5); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 0); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile5encdata.part02.rar").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 5); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 1); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 5); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 1); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile5encdata.part03.rar").c_str()); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 5); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 2); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 5); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 2); } } -TEST_CASE("Rar-reader: rar3 encrypted names", "[Rar][RarReader][Slow][TestData]") +BOOST_AUTO_TEST_CASE(Rar3EcryptedNamesTest) { { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile3encnam.part01.rar").c_str()); - REQUIRE(volume.Read() == false); - REQUIRE(volume.GetVersion() == 3); - REQUIRE(volume.GetEncrypted() == true); + BOOST_CHECK(volume.Read() == false); + BOOST_CHECK(volume.GetVersion() == 3); + BOOST_CHECK(volume.GetEncrypted() == true); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile3encnam.part01.rar").c_str()); volume.SetPassword("123"); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 3); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 0); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 3); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 0); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile3encnam.part02.rar").c_str()); volume.SetPassword("123"); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 3); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 1); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 3); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 1); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile3encnam.part03.rar").c_str()); volume.SetPassword("123"); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 3); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 2); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 3); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 2); } } -TEST_CASE("Rar-reader: rar5 encrypted names", "[Rar][RarReader][Slow][TestData]") +BOOST_AUTO_TEST_CASE(Rar5EncryptedNames) { { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile5encnam.part01.rar").c_str()); volume.SetPassword("123"); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 5); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 0); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 5); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 0); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile5encnam.part02.rar").c_str()); volume.SetPassword("123"); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 5); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 1); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 5); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 1); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile5encnam.part03.rar").c_str()); volume.SetPassword("123"); - REQUIRE(volume.Read() == true); - REQUIRE(volume.GetVersion() == 5); - REQUIRE(volume.GetMultiVolume() == true); - REQUIRE(volume.GetNewNaming() == true); - REQUIRE(volume.GetVolumeNo() == 2); + BOOST_CHECK(volume.Read() == true); + BOOST_CHECK(volume.GetVersion() == 5); + BOOST_CHECK(volume.GetMultiVolume() == true); + BOOST_CHECK(volume.GetNewNaming() == true); + BOOST_CHECK(volume.GetVolumeNo() == 2); } { RarVolume volume((TestUtil::TestDataDir() + "/rarrenamer/testfile5encnam.part01.rar").c_str()); - REQUIRE(volume.Read() == false); - REQUIRE(volume.GetVersion() == 5); - REQUIRE(volume.GetEncrypted() == true); + BOOST_CHECK(volume.Read() == false); + BOOST_CHECK(volume.GetVersion() == 5); + BOOST_CHECK(volume.GetEncrypted() == true); } } diff --git a/tests/postprocess/main.cpp b/tests/postprocess/main.cpp new file mode 100644 index 00000000..f097c936 --- /dev/null +++ b/tests/postprocess/main.cpp @@ -0,0 +1,2 @@ +#define BOOST_TEST_MODULE PostprocessTests +#include diff --git a/tests/queue/CMakeLists.txt b/tests/queue/CMakeLists.txt new file mode 100644 index 00000000..34501656 --- /dev/null +++ b/tests/queue/CMakeLists.txt @@ -0,0 +1,33 @@ +add_executable(NzbFileTest + NzbFileTest.cpp + ${CMAKE_SOURCE_DIR}/daemon/queue/NzbFile.cpp + ${CMAKE_SOURCE_DIR}/daemon/queue/DiskState.cpp + ${CMAKE_SOURCE_DIR}/daemon/queue/DownloadInfo.cpp + ${CMAKE_SOURCE_DIR}/daemon/feed/FeedInfo.cpp + ${CMAKE_SOURCE_DIR}/daemon/main/Options.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/NString.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/Util.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/FileSystem.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/NString.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/Log.cpp + ${CMAKE_SOURCE_DIR}/daemon/nntp/NewsServer.cpp + ${CMAKE_SOURCE_DIR}/lib/regex/regex.c +) +target_link_libraries(NzbFileTest PRIVATE + ZLIB::ZLIB + Yencode +) +target_include_directories(NzbFileTest PRIVATE + ${CMAKE_SOURCE_DIR}/daemon/main + ${CMAKE_SOURCE_DIR}/daemon/util + ${CMAKE_SOURCE_DIR}/daemon/queue + ${CMAKE_SOURCE_DIR}/daemon/feed + ${CMAKE_SOURCE_DIR}/daemon/remote + ${CMAKE_SOURCE_DIR}/daemon/nntp + ${CMAKE_SOURCE_DIR}/lib/yencode + ${OPENSSL_INCLUDE_DIR} + ${Boost_INCLUDE_DIR} +) + +file(COPY ../testdata/nzbfile DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME NzbFileTest COMMAND $ --log_level=message) diff --git a/tests/queue/NzbFileTest.cpp b/tests/queue/NzbFileTest.cpp index 7e93060a..d360c67d 100644 --- a/tests/queue/NzbFileTest.cpp +++ b/tests/queue/NzbFileTest.cpp @@ -20,48 +20,58 @@ #include "nzbget.h" -#include "catch.h" +#define BOOST_TEST_MODULE "NzbFileTest" +#include + +#include #include "NzbFile.h" +#include "Log.h" #include "Options.h" -#include "TestUtil.h" +#include "DiskState.h" + +Log* g_Log; +Options* g_Options; +DiskState* g_DiskState; void TestNzb(std::string testFilename) { - INFO(std::string("Filename: ") + testFilename); + BOOST_TEST_MESSAGE(std::string("Filename: ") + testFilename); + + std::string path = std::filesystem::current_path().string(); - std::string nzbFilename(TestUtil::TestDataDir() + "/nzbfile/"+ testFilename + ".nzb"); - std::string infoFilename(TestUtil::TestDataDir() + "/nzbfile/"+ testFilename + ".txt"); + std::string nzbFilename(path + "/nzbfile/" + testFilename + ".nzb"); + std::string infoFilename(path + "/nzbfile/" + testFilename + ".txt"); NzbFile nzbFile(nzbFilename.c_str(), ""); bool parsedOK = nzbFile.Parse(); - REQUIRE(parsedOK == true); + BOOST_CHECK(parsedOK == true); FILE* infofile = fopen(infoFilename.c_str(), FOPEN_RB); - REQUIRE(infofile != nullptr); + BOOST_CHECK(infofile != nullptr); char buffer[1024]; while (fgets(buffer, sizeof(buffer), infofile) && *buffer == '#') ; - REQUIRE(*buffer); + BOOST_CHECK(*buffer); int fileCount = atoi(buffer); std::unique_ptr nzbInfo = nzbFile.DetachNzbInfo(); - REQUIRE(nzbInfo->GetFileCount() == fileCount); + BOOST_CHECK(nzbInfo->GetFileCount() == fileCount); for (int i = 0; i < fileCount; i++) { while (fgets(buffer, sizeof(buffer), infofile) && *buffer == '#') ; - REQUIRE(*buffer); + BOOST_CHECK(*buffer); FileInfo* fileInfo = nzbInfo->GetFileList()->at(i).get(); - REQUIRE(fileInfo != nullptr); + BOOST_CHECK(fileInfo != nullptr); Util::TrimRight(buffer); - REQUIRE(std::string(fileInfo->GetFilename()) == std::string(buffer)); + BOOST_CHECK(std::string(fileInfo->GetFilename()) == std::string(buffer)); } fclose(infofile); } -TEST_CASE("Nzb parser", "[NzbFile][TestData]") +BOOST_AUTO_TEST_CASE(NZBParser) { Options::CmdOptList cmdOpts; Options options(&cmdOpts, nullptr); diff --git a/tests/suite/TestMain.cpp b/tests/suite/TestMain.cpp deleted file mode 100644 index fc724b31..00000000 --- a/tests/suite/TestMain.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * This file is part of nzbget. See . - * - * Copyright (C) 2015-2016 Andrey Prygunkov - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -#include "nzbget.h" - -#define CATCH_CONFIG_RUNNER -#include "catch.h" - -#include "Thread.h" -#include "Log.h" -#include "Util.h" -#include "FileSystem.h" -#include "TestUtil.h" - -int TestMain(int argc, char * argv[]) -{ - TestUtil::Init(argv[0]); - Log log; - Thread::Init(); - - if (argc == 1) - { - printf("Unit and integration tests for nzbget-%s.\nUse '%s -tests [quick]' to run only quick tests or '%s -h' for more options.\n", - Util::VersionRevision(), FileSystem::BaseFileName(argv[0]), FileSystem::BaseFileName(argv[0])); - } - - // shift arguments for catch to not see the parameter "-tests" - char** testsargv = (char**)malloc(sizeof(char*) * (argc + 1)); - char firstArg[1024]; - snprintf(firstArg, 1024, "%s %s", argv[0], argv[1]); - firstArg[1024-1] = '\0'; - testsargv[0] = firstArg; - for (int i = 2; i < argc; i++) - { - testsargv[i-1] = argv[i]; - } - argc--; - testsargv[argc] = nullptr; - - int ret = Catch::Session().run(argc, testsargv); - - free(testsargv); - TestUtil::Final(); - - return ret; -} - -void TestCleanup() -{ - // If tests were run (via "TestMain") the Catch-framework does clean up automatically. - // However, if no tests were run, the global objects remain alive and causing memory leak - // detection reports. Therefore we clean up the Catch-framework when we don't run any tests. - Catch::cleanUp(); -} diff --git a/tests/suite/TestMain.h b/tests/suite/TestMain.h deleted file mode 100644 index c477010e..00000000 --- a/tests/suite/TestMain.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This file is part of nzbget. See . - * - * Copyright (C) 2015-2016 Andrey Prygunkov - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -#ifndef TESTMAIN_H -#define TESTMAIN_H - -int TestMain(int argc, char * argv[]); -void TestCleanup(); - -#endif diff --git a/tests/suite/TestUtil.cpp b/tests/suite/TestUtil.cpp index 7507271e..cc599bd5 100644 --- a/tests/suite/TestUtil.cpp +++ b/tests/suite/TestUtil.cpp @@ -19,12 +19,16 @@ #include "nzbget.h" + #include -#include "catch.h" +#include #include "Util.h" #include "FileSystem.h" #include "TestUtil.h" +#include "Log.h" +#include "Options.h" +#include "DiskState.h" bool TestUtil::m_usedWorkingDir = false; std::string DataDir; @@ -98,9 +102,9 @@ void TestUtil::PrepareWorkingDir(const std::string templateDir) retries--; FileSystem::DeleteDirectoryWithContent(workDir.c_str(), errmsg); } - REQUIRE_FALSE(FileSystem::DirectoryExists(workDir.c_str())); + assert(FileSystem::DirectoryExists(workDir.c_str()) == false); FileSystem::CreateDirectory(workDir.c_str()); - REQUIRE(FileSystem::DirEmpty(workDir.c_str())); + assert(FileSystem::DirEmpty(workDir.c_str())); CopyAllFiles(workDir, srcDir); } @@ -112,7 +116,7 @@ void TestUtil::CopyAllFiles(const std::string destDir, const std::string srcDir) { std::string srcFile(srcDir + "/" + filename); std::string dstFile(destDir + "/" + filename); - REQUIRE(FileSystem::CopyFile(srcFile.c_str(), dstFile.c_str())); + assert(FileSystem::CopyFile(srcFile.c_str(), dstFile.c_str())); } } diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt new file mode 100644 index 00000000..8ffb232f --- /dev/null +++ b/tests/util/CMakeLists.txt @@ -0,0 +1,32 @@ +file(GLOB UtilTestSrc + main.cpp + FileSystemTest.cpp + UtilTest.cpp + NStringTest.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/FileSystem.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/NString.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/Util.cpp + ${CMAKE_SOURCE_DIR}/lib/regex/regex.c +) + +if (NOT WIN32) + set(UtilTestSrc ${UtilTestSrc} ${CMAKE_BINARY_DIR}/code_revision.cpp) +endif() + +add_executable(UtilTests ${UtilTestSrc}) +target_link_libraries(UtilTests PRIVATE + ZLIB::ZLIB + Yencode + ${LIBXML2_LIBRARIES} +) +target_include_directories(UtilTests PRIVATE + ${CMAKE_SOURCE_DIR}/daemon/main + ${CMAKE_SOURCE_DIR}/daemon/util + ${CMAKE_SOURCE_DIR}/lib/regex + ${CMAKE_SOURCE_DIR}/lib/yencode + ${ZLIB_INCLUDE_DIR} + ${OPENSSL_INCLUDE_DIR} + ${Boost_INCLUDE_DIR} +) + +add_test(NAME UtilTests COMMAND $ --log_level=message) diff --git a/tests/util/FileSystemTest.cpp b/tests/util/FileSystemTest.cpp index cf4e03ff..7d33b4bb 100644 --- a/tests/util/FileSystemTest.cpp +++ b/tests/util/FileSystemTest.cpp @@ -20,20 +20,20 @@ #include "nzbget.h" -#include "catch.h" +#include #include "FileSystem.h" #ifdef WIN32 -TEST_CASE("FileSystem: MakeCanonicalPath", "[FileSystem][Quick]") +BOOST_AUTO_TEST_CASE(FileSystemTest) { - REQUIRE(!strcmp(FileSystem::MakeCanonicalPath("C:\\Program Files\\NZBGet"), "C:\\Program Files\\NZBGet")); - REQUIRE(!strcmp(FileSystem::MakeCanonicalPath("C:\\Program Files\\NZBGet\\"), "C:\\Program Files\\NZBGet\\")); - REQUIRE(!strcmp(FileSystem::MakeCanonicalPath("C:\\\\Program Files\\\\NZBGet"), "C:\\Program Files\\NZBGet")); - REQUIRE(!strcmp(FileSystem::MakeCanonicalPath("C:\\Program Files\\NZBGet\\scripts\\.."), "C:\\Program Files\\NZBGet\\")); - REQUIRE(!strcmp(FileSystem::MakeCanonicalPath("C:\\Program Files\\NZBGet\\scripts\\email\\..\\.."), "C:\\Program Files\\NZBGet\\")); - REQUIRE(!strcmp(FileSystem::MakeCanonicalPath("C:\\Program Files\\NZBGet\\scripts\\email\\..\\..\\"), "C:\\Program Files\\NZBGet\\")); - REQUIRE(!strcmp(FileSystem::MakeCanonicalPath("C:\\Program Files\\NZBGet\\."), "C:\\Program Files\\NZBGet\\")); - REQUIRE(!strcmp(FileSystem::MakeCanonicalPath("\\\\server\\Program Files\\NZBGet\\scripts\\email\\..\\..\\"), "\\\\server\\Program Files\\NZBGet\\")); + BOOST_CHECK(!strcmp(FileSystem::MakeCanonicalPath("C:\\Program Files\\NZBGet"), "C:\\Program Files\\NZBGet")); + BOOST_CHECK(!strcmp(FileSystem::MakeCanonicalPath("C:\\Program Files\\NZBGet\\"), "C:\\Program Files\\NZBGet\\")); + BOOST_CHECK(!strcmp(FileSystem::MakeCanonicalPath("C:\\\\Program Files\\\\NZBGet"), "C:\\Program Files\\NZBGet")); + BOOST_CHECK(!strcmp(FileSystem::MakeCanonicalPath("C:\\Program Files\\NZBGet\\scripts\\.."), "C:\\Program Files\\NZBGet\\")); + BOOST_CHECK(!strcmp(FileSystem::MakeCanonicalPath("C:\\Program Files\\NZBGet\\scripts\\email\\..\\.."), "C:\\Program Files\\NZBGet\\")); + BOOST_CHECK(!strcmp(FileSystem::MakeCanonicalPath("C:\\Program Files\\NZBGet\\scripts\\email\\..\\..\\"), "C:\\Program Files\\NZBGet\\")); + BOOST_CHECK(!strcmp(FileSystem::MakeCanonicalPath("C:\\Program Files\\NZBGet\\."), "C:\\Program Files\\NZBGet\\")); + BOOST_CHECK(!strcmp(FileSystem::MakeCanonicalPath("\\\\server\\Program Files\\NZBGet\\scripts\\email\\..\\..\\"), "\\\\server\\Program Files\\NZBGet\\")); } #endif diff --git a/tests/util/NStringTest.cpp b/tests/util/NStringTest.cpp index fcbe908b..a39d0f42 100644 --- a/tests/util/NStringTest.cpp +++ b/tests/util/NStringTest.cpp @@ -16,174 +16,173 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - + #include "nzbget.h" -#include "catch.h" - -#include "NString.h" +#include +#include "NString.h" -TEST_CASE("BString", "[NString][Quick]") +BOOST_AUTO_TEST_CASE(BStringTest) { BString<100> str; - REQUIRE(sizeof(str) == sizeof(char[100])); - REQUIRE(str.Empty()); - REQUIRE(str); + BOOST_CHECK(sizeof(str) == sizeof(char[100])); + BOOST_CHECK(str.Empty()); + BOOST_CHECK(str); str = "Hello, world"; - REQUIRE(!str.Empty()); - REQUIRE(str); - REQUIRE(!strcmp(str, "Hello, world")); + BOOST_CHECK(!str.Empty()); + BOOST_CHECK(str); + BOOST_CHECK(!strcmp(str, "Hello, world")); str.Format("Hi, %s%c: %i", "World", '!', 21); - REQUIRE(!strcmp(str, "Hi, World!: 21")); + BOOST_CHECK(!strcmp(str, "Hi, World!: 21")); BString<20> str2; str2 = "Hello, world 01234567890123456789"; - REQUIRE(!strcmp(str2, "Hello, world 012345")); + BOOST_CHECK(!strcmp(str2, "Hello, world 012345")); str2.Format("0123456789 Hi, %s%c: %i", "World", '!', 21); - REQUIRE(!strcmp(str2, "0123456789 Hi, Worl")); + BOOST_CHECK(!strcmp(str2, "0123456789 Hi, Worl")); BString<20> str3; memcpy(str3, "Hello, 0123456789 world", str3.Capacity()); str3[str3.Capacity()] = '\0'; - REQUIRE(!strcmp(str3, "Hello, 0123456789 w")); + BOOST_CHECK(!strcmp(str3, "Hello, 0123456789 w")); str3 = "String 3 Test World, Hello!"; - REQUIRE(!strcmp(str3, "String 3 Test World")); + BOOST_CHECK(!strcmp(str3, "String 3 Test World")); BString<100> str4; str4 = "String 4 initialized"; - REQUIRE(!strcmp(str4, "String 4 initialized")); + BOOST_CHECK(!strcmp(str4, "String 4 initialized")); BString<20> str5("Hi, %s%c: %i", "World", '!', 21); - REQUIRE(!strcmp(str5, "Hi, World!: 21")); + BOOST_CHECK(!strcmp(str5, "Hi, World!: 21")); BString<20> str6; str6.Append("Hello, World"); str6.Append("String5String5"); str6.Append("67"); str6.Append("0123456789", 5); - REQUIRE(!strcmp(str6, "Hello, WorldString5")); + BOOST_CHECK(!strcmp(str6, "Hello, WorldString5")); BString<20> str7; str7.Append("0123456789", 5); - REQUIRE(!strcmp(str7, "01234")); + BOOST_CHECK(!strcmp(str7, "01234")); BString<20> str8; str8.Append("0123456789", 5); str8.AppendFmt("%i:%i", 87, 65); - REQUIRE(!strcmp(str8, "0123487:65")); + BOOST_CHECK(!strcmp(str8, "0123487:65")); const char* txt = "String 9 initialized"; BString<100> str9 = txt; - REQUIRE(!strcmp(str9, "String 9 initialized")); + BOOST_CHECK(!strcmp(str9, "String 9 initialized")); } -TEST_CASE("CString", "[NString][Quick]") +BOOST_AUTO_TEST_CASE(CStringTest) { CString str; - REQUIRE(sizeof(str) == sizeof(char*)); - REQUIRE(str.Empty()); - REQUIRE(!str); + BOOST_CHECK(sizeof(str) == sizeof(char*)); + BOOST_CHECK(str.Empty()); + BOOST_CHECK(!str); str = "Hello, world"; - REQUIRE(!str.Empty()); - REQUIRE(str); - REQUIRE(!strcmp(str, "Hello, world")); + BOOST_CHECK(!str.Empty()); + BOOST_CHECK(str); + BOOST_CHECK(!strcmp(str, "Hello, world")); str.Format("Hi, %s%c: %i", "World", '!', 21); - REQUIRE(!strcmp(str, "Hi, World!: 21")); + BOOST_CHECK(!strcmp(str, "Hi, World!: 21")); char* tmp = strdup("Hello there"); CString str2; str2.Bind(tmp); const char* tmp3 = *str2; - REQUIRE(tmp == tmp3); - REQUIRE(!strcmp(str2, "Hello there")); - REQUIRE(tmp == *str2); + BOOST_CHECK(tmp == tmp3); + BOOST_CHECK(!strcmp(str2, "Hello there")); + BOOST_CHECK(tmp == *str2); free(tmp); char* tmp2 = str2.Unbind(); - REQUIRE(tmp2 == tmp); - REQUIRE(str2.Empty()); - REQUIRE(*str2 == nullptr); + BOOST_CHECK(tmp2 == tmp); + BOOST_CHECK(str2.Empty()); + BOOST_CHECK(*str2 == nullptr); CString str3("World 12345678901234567890"); char buf[50]; snprintf(buf, sizeof(buf), "Hi, %s%c: %i", *str3, '!', 21); - REQUIRE(!strcmp(buf, "Hi, World 12345678901234567890!: 21")); + BOOST_CHECK(!strcmp(buf, "Hi, World 12345678901234567890!: 21")); CString str4; - REQUIRE(*str4 == nullptr); - REQUIRE((char*)str4 == nullptr); - REQUIRE((const char*)str4 == nullptr); - REQUIRE(str4.Str() != nullptr); - REQUIRE(*str4.Str() == '\0'); + BOOST_CHECK(*str4 == nullptr); + BOOST_CHECK((char*)str4 == nullptr); + BOOST_CHECK((const char*)str4 == nullptr); + BOOST_CHECK(str4.Str() != nullptr); + BOOST_CHECK(*str4.Str() == '\0'); CString str6; str6.Append(""); str6.Append("Hello, World"); str6.Append("String5String5"); str6.Append("67"); - REQUIRE(!strcmp(str6, "Hello, WorldString5String567")); + BOOST_CHECK(!strcmp(str6, "Hello, WorldString5String567")); str6.Clear(); str6.Append("0123456789", 5); str6.AppendFmt("%i:%i", 87, 65); - REQUIRE(!strcmp(str6, "0123487:65")); + BOOST_CHECK(!strcmp(str6, "0123487:65")); std::vector vec1; vec1.push_back("Hello, there"); CString& str7 = vec1.back(); - REQUIRE(!strcmp(str7, "Hello, there")); + BOOST_CHECK(!strcmp(str7, "Hello, there")); - REQUIRE(!strcmp(CString::FormatStr("Many %s ago", "days"), "Many days ago")); + BOOST_CHECK(!strcmp(CString::FormatStr("Many %s ago", "days"), "Many days ago")); CString str8("Hello, World"); str8.Replace(1, 4, "i"); - REQUIRE(!strcmp(str8, "Hi, World")); + BOOST_CHECK(!strcmp(str8, "Hi, World")); str8.Replace(4, 5, "everybody"); - REQUIRE(!strcmp(str8, "Hi, everybody")); + BOOST_CHECK(!strcmp(str8, "Hi, everybody")); str8.Replace(4, 5, "nome", 2); - REQUIRE(!strcmp(str8, "Hi, nobody")); + BOOST_CHECK(!strcmp(str8, "Hi, nobody")); CString str9 = " Long string with spaces \t\r\n "; str9.TrimRight(); - REQUIRE(!strcmp(str9, " Long string with spaces")); + BOOST_CHECK(!strcmp(str9, " Long string with spaces")); int pos = str9.Find("with"); - REQUIRE(pos == 13); + BOOST_CHECK(pos == 13); str9.Replace("string", "with"); - REQUIRE(!strcmp(str9, " Long with with spaces")); + BOOST_CHECK(!strcmp(str9, " Long with with spaces")); str9.Replace("with", "without"); - REQUIRE(!strcmp(str9, " Long without without spaces")); + BOOST_CHECK(!strcmp(str9, " Long without without spaces")); str9.Replace("without", ""); - REQUIRE(!strcmp(str9, " Long spaces")); + BOOST_CHECK(!strcmp(str9, " Long spaces")); str8 = "test string"; str9 = "test string"; - REQUIRE(str8 == str9); + BOOST_CHECK(str8 == str9); bool eq = str8 == "test string"; - REQUIRE(eq); + BOOST_CHECK(eq); } -TEST_CASE("StringBuilder", "[NString][Quick]") +BOOST_AUTO_TEST_CASE(StringBuilderTest) { StringBuilder str6; str6.Append(""); str6.Append("Hello, World"); str6.Append("String5String5"); str6.Append("67"); - REQUIRE(!strcmp(str6, "Hello, WorldString5String567")); + BOOST_CHECK(!strcmp(str6, "Hello, WorldString5String567")); } -TEST_CASE("CharBuffer", "[NString][Quick]") +BOOST_AUTO_TEST_CASE(CharBufferTest) { CharBuffer buf(1024); - REQUIRE(buf.Size() == 1024); + BOOST_CHECK(buf.Size() == 1024); buf.Reserve(2048); - REQUIRE(buf.Size() == 2048); + BOOST_CHECK(buf.Size() == 2048); buf.Clear(); - REQUIRE(buf.Size() == 0); + BOOST_CHECK(buf.Size() == 0); } diff --git a/tests/util/UtilTest.cpp b/tests/util/UtilTest.cpp index 4cbb79eb..d2d19ee7 100644 --- a/tests/util/UtilTest.cpp +++ b/tests/util/UtilTest.cpp @@ -20,101 +20,101 @@ #include "nzbget.h" -#include "catch.h" +#include #include "Util.h" -TEST_CASE("WebUtil: XmlStripTags", "[Util][Quick]") +BOOST_AUTO_TEST_CASE(XmlStripTagsTest) { const char* xml = "
"; const char* text = " ID: 12345678 Name: Show name Size: 3.00 GB Attributes: Category - Movies > HD "; char* testString = strdup(xml); WebUtil::XmlStripTags(testString); - REQUIRE(strcmp(testString, text) == 0); + BOOST_CHECK(strcmp(testString, text) == 0); free(testString); } -TEST_CASE("WebUtil: XmlDecode", "[Util][Quick]") +BOOST_AUTO_TEST_CASE(XmlDecodeTest) { const char* xml = "Poster: Bob <bob@home> bad—and there's one thing"; const char* text = "Poster: Bob bad—and there's one thing"; char* testString = strdup(xml); WebUtil::XmlDecode(testString); - REQUIRE(strcmp(testString, text) == 0); + BOOST_CHECK(strcmp(testString, text) == 0); free(testString); } -TEST_CASE("WebUtil: XmlRemoveEntities", "[Util][Quick]") +BOOST_AUTO_TEST_CASE(XmlRemoveEntitiesTest) { const char* xml = "Poster: Bob <bob@home> bad—and there's one thing"; const char* text = "Poster: Bob bob@home bad and there s one thing"; char* testString = strdup(xml); WebUtil::XmlRemoveEntities(testString); - REQUIRE(strcmp(testString, text) == 0); + BOOST_CHECK(strcmp(testString, text) == 0); free(testString); } -TEST_CASE("WebUtil: URLEncode", "[Util][Quick]") +BOOST_AUTO_TEST_CASE(URLEncodeTest) { const char* badUrl = "http://www.example.com/nzb_get/12344/Debian V7 6 64 bit OS.nzb"; const char* correctedUrl = "http://www.example.com/nzb_get/12344/Debian%20V7%206%2064%20bit%20OS.nzb"; CString testString = WebUtil::UrlEncode(badUrl); - REQUIRE(strcmp(testString, correctedUrl) == 0); + BOOST_CHECK(strcmp(testString, correctedUrl) == 0); } -TEST_CASE("Util: WildMask", "[Util][Quick]") +BOOST_AUTO_TEST_CASE(WildMaskTest) { WildMask mask("*.par2", true); - REQUIRE_FALSE(mask.Match("Debian V7 6 64 bit OS.nzb")); - REQUIRE_FALSE(mask.Match("Debian V7 6 64 bit OS.par2.nzb")); - REQUIRE(mask.Match("Debian V7 6 64 bit OS.par2")); - REQUIRE(mask.Match(".par2")); - REQUIRE_FALSE(mask.Match("par2")); + BOOST_CHECK(mask.Match("Debian V7 6 64 bit OS.nzb") == false); + BOOST_CHECK(mask.Match("Debian V7 6 64 bit OS.par2.nzb") == false); + BOOST_CHECK(mask.Match("Debian V7 6 64 bit OS.par2")); + BOOST_CHECK(mask.Match(".par2")); + BOOST_CHECK(mask.Match("par2") == false); } -TEST_CASE("Util: RegEx", "[Util][Quick]") +BOOST_AUTO_TEST_CASE(RegExTest) { RegEx regExRar(".*\\.rar$"); RegEx regExRarMultiSeq(".*\\.[r-z][0-9][0-9]$"); RegEx regExSevenZip(".*\\.7z$|.*\\.7z\\.[0-9]+$"); RegEx regExNumExt(".*\\.[0-9]+$"); - REQUIRE(regExRar.Match("filename.rar")); - REQUIRE(regExRar.Match("filename.part001.rar")); - REQUIRE_FALSE(regExRar.Match("filename.rar.txt")); - - REQUIRE_FALSE(regExRarMultiSeq.Match("filename.rar")); - REQUIRE(regExRarMultiSeq.Match("filename.r01")); - REQUIRE(regExRarMultiSeq.Match("filename.r99")); - REQUIRE_FALSE(regExRarMultiSeq.Match("filename.r001")); - REQUIRE(regExRarMultiSeq.Match("filename.s01")); - REQUIRE(regExRarMultiSeq.Match("filename.t99")); - - REQUIRE(regExSevenZip.Match("filename.7z")); - REQUIRE_FALSE(regExSevenZip.Match("filename.7z.rar")); - REQUIRE(regExSevenZip.Match("filename.7z.1")); - REQUIRE(regExSevenZip.Match("filename.7z.001")); - REQUIRE(regExSevenZip.Match("filename.7z.123")); - REQUIRE(regExSevenZip.Match("filename.7z.999")); - - REQUIRE(regExNumExt.Match("filename.7z.1")); - REQUIRE(regExNumExt.Match("filename.7z.9")); - REQUIRE(regExNumExt.Match("filename.7z.001")); - REQUIRE(regExNumExt.Match("filename.7z.123")); - REQUIRE(regExNumExt.Match("filename.7z.999")); + BOOST_CHECK(regExRar.Match("filename.rar")); + BOOST_CHECK(regExRar.Match("filename.part001.rar")); + BOOST_CHECK(regExRar.Match("filename.rar.txt") == false); + + BOOST_CHECK(regExRarMultiSeq.Match("filename.rar") == false); + BOOST_CHECK(regExRarMultiSeq.Match("filename.r01")); + BOOST_CHECK(regExRarMultiSeq.Match("filename.r99")); + BOOST_CHECK(regExRarMultiSeq.Match("filename.r001") == false); + BOOST_CHECK(regExRarMultiSeq.Match("filename.s01")); + BOOST_CHECK(regExRarMultiSeq.Match("filename.t99")); + + BOOST_CHECK(regExSevenZip.Match("filename.7z")); + BOOST_CHECK(regExSevenZip.Match("filename.7z.rar") == false); + BOOST_CHECK(regExSevenZip.Match("filename.7z.1")); + BOOST_CHECK(regExSevenZip.Match("filename.7z.001")); + BOOST_CHECK(regExSevenZip.Match("filename.7z.123")); + BOOST_CHECK(regExSevenZip.Match("filename.7z.999")); + + BOOST_CHECK(regExNumExt.Match("filename.7z.1")); + BOOST_CHECK(regExNumExt.Match("filename.7z.9")); + BOOST_CHECK(regExNumExt.Match("filename.7z.001")); + BOOST_CHECK(regExNumExt.Match("filename.7z.123")); + BOOST_CHECK(regExNumExt.Match("filename.7z.999")); const char* testStr = "My.Show.Name.S01E02.ABC.720"; RegEx seasonEpisode(".*S([0-9]+)E([0-9]+).*"); - REQUIRE(seasonEpisode.IsValid()); - REQUIRE(seasonEpisode.Match(testStr)); - REQUIRE(seasonEpisode.GetMatchCount() == 3); - REQUIRE(seasonEpisode.GetMatchStart(1) == 14); - REQUIRE(seasonEpisode.GetMatchLen(1) == 2); + BOOST_CHECK(seasonEpisode.IsValid()); + BOOST_CHECK(seasonEpisode.Match(testStr)); + BOOST_CHECK(seasonEpisode.GetMatchCount() == 3); + BOOST_CHECK(seasonEpisode.GetMatchStart(1) == 14); + BOOST_CHECK(seasonEpisode.GetMatchLen(1) == 2); } diff --git a/tests/util/main.cpp b/tests/util/main.cpp new file mode 100644 index 00000000..bae6ac5f --- /dev/null +++ b/tests/util/main.cpp @@ -0,0 +1,2 @@ +#define BOOST_TEST_MODULE UtilTests +#include diff --git a/webui/index.html b/webui/index.html index a2dc35cc..db5e364b 100644 --- a/webui/index.html +++ b/webui/index.html @@ -602,11 +602,7 @@

Copyright

Par2

NZBGet uses Par2 by Peter Brian Clements with library interface by Francois Lesueur.

Par2 is licensed under the GPL license.

- -

Catch

-

NZBGet uses C++ testing framework Catch by Two Blue Cubes Ltd.

-

Catch is licensed under the Boost Software License.

- +

jQuery

NZBGet web-interface uses jQuery. The jQuery Project is run by a distributed group of volunteers that all want to see jQuery become the best JavaScript tool possible.

jQuery is licensed under the MIT and GPL licenses.

@@ -626,6 +622,10 @@

Elycharts

iconSweets

NZBGet web-interface includes selected icons from collections iconSweets and iconSweets2 by Yummygum.

The icons are generally licensed under a custom license but used in NZBGet with author's permission.

+ +

Boost

+

NZBGet uses Boost by Boost organization and wider Boost community

+

Boost is licensed under the Boost Software License.

From dc1cfebd067237f20cf80d70b4089399a3d501e2 Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Mon, 27 Nov 2023 09:49:18 +0300 Subject: [PATCH 09/34] Update README and CONTRIBUTING (#63) --- CONTRIBUTING.md | 39 +++++++++++++++++++++++++++++++++++++++ README.md | 29 +++++++++++------------------ 2 files changed, 50 insertions(+), 18 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..2f6e8d6c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,39 @@ +# How to Contribute # + +While we are working on NZBGet project all the time, we still would really like and need help on many areas: + +- Major - code contributions on features and bugs +- Improvements in tests +- Improvements on documentation + +We entice our users to participate in the project, please don't hesitate to get involved - create a [new issue](https://github.com/nzbgetcom/nzbget/issues/new) or [pull request](https://github.com/nzbgetcom/nzbget/compare) - that would also greatly help if you'll share your usage experience. + +## Documentation ## + +Main documentation is available on the NZBGet.com website - [https://nzbget.com/documentation/](https://nzbget.com/documentation/) + +## Development ## + +NZBGet natively supports for multiple platforms and build options, so each platform has their own development documenation, including: + +- [General documentation, including Posix](https://github.com/nzbgetcom/nzbget/blob/develop/README) +- [Windows](https://github.com/nzbgetcom/nzbget/blob/develop/windows/README-WINDOWS.txt) +- [Docker](https://github.com/nzbgetcom/nzbget/blob/develop/docker/README.md) + +### Branches naming policy ### + +- `main` is a protected branch that contains only release code +- `develop` is a protected branch for development +- new branches should follow the following convention: + - `hotfix/brief-description` for any small hotfixes + - `feature/brief-description` for any new developments + - `bugfix/brief-description` for bugs + +### Pull requests flow for `develop` and `main` branches ### + +1. For PRs targeting `develop` branch `Squash and merge` mode must be used. +2. After merging branch to `develop`, branch must be deleted. +3. For release PR (`develop` -> `main`) `Create a merge commit` mode must be used. +4. After merging `develop` -> `main`, must be back merge `main` -> `develop` before any changes in `develop` branch. + +This flow results to the fact that in the PR to master branch we see only the squashed commits that correspond to the PRs in the develop branch in current release cycle. diff --git a/README.md b/README.md index 14060a27..87561fb4 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![License](https://img.shields.io/badge/license-GPL-blue.svg)](http://www.gnu.org/licenses/) ![GitHub release (by tag)](https://img.shields.io/github/downloads/nzbgetcom/nzbget/v22.0/total?label=v22.0) +![docker pulls](https://img.shields.io/docker/pulls/nzbgetcom/nzbget.svg) + [![linux build](https://github.com/nzbgetcom/nzbget/actions/workflows/linux.yml/badge.svg?branch=main)](https://github.com/nzbgetcom/nzbget/actions/workflows/linux.yml) [![windows build](https://github.com/nzbgetcom/nzbget/actions/workflows/windows.yml/badge.svg?branch=main)](https://github.com/nzbgetcom/nzbget/actions/workflows/windows.yml) [![osx build](https://github.com/nzbgetcom/nzbget/actions/workflows/osx.yml/badge.svg)](https://github.com/nzbgetcom/nzbget/actions/workflows/osx.yml) @@ -33,29 +35,20 @@ Please download binaries from our [releases](https://github.com/nzbgetcom/nzbget We also provide a docker image for popular architectures. [Docker readme](docker/README.md) -## Building from sources - -Please follow [instructions](https://nzbget.com/documentation/building-development-version/) on the website +## Supported platforms for installers -## Contribution +`Windows`: Windows 7 and later, 32 or 64 Bit. -Branches naming policy +`Linux`: Linux kernel 2.6 and later, x86 (32 or 64 Bit), ARM 32-bit (armel armhf), ARM 64-bit (aarch64) -- `main` is a protected branch that contains only release code -- `develop` is a protected branch for development -- new branches should follow the following convention: - - `hotfix/brief-description` for any small hotfixes - - `feature/brief-description` for any new developments - - `bugfix/brief-description` for bugs +`macOS`: macOS 10.13 High Sierra and later, Intel / Apple Silicon. -Pull requests flow for `develop` and `main` branches: +## Building from sources -1. For PRs targeting `develop` branch `Squash and merge` mode must be used. -2. After merging branch to `develop`, branch must be deleted. -3. For release PR (`develop` -> `main`) `Create a merge commit` mode must be used. -4. After merging `develop` -> `main`, must be back merge `main` -> `develop` before any changes in `develop` branch. +Please follow [instructions](https://nzbget.com/documentation/building-development-version/) on the website -This flow results to the fact that in the PR to master branch we see only the squashed commits that correspond to the PRs in the develop branch in current release cycle. +## Contribution +Contributions are very welcome - not only from developers, but from our users too - please don't hesitate to participate in [discussions](https://github.com/nzbgetcom/nzbget/discussions) or [create a new discussion](https://github.com/nzbgetcom/nzbget/discussions/new/choose) -We entice our users to participate in the project, please don't hesitate to get involved - create a [new issue](https://github.com/nzbgetcom/nzbget/issues/new) or [pull request](https://github.com/nzbgetcom/nzbget/compare)! \ No newline at end of file +For more information - see [Contributing](CONTRIBUTING.md). \ No newline at end of file From b36d1b7826170a9c884ee94a449328b7fb7d58a9 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 28 Nov 2023 16:24:46 +0300 Subject: [PATCH 10/34] Feature/update platforms readme (#69) * Update README * new contribution.md and readme revamp * Add docker pulls badge * Feature/pull-request-template (#68) * PR template * donate on readme --------- Co-authored-by: phnzb --- .github/PULL_REQUEST_TEMPLATE.md | 11 +++++++++++ README.md | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..333e96f5 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,11 @@ +## Description + +Brief explanation of the goal, link issues covered (partially or fully resolved) by this pull request + +## Lib changes + +If vendored libraries are getting changed, please list new version, old version, and what kind of dependencies or restrictions it may introduce + +## Testing + +Mention smoke testing done or extra QA instructions \ No newline at end of file diff --git a/README.md b/README.md index 87561fb4..3eea975a 100644 --- a/README.md +++ b/README.md @@ -51,4 +51,9 @@ Please follow [instructions](https://nzbget.com/documentation/building-developme Contributions are very welcome - not only from developers, but from our users too - please don't hesitate to participate in [discussions](https://github.com/nzbgetcom/nzbget/discussions) or [create a new discussion](https://github.com/nzbgetcom/nzbget/discussions/new/choose) -For more information - see [Contributing](CONTRIBUTING.md). \ No newline at end of file +For more information - see [Contributing](CONTRIBUTING.md). + +## Donate + +Please [donate](https://nzbget.com/donate/) if you like what we are doing. thank you! + From f8cb2bda415fb6167e8aa7e9d596bb583dc0b1c1 Mon Sep 17 00:00:00 2001 From: Denis <146707790+dnzbk@users.noreply.github.com> Date: Fri, 8 Dec 2023 11:32:03 +0300 Subject: [PATCH 11/34] Use libxml2 on Windows (#70) - added using a cross-platform libxml2 library to work with xml on Windows just as we already do on Linux and macOS. - removed platform-dependent code for working with xml on Windows. - refactored dependency paths on Windows when using vcpkg package manager. - refactored renamed the confusing second README file on INSTALLATION and updated. - added more Feed tests. --- CMakeLists.txt | 3 +- CONTRIBUTING.md | 2 +- README => INSTALLATION.md | 114 +++++------ Makefile.am | 2 +- daemon/feed/FeedFile.cpp | 296 +-------------------------- daemon/feed/FeedFile.h | 6 +- daemon/main/nzbget.h | 12 +- daemon/queue/NzbFile.cpp | 170 +-------------- daemon/queue/NzbFile.h | 6 +- nzbget.vcxproj | 26 ++- tests/feed/CMakeLists.txt | 14 +- tests/feed/FeedFileTest.cpp | 52 +++++ tests/feed/FeedFilterTest.cpp | 6 +- tests/feed/main.cpp | 2 + tests/main/CMakeLists.txt | 2 + tests/nntp/CMakeLists.txt | 2 + tests/postprocess/CMakeLists.txt | 5 + tests/postprocess/RarRenamerTest.cpp | 138 ++++++------- tests/queue/CMakeLists.txt | 2 + tests/testdata/feed/feed.xml | 43 ++++ tests/util/CMakeLists.txt | 3 +- windows/build-nzbget-vs22.bat | 2 +- windows/build-nzbget.bat | 2 +- 23 files changed, 267 insertions(+), 643 deletions(-) rename README => INSTALLATION.md (87%) create mode 100644 tests/feed/FeedFileTest.cpp create mode 100644 tests/feed/main.cpp create mode 100644 tests/testdata/feed/feed.xml diff --git a/CMakeLists.txt b/CMakeLists.txt index 6cd78396..60732fe7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,7 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") find_package(OpenSSL REQUIRED) find_package(ZLIB REQUIRED) +find_package(LibXml2 REQUIRED) if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Weverything") @@ -49,8 +50,6 @@ include_directories(${CMAKE_BINARY_DIR}) add_subdirectory(lib) if (NOT WIN32) - find_package(LibXml2 REQUIRED) - include_directories(${LIBXML2_INCLUDE_DIR}) execute_process(COMMAND chmod +x ${CMAKE_SOURCE_DIR}/code_revision.sh) execute_process(COMMAND ${CMAKE_SOURCE_DIR}/code_revision.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) execute_process(COMMAND mv ${CMAKE_SOURCE_DIR}/code_revision.cpp ${CMAKE_BINARY_DIR}) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2f6e8d6c..8644f451 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ Main documentation is available on the NZBGet.com website - [https://nzbget.com/ NZBGet natively supports for multiple platforms and build options, so each platform has their own development documenation, including: -- [General documentation, including Posix](https://github.com/nzbgetcom/nzbget/blob/develop/README) +- [General documentation, including Posix](https://github.com/nzbgetcom/nzbget/blob/develop/INSTALLATION.md) - [Windows](https://github.com/nzbgetcom/nzbget/blob/develop/windows/README-WINDOWS.txt) - [Docker](https://github.com/nzbgetcom/nzbget/blob/develop/docker/README.md) diff --git a/README b/INSTALLATION.md similarity index 87% rename from README rename to INSTALLATION.md index 992a1374..a08d0dab 100644 --- a/README +++ b/INSTALLATION.md @@ -1,6 +1,4 @@ -===================================== - NZBGet ReadMe -===================================== +# NZBGet installation This is a short documentation. For more information please visit NZBGet home page at @@ -19,9 +17,8 @@ Contents 9. Copyright 10. Contact -===================================== -1. About NZBGet -===================================== + +## 1. About NZBGet NZBGet is a binary newsgrabber, which downloads files from usenet based on information given in nzb-files. NZBGet can be used in @@ -40,9 +37,7 @@ Standalone-tool, server and client are all contained in only one executable file "nzbget". The mode in which the program works depends on command-line parameters passed to the program. -===================================== -2. Supported OS -===================================== +## 2. Supported OS NZBGet is written in C++ and works on Windows, OS X, Linux and most POSIX-conform OS'es. @@ -58,9 +53,7 @@ the program yourself. If you have downloaded binaries you can just jump to section "Configuration". -===================================== -3. Prerequisites on POSIX -===================================== +## 3. Prerequisites on POSIX NZBGet is developed on a linux-system, but it runs on other POSIX platforms. @@ -68,29 +61,30 @@ POSIX platforms. NZBGet absolutely needs the following libraries: - libstdc++ (usually part of compiler) - - libxml2 (https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home) + - [libxml2](https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home) And the following libraries are optional: - for curses-output-mode (enabled by default): - libcurses (usually part of commercial systems) or (better) - - libncurses (https://invisible-island.net/ncurses) + - [libncurses](https://invisible-island.net/ncurses) - for encrypted connections (TLS/SSL): - - OpenSSL (https://www.openssl.org) + - [OpenSSL](https://www.openssl.org) + or - - GnuTLS (https://gnutls.org) + - [GnuTLS](https://gnutls.org) - for gzip support in web-server and web-client (enabled by default): - - zlib (https://www.zlib.net/) + - [zlib](https://www.zlib.net/) - for configuration: - - autotools (https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html) - - autoconf (https://www.gnu.org/software/autoconf/) + - [autotools](https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html) + - [autoconf](https://www.gnu.org/software/autoconf/) - for managing package dependencies: - - pkg-config (https://www.freedesktop.org/wiki/Software/pkg-config/) + - [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) All these libraries are included in modern POSIX distributions and should be available as installable packages. Please note that you also @@ -98,9 +92,7 @@ need the developer packages for these libraries too, they package names have often suffix "dev" or "devel". On other systems you may need to download the libraries at the given URLs and compile them (see hints below). -===================================== -4. Installation on POSIX -===================================== +## 4. Installation on POSIX Installation from the source distribution archive (nzbget-VERSION.tar.gz): @@ -140,8 +132,8 @@ Installation from the source distribution archive (nzbget-VERSION.tar.gz): (you can skip this step if you intend to store configuration files in a non-standard location) -Configure-options ------------------ +### Configure-options +--------------------- You may run configure with additional arguments: --disable-curses - to make without curses-support. Use this option @@ -162,8 +154,8 @@ You may run configure with additional arguments: --enable-debug - to build in debug-mode, if you want to see and log debug-messages. -Optional package: par-check ---------------------------- +### Optional package: par-check +------------------------------- NZBGet can check and repair downloaded files for you. For this purpose it uses library par2. @@ -175,8 +167,8 @@ can be disabled using configure option "--disable-parcheck": ./configure --disable-parcheck -Optional package: curses -------------------------- +### Optional package: curses +---------------------------- For curses-outputmode you need ncurses or curses on your system. If you do not have one of them you can download and compile ncurses yourself. Following configure-parameters may be useful: @@ -189,7 +181,7 @@ make the program without support for curses using option "--disable-curses": ./configure --disable-curses -Optional package: TLS +### Optional package: TLS ------------------------- To enable encrypted server connections (TLS/SSL) you need to build the program with TLS/SSL support. NZBGet can use two libraries: OpenSSL or GnuTLS. @@ -212,25 +204,25 @@ TLS/SSL support using option "--disable-tls": ./configure --disable-tls -===================================== -5. Compiling on Windows -===================================== +## 5. Compiling on Windows NZBGet is developed using MS Visual Studio 2015 (Community Edition). The project file is provided. To compile the program with TLS/SSL support you need either OpenSSL or GnuTLS: - - OpenSSL (https://www.openssl.org) - or - - GnuTLS (https://gnutls.org/) + - [OpenSSL](https://www.openssl.org) + + or + - [GnuTLS](https://gnutls.org/) Also required are: - - Regex (https://gnuwin32.sourceforge.net/packages/regex.htm) - - Zlib (https://gnuwin32.sourceforge.net/packages/zlib.htm) + - [Regex](https://regexlib.com/) + - [Zlib](https://gnuwin32.sourceforge.net/packages/zlib.htm) + - [libxml2](https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home) -===================================== -6. Configuration -===================================== +We recommend using [vcpkg](https://vcpkg.io/) to install dependencies. + +## 6. Configuration NZBGet needs a configuration file. @@ -270,9 +262,7 @@ In special cases you can run program without configuration file using switch "-n". You need to use switch "-o" to pass required configuration options via command-line. -===================================== -7. Usage -===================================== +## 7. Usage NZBGet can be used in either standalone mode which downloads a single file or as a server which is able to queue up numerous download requests. @@ -283,13 +273,13 @@ in "nzbget-shell.bat". Start this script from Windows Explorer and you will be running a command shell with PATH adjusted to find NZBGet executable. Then you can type all commands without full path to nzbget.exe. -Standalone mode: ----------------- +### Standalone mode: +-------------------- nzbget -Server mode: ------------- +### Server mode: +---------------- First start the nzbget-server: @@ -384,8 +374,8 @@ or: nzbget -o createlog=no -C -Running client & server on seperate machines: ---------------------------------------------- +### Running client & server on seperate machines: +------------------------------------------------- Since nzbget communicates via TCP/IP it's possible to have a server running on one computer and adding downloads via a client on another computer. @@ -394,8 +384,8 @@ Do this by setting the "ControlIP" option in the nzbget.conf file to point to th IP of the server (default is localhost which means client and server runs on same computer) -Security warning ----------------- +### Security warning +-------------------- NZBGet communicates via unsecured socket connections. This makes it vulnerable. Although server checks the password passed by client, this password is still @@ -406,8 +396,8 @@ If you need to control server from WAN it is better to connect to server's terminal via SSH (POSIX) or remote desktop (Windows) and then run nzbget-client-commands in this terminal. -Post processing scripts ------------------------ +### Post processing scripts +--------------------------- After the download of nzb-file is completed nzbget can call post-processing scripts, defined in configuration file. @@ -420,8 +410,8 @@ To use the scripts copy them into your local directory and set options For information on writing your own post-processing scripts please visit NZBGet web site. -Web-interface -------------- +### Web-interface +----------------- NZBGet has a built-in web-server providing the access to the program functions via web-interface. @@ -450,9 +440,7 @@ Please note, that in this case the password is saved in a bookmark or in browser history in plain text and is easy to find by persons having access to your computer. -===================================== -8. Authors -===================================== +## 8. Authors NZBGet is developed and maintained by Andrey Prygunkov (hugbug@users.sourceforge.net). @@ -493,9 +481,7 @@ Boost: Boost organization and wider Boost community -===================================== -9. Copyright -===================================== +## 9. Copyright This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -506,9 +492,7 @@ The complete content of license is provided in file COPYING. Additional exemption: compiling, linking, and/or using OpenSSL is allowed. -===================================== -10. Contact -===================================== +## 10. Contact If you encounter any problem, feel free to contact us https://nzbget.com/contact/ diff --git a/Makefile.am b/Makefile.am index 7d310435..4b741907 100644 --- a/Makefile.am +++ b/Makefile.am @@ -320,7 +320,7 @@ linux_FILES = \ linux/build-toolchain-freebsd doc_FILES = \ - README \ + INSTALLATION.md \ ChangeLog \ COPYING diff --git a/daemon/feed/FeedFile.cpp b/daemon/feed/FeedFile.cpp index 18306bd6..a908ad31 100644 --- a/daemon/feed/FeedFile.cpp +++ b/daemon/feed/FeedFile.cpp @@ -31,11 +31,8 @@ FeedFile::FeedFile(const char* fileName, const char* infoName) : debug("Creating FeedFile"); m_feedItems = std::make_unique(); - -#ifndef WIN32 m_feedItemInfo = nullptr; m_tagContent.Clear(); -#endif } void FeedFile::LogDebugInfo() @@ -75,295 +72,9 @@ void FeedFile::ParseSubject(FeedItemInfo& feedItemInfo) feedItemInfo.SetFilename(feedItemInfo.GetTitle()); } -#ifdef WIN32 -bool FeedFile::Parse() -{ - CoInitialize(nullptr); - - HRESULT hr; - - MSXML::IXMLDOMDocumentPtr doc; - hr = doc.CreateInstance(MSXML::CLSID_DOMDocument); - if (FAILED(hr)) - { - return false; - } - - // Load the XML document file... - doc->put_resolveExternals(VARIANT_FALSE); - doc->put_validateOnParse(VARIANT_FALSE); - doc->put_async(VARIANT_FALSE); - - _variant_t vFilename(*WString(m_fileName)); - - // 1. first trying to load via filename without URL-encoding (certain charaters doesn't work when encoded) - VARIANT_BOOL success = doc->load(vFilename); - if (success == VARIANT_FALSE) - { - // 2. now trying filename encoded as URL - char url[2048]; - EncodeUrl(m_fileName, url, 2048); - debug("url=\"%s\"", url); - _variant_t vUrl(url); - - success = doc->load(vUrl); - } - - if (success == VARIANT_FALSE) - { - _bstr_t r(doc->GetparseError()->reason); - const char* errMsg = r; - error("Error parsing rss feed %s: %s", *m_infoName, errMsg); - return false; - } - - bool ok = ParseFeed(doc); - - return ok; -} - -void FeedFile::EncodeUrl(const char* filename, char* url, int bufLen) -{ - WString widefilename(filename); - - char* end = url + bufLen; - for (wchar_t* p = widefilename; *p && url < end - 3; p++) - { - wchar_t ch = *p; - if (('0' <= ch && ch <= '9') || - ('a' <= ch && ch <= 'z') || - ('A' <= ch && ch <= 'Z') || - ch == '-' || ch == '.' || ch == '_' || ch == '~') - { - *url++ = (char)ch; - } - else - { - *url++ = '%'; - uint32 a = (uint32)ch >> 4; - *url++ = a > 9 ? a - 10 + 'A' : a + '0'; - a = ch & 0xF; - *url++ = a > 9 ? a - 10 + 'A' : a + '0'; - } - } - *url = '\0'; -} - -bool FeedFile::ParseFeed(IUnknown* nzb) -{ - MSXML::IXMLDOMDocumentPtr doc = nzb; - MSXML::IXMLDOMNodePtr root = doc->documentElement; - - MSXML::IXMLDOMNodeListPtr itemList = root->selectNodes("/rss/channel/item"); - for (int i = 0; i < itemList->Getlength(); i++) - { - MSXML::IXMLDOMNodePtr node = itemList->Getitem(i); - - m_feedItems->emplace_back(); - FeedItemInfo& feedItemInfo = m_feedItems->back(); - - MSXML::IXMLDOMNodePtr tag; - MSXML::IXMLDOMNodePtr attr; - - // Debian 6 - tag = node->selectSingleNode("title"); - if (!tag) - { - // bad rss feed - return false; - } - _bstr_t title(tag->Gettext()); - feedItemInfo.SetTitle(title); - ParseSubject(feedItemInfo); - - // Wed, 26 Jun 2013 00:02:54 -0600 - tag = node->selectSingleNode("pubDate"); - if (tag) - { - _bstr_t time(tag->Gettext()); - time_t unixtime = WebUtil::ParseRfc822DateTime(time); - if (unixtime > 0) - { - feedItemInfo.SetTime(unixtime); - } - } - - // Movies > HD - tag = node->selectSingleNode("category"); - if (tag) - { - _bstr_t category(tag->Gettext()); - feedItemInfo.SetCategory(category); - } - - // long text - tag = node->selectSingleNode("description"); - if (tag) - { - _bstr_t bdescription(tag->Gettext()); - // cleanup CDATA - CString description = (const char*)bdescription; - WebUtil::XmlStripTags(description); - WebUtil::XmlDecode(description); - WebUtil::XmlRemoveEntities(description); - feedItemInfo.SetDescription(description); - } - - // - tag = node->selectSingleNode("enclosure"); - if (tag) - { - attr = tag->Getattributes()->getNamedItem("url"); - if (attr) - { - _bstr_t url(attr->Gettext()); - feedItemInfo.SetUrl(url); - } - - attr = tag->Getattributes()->getNamedItem("length"); - if (attr) - { - _bstr_t bsize(attr->Gettext()); - int64 size = atoll(bsize); - feedItemInfo.SetSize(size); - } - } - - if (!feedItemInfo.GetUrl()) - { - // https://nzb.org/fetch/334534ce/4364564564 - tag = node->selectSingleNode("link"); - if (!tag) - { - // bad rss feed - return false; - } - _bstr_t link(tag->Gettext()); - feedItemInfo.SetUrl(link); - } - - - // newznab special - - // - if (feedItemInfo.GetSize() == 0) - { - tag = node->selectSingleNode("newznab:attr[@name='size'] | nZEDb:attr[@name='size']"); - if (tag) - { - attr = tag->Getattributes()->getNamedItem("value"); - if (attr) - { - _bstr_t bsize(attr->Gettext()); - int64 size = atoll(bsize); - feedItemInfo.SetSize(size); - } - } - } - - // - tag = node->selectSingleNode("newznab:attr[@name='imdb'] | nZEDb:attr[@name='imdb']"); - if (tag) - { - attr = tag->Getattributes()->getNamedItem("value"); - if (attr) - { - _bstr_t bval(attr->Gettext()); - int val = atoi(bval); - feedItemInfo.SetImdbId(val); - } - } - - // - tag = node->selectSingleNode("newznab:attr[@name='rageid'] | nZEDb:attr[@name='rageid']"); - if (tag) - { - attr = tag->Getattributes()->getNamedItem("value"); - if (attr) - { - _bstr_t bval(attr->Gettext()); - int val = atoi(bval); - feedItemInfo.SetRageId(val); - } - } - - // - tag = node->selectSingleNode("newznab:attr[@name='tvdbid'] | nZEDb:attr[@name='tvdbid']"); - if (tag) - { - attr = tag->Getattributes()->getNamedItem("value"); - if (attr) - { - _bstr_t bval(attr->Gettext()); - int val = atoi(bval); - feedItemInfo.SetTvdbId(val); - } - } - - // - tag = node->selectSingleNode("newznab:attr[@name='tvmazeid'] | nZEDb:attr[@name='tvmazeid']"); - if (tag) - { - attr = tag->Getattributes()->getNamedItem("value"); - if (attr) - { - _bstr_t bval(attr->Gettext()); - int val = atoi(bval); - feedItemInfo.SetTvmazeId(val); - } - } - - // - // - tag = node->selectSingleNode("newznab:attr[@name='episode'] | nZEDb:attr[@name='episode']"); - if (tag) - { - attr = tag->Getattributes()->getNamedItem("value"); - if (attr) - { - _bstr_t val(attr->Gettext()); - feedItemInfo.SetEpisode(val); - } - } - - // - // - tag = node->selectSingleNode("newznab:attr[@name='season'] | nZEDb:attr[@name='season']"); - if (tag) - { - attr = tag->Getattributes()->getNamedItem("value"); - if (attr) - { - _bstr_t val(attr->Gettext()); - feedItemInfo.SetSeason(val); - } - } - - MSXML::IXMLDOMNodeListPtr itemList = node->selectNodes("newznab:attr | nZEDb:attr"); - for (int i = 0; i < itemList->Getlength(); i++) - { - MSXML::IXMLDOMNodePtr node = itemList->Getitem(i); - MSXML::IXMLDOMNodePtr name = node->Getattributes()->getNamedItem("name"); - MSXML::IXMLDOMNodePtr value = node->Getattributes()->getNamedItem("value"); - if (name && value) - { - _bstr_t bname(name->Gettext()); - _bstr_t bval(value->Gettext()); - feedItemInfo.GetAttributes()->emplace_back(bname, bval); - } - } - } - return true; -} - -#else bool FeedFile::Parse() { -#ifdef DISABLE_LIBXML2 - error("Could not parse rss feed, program was compiled without libxml2 support"); - return false; -#else xmlSAXHandler SAX_handler = {0}; SAX_handler.startElement = reinterpret_cast(SAX_StartElement); SAX_handler.endElement = reinterpret_cast(SAX_EndElement); @@ -382,7 +93,6 @@ bool FeedFile::Parse() } return true; -#endif } void FeedFile::Parse_StartElement(const char *name, const char **atts) @@ -571,11 +281,8 @@ void FeedFile::SAX_characters(FeedFile* file, const char * xmlstr, int len) void* FeedFile::SAX_getEntity(FeedFile* file, const char * name) { -#ifdef DISABLE_LIBXML2 - void* e = nullptr; -#else xmlEntityPtr e = xmlGetPredefinedEntity((xmlChar* )name); -#endif + if (!e) { warn("entity not found"); @@ -604,4 +311,3 @@ void FeedFile::SAX_error(FeedFile* file, const char *msg, ...) for (char* pend = errMsg + strlen(errMsg) - 1; pend >= errMsg && (*pend == '\n' || *pend == '\r' || *pend == ' '); pend--) *pend = '\0'; error("Error parsing rss feed %s: %s", *file->m_infoName, errMsg); } -#endif diff --git a/daemon/feed/FeedFile.h b/daemon/feed/FeedFile.h index fa7e3eef..2d9fe2f8 100644 --- a/daemon/feed/FeedFile.h +++ b/daemon/feed/FeedFile.h @@ -39,10 +39,7 @@ class FeedFile CString m_infoName; void ParseSubject(FeedItemInfo& feedItemInfo); -#ifdef WIN32 - bool ParseFeed(IUnknown* nzb); - static void EncodeUrl(const char* filename, char* url, int bufLen); -#else + FeedItemInfo* m_feedItemInfo; StringBuilder m_tagContent; bool m_ignoreNextError; @@ -56,7 +53,6 @@ class FeedFile void Parse_EndElement(const char *name); void Parse_Content(const char *buf, int len); void ResetTagContent(); -#endif }; #endif diff --git a/daemon/main/nzbget.h b/daemon/main/nzbget.h index aecab84b..fa036523 100644 --- a/daemon/main/nzbget.h +++ b/daemon/main/nzbget.h @@ -178,13 +178,6 @@ using namespace MSXML; #include #include -#ifndef DISABLE_LIBXML2 -#include -#include -#include -#include -#endif - #ifdef HAVE_SYS_PRCTL_H #include #endif @@ -230,6 +223,11 @@ using namespace MSXML; #include #include +#include +#include +#include +#include + // NOTE: do not include in "nzbget.h". contains objects requiring // intialization, causing every unit in nzbget to have initialization routine. This in particular // is causing fatal problems in SIMD units which must not have static initialization because diff --git a/daemon/queue/NzbFile.cpp b/daemon/queue/NzbFile.cpp index 7ff73539..fcdc540d 100644 --- a/daemon/queue/NzbFile.cpp +++ b/daemon/queue/NzbFile.cpp @@ -439,172 +439,9 @@ void NzbFile::ReadPassword() } } -#ifdef WIN32 -bool NzbFile::Parse() -{ - CoInitialize(nullptr); - - HRESULT hr; - - MSXML::IXMLDOMDocumentPtr doc; - hr = doc.CreateInstance(MSXML::CLSID_DOMDocument); - if (FAILED(hr)) - { - return false; - } - - // Load the XML document file... - doc->put_resolveExternals(VARIANT_FALSE); - doc->put_validateOnParse(VARIANT_FALSE); - doc->put_async(VARIANT_FALSE); - - _variant_t vFilename(*WString(*m_fileName)); - - // 1. first trying to load via filename without URL-encoding (certain charaters doesn't work when encoded) - VARIANT_BOOL success = doc->load(vFilename); - if (success == VARIANT_FALSE) - { - // 2. now trying filename encoded as URL - char url[2048]; - EncodeUrl(m_fileName, url, 2048); - debug("url=\"%s\"", url); - _variant_t vUrl(url); - - success = doc->load(vUrl); - } - - if (success == VARIANT_FALSE) - { - _bstr_t r(doc->GetparseError()->reason); - const char* errMsg = r; - m_nzbInfo->AddMessage(Message::mkError, BString<1024>("Error parsing nzb-file %s: %s", - FileSystem::BaseFileName(m_fileName), errMsg)); - return false; - } - - if (!ParseNzb(doc)) - { - return false; - } - - if (m_nzbInfo->GetFileList()->empty()) - { - m_nzbInfo->AddMessage(Message::mkError, BString<1024>( - "Error parsing nzb-file %s: file has no content", FileSystem::BaseFileName(m_fileName))); - return false; - } - - ProcessFiles(); - - return true; -} - -void NzbFile::EncodeUrl(const char* filename, char* url, int bufLen) -{ - WString widefilename(filename); - - char* end = url + bufLen; - for (wchar_t* p = widefilename; *p && url < end - 3; p++) - { - wchar_t ch = *p; - if (('0' <= ch && ch <= '9') || - ('a' <= ch && ch <= 'z') || - ('A' <= ch && ch <= 'Z') || - ch == '-' || ch == '.' || ch == '_' || ch == '~') - { - *url++ = (char)ch; - } - else - { - *url++ = '%'; - uint32 a = (uint32)ch >> 4; - *url++ = a > 9 ? a - 10 + 'A' : a + '0'; - a = ch & 0xF; - *url++ = a > 9 ? a - 10 + 'A' : a + '0'; - } - } - *url = '\0'; -} - -bool NzbFile::ParseNzb(IUnknown* nzb) -{ - MSXML::IXMLDOMDocumentPtr doc = nzb; - MSXML::IXMLDOMNodePtr root = doc->documentElement; - - MSXML::IXMLDOMNodePtr node = root->selectSingleNode("/nzb/head/meta[@type='password']"); - if (node) - { - _bstr_t password(node->Gettext()); - m_password = password; - } - - MSXML::IXMLDOMNodeListPtr fileList = root->selectNodes("/nzb/file"); - for (int i = 0; i < fileList->Getlength(); i++) - { - node = fileList->Getitem(i); - MSXML::IXMLDOMNodePtr attribute = node->Getattributes()->getNamedItem("subject"); - if (!attribute) return false; - _bstr_t subject(attribute->Gettext()); - - std::unique_ptr fileInfo = std::make_unique(); - fileInfo->SetSubject(subject); - - attribute = node->Getattributes()->getNamedItem("date"); - if (attribute) - { - _bstr_t date(attribute->Gettext()); - fileInfo->SetTime(atoi(date)); - } - - MSXML::IXMLDOMNodeListPtr groupList = node->selectNodes("groups/group"); - for (int g = 0; g < groupList->Getlength(); g++) - { - MSXML::IXMLDOMNodePtr node = groupList->Getitem(g); - _bstr_t group = node->Gettext(); - fileInfo->GetGroups()->push_back((const char*)group); - } - - MSXML::IXMLDOMNodeListPtr segmentList = node->selectNodes("segments/segment"); - for (int g = 0; g < segmentList->Getlength(); g++) - { - MSXML::IXMLDOMNodePtr node = segmentList->Getitem(g); - _bstr_t bid = node->Gettext(); - BString<1024> id("<%s>", (const char*)bid); - - MSXML::IXMLDOMNodePtr attribute = node->Getattributes()->getNamedItem("number"); - if (!attribute) return false; - _bstr_t number(attribute->Gettext()); - - attribute = node->Getattributes()->getNamedItem("bytes"); - if (!attribute) return false; - _bstr_t bytes(attribute->Gettext()); - - int partNumber = atoi(number); - int lsize = atoi(bytes); - - if (partNumber > 0) - { - std::unique_ptr article = std::make_unique(); - article->SetPartNumber(partNumber); - article->SetMessageId(id); - article->SetSize(lsize); - AddArticle(fileInfo.get(), std::move(article)); - } - } - - AddFileInfo(std::move(fileInfo)); - } - return true; -} - -#else bool NzbFile::Parse() { -#ifdef DISABLE_LIBXML2 - error("Could not parse rss feed, program was compiled without libxml2 support"); - return false; -#else xmlSAXHandler SAX_handler = {0}; SAX_handler.startElement = reinterpret_cast(SAX_StartElement); SAX_handler.endElement = reinterpret_cast(SAX_EndElement); @@ -633,7 +470,6 @@ bool NzbFile::Parse() ProcessFiles(); return true; -#endif } void NzbFile::Parse_StartElement(const char *name, const char **atts) @@ -816,11 +652,8 @@ void NzbFile::SAX_characters(NzbFile* file, const char * xmlstr, int len) void* NzbFile::SAX_getEntity(NzbFile* file, const char * name) { -#ifdef DISABLE_LIBXML2 - void* e = nullptr; -#else xmlEntityPtr e = xmlGetPredefinedEntity((xmlChar* )name); -#endif + if (!e) { file->m_nzbInfo->AddMessage(Message::mkWarning, "entity not found"); @@ -850,4 +683,3 @@ void NzbFile::SAX_error(NzbFile* file, const char *msg, ...) file->m_nzbInfo->AddMessage(Message::mkError, BString<1024>("Error parsing nzb-file: %s", errMsg)); } -#endif diff --git a/daemon/queue/NzbFile.h b/daemon/queue/NzbFile.h index 62ba59f4..fe592f8d 100644 --- a/daemon/queue/NzbFile.h +++ b/daemon/queue/NzbFile.h @@ -49,10 +49,7 @@ class NzbFile void CalcHashes(); bool HasDuplicateFilenames(); void ReadPassword(); -#ifdef WIN32 - bool ParseNzb(IUnknown* nzb); - static void EncodeUrl(const char* filename, char* url, int bufLen); -#else + std::unique_ptr m_fileInfo; ArticleInfo* m_article = nullptr; StringBuilder m_tagContent; @@ -67,7 +64,6 @@ class NzbFile void Parse_StartElement(const char *name, const char **atts); void Parse_EndElement(const char *name); void Parse_Content(const char *buf, int len); -#endif }; #endif diff --git a/nzbget.vcxproj b/nzbget.vcxproj index b692fb72..7e5336e1 100755 --- a/nzbget.vcxproj +++ b/nzbget.vcxproj @@ -84,7 +84,7 @@ Disabled - ..\bin\Debug32;.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\par2;.\lib\yencode;.\windows\resources;C:\Program Files (x86)\zlib\include;C:\Program Files (x86)\OpenSSL-Win32\include;.\lib\regex;%(AdditionalIncludeDirectories) + C:\vcpkg\installed\x86-windows-static\include;..\bin\Debug32;.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\par2;.\lib\yencode;.\windows\resources;.\lib\regex;%(AdditionalIncludeDirectories) WIN32;PACKAGE="nzbget";VERSION="22.0";_DEBUG;_CONSOLE;DEBUG;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions) false EnableFastChecks @@ -96,18 +96,17 @@ true - libcrypto32MTd.lib;libssl32MTd.lib;zlibstatic32.lib;Dbghelp.lib;WS2_32.lib;ole32.lib;OleAut32.Lib;comsuppwd.lib;Advapi32.lib;gdi32.lib;shell32.lib;Winmm.lib;crypt32.lib;%(AdditionalDependencies) + libcrypto.lib;libssl.lib;zlibd.lib;libxml2.lib;lzma.lib;iconv.lib;Dbghelp.lib;WS2_32.lib;ole32.lib;OleAut32.Lib;comsuppwd.lib;Advapi32.lib;gdi32.lib;shell32.lib;Winmm.lib;crypt32.lib;%(AdditionalDependencies) true Console - MachineX86 - C:\Program Files (x86)\zlib\lib\;C:\Program Files (x86)\OpenSSL-Win32\lib\VC\static;%(AdditionalLibraryDirectories) + C:\vcpkg\installed\x86-windows-static\debug\lib;%(AdditionalLibraryDirectories) msvcrt.lib; libcmt.lib; msvcrtd.lib Disabled - ..\bin\Debug64;.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\regex;.\lib\par2;.\lib\yencode;.\windows\resources;C:\Program Files (x86)\zlib\include;C:\Program Files\OpenSSL-Win64\include;%(AdditionalIncludeDirectories) + C:\vcpkg\installed\x64-windows-static\include;..\bin\Debug64;.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\regex;.\lib\par2;.\lib\yencode;.\windows\resources;%(AdditionalIncludeDirectories) WIN32;PACKAGE="nzbget";VERSION="22.0";_DEBUG;_CONSOLE;DEBUG;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions) false EnableFastChecks @@ -121,9 +120,8 @@ true Console - C:\Program Files (x86)\zlib\lib;C:\Program Files\OpenSSL-Win64\lib\VC\static;%(AdditionalLibraryDirectories) - MachineX64 - libcrypto64MTd.lib;libssl64MTd.lib;zlibstatic64d.lib;Dbghelp.lib;WS2_32.lib;ole32.lib;OleAut32.Lib;comsuppwd.lib;Advapi32.lib;gdi32.lib;shell32.lib;Winmm.lib;crypt32.lib;%(AdditionalDependencies) + C:\vcpkg\installed\x64-windows-static\debug\lib;%(AdditionalLibraryDirectories) + libcrypto.lib;libssl.lib;zlibd.lib;libxml2.lib;lzma.lib;iconv.lib;Dbghelp.lib;WS2_32.lib;ole32.lib;OleAut32.Lib;comsuppwd.lib;Advapi32.lib;gdi32.lib;shell32.lib;Winmm.lib;crypt32.lib;%(AdditionalDependencies) false msvcrt.lib; libcmt.lib; msvcrtd.lib -s %(AdditionalOptions) @@ -134,7 +132,7 @@ - ..\bin\Release32;.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\par2;.\lib\yencode;.\windows\resources;C:\Program Files (x86)\zlib\include;C:\Program Files (x86)\OpenSSL-Win32\include;.\lib\regex;%(AdditionalIncludeDirectories) + C:\vcpkg\installed\x86-windows-static\include;..\bin\Release32;.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\par2;.\lib\yencode;.\windows\resources;.\lib\regex;%(AdditionalIncludeDirectories) WIN32;PACKAGE="nzbget";VERSION="22.0";NDEBUG;_CONSOLE;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions) Sync MultiThreaded @@ -156,14 +154,14 @@ true - libcrypto32MT.lib;libssl32MT.lib;zlibstatic32.lib;WS2_32.lib;ole32.lib;OleAut32.Lib;comsuppwd.lib;Advapi32.lib;gdi32.lib;shell32.lib;Winmm.lib;crypt32.lib;%(AdditionalDependencies) + libcrypto.lib;libssl.lib;zlib.lib;libxml2.lib;lzma.lib;iconv.lib;WS2_32.lib;ole32.lib;OleAut32.Lib;comsuppwd.lib;Advapi32.lib;gdi32.lib;shell32.lib;Winmm.lib;crypt32.lib;%(AdditionalDependencies) true Console true true MachineX86 UseFastLinkTimeCodeGeneration - C:\Program Files (x86)\zlib\lib\;C:\Program Files (x86)\OpenSSL-Win32\lib\VC\static;%(AdditionalLibraryDirectories) + C:\vcpkg\installed\x86-windows-static\lib;%(AdditionalLibraryDirectories) NotSet msvcrt.lib; libcmtd.lib; msvcrtd.lib @@ -173,7 +171,7 @@ - ..\bin\Release64;.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\par2;.\lib\yencode;.\windows\resources;C:\Program Files (x86)\zlib\include;C:\Program Files\OpenSSL-Win64\include;.\lib\regex;%(AdditionalIncludeDirectories) + C:\vcpkg\installed\x64-windows-static\include;..\bin\Release64;.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\par2;.\lib\yencode;.\windows\resources;.\lib\regex;%(AdditionalIncludeDirectories) WIN32;PACKAGE="nzbget";VERSION="22.0";NDEBUG;_CONSOLE;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions) Sync MultiThreaded @@ -192,13 +190,13 @@ Fast - libcrypto64MT.lib;libssl64MT.lib;zlibstatic64.lib;WS2_32.lib;ole32.lib;OleAut32.Lib;comsuppwd.lib;Advapi32.lib;gdi32.lib;shell32.lib;Winmm.lib;crypt32.lib;%(AdditionalDependencies) + libcrypto.lib;libssl.lib;zlib.lib;libxml2.lib;lzma.lib;iconv.lib;WS2_32.lib;ole32.lib;OleAut32.Lib;comsuppwd.lib;Advapi32.lib;gdi32.lib;shell32.lib;Winmm.lib;crypt32.lib;%(AdditionalDependencies) false Console true true UseLinkTimeCodeGeneration - C:\Program Files (x86)\zlib\lib;C:\Program Files\OpenSSL-Win64\lib\VC\static;%(AdditionalLibraryDirectories) + C:\vcpkg\installed\x64-windows-static\lib;%(AdditionalLibraryDirectories) msvcrt.lib; libcmtd.lib; msvcrtd.lib diff --git a/tests/feed/CMakeLists.txt b/tests/feed/CMakeLists.txt index f9a2d866..2620cf14 100644 --- a/tests/feed/CMakeLists.txt +++ b/tests/feed/CMakeLists.txt @@ -1,6 +1,9 @@ -add_executable(FeedFilterTest +add_executable(FeedTest FeedFilterTest.cpp + FeedFileTest.cpp + main.cpp ${CMAKE_SOURCE_DIR}/daemon/feed/FeedFilter.cpp + ${CMAKE_SOURCE_DIR}/daemon/feed/FeedFile.cpp ${CMAKE_SOURCE_DIR}/daemon/feed/FeedInfo.cpp ${CMAKE_SOURCE_DIR}/daemon/main/Options.cpp ${CMAKE_SOURCE_DIR}/daemon/util/NString.cpp @@ -12,11 +15,12 @@ add_executable(FeedFilterTest ${CMAKE_SOURCE_DIR}/daemon/nntp/NewsServer.cpp ${CMAKE_SOURCE_DIR}/lib/regex/regex.c ) -target_link_libraries(FeedFilterTest PRIVATE +target_link_libraries(FeedTest PRIVATE ZLIB::ZLIB Yencode + LibXml2::LibXml2 ) -target_include_directories(FeedFilterTest PRIVATE +target_include_directories(FeedTest PRIVATE ${CMAKE_SOURCE_DIR}/daemon/feed ${CMAKE_SOURCE_DIR}/daemon/main ${CMAKE_SOURCE_DIR}/daemon/util @@ -25,6 +29,8 @@ target_include_directories(FeedFilterTest PRIVATE ${CMAKE_SOURCE_DIR}/daemon/remote ${CMAKE_SOURCE_DIR}/lib/regex ${Boost_INCLUDE_DIR} + ${LIBXML2_INCLUDE_DIR} ) -add_test(NAME FeedFilterTest COMMAND $ --log_level=message) +file(COPY ../testdata/feed DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME FeedTest COMMAND $ --log_level=message) diff --git a/tests/feed/FeedFileTest.cpp b/tests/feed/FeedFileTest.cpp new file mode 100644 index 00000000..1067a7e8 --- /dev/null +++ b/tests/feed/FeedFileTest.cpp @@ -0,0 +1,52 @@ +/* + * This file is part of nzbget. See . + * + * Copyright (C) 2023 Denis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "nzbget.h" + +#include + +#include +#include "FeedFile.h" + +BOOST_AUTO_TEST_CASE(FeedFileTest) +{ + std::string path = std::filesystem::current_path().string(); + std::string testFile = path + "/feed/feed.xml"; + FeedFile file(testFile.c_str(), "feedName"); + + BOOST_CHECK(file.Parse() == true); + + std::unique_ptr items = file.DetachFeedItems(); + FeedItemInfo& feedInfo = items.get()->back(); + + BOOST_CHECK(feedInfo.GetCategory() == std::string("Movies>HD")); + BOOST_CHECK(feedInfo.GetEpisode() == std::string("1")); + BOOST_CHECK(feedInfo.GetEpisodeNum() == 1); + BOOST_CHECK(feedInfo.GetSeason() == std::string("S03")); + BOOST_CHECK(feedInfo.GetSeasonNum() == 3); + BOOST_CHECK(feedInfo.GetTvmazeId() == 33877); + BOOST_CHECK(feedInfo.GetTvdbId() == 33877); + BOOST_CHECK(feedInfo.GetRageId() == 33877); + BOOST_CHECK(feedInfo.GetImdbId() == 42054); + BOOST_CHECK(feedInfo.GetUrl() == std::string("https://indexer.com/getnzb/nzb.nzb")); + BOOST_CHECK(feedInfo.GetDescription() == std::string("Description")); + BOOST_CHECK(feedInfo.GetFilename() == std::string("Crows.And.Sparrows")); + BOOST_CHECK(feedInfo.GetSize() == 7445312955); + BOOST_CHECK(feedInfo.GetTitle() == std::string("Crows.And.Sparrows")); +} diff --git a/tests/feed/FeedFilterTest.cpp b/tests/feed/FeedFilterTest.cpp index aec44872..0fec07ba 100644 --- a/tests/feed/FeedFilterTest.cpp +++ b/tests/feed/FeedFilterTest.cpp @@ -2,6 +2,7 @@ * This file is part of nzbget. See . * * Copyright (C) 2015-2016 Andrey Prygunkov + * Copyright (C) 2023 Denis * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,13 +15,12 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #include "nzbget.h" -#define BOOST_TEST_MODULE "FeedFilterTest" -#include +#include #include "FeedFilter.h" #include "Log.h" diff --git a/tests/feed/main.cpp b/tests/feed/main.cpp new file mode 100644 index 00000000..14a70157 --- /dev/null +++ b/tests/feed/main.cpp @@ -0,0 +1,2 @@ +#define BOOST_TEST_MODULE "FeedTest" +#include diff --git a/tests/main/CMakeLists.txt b/tests/main/CMakeLists.txt index 7280d3a9..c38b58b7 100644 --- a/tests/main/CMakeLists.txt +++ b/tests/main/CMakeLists.txt @@ -17,6 +17,7 @@ add_executable(MainTests target_link_libraries(MainTests PRIVATE ZLIB::ZLIB Yencode + LibXml2::LibXml2 ) target_include_directories(MainTests PRIVATE ${CMAKE_SOURCE_DIR}/daemon/main @@ -29,6 +30,7 @@ target_include_directories(MainTests PRIVATE ${CMAKE_SOURCE_DIR}/lib/regex ${OPENSSL_INCLUDE_DIR} ${Boost_INCLUDE_DIR} + ${LIBXML2_INCLUDE_DIR} ) add_test(NAME MainTests COMMAND $ --log_level=message) diff --git a/tests/nntp/CMakeLists.txt b/tests/nntp/CMakeLists.txt index fcfc0e22..5c06ecc5 100644 --- a/tests/nntp/CMakeLists.txt +++ b/tests/nntp/CMakeLists.txt @@ -20,6 +20,7 @@ target_link_libraries(ServerPoolTest PRIVATE ZLIB::ZLIB Par2 Yencode + LibXml2::LibXml2 ) target_include_directories(ServerPoolTest PRIVATE ${CMAKE_SOURCE_DIR}/daemon/main @@ -33,6 +34,7 @@ target_include_directories(ServerPoolTest PRIVATE ${CMAKE_SOURCE_DIR}/lib/par2 ${OPENSSL_INCLUDE_DIR} ${Boost_INCLUDE_DIR} + ${LIBXML2_INCLUDE_DIR} ) add_test(NAME ServerPoolTest COMMAND $ --log_level=message) diff --git a/tests/postprocess/CMakeLists.txt b/tests/postprocess/CMakeLists.txt index fa5d711c..73e68a57 100644 --- a/tests/postprocess/CMakeLists.txt +++ b/tests/postprocess/CMakeLists.txt @@ -5,6 +5,8 @@ file(GLOB PostprocessTestsSrc ParCheckerTest.cpp ParRenamerTest.cpp RarReaderTest.cpp + RarReaderTest.cpp + RarRenamerTest.cpp ../suite/TestUtil.cpp ${CMAKE_SOURCE_DIR}/daemon/postprocess/DirectUnpack.cpp ${CMAKE_SOURCE_DIR}/daemon/postprocess/DupeMatcher.cpp @@ -12,6 +14,7 @@ file(GLOB PostprocessTestsSrc ${CMAKE_SOURCE_DIR}/daemon/postprocess/ParParser.cpp ${CMAKE_SOURCE_DIR}/daemon/postprocess/ParRenamer.cpp ${CMAKE_SOURCE_DIR}/daemon/postprocess/RarReader.cpp + ${CMAKE_SOURCE_DIR}/daemon/postprocess/RarRenamer.cpp ${CMAKE_SOURCE_DIR}/daemon/main/Options.cpp ${CMAKE_SOURCE_DIR}/daemon/util/NString.cpp ${CMAKE_SOURCE_DIR}/daemon/util/Util.cpp @@ -35,6 +38,7 @@ target_link_libraries(PostprocessTests PRIVATE Par2 OpenSSL::SSL OpenSSL::Crypto + LibXml2::LibXml2 ) target_include_directories(PostprocessTests PRIVATE ../suite @@ -49,6 +53,7 @@ target_include_directories(PostprocessTests PRIVATE ${CMAKE_SOURCE_DIR}/lib/yencode ${CMAKE_SOURCE_DIR}/lib/par2 ${Boost_INCLUDE_DIR} + ${LIBXML2_INCLUDE_DIR} ) file(COPY ../testdata/rarrenamer DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/tests/postprocess/RarRenamerTest.cpp b/tests/postprocess/RarRenamerTest.cpp index 1cf8c1ad..8df3ff58 100644 --- a/tests/postprocess/RarRenamerTest.cpp +++ b/tests/postprocess/RarRenamerTest.cpp @@ -20,7 +20,7 @@ #include "nzbget.h" -#include "catch.h" +#include #include "Options.h" #include "RarRenamer.h" @@ -39,195 +39,195 @@ RarRenamerMock::RarRenamerMock() SetDestDir(TestUtil::WorkingDir().c_str()); } -TEST_CASE("Rar-renamer: rename not needed", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameNotEeededTest) { RarRenamerMock rarRenamer; rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 0); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 0); } -TEST_CASE("Rar-renamer: rename not needed 2", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameNotEeeded2Test) { RarRenamerMock rarRenamer; - REQUIRE(FileSystem::CopyFile((TestUtil::WorkingDir() + "/testfile5.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12348").c_str())); - REQUIRE(FileSystem::CopyFile((TestUtil::WorkingDir() + "/testfile3oldnam.r00").c_str(), (TestUtil::WorkingDir() + "/testfile3oldnamB.r00").c_str())); + BOOST_CHECK(FileSystem::CopyFile((TestUtil::WorkingDir() + "/testfile5.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12348").c_str())); + BOOST_CHECK(FileSystem::CopyFile((TestUtil::WorkingDir() + "/testfile3oldnam.r00").c_str(), (TestUtil::WorkingDir() + "/testfile3oldnamB.r00").c_str())); rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 0); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 0); } -TEST_CASE("Rar-renamer: rename rar3", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE("Rar-renamer: rename rar3", "[Rar][RarRenamer][Slow][TestData]") { RarRenamerMock rarRenamer; - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12345").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12342").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part03.rar").c_str(), (TestUtil::WorkingDir() + "/12346").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12345").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12342").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part03.rar").c_str(), (TestUtil::WorkingDir() + "/12346").c_str())); rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 3); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 3); } -TEST_CASE("Rar-renamer: rename rar5", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameRar5Test) { RarRenamerMock rarRenamer; - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12348").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12343").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part03.rar").c_str(), (TestUtil::WorkingDir() + "/12344").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12348").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12343").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part03.rar").c_str(), (TestUtil::WorkingDir() + "/12344").c_str())); rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 3); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 3); } -TEST_CASE("Rar-renamer: missing parts", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(MissingPartsTest) { RarRenamerMock rarRenamer; - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12348").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12343").c_str())); - REQUIRE(FileSystem::DeleteFile((TestUtil::WorkingDir() + "/testfile5.part03.rar").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12348").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12343").c_str())); + BOOST_CHECK(FileSystem::DeleteFile((TestUtil::WorkingDir() + "/testfile5.part03.rar").c_str())); rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 0); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 0); } -TEST_CASE("Rar-renamer: rename rar3 bad naming", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameRar3BadNamingTest) { RarRenamerMock rarRenamer; - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part01.rar").c_str(), (TestUtil::WorkingDir() + "/testfile3.part04.rar").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str(), (TestUtil::WorkingDir() + "/testfile3.part01.rar").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part01.rar").c_str(), (TestUtil::WorkingDir() + "/testfile3.part04.rar").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str(), (TestUtil::WorkingDir() + "/testfile3.part01.rar").c_str())); rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 3); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 3); } -TEST_CASE("Rar-renamer: rename rar3 bad naming 2", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(Rar3BadNaming2) { RarRenamerMock rarRenamer; - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str(), (TestUtil::WorkingDir() + "/testfile3.part2.rar").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str(), (TestUtil::WorkingDir() + "/testfile3.part2.rar").c_str())); rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 3); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 3); } -TEST_CASE("Rar-renamer: rename rar3 bad naming 3", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameRar3BadNaming3Test) { RarRenamerMock rarRenamer; - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str(), (TestUtil::WorkingDir() + "/testfile3-1.part02.rar").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str(), (TestUtil::WorkingDir() + "/testfile3-1.part02.rar").c_str())); rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 3); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 3); } -TEST_CASE("Rar-renamer: rename rar3 bad naming 4", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameRar3BadNaming4Test) { RarRenamerMock rarRenamer; - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str(), (TestUtil::WorkingDir() + "/testfil-3.part02.rar").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str(), (TestUtil::WorkingDir() + "/testfil-3.part02.rar").c_str())); rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 3); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 3); } -TEST_CASE("Rar-renamer: rename rar3 bad naming 5", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameRar3BadNaming5Test) { RarRenamerMock rarRenamer; - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3oldnam.rar").c_str(), (TestUtil::WorkingDir() + "/testfile3oldnamA.rar").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3oldnam.rar").c_str(), (TestUtil::WorkingDir() + "/testfile3oldnamA.rar").c_str())); rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 1); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 1); } -TEST_CASE("Rar-renamer: rename rar3 bad naming 6", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameRar3BadNaming6Test) { RarRenamerMock rarRenamer; - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3oldnam.rar").c_str(), (TestUtil::WorkingDir() + "/testfile3oldnamA.rar").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3oldnam.r00").c_str(), (TestUtil::WorkingDir() + "/testfile3oldnamB.r00").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3oldnam.r01").c_str(), (TestUtil::WorkingDir() + "/testfile3oldnamA.r01").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3oldnam.rar").c_str(), (TestUtil::WorkingDir() + "/testfile3oldnamA.rar").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3oldnam.r00").c_str(), (TestUtil::WorkingDir() + "/testfile3oldnamB.r00").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3oldnam.r01").c_str(), (TestUtil::WorkingDir() + "/testfile3oldnamA.r01").c_str())); rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 3); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 3); } -TEST_CASE("Rar-renamer: rename two sets", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameTwoSetsTest) { RarRenamerMock rarRenamer; - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12345").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12342").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part03.rar").c_str(), (TestUtil::WorkingDir() + "/12346").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12348").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12343").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part03.rar").c_str(), (TestUtil::WorkingDir() + "/12344").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12345").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12342").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part03.rar").c_str(), (TestUtil::WorkingDir() + "/12346").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12348").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12343").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part03.rar").c_str(), (TestUtil::WorkingDir() + "/12344").c_str())); rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 6); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 6); } -TEST_CASE("Rar-renamer: rename duplicate", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameDuplicateTest) { RarRenamerMock rarRenamer; - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12345").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12342").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part03.rar").c_str(), (TestUtil::WorkingDir() + "/12346").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part01.rar").c_str(), (TestUtil::WorkingDir() + "/testfile3.dat.part0001.rar").c_str())); - REQUIRE(FileSystem::DeleteFile((TestUtil::WorkingDir() + "/testfile5.part02.rar").c_str())); - REQUIRE(FileSystem::DeleteFile((TestUtil::WorkingDir() + "/testfile5.part03.rar").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12345").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12342").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3.part03.rar").c_str(), (TestUtil::WorkingDir() + "/12346").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5.part01.rar").c_str(), (TestUtil::WorkingDir() + "/testfile3.dat.part0001.rar").c_str())); + BOOST_CHECK(FileSystem::DeleteFile((TestUtil::WorkingDir() + "/testfile5.part02.rar").c_str())); + BOOST_CHECK(FileSystem::DeleteFile((TestUtil::WorkingDir() + "/testfile5.part03.rar").c_str())); rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 3); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 3); } #ifndef DISABLE_TLS -TEST_CASE("Rar-renamer: rename rar5 encrypted", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameRar5EncryptedTest) { RarRenamerMock rarRenamer; rarRenamer.SetPassword("123"); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5encnam.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12348").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5encnam.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12343").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5encnam.part03.rar").c_str(), (TestUtil::WorkingDir() + "/12344").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5encnam.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12348").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5encnam.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12343").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile5encnam.part03.rar").c_str(), (TestUtil::WorkingDir() + "/12344").c_str())); rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 3); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 3); } -TEST_CASE("Rar-renamer: rename rar3 encrypted", "[Rar][RarRenamer][Slow][TestData]") +BOOST_AUTO_TEST_CASE(RenameRar3EncryptedTest) { RarRenamerMock rarRenamer; rarRenamer.SetPassword("123"); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3encnam.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12348").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3encnam.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12343").c_str())); - REQUIRE(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3encnam.part03.rar").c_str(), (TestUtil::WorkingDir() + "/12344").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3encnam.part01.rar").c_str(), (TestUtil::WorkingDir() + "/12348").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3encnam.part02.rar").c_str(), (TestUtil::WorkingDir() + "/12343").c_str())); + BOOST_CHECK(FileSystem::MoveFile((TestUtil::WorkingDir() + "/testfile3encnam.part03.rar").c_str(), (TestUtil::WorkingDir() + "/12344").c_str())); rarRenamer.Execute(); - REQUIRE(rarRenamer.GetRenamedCount() == 3); + BOOST_CHECK(rarRenamer.GetRenamedCount() == 3); } #endif diff --git a/tests/queue/CMakeLists.txt b/tests/queue/CMakeLists.txt index 34501656..bb535efd 100644 --- a/tests/queue/CMakeLists.txt +++ b/tests/queue/CMakeLists.txt @@ -16,6 +16,7 @@ add_executable(NzbFileTest target_link_libraries(NzbFileTest PRIVATE ZLIB::ZLIB Yencode + LibXml2::LibXml2 ) target_include_directories(NzbFileTest PRIVATE ${CMAKE_SOURCE_DIR}/daemon/main @@ -27,6 +28,7 @@ target_include_directories(NzbFileTest PRIVATE ${CMAKE_SOURCE_DIR}/lib/yencode ${OPENSSL_INCLUDE_DIR} ${Boost_INCLUDE_DIR} + ${LIBXML2_INCLUDE_DIR} ) file(COPY ../testdata/nzbfile DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/tests/testdata/feed/feed.xml b/tests/testdata/feed/feed.xml new file mode 100644 index 00000000..a0349963 --- /dev/null +++ b/tests/testdata/feed/feed.xml @@ -0,0 +1,43 @@ + + + + + DS + DS RSS Details + https://indexer.com/ + en-gb + ds@indexer.com DS + indexer, ds, slug + nZEDb + 10 + https://indexer.com/rss-info/ + + + + + Crows.And.Sparrows + https://indexer.com/details/9bdef3a6cb1a370598f9af73ba50d40df354b327 + https://indexer.com/getnzb/9bdef3a6cb1a370598f9af73ba50d40df354b327.nzb&i=60790&r=4ad82a6e8c985b3060ef8972e6224daa + https://indexer.com/details/9bdef3a6cb1a370598f9af73ba50d40df354b327#comments + Mon, 04 Dec 2023 05:48:03 +0000 + Movies > HD + Description + + + + + + + + + + + + + + + + + + + diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt index 8ffb232f..dbc15436 100644 --- a/tests/util/CMakeLists.txt +++ b/tests/util/CMakeLists.txt @@ -17,7 +17,7 @@ add_executable(UtilTests ${UtilTestSrc}) target_link_libraries(UtilTests PRIVATE ZLIB::ZLIB Yencode - ${LIBXML2_LIBRARIES} + LibXml2::LibXml2 ) target_include_directories(UtilTests PRIVATE ${CMAKE_SOURCE_DIR}/daemon/main @@ -27,6 +27,7 @@ target_include_directories(UtilTests PRIVATE ${ZLIB_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR} ${Boost_INCLUDE_DIR} + ${LIBXML2_INCLUDE_DIR} ) add_test(NAME UtilTests COMMAND $ --log_level=message) diff --git a/windows/build-nzbget-vs22.bat b/windows/build-nzbget-vs22.bat index e562367a..d0ad9667 100644 --- a/windows/build-nzbget-vs22.bat +++ b/windows/build-nzbget-vs22.bat @@ -186,7 +186,7 @@ copy windows\README-WINDOWS.txt ..\distrib\NZBGet if errorlevel 1 goto BUILD_FAILED copy ChangeLog ..\distrib\NZBGet if errorlevel 1 goto BUILD_FAILED -copy README ..\distrib\NZBGet +copy INSTALLATION.md ..\distrib\NZBGet if errorlevel 1 goto BUILD_FAILED copy COPYING ..\distrib\NZBGet if errorlevel 1 goto BUILD_FAILED diff --git a/windows/build-nzbget.bat b/windows/build-nzbget.bat index 5913aa78..ee377999 100644 --- a/windows/build-nzbget.bat +++ b/windows/build-nzbget.bat @@ -200,7 +200,7 @@ copy windows\README-WINDOWS.txt ..\distrib\NZBGet if errorlevel 1 goto BUILD_FAILED copy ChangeLog ..\distrib\NZBGet if errorlevel 1 goto BUILD_FAILED -copy README ..\distrib\NZBGet +copy INSTALLATION.md ..\distrib\NZBGet if errorlevel 1 goto BUILD_FAILED copy COPYING ..\distrib\NZBGet if errorlevel 1 goto BUILD_FAILED From d337cf0af5d08b596b94956049c09560973954c9 Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Wed, 13 Dec 2023 12:32:33 +0300 Subject: [PATCH 12/34] Publish pre-release on develop push (#73) --- .github/workflows/build.yml | 34 +++++++++++++++++++ .github/workflows/linux.yml | 20 ++++++++++++ .github/workflows/osx.yml | 21 +++++++++++- .github/workflows/windows.yml | 20 ++++++++++++ .gitignore | 1 - CMakeLists.txt | 8 +---- CONTRIBUTING.md | 11 +++++++ Makefile.am | 56 +------------------------------- code_revision.sh | 53 ------------------------------ configure.ac | 2 +- daemon/util/Util.cpp | 17 +--------- nzbget.vcxproj | 8 ++--- tests/postprocess/CMakeLists.txt | 4 --- tests/util/CMakeLists.txt | 4 --- windows/build-nzbget-vs22.bat | 5 --- windows/build-nzbget.bat | 5 --- windows/nzbget-setup.nsi | 2 +- 17 files changed, 114 insertions(+), 157 deletions(-) delete mode 100755 code_revision.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a2005f17..53fdcaae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,7 @@ jobs: mv nzbget-osx-installers/* builds cd builds VERSION=$(ls | grep bin-windows-setup | cut -d - -f 2) + if [ "$GITHUB_REF_NAME" != "main" ]; then VERSION="$VERSION-testing"; fi SIGS_FILE="nzbget-$VERSION.sig.txt" echo "Generating $SIGS_FILE ..." @@ -79,3 +80,36 @@ jobs: nzbget-windows-installers nzbget-linux-installers nzbget-osx-installers + + make-testing-release: + runs-on: ubuntu-latest + needs: [generate-signatures] + permissions: + contents: write + if: github.ref_name == 'develop' + steps: + + - name: Download build artifacts + uses: actions/download-artifact@v3 + + - name: Create latest artifacts + run: | + cp $(find nzbget-installers/ -name *linux.run) nzbget-installers/nzbget-latest-testing-bin-linux.run + cp $(find nzbget-installers/ -name *windows-setup.exe) nzbget-installers/nzbget-latest-testing-bin-windows-setup + + - name: Delete tag and release + uses: dev-drprasad/delete-tag-and-release@v0.2.1 + with: + delete_release: true + tag_name: testing + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Make release + uses: ncipollo/release-action@v1 + with: + artifacts: "nzbget-installers/*" + generateReleaseNotes: true + tag: testing + allowUpdates: true + prerelease: true diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 261b5ddb..4066c64b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -15,13 +15,33 @@ jobs: with: fetch-depth: 0 + - name: Change version for non-release + if: github.ref_name != 'main' + run: | + VERSION=$(cat configure.ac | grep AC_INIT | cut -d , -f 2 | xargs) + NEW_VERSION="$VERSION-testing-$(date '+%Y%m%d')" + sed -e "s|AC_INIT(nzbget.*|AC_INIT(nzbget, $NEW_VERSION, https://github.com/nzbgetcom/nzbget/issues)|g" -i configure.ac + echo NEW_VERSION=$NEW_VERSION >> $GITHUB_ENV + - name: Build run: | rm -rf /build/nzbget + rm -rf /build/output cp -r . /build/nzbget cd /build docker run -e ALL_ARCHS="i686 x86_64 aarch64 armhf armel" -v /build:/build nzbget-build /build/scripts/build-nzbget-ci.sh + - name: Rename build artifacts + if: github.ref_name != 'main' && github.ref_name != 'develop' + run: | + cd /build/output + NEW_VERSION_FEATURE="$NEW_VERSION-${GITHUB_REF_NAME/\//-}" + for FILE in *.run; do + [ -f $FILE ] || continue + NEW_FILE=${FILE/$NEW_VERSION/$NEW_VERSION_FEATURE} + mv $FILE $NEW_FILE + done + - name: Upload build artifacts uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index 19f31f1c..f67f394c 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -14,10 +14,29 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + + - name: Change version for non-release + if: github.ref_name != 'main' + run: | + VERSION=$(cat configure.ac | grep AC_INIT | cut -d , -f 2 | xargs) + NEW_VERSION="$VERSION-testing-$(date '+%Y%m%d')" + sed -e "s|AC_INIT(nzbget.*|AC_INIT(nzbget, $NEW_VERSION, https://github.com/nzbgetcom/nzbget/issues)|g" -i '' configure.ac + echo NEW_VERSION=$NEW_VERSION >> $GITHUB_ENV - name: Build run: | - bash osx/build-nzbget.sh + bash osx/build-nzbget.sh + + - name: Rename build artifacts + if: github.ref_name != 'main' && github.ref_name != 'develop' + run: | + cd osx/build/Release + NEW_VERSION_FEATURE="$NEW_VERSION-${GITHUB_REF_NAME/\//-}" + for FILE in *.zip; do + [ -f $FILE ] || continue + NEW_FILE=${FILE/$NEW_VERSION/$NEW_VERSION_FEATURE} + mv $FILE $NEW_FILE + done - name: Upload build artifacts uses: actions/upload-artifact@v3 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2084b420..690836d3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -13,10 +13,30 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Change version for non-release + if: github.ref_name != 'main' + run: | + $Version = ((((Select-String -Path nzbget.vcxproj -Pattern ";VERSION=")[0] -split(';'))[2] -split('='))[1]) -replace '"', '' + $Date=Get-Date -Format "yyyyMMdd" + $NewVersion = "$Version-testing-$Date" + (Get-Content nzbget.vcxproj) | ForEach-Object {$_ -replace "VERSION=`"$Version`"", "VERSION=`"$NewVersion`""} | Set-Content nzbget.vcxproj + (Get-Content windows\nzbget-setup.nsi) | ForEach-Object {$_ -replace "`"DisplayVersion`" `"$Version`"", "`"DisplayVersion`" `"$NewVersion`""} | Set-Content windows\nzbget-setup.nsi + "NEW_VERSION=$NewVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Build run: | .\windows\build-nzbget-vs22.bat + - name: Rename build artifacts + if: github.ref_name != 'main' && github.ref_name != 'develop' + run: | + $Output="c:\nzbget\build\output" + $NewVersion=$env:NEW_VERSION + $Suffix = $env:GITHUB_REF_NAME.Replace("/","-") + ForEach ($File In Get-ChildItem -Path $Output -Filter "*.exe") { + Rename-Item -Path "$Output\$($File.Name)" -NewName $File.Name.Replace($NewVersion, "$NewVersion-$Suffix") + } + - name: Upload build artifacts uses: actions/upload-artifact@v3 with: diff --git a/.gitignore b/.gitignore index 16ee1cd9..a5e6c170 100644 --- a/.gitignore +++ b/.gitignore @@ -78,7 +78,6 @@ ipch/ # NZBGet specific nzbget build -code_revision.cpp *.temp *.pyc pytest.ini diff --git a/CMakeLists.txt b/CMakeLists.txt index 60732fe7..765acc7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.22) project( nzbget - VERSION "22.0" + VERSION "22.2" DESCRIPTION "NZBGet is a binary downloader, which downloads files from Usenet" LANGUAGES C CXX ) @@ -49,12 +49,6 @@ include_directories(lib/regex) include_directories(${CMAKE_BINARY_DIR}) add_subdirectory(lib) -if (NOT WIN32) - execute_process(COMMAND chmod +x ${CMAKE_SOURCE_DIR}/code_revision.sh) - execute_process(COMMAND ${CMAKE_SOURCE_DIR}/code_revision.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) - execute_process(COMMAND mv ${CMAKE_SOURCE_DIR}/code_revision.cpp ${CMAKE_BINARY_DIR}) -endif() - if(ENABLE_TESTS) include(CTest) add_subdirectory(tests) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8644f451..38ebc023 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,3 +37,14 @@ NZBGet natively supports for multiple platforms and build options, so each platf 4. After merging `develop` -> `main`, must be back merge `main` -> `develop` before any changes in `develop` branch. This flow results to the fact that in the PR to master branch we see only the squashed commits that correspond to the PRs in the develop branch in current release cycle. + +### Version changes in release cycle + +After the release has been published (from the `main` branch), the minor version in the `develop` branch should be increased so that subsequent test builds are a higher version than the release. + +List of files to change version: + +1. configure.ac - "AC_INIT" macro +2. CMakeLists.txt - "project" block +3. nzbget.vcxproj - "PreprocessorDefinitions" blocks - 4 matches +4. windows/nzbget-setup.nsi - WriteRegStr - "DisplayVersion" diff --git a/Makefile.am b/Makefile.am index 4b741907..643186eb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -169,8 +169,7 @@ nzbget_SOURCES = \ daemon/nserv/NzbGenerator.h \ daemon/nserv/NzbGenerator.cpp \ daemon/nserv/YEncoder.h \ - daemon/nserv/YEncoder.cpp \ - code_revision.cpp + daemon/nserv/YEncoder.cpp if WITH_PAR2 nzbget_SOURCES += \ @@ -455,59 +454,6 @@ install-conf: uninstall-conf: rm -f "$(DESTDIR)$(sysconfdir)/nzbget.conf" -# Determining git revision: -# 1) If directory ".git" exists we take revision from git log. -# File is recreated only if revision number was changed. -# 2) If directory ".git" doesn't exists we keep and reuse file "code_revision.cpp", -# which was possibly created early. -# 3) If neither directory ".git" nor file "code_revision.cpp" are available -# we create new file "code_revision.c" with empty revision number. -code_revision.cpp: FORCE - @ if test -d ./.git ; then \ - B=`git branch | sed -n -e 's/^\* \(.*\)/\1/p'`; \ - M=`git status --porcelain` ; \ - if test "$$M" != "" ; then \ - M="M" ; \ - fi ; \ - if test "$$B" = "master" ; then \ - V="$$M" ; \ - elif test "$$B" = "develop" ; then \ - V=`git rev-list HEAD | wc -l | xargs` ; \ - V="$${V}$$M" ; \ - else \ - V=`git rev-list HEAD | wc -l | xargs` ; \ - V="$${V}$$M ($$B)" ; \ - fi ; \ - H=`test -f ./code_revision.cpp && head -n 1 code_revision.cpp`; \ - if test "/* $$V */" != "$$H" ; then \ - ( \ - echo "/* $$V */" ;\ - echo "/* This file is automatically regenerated on each build. Do not edit it. */" ;\ - echo "#include \"nzbget.h\"" ;\ - echo "const char* code_revision(void)" ;\ - echo "{" ;\ - echo " const char* revision = \"$$V\";" ;\ - echo " return revision;" ;\ - echo "}" ;\ - ) > code_revision.cpp ; \ - fi \ - elif test -f ./code_revision.cpp ; then \ - test "ok, reuse existing file"; \ - else \ - ( \ - echo "/* */" ;\ - echo "/* This file is automatically regenerated on each build. Do not edit it. */" ;\ - echo "#include \"nzbget.h\"" ;\ - echo "const char* code_revision(void)" ;\ - echo "{" ;\ - echo " const char* revision = \"\";" ;\ - echo " return revision;" ;\ - echo "}" ;\ - ) > code_revision.cpp ; \ - fi -FORCE: - -# Ignore "code_revision.cpp" in distcleancheck distcleancheck_listfiles = \ find . -type f -exec sh -c 'test -f $(srcdir)/$$1 || echo $$1' \ sh '{}' ';' diff --git a/code_revision.sh b/code_revision.sh deleted file mode 100755 index 420371f2..00000000 --- a/code_revision.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# TODO: Delete this file after full migration to CMake -# Determining git revision: -# 1) If directory ".git" exists we take revision from git log. -# File is recreated only if revision number was changed. -# 2) If directory ".git" doesn't exists we keep and reuse file "code_revision.cpp", -# which was possibly created early. -# 3) If neither directory ".git" nor file "code_revision.cpp" are available -# we create new file "code_revision.c" with empty revision number. - -if test -d ./.git ; then \ - B=`git branch | sed -n -e 's/^\* \(.*\)/\1/p'`; \ - M=`git status --porcelain` ; \ -if test "$$M" != "" ; then \ - M="M" ; \ -fi ; \ -if test "$$B" = "master" ; then \ - V="$$M" ; \ -elif test "$$B" = "develop" ; then \ - V=`git rev-list HEAD | wc -l | xargs` ; \ - V="$${V}$$M" ; \ -else \ - V=`git rev-list HEAD | wc -l | xargs` ; \ - V="$${V}$$M ($$B)" ; \ -fi ; \ - H=`test -f ./code_revision.cpp && head -n 1 code_revision.cpp`; \ -if test "/* $$V */" != "$$H" ; then \ - ( \ - echo "/* $$V */" ;\ - echo "/* This file is automatically regenerated on each build. Do not edit it. */" ;\ - echo "#include \"nzbget.h\"" ;\ - echo "const char* code_revision(void)" ;\ - echo "{" ;\ - echo "const char* revision = \"$$V\";" ;\ - echo "return revision;" ;\ - echo "}" ;\ -) > code_revision.cpp ; \ -fi \ -elif test -f ./code_revision.cpp ; then \ - test "ok, reuse existing file"; \ -else \ - ( \ - echo "/* */" ;\ - echo "/* This file is automatically regenerated on each build. Do not edit it. */" ;\ - echo "#include \"nzbget.h\"" ;\ - echo "const char* code_revision(void)" ;\ - echo "{" ;\ - echo "const char* revision = \"\";" ;\ - echo "return revision;" ;\ - echo "}" ;\ - ) > code_revision.cpp ; \ -fi diff --git a/configure.ac b/configure.ac index 5b6e3838..78d9aa48 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.65) -AC_INIT(nzbget, 22.0, https://github.com/nzbgetcom/nzbget/issues) +AC_INIT(nzbget, 22.2, https://github.com/nzbgetcom/nzbget/issues) AC_CONFIG_AUX_DIR(posix) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([foreign subdir-objects]) diff --git a/daemon/util/Util.cpp b/daemon/util/Util.cpp index 9711252d..bb850b27 100644 --- a/daemon/util/Util.cpp +++ b/daemon/util/Util.cpp @@ -22,11 +22,6 @@ #include "Util.h" #include "YEncode.h" -#ifndef WIN32 -// function "code_revision" is automatically generated in file "code_revision.cpp" on each build -const char* code_revision(void); -#endif - #ifdef WIN32 // getopt for WIN32: // from http://www.codeproject.com/cpp/xgetopt.asp @@ -110,17 +105,7 @@ char Util::VersionRevisionBuf[100]; void Util::Init() { -#ifndef WIN32 - if ((strlen(code_revision()) > 0) && strstr(VERSION, "testing")) - { - snprintf(VersionRevisionBuf, sizeof(VersionRevisionBuf), "%s-r%s", VERSION, code_revision()); - } - else -#endif - { - snprintf(VersionRevisionBuf, sizeof(VersionRevisionBuf), "%s", VERSION); - } - + snprintf(VersionRevisionBuf, sizeof(VersionRevisionBuf), "%s", VERSION); // init static vars there CurrentTicks(); } diff --git a/nzbget.vcxproj b/nzbget.vcxproj index 7e5336e1..4566a45f 100755 --- a/nzbget.vcxproj +++ b/nzbget.vcxproj @@ -85,7 +85,7 @@ Disabled C:\vcpkg\installed\x86-windows-static\include;..\bin\Debug32;.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\par2;.\lib\yencode;.\windows\resources;.\lib\regex;%(AdditionalIncludeDirectories) - WIN32;PACKAGE="nzbget";VERSION="22.0";_DEBUG;_CONSOLE;DEBUG;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions) + WIN32;PACKAGE="nzbget";VERSION="22.2";_DEBUG;_CONSOLE;DEBUG;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebug @@ -107,7 +107,7 @@ Disabled C:\vcpkg\installed\x64-windows-static\include;..\bin\Debug64;.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\regex;.\lib\par2;.\lib\yencode;.\windows\resources;%(AdditionalIncludeDirectories) - WIN32;PACKAGE="nzbget";VERSION="22.0";_DEBUG;_CONSOLE;DEBUG;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions) + WIN32;PACKAGE="nzbget";VERSION="22.2";_DEBUG;_CONSOLE;DEBUG;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebug @@ -133,7 +133,7 @@ C:\vcpkg\installed\x86-windows-static\include;..\bin\Release32;.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\par2;.\lib\yencode;.\windows\resources;.\lib\regex;%(AdditionalIncludeDirectories) - WIN32;PACKAGE="nzbget";VERSION="22.0";NDEBUG;_CONSOLE;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions) + WIN32;PACKAGE="nzbget";VERSION="22.2";NDEBUG;_CONSOLE;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions) Sync MultiThreaded Use @@ -172,7 +172,7 @@ C:\vcpkg\installed\x64-windows-static\include;..\bin\Release64;.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\par2;.\lib\yencode;.\windows\resources;.\lib\regex;%(AdditionalIncludeDirectories) - WIN32;PACKAGE="nzbget";VERSION="22.0";NDEBUG;_CONSOLE;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions) + WIN32;PACKAGE="nzbget";VERSION="22.2";NDEBUG;_CONSOLE;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions) Sync MultiThreaded Use diff --git a/tests/postprocess/CMakeLists.txt b/tests/postprocess/CMakeLists.txt index 73e68a57..2d674d81 100644 --- a/tests/postprocess/CMakeLists.txt +++ b/tests/postprocess/CMakeLists.txt @@ -27,10 +27,6 @@ file(GLOB PostprocessTestsSrc ${CMAKE_SOURCE_DIR}/lib/regex/regex.c ) -if (NOT WIN32) - set(PostprocessTests ${PostprocessTestsSrc} ${CMAKE_BINARY_DIR}/code_revision.cpp) -endif() - add_executable(PostprocessTests ${PostprocessTestsSrc}) target_link_libraries(PostprocessTests PRIVATE ZLIB::ZLIB diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt index dbc15436..9d975434 100644 --- a/tests/util/CMakeLists.txt +++ b/tests/util/CMakeLists.txt @@ -9,10 +9,6 @@ file(GLOB UtilTestSrc ${CMAKE_SOURCE_DIR}/lib/regex/regex.c ) -if (NOT WIN32) - set(UtilTestSrc ${UtilTestSrc} ${CMAKE_BINARY_DIR}/code_revision.cpp) -endif() - add_executable(UtilTests ${UtilTestSrc}) target_link_libraries(UtilTests PRIVATE ZLIB::ZLIB diff --git a/windows/build-nzbget-vs22.bat b/windows/build-nzbget-vs22.bat index d0ad9667..1d99fde3 100644 --- a/windows/build-nzbget-vs22.bat +++ b/windows/build-nzbget-vs22.bat @@ -88,11 +88,6 @@ cd .. cd tmp\nzbget-%VERSION% -rem Activate revision info (using code_revision.cpp) -rem %SED% -e ":a;N;$!ba;s|void Util::Init()\n{\n#ifndef WIN32|void Util::Init()\n{\n#ifndef WIN32DISABLED|" -i daemon\util\Util.cpp -rem %SED% -e ":a;N;$!ba;s|#ifndef WIN32\n// function|#ifndef WIN32DISABLED\n// function|" -i daemon\util\Util.cpp -rem %SED% -e "s|||" -i nzbget.vcxproj - :TARGET_DEBUG rem Build debug binaries if %BUILD_DEBUG%==0 goto TARGET_RELEASE diff --git a/windows/build-nzbget.bat b/windows/build-nzbget.bat index ee377999..0b2501c6 100644 --- a/windows/build-nzbget.bat +++ b/windows/build-nzbget.bat @@ -101,11 +101,6 @@ cd .. cd tmp\nzbget-%VERSION% -rem Activate revision info (using code_revision.cpp) -%SED% -e ":a;N;$!ba;s|void Util::Init()\n{\n#ifndef WIN32|void Util::Init()\n{\n#ifndef WIN32DISABLED|" -i daemon\util\Util.cpp -%SED% -e ":a;N;$!ba;s|#ifndef WIN32\n// function|#ifndef WIN32DISABLED\n// function|" -i daemon\util\Util.cpp -%SED% -e "s|||" -i nzbget.vcxproj - :TARGET_DEBUG rem Build debug binaries if %BUILD_DEBUG%==0 goto TARGET_RELEASE diff --git a/windows/nzbget-setup.nsi b/windows/nzbget-setup.nsi index d74dab41..f4e5178d 100644 --- a/windows/nzbget-setup.nsi +++ b/windows/nzbget-setup.nsi @@ -179,7 +179,7 @@ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NZBGet" "U WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NZBGet" "InstallLocation" "$INSTDIR" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NZBGet" "Publisher" "nzbget.com" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NZBGet" "DisplayIcon" "$\"$INSTDIR\nzbget.exe$\",0" -WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NZBGet" "DisplayVersion" "22.0" +WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NZBGet" "DisplayVersion" "22.2" ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2 IntFmt $0 "0x%08X" $0 From 3f8fd6d433b38ed9f18ab7ffe25fd7a4a0c5c246 Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Fri, 15 Dec 2023 11:35:15 +0300 Subject: [PATCH 13/34] Synology support (spk) (#72) --- .github/workflows/build.yml | 17 ++-- .github/workflows/synology.yml | 43 ++++++++++ .gitignore | 1 + README.md | 3 + synology/README.md | 53 ++++++++++++ synology/build-info.md | 44 ++++++++++ synology/build-nzbget.sh | 52 ++++++++++++ synology/package/INFO.sh | 22 +++++ synology/package/PACKAGE_ICON.PNG | Bin 0 -> 13154 bytes synology/package/PACKAGE_ICON_256.PNG | Bin 0 -> 37045 bytes synology/package/README.md | 7 ++ synology/package/SynoBuildConf/build | 25 ++++++ synology/package/SynoBuildConf/depends | 4 + synology/package/SynoBuildConf/install | 55 ++++++++++++ .../package/WIZARD_UIFILES/install_uifile | 80 ++++++++++++++++++ .../package/WIZARD_UIFILES/uninstall_uifile | 16 ++++ .../package/WIZARD_UIFILES/upgrade_uifile | 12 +++ synology/package/conf/privilege | 5 ++ synology/package/conf/resource | 19 +++++ synology/package/nzbget.sc | 5 ++ synology/package/scripts/postinst | 32 +++++++ synology/package/scripts/postuninst | 8 ++ synology/package/scripts/postupgrade | 3 + synology/package/scripts/preinst | 3 + synology/package/scripts/preuninst | 3 + synology/package/scripts/preupgrade | 3 + synology/package/scripts/start-stop-status | 25 ++++++ synology/package/scripts/vars | 2 + 28 files changed, 536 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/synology.yml create mode 100644 synology/README.md create mode 100644 synology/build-info.md create mode 100644 synology/build-nzbget.sh create mode 100755 synology/package/INFO.sh create mode 100644 synology/package/PACKAGE_ICON.PNG create mode 100644 synology/package/PACKAGE_ICON_256.PNG create mode 100644 synology/package/README.md create mode 100644 synology/package/SynoBuildConf/build create mode 100644 synology/package/SynoBuildConf/depends create mode 100644 synology/package/SynoBuildConf/install create mode 100644 synology/package/WIZARD_UIFILES/install_uifile create mode 100644 synology/package/WIZARD_UIFILES/uninstall_uifile create mode 100644 synology/package/WIZARD_UIFILES/upgrade_uifile create mode 100644 synology/package/conf/privilege create mode 100644 synology/package/conf/resource create mode 100644 synology/package/nzbget.sc create mode 100755 synology/package/scripts/postinst create mode 100755 synology/package/scripts/postuninst create mode 100755 synology/package/scripts/postupgrade create mode 100755 synology/package/scripts/preinst create mode 100755 synology/package/scripts/preuninst create mode 100755 synology/package/scripts/preupgrade create mode 100755 synology/package/scripts/start-stop-status create mode 100644 synology/package/scripts/vars diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 53fdcaae..57371068 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,11 +17,14 @@ jobs: build-osx: uses: ./.github/workflows/osx.yml + build-synology: + uses: ./.github/workflows/synology.yml + generate-signatures: env: PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} runs-on: ubuntu-latest - needs: [build-windows, build-linux, build-osx] + needs: [build-windows, build-linux, build-osx, build-synology] steps: - name: Download build artifacts @@ -30,9 +33,10 @@ jobs: - name: Generate signatures run: | mkdir -p builds - mv nzbget-windows-installers/* builds - mv nzbget-linux-installers/* builds - mv nzbget-osx-installers/* builds + mv nzbget-windows-installers/* builds || true + mv nzbget-linux-installers/* builds || true + mv nzbget-osx-installers/* builds || true + mv nzbget-synology-packages/* builds || true cd builds VERSION=$(ls | grep bin-windows-setup | cut -d - -f 2) if [ "$GITHUB_REF_NAME" != "main" ]; then VERSION="$VERSION-testing"; fi @@ -44,7 +48,7 @@ jobs: echo "nzbget_signatures({" | tee $SIGS_FILE echo | tee -a $SIGS_FILE - for FILE in *.exe *.run *.zip; do + for FILE in *.exe *.run *.zip *.spk; do [ -f $FILE ] || continue MD5=$(openssl dgst -md5 $FILE | cut -d ' ' -f 2) @@ -80,6 +84,7 @@ jobs: nzbget-windows-installers nzbget-linux-installers nzbget-osx-installers + nzbget-synology-packages make-testing-release: runs-on: ubuntu-latest @@ -95,7 +100,7 @@ jobs: - name: Create latest artifacts run: | cp $(find nzbget-installers/ -name *linux.run) nzbget-installers/nzbget-latest-testing-bin-linux.run - cp $(find nzbget-installers/ -name *windows-setup.exe) nzbget-installers/nzbget-latest-testing-bin-windows-setup + cp $(find nzbget-installers/ -name *windows-setup.exe) nzbget-installers/nzbget-latest-testing-bin-windows-setup.exe - name: Delete tag and release uses: dev-drprasad/delete-tag-and-release@v0.2.1 diff --git a/.github/workflows/synology.yml b/.github/workflows/synology.yml new file mode 100644 index 00000000..70be5cb7 --- /dev/null +++ b/.github/workflows/synology.yml @@ -0,0 +1,43 @@ +name: synology build + +on: + workflow_call: + workflow_dispatch: + +jobs: + build: + runs-on: [self-hosted, linux] + + steps: + + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Build + run: | + sudo -E bash synology/build-nzbget.sh + + - name: Rename build artifacts + if: github.ref_name != 'main' + run: | + cd /toolkit/result_spk/nzbget/ + VERSION=$(date '+%Y%m%d') + NEW_VERSION="$VERSION-testing" + for FILE in *.spk; do + [ -f $FILE ] || continue + NEW_FILE=${FILE/$VERSION/$NEW_VERSION} + sudo mv $FILE $NEW_FILE + done + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: nzbget-synology-packages + path: /toolkit/result_spk/nzbget/*.spk + retention-days: 5 + + - name: Cleanup + run: | + sudo rm /toolkit/result_spk/nzbget/*.spk diff --git a/.gitignore b/.gitignore index a5e6c170..600afee6 100644 --- a/.gitignore +++ b/.gitignore @@ -78,6 +78,7 @@ ipch/ # NZBGet specific nzbget build +!synology/package/SynoBuildConf/build *.temp *.pyc pytest.ini diff --git a/README.md b/README.md index 3eea975a..7d883341 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ [![windows build](https://github.com/nzbgetcom/nzbget/actions/workflows/windows.yml/badge.svg?branch=main)](https://github.com/nzbgetcom/nzbget/actions/workflows/windows.yml) [![osx build](https://github.com/nzbgetcom/nzbget/actions/workflows/osx.yml/badge.svg)](https://github.com/nzbgetcom/nzbget/actions/workflows/osx.yml) [![docker build](https://github.com/nzbgetcom/nzbget/actions/workflows/docker.yml/badge.svg)](https://github.com/nzbgetcom/nzbget/actions/workflows/docker.yml) +[![synology build](https://github.com/nzbgetcom/nzbget/actions/workflows/synology.yml/badge.svg)](https://github.com/nzbgetcom/nzbget/actions/workflows/synology.yml) ![Contributions welcome](https://img.shields.io/badge/contributions-welcome-blue.svg) @@ -35,6 +36,8 @@ Please download binaries from our [releases](https://github.com/nzbgetcom/nzbget We also provide a docker image for popular architectures. [Docker readme](docker/README.md) +Synology DSM 7.x packages also available. [Synology readme](synology/README.md) + ## Supported platforms for installers `Windows`: Windows 7 and later, 32 or 64 Bit. diff --git a/synology/README.md b/synology/README.md new file mode 100644 index 00000000..03b1b513 --- /dev/null +++ b/synology/README.md @@ -0,0 +1,53 @@ +# Synology nzbget packages + +## Package versions + +We provide native packages for most Synology platforms (DSM 7.x). To select a correct package for yours platform please find Synology model in [Synology NAS list](https://kb.synology.com/en-us/DSM/tutorial/What_kind_of_CPU_does_my_NAS_have) and select package based on `Package Arch` field: + +| Package Arch | NZBGet package name +|:---------------|:- +| alpine | nzbget-armv7-*.spk +| alpine4k | nzbget-armv7-*.spk +| apollolake | nzbget-x86_64-*.spk +| armada370 | nzbget-armada370-*.spk +| armada375 | nzbget-armada375-*.spk +| armada37xx | nzbget-armv8-*.spk +| armadaxp | nzbget-armadaxp-*.spk +| avoton | nzbget-x86_64-*.spk +| braswell | nzbget-x86_64-*.spk +| broadwell | nzbget-x86_64-*.spk +| broadwellnk | nzbget-x86_64-*.spk +| broadwellntb | nzbget-x86_64-*.spk +| broadwellntbap | nzbget-x86_64-*.spk +| bromolow | nzbget-x86_64-*.spk +| cedarview | nzbget-x86_64-*.spk +| coffeelake | nzbget-x86_64-*.spk +| comcerto2k | `not supported` +| denverton | nzbget-x86_64-*.spk +| evansport | nzbget-i686-*.spk +| geminilake | nzbget-x86_64-*.spk +| grantley | nzbget-x86_64-*.spk +| kvmx64 | nzbget-x86_64-*.spk +| monaco | nzbget-monaco-*.spk +| purley | nzbget-x86_64-*.spk +| rtd1296 | nzbget-armv8-*.spk +| rtd1619 | nzbget-armv8-*.spk +| skylaked | nzbget-x86_64-*.spk +| v1000 | nzbget-x86_64-*.spk + +## Installing / upgrading / uninstalling / reinstalling + +To install NZBGet package from Synology Package Center press Manual Install and select downloaded package -> Next -> Agree -> Select shared folder and download directory -> Credentials for web interface -> Done. +After installation NZBGet web interface will be availabe from http://[Synology NAS IP or Hostname]:6789 with provided during installation username/password (nzbget/nzbget by default). Also this link available from package center "Open" button on installed NZBGet package icon. + +To upgrade nzbget package - do the same thing with new package. NZBGet settings will be keeped. + +Uninstall - from Package center select NZBGet package and hit uninstall in action combo box. You can keep existing config files or cleanup all package data. If you keep existing config files, all settings selected in next package installations will be ignored, old config files settings will be preferred. + +## Shared folders permissions and nzbget + +When installed, the package adds all the necessary permissions for the selected Shared folder to work correcty. If you want to change the download path to another shared folder, you must manually add permissions for the nzbget user. For example - you changed MainDir to /volume2/some_shared_folder/some_download_directory. You must add r/w permission to `nzbget` user via Control Panel -> Shared Folder -> Select `some_shared_folder` -> Edit -> Permissions tab -> select from combobox `System internal user` -> nzbget -> Read/Write -> Save. + +## Extensions + +You can put custom extension in `ScriptDir` directory. During installation this directory appears in `selected_shared_folder\selected_download_directory\scripts` and populates with default scripts (Email and Logger). Synology DSM 7.x bundled with python 3.8, so you must make sure that the script you are installing supports it. Our forks of VideoSort/FailureLink/FakeDetector are tested and working. diff --git a/synology/build-info.md b/synology/build-info.md new file mode 100644 index 00000000..5f1330a1 --- /dev/null +++ b/synology/build-info.md @@ -0,0 +1,44 @@ +# About + +"build-nzbget.sh" is a bash script which is used to build nzbget Synology packages. + +# Prerequisites + +## Synology toolkit and environments + +Basic setup (assuming have Debian/Ubuntu host): + +1. Install Synology toolkit (reference - https://help.synology.com/developer-guide/getting_started/prepare_environment.html) +``` +sudo apt-get install git cifs-utils python3 python3-pip +sudo mkdir -p /toolkit +sudo chmod 777 /toolkit +cd /toolkit +git clone https://github.com/SynologyOpenSource/pkgscripts-ng +cd /toolkit/pkgscripts-ng/ +git checkout DSM7.0 +``` + +2. Install needed environments (please note - user must have sudo access) + +- according to https://help.synology.com/developer-guide/appendix/platarchs.html - one per architecture, and specific separately +- we exclude `comcerto2k` - toolchain for this platform does not support C++14 + +``` +cd /toolkit/pkgscripts-ng/ +for PLATFORM in alpine armada370 armada375 armada37xx armada38x armadaxp avoton evansport monaco; do sudo ./EnvDeploy -v 7.0 -p $PLATFORM; done +``` + + +## Building NZBGet + +From cloned repository run +``` +sudo bash synology/build-nzbget.sh [platform] +``` +Please note - user must have sudo access. Synology toolkit requires root access to build packages. + + +## Output files + +- /toolkit/result_spk/nzbget/*.spk - one file per platform diff --git a/synology/build-nzbget.sh b/synology/build-nzbget.sh new file mode 100644 index 00000000..12b69990 --- /dev/null +++ b/synology/build-nzbget.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# synology toolkit path +TOOLKIT=/toolkit + +# parameter can be build platform +BUILD_PLATFORM=$1 +if [ ! -z "$BUILD_PLATFORM" ]; then BUILD_PARAM="-p $BUILD_PLATFORM"; fi + +# clean up +rm -rf $TOOLKIT/source/nzbget +rm -rf $TOOLKIT/result_spk/ +if [ ! -z "$BUILD_PLATFORM" ]; then + PLATFORMS=$BUILD_PLATFORM +else + PLATFORMS="alpine armada370 armada375 armada37xx armada38x armadaxp avoton evansport monaco" +fi +for PLATFORM in $PLATFORMS; do + echo "Cleanup $PLATFORM environment ..." + rm -rf $TOOLKIT/build_env/ds.$PLATFORM-7.0/image/packages +done + +# copy source and prepare package structure +mkdir -p $TOOLKIT/source/nzbget +cp -r . $TOOLKIT/source/nzbget +cp -r synology/package/* $TOOLKIT/source/nzbget/ +cd $TOOLKIT/source/nzbget/ +chmod +x scripts/* +chmod -x scripts/vars +chmod +x SynoBuildConf/* +chmod -x SynoBuildConf/depends +chmod +x INFO.sh + +# correct build version in INFO.sh +VERSION=$(grep "AC_INIT(nzbget, " configure.ac | cut -d "," -f 2 | xargs) +SPK_VERSION=$(date '+%Y%m%d')-${VERSION//./} +# if running from CI/CD, add testing to builds from non-main branch +if [ -n "$GITHUB_REF_NAME" ]; then + if [ "$GITHUB_REF_NAME" != "main" ]; then + NEW_VERSION="$VERSION-testing-$(date '+%Y%m%d')" + sed -e "s|AC_INIT(nzbget.*|AC_INIT(nzbget, $NEW_VERSION, https://github.com/nzbgetcom/nzbget/issues)|g" -i configure.ac + fi +fi +sed -e "s|version=.*$|version=\"$SPK_VERSION\"|g" -i INFO.sh + +# build +$TOOLKIT/pkgscripts-ng/PkgCreate.py -v 7.0 -c -P 2 nzbget $BUILD_PARAM + +# remove debug packages and set user perms on packages +mv $TOOLKIT/result_spk/nzbget-$SPK_VERSION/ $TOOLKIT/result_spk/nzbget/ +rm $TOOLKIT/result_spk/nzbget/*_debug.spk +chmod 666 $TOOLKIT/result_spk/nzbget/* diff --git a/synology/package/INFO.sh b/synology/package/INFO.sh new file mode 100755 index 00000000..621e8436 --- /dev/null +++ b/synology/package/INFO.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +source /pkgscripts/include/pkg_util.sh + +package="nzbget" +version="yyyymmdd-version" +displayname="NZBGet" +os_min_ver="7.0-41201" +maintainer="nzbget@nzbget.com" +adminport="6789" +description="NZBGet is a binary downloader, which downloads files from Usenet based on information given in nzb-files." + +# populate arch +BUILD_ARCH="$(pkg_get_platform)" +arch=$BUILD_ARCH +if [ "$BUILD_ARCH" == "alpine" ]; then arch="alpine alpine4k"; fi +if [ "$BUILD_ARCH" == "armada37xx" ]; then arch="armada37xx rtd1296 rtd1619 aarch64"; fi +if [ "$BUILD_ARCH" == "avoton" ]; then arch="apollolake avoton braswell broadwell broadwellnk broadwellntb broadwellntbap bromolow cedarview coffeelake denverton geminilake grantley kvmx64 purley skylaked v1000 x86_64"; fi +if [ "$BUILD_ARCH" == "evansport" ]; then arch="evansport x86 i686"; fi + +[ "$(caller)" != "0 NULL" ] && return 0 +pkg_dump_info diff --git a/synology/package/PACKAGE_ICON.PNG b/synology/package/PACKAGE_ICON.PNG new file mode 100644 index 0000000000000000000000000000000000000000..93a07e852f53071bc9ffc11935d11ba5818b5a2e GIT binary patch literal 13154 zcmV-oGo8$dP)eH z4<#YeO;{-a000SaNLh0L01k8j01k8kYb3MQ001)qNklAX4# zc>{@g0KxFa8F`3~N&rWMpuhyq3eLi~qOQ9~4?5`j$F9e-tMbR-S=3owQPi`(&QWGi zXIxPb<)|=Z9S|WPNi-pE^6ES~o$ju?-@R40>Q;4i(w%f5x_jZKs&7?S-MYWu_q?|Y z;Q!12=^|b34ve$sCYQTom%98E2_Qw$&fBbj4@ZWd6iI#x1duHD#qCgS=0ZRRm<-bf z7W+TC@?#``72q~uD+$#WX5Z@B&49~c_W5TJwm(`zI4*Ywq9|qw=AhbyeY?#(|biHKQZYG3iE&#?M z5yl$<%)oOM&Lx_I>k?`_tqBPUiHjF6&YLk~M#=P&>BTp%ym>l;USPA^opuCT!a~@E z2@qn^{Stm+jS_318(ArV-rio%@#Dv<4jnx7eNAo6xys7Q+Vkhnw}V1}0k!&s%1OdC zglIBAyzO`>QU$c1r(xqjyZd$Qokpm?jft1XaT>%_{ zrw1qvA{c&&eH|~Q(nfCs(%js1Vb7kIzC3sCT-AH;y?4^%@$}%Keym=#a$<D= zzH#HmUtEQSgK7X@YvY9g2{WvkDd14j%cvtE2)xiy$#g&h&I`6tKcKnje(UYG4*&l5 z|MA}^Pn@WwO==a%z=^=kgH;4^NkO<=_Y@sF?!svtjPMc@Xc4SG9pKcoO#ygm&JB+wag(c=(Y= z-umE!4~}7zN3CWe@aW-^YlBNk01mzw#uFAgKup()4jyyru%=*5qxSuG zyLR23mYSMH2mvdp*K9v-F%$z-uWlA?2H4|otvhn-qx zltt2ycWcGkthQMcdViV+Ad1JVXJr@!TtO9A9?7ZhhA!E zK-TI+;7+6HC|aeN#|)gYyuPUNMF-D~HEsIz=|xXHwe!AZ%gU}+N67%R=;-zI^unP- z2jPu3-hh^t7VA6Wm2I=|Lb+)7v#=K7e(J~`lXRn5sKwew34z;FM1e^>2m46}y1U@@|9TzX zdFNfU!N#si6Y=6V+QB|oRqL0bP;(JHfkgNeCB9VxyUosg1zPj-^WgT|H!&hmKSgvp z#cfYdPZ#<;yFdK!!>_Q3W*Dh95PgF&CBayX90#ALZ#np>SSQS%KYuo=@P9&wDvu4K z3Ocv>{PUY{z6o!={Whx00g!{TLJSmc+k6QeWjN6Jmpg}LEaU?A`%@d(zeQ3KbU>*_ z!1kHwG;ZFs8U2M~%~_OGTfnse{l90=o_Dry-~JjXB%o%Y8;m5NHRdFU^(czq^VptB zJq17GSL=Uu<1^1a^Pnrvm8eNOF@|%Mm6h<~i!VYWhHeyiSq_41$MEbbyy!|C*tGEl zd`LkhZad%r$2U%}%UmN!aKjBZ!luoe0H0km30xD{B!v)Pe)+}M8#Zj*iCTfWpp*!d z1XLUFoI%V<5X;dtgHI)&seG&%J05;`?T+96_HI1GPMCj74AMW~9e_PA?San@f2M$r zp_fc>I|spEO-AgT5l!>2w&RaF%{_v~|Uv7;TO zUI9Ot9{_nZK5O13fosf)tS`}v zz51~;Sg`dX=utwj*R5T<@Zh0C zRjsY96nOJ8HCjfk0Y*yzK9k2KpJw)$+JE}#r|+t$s8~zEr_Uxco3D8Dot>SqYu7Ho z_*e7(2d?*mZo z@RNh5FJ8Pz{Q&byqft*FjfMbR^7%>~?(k(k_~3)FZzxxO(?OOX+dkreAr;pGPNd@wj^0Fu5>MgSa8Q(XfdPdAj5lxV9K zB$W&a@d=4bmoAJjT1w*Vo4`5=iqy=ijt5^%(0C7H}!T8ur0sLx@0X0Q#o%L2`XE`UOsC zX>DcG)K^ZQuJ&Iqsi~dlwygZ7FxAjz?__aUH13U)XG3_*%m5J8TYp{K+H ziOtCn=Z%BT_6|0&MKyuBpwpOHTwI)qPV-4HEMo7SHmMvR;dDDuU%2*uFDq-0?ItlXL{{77Brvn#A3qbQN4WkC1fSyD$ zf=(A_5C;6v(oTk{U`ZC`y2?GY^8_Lo`ZWR))RtAlV2Y0siLP^K($e8rgLE|k0lUrN z!tnVYT`pG^C{A~hiUt1x%rIVzu|%T*M6X{<_Dr2RbsBc)G0A3ga+S}e|BElafD5`r7J^A5Pw-ev{BY`BKQ2XR2Kaf}k}ruEC12PYv_i;$MaOhvM{_W#8?t}M zMi1J~BBp8R4>%llg?#KJ0x9m4RP+gw4;(mf3POLB5|vXJDFMu?pR$grevIcIDJm{5 z1g`qkgwF+Z`ab^nfHu)nx2zThG6!M^{?NcH$t7`(aO9&Rt}z5b(@2~Qe6fePMpR!D zW*WHYNDy=dp)b7;vg>o02JPr*2NW{kb0_qQR0EZkmKJ~h`R8Yvo11B>*!)A3hzStQ zFN3)BYhmA-HMd@W-F4SpO;fs>$BzUU^bf*EAAQ6+OJ~BG=Qcy%q`s&I!U%|P z!-bi3P;j=0nSoQMPQgsN(um%{M!+Vs^^UfkPd&AD`HB^1!FnZ8M5;Ct4PcJ>ncYuJ zOw4)hwO1c!i#Ij!m4wfyXupt|%ERR1!z`>Dk=?ga`NV8{Rc&C@1QIm8)(qZiF9f;+ z!_=TqtwL5P=ZRuj{Sgki!RutQ=qa- zhPs76j3M~M0({;c{XK^&l2Zap$4^p?i^*9uoC^@WbBNzNKkppKPDPNvI{Fnl*FolB z2h}C)wBB>iJ?nCEa&ke*#U!d2@!wQN1ne-~2$|_i#+W~I7?_>%^Q>qAJf^6<^zGk=>qMkddm2m>FhB02Ra08CK;G2CBhgVB+|m*9iy z(rV^=bai&Y_uv1(qAS9t%#}zhAt51U)22-~gF=906(c7^7!gFm60`KXckI~lYlqX3 zq!EBs0w+(LWNBVDotfDKZBtsK9%%C*5i_7+HGv2Qg!RlvTpW_cJ#^5C1?WU2>S##N zbVUPr(!1H1e)G*q7#tjA!p6s(ZntjTdh6uLlP7@^nMI`qhB`q^pJ;3QQ2H}gu3TBh zZ_aDK*9&LPRB6&*JEvxJ18$|t`G6aa>v2Dk!hA0VMRG{`{cU0HXCMJFXsgkXpz6vq z3{DyqoIQ6|%?rp{jsVHw*tl`y3eX7BD zAZ6;syf)~Y&>Qt28&$u_(+^4TSS5UPdmL*8AUTA4!SIqF5|)mF1U)GpXwGS3V_RQe z4_@zpGWNpwZ{EClReE}QmP!In06twGwhR>pnq&V&>_Bq)nl;O1HSFVC`kOmC(?>f< zbK5mD&W{p&2m#-iqBWC42Y~wo#ZMH1JfJwjfnGHtLaoL3=~w7A0__2#d|2TUB;d?( zYS)*Z>&TqFR8)-TZfllHTFS2w+b8ve^HQJMLJH;a@rfURE4G`b-pjs`_bZozx72 z@zFVcA>acsfNdm%*%Q~#70-z;bQ#;kCkuEZHreYKl8kMLS$RWbiXiUM`D^9a9R;JhM!RUm`kd~H~y=c**Qc!X=37|WJQTYI( z^QRG@q@*Ojw6yf9pn5a5!Uweg%~Y{3Ap=`;T2T6ZQQ>Zk_esbgg$%F-_=fL-5+ww^ z7&G_N8h~J5K;6gMr&in#SXJRT`yTslK$(m&X&w^NN3i_NpOlX-F&&GP1Ou)CXv}C} z+P1B=O*6w32cih1v}VnkG7AEj--@P{p-h07`b}82Y}xfj)vw%?OFyBWf59lE-vF*K zWLB9z2=xgJWI%;iwe>p~_&z!^hAsHaMNbsKgt7_dBrxlXq$PoM6QQMs`8x>sajlb4 zPu;U}Zc-H#bQiIRfUY9S%FIOJqkU9N!ICA{UgdJRQhYvNf{L93bOJ=>1Bi=05^uTX zmL)vt!*l;Vy*(^0rPAM<-~o@@6V<~QnQzntW+^d9lBn|4W5gtxazC1>?iepEmvs0= zA`lf=#UB(%0IFkXF-c?~OcV}bS5g=BBy>Z%F9W)}x*#Jx1FarLWa|46TrOu~+0wH4 zfBN&ET0nnw9>vmf-JRJ4nAJZcz^qxb@+aozPGyoWE0vO=rMZQHPgPRwAF#P^OB@-(oo~45y&Iuf0(yBhSo(UcOxfxwUC>#7T8RpKNcO@tUh=*aag0?Vi zJpO0-|DXT-XS4LYzmkC(@cPgWDX&gx%4h_?!yo;iS|v;*>-Nx$;1JP(ZEO-jnzjN{ z{vWu%LM%vYl>DKjK2m4U?-)c9)G;kUe_*30g%nMYl$4Y{ZQ8WSpeKZQ??dn&N&_$l zkiJ%R;lf3WwB%1vxmjmd2b=4s$%vNJ7Ko-0gBlFu2bj(R5GP~w6+T9vfID6ga}%Iw z0QDX;!DAw;6p`eE(JWX*1d*0TcO#o|?d$JX)51jiT_wfoh8u2J4Eozt`EoHZ-^t1c z5Z~bCoIQJX9!hzf+0OL$_Gv$TZg;muKcK@%Ke0L{bYFA63;6AE zP#-2#@|7~Y{D&8a@TE1eg=qk4e!WNnB{i>OL|>>0Mhzf(Mq2O0C_o%y?H50Vg@q-^ zC`lGp{m^|M_5ShZey1P06T3$^tR%X9gV!%kwy5Vxx+*T-Rlrig6cnBkrUzx8ah-(h zHLaTv*N*XQAO;f&Q{xp+-5~13@MhYO5LRmn4f(rbm>H~x~{1&693DES3N}3oAY@lzAn$aMwFkd2Xo;dR=+Jw2QNqAt`PJX|JFGXaYhFPg4{uTK4{FI=S6 z6F&m!59i=XrgIEy0Zm##BZM*aE17ZwQpmlyx(;2%L)28VY>{;gopsdvA`(>d4FtF? zO`Ih$3|AbsbjNiv3pV?$q{ zCqBC5kJSSY_4s1QXO&E`Y{B!qwF8>!m+axvv+C(oY8(>qw}VS|B}K!WT$_THJ=G4j zc)KdQeEq+sH?&vKYdSz9El1mw=#i|u9!=?v>((ZN{OABW>~@9^eINwlP(jpN(5hkV-ck52uuPT_73_KK$wS(P3d>^L(q|w10-c>5(1RH%nVga8I8~k8Y&H%cB)FF(JUQNrmcn< zB$g%!0!;&Ast{<3Sj2$9;5Z9|lR)C^UK3~W60eE!`d4IpwqBLK|S9mN^IOw@vWWC_fuJ?tM&yYqIv znQ(mU1R~Y%I`<(5XSfzh^lH>H_2k?uS6wkp-2~Io)Tv|8dzq;K!$~JB*cBEP;MOs5 z3g~bL$1(yL0p#T5Ym^*DoN8yX^<$2rh06_`lHe1e|L zx&l$6SYrT4Y_Daq;}8duHUvE*Mlg$;I7UV)eAR5`cHhXnwyxM>YJ+Ge$6? zOCjv0lkN;Hx5@@bI&E_f5V4)dbSaep#G6?HaGI?A{$@W!e*lSd75iF7?3qDgm{h`= zu?oakr{Rls6n_{dF544r44upf1pOohgFi(dK-4e*(K3ocL`lQ{F9F8QvZ)~ZY!0yC zpK&5a7(g`KSQKvtf!G&qxSv3n34rrwOTQEKi135s8W>iXra0iSfh;90Q&A`a6-;7{ zorGR{dh!Qb;GF<-)Gc^w+P*Cwg!k9V5b-!T%;z^2T14Kz?(z}o( zzjrX8%;^Fe1Ar^j1Q5$_k@z{JeNSgVB!DF}MOw^IFb;8TWxc4Pu2ZzV z|IAsY8y%Tha<$shu|&Q7Gk3m7A5F=;3J|wi+HXsQ@5RsJf6)O9l5_3vlOH|}`79y{ zw~Z;fGf07?B#BG{aA~Geof6^H!~+izSzP3}Gm_*-mA*}SScKplaZpI6OJYW?y|Jq& z2hvr(ju1Zv$f4#^v;@%yK$t5Nz#^^DM$?KbsPV4Khe^guDm{OK`<2C_N(wVFaG5DX zS)PO*h+G{Rioit21heRwPN%(P);$_|9(~~hKP#&CAJ6k*$JHcv$EN@~8}qyqGNX^k zKC6i@YdI;2b42jc7cwK_TFW-7t7-b0Vykv0L(8sg=M#Pa+h2}*&sBXpvOx%VahJl5 z@PaSHqb#TZR5gAAJzFop*cVrvP9vVViPTLB&tX!R1w~&zC?QBnv+JVy<94Bn;I)x7EVo2}~RjH@&Qk0E~u( z5Y0eP)mRH)3qkadAj!(W&=QLkV2D9vbiWJge^Udef7}kE2gYo@kG+^Q7obj2MwoJ5 z8Sd*B4G;-{QwJ9pGs8o}qcd6+ZHNlX!73vF z0>w}=yHPS|QZ}`CBaLz5L%N7i8J@$E}+QYL6Kh<;PGQga(n7ZpoEk#8(?}m zV#WgKL@+cogkn=n8RN(*8dn0~1tK$%h`AiBT^!c~(DL*VAB3Wzq&pj%s#VD#>Ecp< z?+&@3Zc8-;mIRWz*R=vqAw~Z0DDtZVQe!cbkgaBepZLMW2w=*x7J$-V;PPc8fVhdJ z?F1l7fe5t$Cc+cpQ8Us+yFnx}qm@acH!hD>B_X*klswQ!>Z_=;@7OIuZ9>W$6Pg*jxBEwP@fGOm}LX`XtF;@c(?$_INTU*;n zp8JoBe~d+U>ArwMwJ^QWvT?gf4kWJY3W=cpMJfquzgdL^Jo7!U^tD>>FZP?$KUF|1 z#6hwnAR;*^Bt;Aln1Fj`#u^oj@7vqjPJ=v&WI`3d#m01NYin0jwT6UYEIQFWQ1huJ zkTQs&e)jK;;7hRTPcS*fQ{;tuDhYTFfNKqi{3Wl_{!|4t@|AIM3Y?v+0f_paEz6IM zX`CB1H|ZB=}q`n{JcD;N&K;jodTk#qmWOBcJr znmbThW5_-W;QtK*=;-L^qzG4e9$-EloS4uegF{LPiq$lv0DyzTcZkFN_6UM>W(tdyYUYbUdkpI^SbQ~<5YC)AgZf`AGbi;1#@a#0 zB>+;;WK&bqz9^Rf`l1jL0NaN^r-Sv%(v&(+WFk@g#m4QjxwMfGjQ-{;^)hwfF3j`_ zkQ}`9ehm2)eyg~*8*`RtkT=Wor2q{|1M|husUEwKxMCZLM5g!e-`~RV2c`<(qicYS z0Jx}N5`ebw#fuj)Ih~~n2rfR1PlVaJz)G?T0+7bkEY_eH2N0pRroJS6VENO~&;AM@ zEd6~Qco)pAI`EcJcs4oDCoBGOtXF&1F!8T#4_D2yd=yW8 zy}f7YtN^ow#gYI9#FGF>F{nSnM<`59PlrW+0N$+k(j|SLI)N2rWl94XLt}yw+Z9K5 zs&)wh+Gl^c59+p6v-$X3fUjIvH|0JHQnmYo6X76>b|^iBTfu zB9IaRI$@UnPhG}|z(;j`Jr(=jVvpV@JMtxnwDmh4qEpExe!KT}EiVHm=ptZ=0f^2- zqo05Nc@t;^z>7}DEG`vG0&rizw0@EC6DLj_w$uf{O`_A&ER{JrBg$N5P)1TK^h@me zQn5^oF+CgzTCnf(GFnH7+1tx%Och5B_PrE0n5UOZfVfpe;)R5XcEALsv?~V>wtQyp z64vw%RsbCvyTa^%weIU6hgFhE9tcKv{@@IK;ozHvkSIz<2^zc5>>#U+rhX9Nq$tdCe#>a{S5&A|~?VSpBIW zKbOpdn*uj8d+X@YR*T-(4M26@{(V@e373Gm{uf=qDG`831k5F@U-at7AAkHVk38W% z0Xzx|8=-FUx%}`w-}h6-y+ak)h`?%Ofq@9ArENJ+YuT$qQ2Wec7PFTK`3*bj!Am(` zQz=?gElA{uHuZf>WP{{$8t_o)hu~Ly%mLTc)dk{)9h3q+=gv_<+;$Q)?jHx!1?=!m zCQASa7JmS3W5tUf%nE@h*hhUq*WswHf@42|n zS(gK~&sVeHO&J7g=@jx6D)w{Trh`WX`8^zwc6R9y1Nmuif2Dg7e9M0$Tlu5LxIPUB z!TF=Yr=K;wM-Rmqz%ei#KnaUSB_jd&YydBclr{GL`|s~mZ3YMeH4?S`0xmZ^ob{I} z6M&Nlh=T|Sh;COaA%IjOSP?mIeGXLrstSnDiU3^4U$U(hJoz5y%tNMXz&Z_d9GfBJ zBm7m)BWz4j)n2%8(Xjlv9d@p#r>(X1=s_^WKPLd`3ShDXz(JG(i~vrYIPrfMFJ3%u z*F*jN16su}N(6P@df4FGlp!J@4slN;5`oycHA)b5L*qTgZx{An_-D>2^&*7#RGd)c5I(EHvW+wIwBB&X#K~9bV|pv z9KyZ5y#uRPuii{MpopF6={W~WmMme#4C*{}aA0yjOsL6c5pfWK>>FZ!V~rjnMq__T zjAd8)ZJ^T6R`SAUCt>M}_28N35ze(E4NR3J?&%h19yXsqCXip?Du92;{~5Kbe6Y89 zFLa;nHVZ`Pt-Yh;aARZRTl8=Y{~DwXeE=u{lByz_Y~e_8bQuv)V`O6f{P_zD3kw&C zRYNf}2}__O5qO9fN?m2Je{yfi1mGAjBBI>hy;!^M1Y!^x|20?>grWxu!JXxj?&l*S z(m~*E%kR$h0Af2f9poeYB>$&S>8pfGy}j_!M;|eYHj$6EjT(9D&0SmQ46Iux0F(mA zZCv~(gmlZtvm{dI&YkOCyLRnem`EzB?;AuBH9R~5p->2li;JPyRYJ*d22M?%OnCqt z14qn%c4@$gBi1^bl^}%Z0vEB}OK4(JLRBCRVHUuDJ9qAUj();4Z5R}QGXT{8 zNpn9!x{h)#1(ZvdF7;O|tf*y&}@` z!Ay?p?P!jHcJnON_Pevji*~Gz_)Kvb0OD1`QYs;zsu3s~VHZ^eoy(Um-=GlU7pEtur1pRZ z*7(-Ip7AD1qUooWkq@k{7bTsvc2(ZQmsRvzjXegcKvojO$L?cd$WpT47Ylv~g`PrI zeEap+U)K^s<242SfB5j>_rCh-EA;xINJYaBt$)=0T=XXm=|})o7-!bEa5x<4@9*!W zhTlf#)UY3>r>CK&rUtTI+0fu$2A^L2B&`7w2RIfXfEAS~FStmL7bSvB1tjcOa?kWc z>3=|#zlwSLw!QQcF79Yo6p-K7+k5(*ci(*xG|`XTFN*$z`2g%NyR}l27|77j&~P9S z@Y9(=gPjPvs6CLIn+s)SWl-QQfO=m&?77-B%UgqubDh81x!Xb%Hv52B#JcUw7%Cuf zACiBLpD%aU|Xb_9fp`72d2> z03SBPE}+)G+SS$7T3c6lvrAEemL*F{1k`w8%f_{}wUF)3fm=hH;mqV2=!>LQb|x7h zl2^LtWeVvWRs~nVFBkqA3aG({#kZb*`e`_S;R2@j(+yga0O*+QrVST+#3>(g&8(1* zFk1o;M};pOshFFlySw{%ZEeksgeZQyO>pYeDHhI5XAa&`QAQE^Hn7bgVu+aNxl2>1oIze99+V?oA6a zAptmuI!L86gYk3cdQMd>u3E21h@h*x3y!xQ!xCqh(iB!^t%Q1iJsg{8h4JY4oFm~{ zK#{u${;B+*;qLrYfE~~6|9J1-y*t3P`1yQ4X9)Ela-Z~*C{r2fNgMa2%7gcL*=4MD4t&orQTAwE$0rnGBXD4lc|@W z|0cs-d3VFVF8n!EQGJh2vaMUU!rO1ZZSn0Z0`lA1+CJR3Z{Mq6MZUPuGb_>0A(Ik7 zMg&pZQ_$1XbG)>)bOojQ96J$&C&SRZrW#jy_m`{ z)c9-QUl#rwe7EqsOypCph9`gVB%KwV(49QQNWH5gUp;Z+#O{`s7Q5IN{rnk0K0+oH z9-luM1t)34{4tobz91M3R^D>UE&rIGm$!shAUE3#D?+(o!2)>v?;eMmnrbZ|QJsON zkXdM0+UhCWOjVA;|{39iQ4Y%dp242O-MEe(Cw7}LaTVdexfVQKW zrPm=w`ByE=S9Fvbdt3VZ`wxRQ&qw6r@~(Z4U&fHn5teBXi2xf)0?hG-M1Vzi3hL_W z?pfN<@Ce1OPeuTkgv#&p!^00h4ENo4AErHL7oLtzL-WWU*ww!i+QVs?#Di#uOcc@35*b^lt35qqmMocw{G4HUTQfT zvxsmf{GtCX*gM)xjm9f;^ce9Ws!0Z@@Y(|z{r`^S$RdlNKWFN%EG)~<{qpCf9nKqLaL5^xVW7BXVefDS|< zHT)haD=YgBMY!US1bQu8jDihih2Wuw9)f%Cy%+NH^YwJ7+QyWvL{^TjqURche%`wTRs}-gtxkH<7Lw+|R_lOW`|vFC960Wc$$I z(3hZj_Bhw`l|3=J)0`lmBWW(d5=I7kIeO5f0TKdAgS>h3=B-+`Y}wxgg25_Y0GX=- z7G@UZWH?oGdgqUuAG%^bNNA^KCC4}?g^Kks?v9#?5)aMPMWl-)b zhf04X+&J%M$aUvvp;`D~6p^^v`N0Ptz^+}p3?Dv%g#h%FdaTX@A(8Xv&wqIO^yyt- ziu+-(M)W4!(v?XB%{B0Q7y+fA5dsncrvAj*c8m}fRW7=_va<3)I)*tjF$_cw_?{9D z+*tlsEbFQeC9PJuugri~Tn&^a{$sR@^6EoxVyGfW?{G?G2*l1?=bv!gZN#uBJ!^6XesD=OLl`B`;1jKW< zF8A(<+qsP=`BNqU@m_Y7z@-7&28`vI4p>68;n7nDL#Q4tgr6hK8q1r!(0hrGOe7O#k@ZbnB(VPIf@C0wB5 zneBM)?d@gn&z?QY0y15i(U!`yq9^nWRSWOY>*1yiMEoc?5idG-=3L~<5b||{7)``$ z+VPo!NC;>nWK+&AqKMl_3E?jKem+SN3nJLPkd{vA+|JA4qzjbz{=dDeX=xY;qT510 z)HW5*iZ{`tUi9w2_9%K2Po8>HJQYjDk`T>7-;@k}88$75G`rG)VJB_UHv8Vr%%<5% zfoa|2WHPydtCw4$b-9+P1zz1fFW}r5_zFT(!rnk1SFibj5c`8Ym5|j-WsbYqY<6E1gRFm30DnJ+1x^(Eu1W?; z8W&_h0(g$;;3eYxDLli$rhmAMbcBW%Bz8~J>GT%1T(_4Ip1NgHr=TvRAnFG2;3IM!pte5Y5Q8 zpa%!M?f6i{M+6NIqTNz^q)H66dk7DMBuP$?ND3K7&;jgyc#08X`~cdA7wMFry;x!e z{Q}4tlE)9Y^LM!MIodhew=_-10A30&YvIM5+MHh3(yV&3hPwISfVUkUnph%m!pPG| z^$wau>UNjj@6a(yDEmM~UJB2pa|MF0Q*07*qo IM6N<$g1F7`z5oCK literal 0 HcmV?d00001 diff --git a/synology/package/PACKAGE_ICON_256.PNG b/synology/package/PACKAGE_ICON_256.PNG new file mode 100644 index 0000000000000000000000000000000000000000..6e1397828625e90c07e21769adf7762e33170bb8 GIT binary patch literal 37045 zcmV*8Kykl`P)eH z4F^ZfP!HQVM!1Yvb|S#?!8sF>aY85y(}zwN$Njbs_ItNd-ba7`~LOb0QlmI zFTVKVi!bd@w3faAUoMC=_c@c6zHnd8ulNMeIwet`n@4)*IUw?|Z$3G_c;-K6yP}U%Y-_&V%>_aQ>w^fcIL8bxpCZ+86Kp z8!JSyl))WuU%aL2dm7vC%Q+CA0M4H@q|tF7ZmNFpSQp#6$1(AiUeXX~F~|+6Pj!sE zPws0h8TdqS9>gbrb1RMUzZ(O13~YH@N9*yHUc}KD@d7dvqY+D)7*s@YHiY1l!8sD2 z0M1?-qv^dsj{&WL19*8~0G+EhVqHV$0;sJCmBiE9hSYB~VO=H#1KfmSNY~&+2EJu* zj>RW{=1XIu?_Op**48?>0jw+f#d^S_PyQ_Y9bV)UPgEe3fh|BAmHLQBpP|^6Kg$4b zcj9ca559PaPXJAmrhr~$#(M!>)dFa#q3w80Q!G_+0@by9nffYiE(2QC1PMgZc0=dL z7DQv*2WZ5$FCO9(K;tD|N=@@I-=E$>-?l>FG&*`t<3T znVFfAk&%&d(M1=f^z7L)BP%Pb8=a=N0T;#7Hgc|~by>5092_nx5ZRY#8=tv+((NYxKN{7`k` z#EBYk0~~`|ZV`_@`5Z4|0dU9xAl5*mO&pxEzr<% z?AWoH_uO+&e=1kx=H~WefYx+9NP!%rXbuE|L0w!R1vOpLHI2}9;Ole^G``d9XRvTq z#ZM&GvA}m|)-mQMQ1nHkMuh%H3?o9xBfL8;NvYL z(zYQTBU=ga+y$>X1bN*TOMC)wOH<5z>|?7;daT7&fX6Ll?PtqizkdDF3JVMK`d@Wb zc7FcAemOmJdS_mo*^_;P{T7q>?=#^?nkQ%$34nup^pngjY7v;{5c6z}{se-C`LNG$ zpA-A)h&^ScWhMJc_U)ylu=|^Dzd5|_gLV7&?Adb~9AMX5>-FF!0Tm&5Sqj)y@FD~E zEm5zxYw-!dk%lzBDsnFaUpC`0z{N78>c8ZYOVZ}OIPbQhLx%oS*REZ&7$9lWxF%=d zC;V{ z9(w4Z4-XzZSOq5d1p#0p@ak8&52~1fDx+ZEB9HZUD?R}t(YZYxgi(^8V!HCS`SNBEz~g6Q^Bt|bEDTUu`Sw`?&6ah7Kg)fZNn#?Vps73ux_#{E zu>;GNEqia?ym?=gmX=o4)YR0{J$2v^09%isrA!Q7E&`4hsOk&k8`JKjy%Kh50Wa3W;DDYlJ9X-m{OYT({_{;#x^?T8la!Ry!Tc&B{yAcygxK2CyYP)D2*Hgn z3EV>0+t?LB0mK&?rUqdd*ipc^Z;PqP8#({t)-Yio`jJ9c=>)-78f zc;JD*oj!fK8XO|POH2-!5WHLjnF!>{L)Ch_koHCZ@yvY{_+^bRYkC>GMFhNIY(oL{j3zY#7 z>*7l{)rti0%W=mgFSab0zhLdUb?XisK75!35t(IBkCvDWRF(m@ z2vj7{?%jg+L;x!A#{<5~%ojjs>q+2%pS7fLIGnU*&6;0cbImowQ`1tr=$fuOV08r3UE z>U^#SB7hm=PFNaW6Q&0u04H5(UbjIE<8)=^&)bT&e|p#0v2WGa*9-SREbGv=AOYbj zsN92iM9}U?pgj;kQ_OuiZ!eqoLd)BrXUi#5ru6yM)L)Ih;l>+A+dviHBD60d2yDdk zqj8@&R_W{`4B5c9^K+j5KI0!G1=OiR(S_Xv4s?2s9up|AqX+gA+p>AfN3Xo{%13X!@y3tfkN_qFY#pd#1@VXg z-)_}9j@l_^120d?g-E~*q!i5VT>C&Z3wyx`%32gJ_wxEQf^_Iv0 z2BG1dAewoe=}X%txviWXElunnLpZQC-2^(dJb-FVC@CocYC6M_BV};(Xc?53m&3`E zC*jnoQ*h?Y8K|wTg`}h;NJ&Y7PMtad{TIokX@!8??cNJV*h>9hx?y|8-q>iuAX9=AHF zVHZJV5y*7}_|X8gVG?Mo1mI=vGm&%na@8G9*9mQ(gxj;vK6~T1apUjE%gwzKN9tv> z-qijgt*3LXYUcDE%`d=DG=ysFWSkvf{1OO;AP}IRLlL-t|9&`l@E`~Hp+kqDw6qk; z${5g(!tvwBp{lBi9vd(Tfm#BZumVuCzlm#ncQZ?b4Twe!NKH+J^z?L24BfkThs?}O z$j;8D1d#Q9^IeGFkAAkJuAxd6sd;)8N1lT&Z25^i(b`4b4 zK$|6jwnhLdlV4S`i|g-k?q1gRoB(FdoH=0n^cnY1bNFihiFUfq`UY&)+b%qDG`u)W z_SK0)3k)2=P>7o3At?E&1hy3w!S?Ojxt3=dzM`Un1Bz*NwoEi(7DJS2f4c12wJWy} zn00X7b=Sf5*I!Rvi9D#QtAqObdPT*6W|u45WF}&gI6x@J7BrAjjvDOSw|D3K`SX|4 z_ATvTX+%K)Di=X^3uJ4+D>l$(NT96{K)gU-JgqPL__oHUE&1xJuTEdIXwlUC{QM!N zPwoKSj?xPs*7E<+4zrrijs=KIb658<;8#+A{p8OlVg0)GuzJmED52(kn36#-7;NeL zde#z&L^$Y~n{dY+cfc*TjDpUcyFkZ|9nHI9Socc9p1+j~KyHEtBBNo4BCSw^JF*}S z-mzoH*8A_jfAP+pJCB1&0D=r;ivY(6ysUvX8z5{81kg}=4@dY_k$s`{JK(lq!-lB^ z1qCCMl9G}M0ySTgwjDyic08`Yb-yPe3hr3QK#@bp0?o2$0h?dJ90N2803D7U4+Pv~iCG4l>{hBrJ!^%}Fxprhx_;Uq# ztp{yc8tC0AAXsCOijc;CsfI@L#S6ra~kdu`>xG_3277xB#!krVgcJt12she)^eb7Q8rj z?hbIQ0Xa^9gN3R>qIktat(F8@GXbbldn)h?&5yNy4DeaoyLa#JGcq!I1@wSUTv}Wz z+CduK1%Bez{7iJJ@qz&z=Ffi#-hKC7{?ao|-)zvQ&>z>4F4HK`d((C)ZMpQN?{r}w zB{@Y2VLxsAX#0`=;!1iaSgqcfW_%XCZ_G02(4hm2r53@jr%#8d5#{&ERWxJ?cLe01 zp{60DMvEZ~BN{cz%F2G~+qds;t*fjCZz90ffU2xm9#;U+N=cwK5L@8r*{uD-r{>6=TJJvigR55XjW zGoW@0aAhH`9gqu%09r8-B-UHhwCh#*`*NTU=kx909#~qRYJ-a?IRCdt_wIe|%)C(c z*t{p29n}Y`*R>Cs`pl}{yk!f_ojaH3P zfwn{R2A%dkmKQT=Rt2NZ9;gl(8R;-%#;;-U;K7dNB^3)fu>w0xU>6rT9)jjN_fYBK z9}90Q{699$8Mv(h94y531M$*@0Iie+S`z`Nz^@AQVeqTW{S>yG`~34aPrmowsmaO7 zX-+g>2EVfoazD!dGe4G@tIOV82Jf$3%TiH1(AN|*KQM%9_?syJGOQoi0=fP3DFVFY z7)8&=21GZzql=pLn{h=WUxLPCC6``$DYXi2g>mD?)B7FZeXf$`7+1j|1iVjF6*8%* zsi|DFXwl-?vuAIjn{1L2MgZ6%klh086378UfL2HXt>rEA0>4m?c=|0l!jJv@6lz|k zY}l}2M!}##H){gKC?79`h(3aRe9i6uv-haFx`r3$JoVJmyh^XpIeL0EfkE{60*#vX zty{}CSE9S9b?_yD=of_RU0t_8s_9k{k>->)>pH*ptlDtatl4nG4L9(Zf%|z_<11`! zFJ%gx`YMZTOiQ77+xAax8GXy^hGA5K;}+offSf77)08oh|L_SY))P`%0|7Lo`Bi~F z+2rToFDxwV`O-@-J(iw+QFct#u3!SNrr#3retB?@LHJ9VnwAR7mMw$j?<|Ld2MDrcHa{qmMo+0h0i5pfH|GAde>iXhkHD z=mZc?^W$J2F6G50KL_Qm>y8Oc*<}a8tXO3_QWNQGs1h|w~HGO%j zAb~`F8@m#-xth;5`3njPdMsJ8WLC~4IhTtFpE>EKd*q&&9?K*H;(B6C>(tfO z!s<0^;7@=2qg~SL0N!wxhD9p$kptqZnz}rCx5GzQinJxjJ zZ^c?Sg}~&=|H^}fNgcw#cmP)hy5fV_BCu-+9E;(=fdjiIPo6mMn{U1=1JfFiYX{^p z1#)n(Rggd;zMT!3{ic*7kdTM^t+&pk#KRo=% zBVa_LoILorcrdj-d&CBwJfj-{{YDLfxBCA5`4D|$00N%}L9Yn7hB%8+ho-xr@#3qe zo_dN8NQ#;45UdJFG|Q=g*)2H2ZT{TsyOoW`>jK6JziVYaBjb2e91$re*4*5qS0G zSK#G^FZ1I7>=2=Qat?8kljy}wq^4u@%=%fwtuxP7o+^_-4 zE6SmN|NfK^ber(S+yr>iaxu-B?G#v}IfKDqXwsxf!)t14_7@cul|%CsCIR((oe+{p z1khOU<6xig^=k2D^6e zGG8o_5_H}f^QqFSAVa9u|4({>d752Y@5^}f9MXbLMDpO}%ChH~?3%5%3b_U}*S=5ku(K;mw;jAA|T{_R{VN zO9F{9dPURe?@$5DztW zG70v9u>QmKt0zvJ_$HX{fb0^eG6V_l4kU^NAP4=te0~-9x#nNFa^<}vM~)cpq~a{I z&Xx9)vU)_+?(1;u#0hxf@yFq-9XsskvN*;G4AQk81{jm*vmH%LI`XAug+7D&0d)|$ zq@G#>K?qa@cpU-Q^COzeef##owr$&BK*2yh2cj6y!NjZT66FZEo6x&guYLss3&JZ_ ztk@0lwZA-22=^z7(nY^9F|I)_^1;J+~R}H`?EkFRrkzoFalAC42ys-XPyV<{|My3`(s zVts=6AWk6BOQTRfr54Cl=V*2eU(TCE^6H`X${Gk94?^(gkP{#TGi_+lXI@lX3^mo& z(C@O#Y&U_4{HIlHyHA<|Jv%!)Z{*04>GZw%2dFIpdAKlf&bGHzsqPCdE&1gtzh54UiGzf? zJqCcyKs05_zd_%A{UBN&!9xXjAkq8~Cm6`i(b1^G;?F;4B=8ED;1@(7mk)c@3CI@0 z1%KIE$_0=o@=%%m82mWepZ3l>@7z0h@Qrr}5;dd|eXdlGYafB_MMW_8#TU7jHz${1 zPuBp{$L!I}FiO}oRF)-53dX9iS3s5}gzim;OLAkddAa-FtKg z`wzKTZlZXHL6 z@+l*R4*8dj@KI z)I!>>G!_{|#X~xTs0;Azci-``2L1Z=O=$Eq7;cj*`x2>yZ2>-1`SGDv0_C$ z62NE1xzY%j5WM@Xwhu=l`jD(%86)G{4vF_8rGZV&}kSCimsUfg~g_ zY&b%q0J~Z;OTut1$L>l45)4|jLIc`mgchU`ND-4CEUaK=HAu{|91`qg2A0W^5F&-J zGntUf#EI=Bb{sp29p85Mt9@0kj<4#~>ux*UZBt3Rk9SplRo{Ko54LUF_IJUGJ)m)U z6|Ccbrc|C5>-g-m&v>wo2nAL4f<##YdhhFoL~VR>_(n3=NQM}W^IZlEHRhJbVPI}Q z6t|Q>bd-7tRCXaH22D*((9_)w^XD&+bsZdY(^No4L9~m}_vg%6;OUZQzudR46Ou~- zVY>f>7zJ}l08;7w*xiSbpS_-Z^2yatKmGJifn%>K*x|#F5F&{HLGP5B|6<1uIDGgp zE7&0ezfc>UJq+ECTm(`&X(Y38w@e{>I_F0>L>R2@KQPVM9b=P zkrXgIGz=cmfOF^0Nl{;JQpx?jy*Ks1!1a9-3IB1mP{bbx!j8F(;r^4I7!1}9Kq5Z@ z#cd_1>X4rd)_eIfvkRyS0z zWaA*d@WW0RT0EEw7++BvH?liP&da0}Fa}9sG7^O0njsjRF$m=+Dr8DA3mT#YU_2($ zdb$;sEnCKei3GCy90iYtI4Wb5N~$;Ca?8Abf8&jPU>EyS?LeF}B9JQrkdD6}=k$v} zpQq-`nX?M(_PACbuD&Dou1~lwy#B@;tWKXQ1IsUHU*GxF>-8>2O{X z+SzF7NC6?oCL~EAIl@4X~n|%?}wFh3jj_Y^pCQ? zQ>T_y-FoYWnz!G6o9;$rZZAecelsDM^_Fb{5a#m3n|9a=dX&8Q;)@$@yY04Z45Vf_ zFERl7pZy3wS{mxZ4?ck7$B(hwJ7S_Zbxsty(Duj~aLW?8fbE!@mD`V(^U8g+#W5mk zocLx`5%3anA91d_Ml5kBc^?D)fbRq`NEFB6(vk~M(O3mh*Y^-GX}}`_y?uSq-`5X| z7A^F5bpn)A!bMCOL+F5%P-oQC)RvS?>D;~hb6QZuW(P>eO_(iZjnzA za(f$8L%A-|j*|>58;tg$L?andNVD&gf*5$Lsb@|%RGh5vh(I1!1$^5;$N3I+%2ij* z=4K?*fbTcLL(K*8UA5}kRR<0n_^PF)r5|)#Kssr{SqDlsA7FBSEc)ZR{aELp5{*Wu z96b2v?G@$aSDC>+N)>Qqq7DrMjK=a<8t(@l_t$gxeGws^KMJi6HUr6v*7x+KLUMJS3faO*|o>g+>`ZEV zGVzW^;HZ3pix)1mue|1(pSrGl8T@czx<8T#88(ZInxVp34HM2*yqk^t3kkps^~DlE z;YS~R^jLYt)T?CqE{V*d{vLo|+Edl%J9)B+Mfj=AFObqNZS8;AHo1{M9kH2lclDC8 zqoZCarG_jS{s=lpS;$G6+m zYnHxOR8>+>)+69EIl0zB?N^ESZWf!k+i)o3EgLF8GOK?w(Vyx48*khABW&%LDZM-f zn?hCC0+~GJ#^IN5{gM*{l+ejHk!-v33=Gd0$_DJl)siAUKsd6=>meL5&1*8LJ&wch zCnW=+Hkb#K5CZ?FiIWE6#c}Ab?t{waDwRY;gN33|IC<(6G&HP45rH7ro$?Gik_OV{ zOLGQFrj&H<{(QHv2ZX5trjD9buRyjV-c945t-2300M4B|x9aY@w?4`$?jo)a;xps; zoIkk!cZ&SK`qh8H(BP0RxL)5z4}*A*BZ8iIG<{ZD`Ua_)U{xkcI~ zB7ulkk5>L_c;LPV?yIY-s{|zhm{Neik1(iayk(jIgo*yCYWWwx^PAs1S5TN=>bgpQ zmnpg+I6sjo{j`w7AO5h5Zs`P(sHhGLengk|x>(-@-SwBU0kbi;0N1xcOnxWmItWMV zRNP%#LN*VR`J3%KI!_}AX*}2Rn=*NmV4rM+U=p;>Md#t%qIO;f!0#8WGE6HD@7?<) ziyUNYRjki|%IY%dlzuKOC@gvBop=5bRERqz1cCsVL_ieBNws3GsAXCOz=)4adzt(8 zX`=u3?c48Iz3SSH+CF^5H~YJ;u=cwwpP%t~57WOn^bJey$%{p`4SeYt12z57cJtW` z4{hu%RNS|6e2_?z(w!Et4LIl?zT4B0eNcva?Ain4v+bq10R#7Q(6a$q#Y4tu`AzdC z$RCryN&cK$>d-s$GL&_cLE%s#h>b`nL1=3`3uRNwVA`~4Qc?v+cmjx02jq^V0A*!m z71h<%y?hTsvuLRJF0QoY3uLrqQUb7Xf1Cav*tPeL+i!nR1ontpe7;e|H-yS9x41;m z)6)aHcI|?~qC)VueOB8Yq6@>=%+ms8LAx%XAc_#>X&k>C4*B4Y;)9(-Estmi--BP1Ab=;3JPG~mtR6} z?`0K+?)siSrl#_(iP(B}{O|O&Wy_YWpmwklcz~q<$}lnRWX&L$DFTp6^tXllGUVUC zfB#GQ`2|Hx^aocWJ1fa0L@QLSheG+i_uhli(NX^)JiXV){|L0++A^WyW2mlg<@h9k zT-v!dq@jx`;l1J>wBr6dN$4+^zQ>96*p<9obWc}2M?3B>d`(qwEK-m~D$r~MV1XIH z#1aAT*^M_GlhTJMB{&j~!*74PllRFDcn28LOTyqYIFE1??%lihIZ$cdBX`9uADfFzlQiGMC4}@er^(bfPl}r_s&E2mp!^%Zo762y$;?eB;qf{Er>?| zs&1`>>bs`1-Il~5M~nl<2RQn*k_ZsX`2l?fWK2jd)q%nC0XTNUVOX-S-Y*TtCC}d8 zURH8^^_n%{Ab6@g6vCL3Dp&79O?A!H4?p~H{abInbpTY!Fud)!=^+s0Fr$<&lLR1{ z;ScZQCkeohfBe`_B3>gd+O&%(LZHeq`Feln`SWn_&_R}+C4zi>cOO7c-6iOo)tgD! zjH!(Y`NNEQ5Ik2q?v1to*Z_2Y(KBJ=Ox23#7RfON?2loDKs$%yx%d-yF8`csBG6sa z4PCQ4VS0PDbZt_D^wFb7>AnF_Ijzb=SKmG&B89>6C0YlCQ+twYW^&^5aJHB zs0PwLU{ebW_~q19NL7K=$6%mz5d1YrxWUwc|M~1QUkwuKs$gdR#*?a4o$I@@N=i!0 ze*NpW?*qF_P~eSe3$Q7b3l(!ZC>}6~sMrM+6St_(yN;QOp+U!w$1c?f+`O#TMWydjOYqU4BkO!-^Z` z&!0aH6cG@Fz>E&eid!(#UI0v~%%C4B{=fY5pFc_sf6Q7c!u*-B#6^hD{ixopE?v3= zjo&u`B|3Yo9kw^@*7;A@IapAE`;38e0i$;m+6A<80U^i4gvF-Ymbc<=SLv=w2sjVNt&n9g*=XAc%q3Wtwo6!2ABt zLl6CRBod)+L2L`4FEdHV78@{bLNHze5T=JhPWex86U zg58AC8zgb4t*u?OX3d(J5R?GuJH{zf3V@LBX|+sx0c^UzCjP(j$}2x}#lCy4A^_qu zpzrkc```WEugW5+tB?Ex<$Z8=>FI3Gt=3YC{WdGVd9HA4r<4wqvpbLkG`aDg@hTiX z%)OTy;R_=K%07@HkP5?j5)gq?^P8Zrtd|F+fm8=}@BUmG0bMQum|M_^d;!|i9XodX z6XeMXkw8+VOxy&tIv9lKnkuy^JC(ar1}1ns0lZv=>lZOtm;h=wu+Dn zBOwIN0daqEAM<#QiNLoDk8AcRN(?Sv?uAPiFDm;M(QRGootXw;O6ipHC!Tm>H3X#q zK>#q0*+x6&)iE9dU|Z&x2$+dKOaj=nY15rVib1aKA^}|j$jghd$SRj7QuxL+AFw^s zyP>DLJL?lFS~{FR0QG?TD)~ZI3)qq6rm>okiPB!VYD@(%5L;IVAjHlQj)F z>qRH9>kn`Ak^iqRyzsQN_Jb&&zo5(7u|0!08E#)GL-r_R{CdGq%n7!-tK0+K}srrpMq3}iDr2nhh| z|BMK1-MV#S#N*|3V2%*=9p4V%OUXngf4FV}4t(_$tGGhg&MPW3_W1H6o(hnglHO@$ z>OsgctLTc~kw4!-mxkB`uEI0UpO;sW2Sn>OK~_uwS0VuWh`Rd{c!sbcA7i;*oR`f6A{w9a z=Y@ZQhQ@1r^_7~hBh)Q;2xiWl>37@Zgp%-#R@OE4Ba;Lo-a!v z$`?IC{2-wqf%}Oo>EbV~FJUk3dFpO}U5H?OGKr1l zY7qE^yQLwihHWPF91+N&R}o^}B9A;#zkkz-rEdiDBPEcW*3=qSxP zqLP3p9gd{{KN(?+NRQi<7y$*>Hwl2y|6{Mc_S%m`MwGPp3-KS6%TE;lY;8TwH)7!N zE^I$e7=q^YQZ82dv4|Vc3}@QTKLptt^aLfXk`KBM zMr!;WKhM-OH6Oj!7YB65KT)nxu-G*mv{ntnp2T%0NC+`}oey=0FJ9bU1_mK-7@w6_Uw!p1&;x?79YEmT6{!K^H3FL2FV_EAhpVfr z%a+yGuVlg#7>%UP%vuQX;kM#9zS?F~Kk=4C5@T9q9Pn+2M%jV1x_<2eMnJv01zn zX#WEJM&dlQjKVx7;)7WnCB<xaMzP7vr1Ma4yBYuB!&E($#$;K514wgrfvu> zE4(I<1ex`58$vqjpdpzAYz`9BDt-4#Hf*%BgYDv~k|CtV|4UNhd#K!6Xef(X9O;oF5zM z#7|h)2mASKH>BE6gsV>^xSjL-TLga&(fk8*d1sR0s4}AXs6r1@ely~!sUw@5y;QaFRWi)f4w3AoVp2$ z$7X{UO!T19`0ck+^!K@-!;FS4vrjRfYR;O4iwE?6?POvxR*9yt#)|x5bXxNSD9$W7 z>Q(7^#;ws7Ud2dAJUx({G zw8cGrsJ*S78UOrEK$r~R0f4$uTC+bp=IFHVB*{4;Y*C2d)_4H>oHzkOgE%AvRq@da zqcD7CBzLeGV;j8`SK>WEt5FV1aCarnvvG#{@*zk((jpKRDS#bA*X4*9oUCbrxfkX^ z)X8Jaj(WN}JGx50MGIYI_#;Hr{u6ZofFXSUzyRMp#ZRB~T_zE5^9b~o zUe4Z(@D^(L6Gv|A#&K==uR4z*C zZ<;M!{*|x17f+~POevFegTR`}HrE!i4YP0Z19(u(#ZQOL1@bLpO00JO&fFAG= zzT;d6y0HqHI5h8IRwe?sq_O^?kidR-12T?US~^E3>NrPq$2=ykbQCfO(k=Y*gu^T= z8@gw({eOFJ0$$fu9SW~~?$y;S*^*`1vSoRS9cLzqOA0N8DHVOHZ8CH-s_`4 zc|Z$=*Fy7Nfsg>Dlpp^7g??cSFU&&%35i2uXC55e@u=AHBu|nx5BHw)?|HAi&pvmM zbg!gDOFlm5o_Vjc*Sz-Hx+<{lhBDoiAdLnS8_I!DAir#Hcf;&uCoW8Ufl>CU)@k_1C}Y4G=FGj-vsJ3B+2P5ArbpQs6rE zK+Oa$zWCy{MT-}$Qr_iACOhZ`h9=vId->S_2`T+m+&`P1gd^>T%kmNOwy=PwIDbZ& z3FpPbR_Hhw;*Q*7XaEs505deLT5nA!kC(;Q}M8)9Qj_=vygXh135 zDS){5-%0}d!$17P%XCZ=FFC2!u=kMK0UI5K<5h|Q9BC^*@#l~EdlFl$Yu#(?dy>R+ zu<{vshy*O@W<~?5bBTS=ISRTWkk*P6N0SLh(i|}Au)>G=CMvXOJ55#l9ciCn0>rNe zD9F^EZ#mP@v*;k0)L`-W)2C#fi(4cFLTkbtMm=x2@y3h5HUXxc7F=p3pfCKV7s{b7 zR%(o?^~YPM^PNLk7p?ci2}q{{9tI3hF8Prqvp=nOtkrHT-=km=w?le7{#HJ}R)Gy+ zW0f{?AHv>&V}6cv05ma(V5T^q!FK#1EJ(bVYjG>R;Zf_nDVTHq8bGk~O`pt986A30DuVnGip7t+G1%+m?;85Q-fi|+l<6!sQ7y4{yv-E)dHMHlmmJjkDIh$xt`2U zLN1pxCP0K{#*RQH3kjNPU%sph^5+70joN(gRBRN$jR3gizf)~(ZS{?fjcq2~*9`e( z5UPfRA{}xvo8<&=3VsskZr@)%>=%MW@4ao`C#jF|vQ#AY35+x}MD6+uY)R;t3c)<_ z0jO=H?%Vzju}z4r=h)g&WPKB(P2i8V;Go<|r*# zPC!6@Gn7!**wEOzWXTdX7ThfiQcPB$7m~V@%SkZtdo_TMee7ee(^Y=d0HDw=d(5Yf zr;YDB(`Rlj)ql3$+p)VWNKb5?BmI*)QRH?9;=i5sE5;zA_$kQSZ=df-I8Y9>sL0Pc zd%zfgssv;P6`}U%b`nk0SQD@%I#@Xs*cIRo!m=BwfNKNFe-=u~ubqNmh7f_I^;@h33>Z_g=pFi?^Pz#;(GYA&Wd{i^OC z=*F<4XZp^FX_Nw^4vkff!BF+kj3c}lz`5*pi<3G`f(q)f`_0*gG59*Uv2%$v!p>q2 zx=_O01;TyOM7KvL*rMo$!IQ%*Fn2(|)H{tyzj!wXqLSB?5pwRAaI(n})3MZ|FqLf_0JW}{(6 zJIq8mCZcANf*PBe+Lte1&T0g>PWYrL#PdS2i9jy#Ta|#Wyz5uxRftW?*RKv-#euPBlpGP927I+u|wqt#f0monRP zG?W#y)R`k%6yMsfkJ%R@h1cTmOnY`(wTU&mAh67<8om z2zTZR^H-D$8yg=t6|+EU&1%j7ln=l#wRY`VHiuwRQ4rtcp@~pvFp!U%#C!mh0c;S7 zJ}8w@)%ydL-z@R~CMG6%$L9nPg?bd=nflX}`vM7`{Fw77;e3*K+zjfl?$5#J6eO0U z(ejQ+%h{9N*7}wfsJp06C()>monwP=BK%y!N9Tn@p`)3h*QVD^p3D~3yh6v(CT|y0 z_$DH#JGaJU{keq#NTjuGQ}|Qe$j2b%E_odu;1g+{O3bAMo#GBI!Y}H%&b>e0Khr~n zPt~3TQScVD7LetUfKYi#rPEh3#7Hqu!5%hj*svC6C<;)_Xh2LJZo&bVHSO(7*NH5@ zNFz+={PPBx>_BGk=z+_O4bo#rnvTvGa*JvSf+UO4NFnzI5yZQzy~oZ@vk6%f2mfuZ zb4LY6#Pd9Qe*MLDbg4}~kC^v~(0z&Xrh1zw`Xi=9yMr73TfU%W&}j2nTyI_~a)##` z+=w~!BIo{*c^NfK*!yL0?~YS`EF$3iinpLZ2PqTu)E|Pb(JnLV6`MFD#Ql!32*wZs zjuZ182^&So@&WQC0?n8Yz-Lh@Mxd9Lme$p3f&(+}ALtOE8Wuc3iJy)B6O9gd{GXKp zXDO0%22fRmlrjP$#i^jj5$P$jK(?Rr8?I1`E=w%O$k&BlBI&gYAr zXKPWKK_)o^D+Jw*2NZ$@1E92$%Vj~?`&PkFFcpHtxPT?BPM|LrfH(_40cKE49)SAo z8v>lV`s%Bf>luF4N7K?@rZGyqjtmc*@E=ltjx`=DE3%UuIr(DyNxU;TWEhv6_&FxZ zfCi!3Vn0=%fLT!9Z<_Bz7Ax(`q!b*jI}B$0t6&17V`E(NQGPVu9%W7| zKY;umn>TN6hqwvgn=>#kloAH?IU0gjzVek9Mu=&utR!VG}vAuCY3^V@%^vVPtazEpf$jjTqB`Hmjt#>P})iQj#6O ziZ(>VbUpP%Y~@Cp8GywkBBHboB*}?+f31K!_)&v^Ogo7@-)p2h<_$RJk%BA9@Q^q5rvoB78;&6lC)(!}!xm|THtuf28?_*MTxMMABXxeUO^ zk6m@b@&T-0zkU;*>rZhj<0ujvIeHFjAio*!oU+jr2{}@}!k@`uoT-0dPw+`>xgE^u z$ca^cwZlge1R;)uBZj~TG9nzqj37HZg2sPv z1jI4`*-R=G1vjnMK~a+386SFToNvZwfTa;}Zf`T<$lBI29gIZ7)-V_b0btek$99BG zc*=B;Qr{vJg6{0<04kHuNON&im!o$@2Gu$QurvX*gDW6jn~G1km09LN(L~Kk*f!x$35`Mva+`%X2+?R4_FpKH zBFYXP6|Z=PuI%#UYvM{~p8GgVM&QDJMqD`;FmZgcyu_b?m}o3E9#X(aeAmRWNqHNh zrM;2OVy#^ySRC+3xu5m<^75HkV3-PF`n$9NGQudF8j5Q#x-Tbcy9klQi= zs)*8G(^ur<%K#+)J0E$))J%yE;=32Pc6J0fmTq-&6f!g>fwX=3PNN+_ip+MOEePRA zsC5@F&KxJD`VZ-hjswqgF9*;0z-zWa9wt*^{GO>gV~q?n+O(NJQ-#&dbb1_HL1Sa1 zVgRn7c3YCzs(gcie9|9praU62^_!TZaD7dl(iG#h$?-B?kV?Wnc_I5uI}WVP@x&pzR7p=UCl1LJU#u zkFyDLK~gx-i3Yg%wN9^0gy3|QJNd1NrrA}208E~Zcy zL6-mvLs%D=pdKcl=IW)!b$PxuMV^(nxax)5^&DrCR9{r!A!uo$+Y&pt&;XKE=m&@|K34LFlWJ#c^0_ zyiAhAqiVsTC1qlZB)itu)e%f zH#aW=e|}C;_CG*rQ-k5({O0xb_04z+Fr}jCxzA-*Q!W$*K#7{rQhwc`s=*mW=9Gct zQ3Vsx;&kl zB-(z7ycd)K22y8rB9K}D%?|)N`6uMli5bQa0;NAz8K}@)08@4X`g{TScTinj-KZTE zpj0Q3_phc0i)0~?0M-8scx}4~vLshF#7<=ZP&@*FopX3sq$Na>#Tj=pMb`hWmq2xU zJxo?gMV!~p7-%rZeE_XDnORJaOn>Tv+l3=m0mYJ31dZEbD6yp69ESdv4~`aPARp!#CU0P1zhau`}RzZ%rQ z)!Up3*Qhc`0Z)a@1{D|t^T zjRR00!-N8*y#kVBMJoHtm;eIhVOdRpe2wr!GHdWl5SKvXj3IJ3N<7jnonL&@$VF@! z8|Dy+c=0^Y0I;mbj1#B#T6n@(@-`3Q2>^{zGEM>Wo#LjI^(_$Ui`ERvh;nWM1T5c= zSI5=00)<))Xtv-;R@^dzmI~ku7~)rNT9O7(Y$~u9GnAM!Qcpo4ipV4b>Dhrm+pr)@ zJ+Vqhv!MaxZxZ$t+oWns7SoXpjYs;2ws(^x3#hSmHn<(q-X>yZpn0GHh#d9+z+qvg zRfeEr4#3D|3E1!NkhrF7v)`AmZ|)Y?uJSVh=V%%1f*kz=66&`Kq~9bPc|?y)6jF&| zK@eoXMwD-z7fPKQ(CU-)1yUx?587)fVwcJnAmZ17j8G^$mu-Y|iUGLRdlCtoy-AKL zgDjG8mQsr&kLNMY2DD#%zGwid4mD9!*v+IM%3Ih`9xzvI+6dAT^vQR}^q%;%W3)7osf+&xqboc?*24wECLZVcU z0}`0A?45N|}p<5Gx-bbj|4y;U=^-sOdCdsy+Y?qQY;WRT9m$ zu&iSmKuXL446-($SM#k96i3YVo}}QEZOsD2$=JS+*{6z#keE!2Joiz*c_d{XXaG@6 zv5TwdQNlL4&>Dg%96BAC zmIgpoy_}r-$F2#e2LOqb1?B(c$v`{_DBwN;QlWfn3)fRP;yX8PF8JJpc|wLV)@y48 zapQsDr!iG=UN8W~II*r{*A&1Jk9g#jlt6k(K7jaH?is~-3CatM29#DT9H&G&`#{eO z6dw#EXAus=LN;_k4lz{*z;7Jpa(tM-=*!9nAbdc$iYen>flL761rV4iAphnD__D$B z$p+g68#$gkLrlPskn=NuI5}m$ljPy2WBaYTUqz0g)hf!Rejj;!Yz87(-DcQ~pGtG!=q@ z7K*~pBWMO`(V;!>rqTwoli3M$t0-Ze|M|`h3Pn?J9}XucCr4G-4la&fMz$>%LH`5&F#OyIkg9;I=BfHXRP6zQN&Y)6v(H#{ z*M=0Yt{bUIGHU`+g;ye;q$!EiBA(1pRxgQ$u(9?z$o9>p+zCIZ0-`oMGj;ulhsd$N zqfqfpl7~shvncR2#QK=|JO>2bw=|L}4bt?FX#qr*$z#kQ79P@v8H(b3W2rluyoD+Hvrh|C3ZaxSM+fcd-gQpaiD_)3G{ zI?Nvsvh7r<-qLSTv#J`pKXV8sPfQ9LbxU>yPP8LsOB6y#thaI-9}9n6jh7-eJ23Yd zz|QOTP^Rc$FCmn|m}I&ot-Ek$S(PYzy(rC@BT3WaO(~AcR6S*&)gls-ZbCDNMJ>E+A!pKD$$Ka-OdhZ7D9`!}>frqEZITlU+W|y~ZTVpK?5e6L z!%bnF1CX1{ase8u@iSU`iFgXVdgbBakrA*vRmmDaJ|BQ9^2 zxYI&a1lGk51Ht*KU^W;)TskNgn>S@Na_%92S1+%I3%+|UWR_=Up)Cv0^7_Sa0VRIp zQ8A8Z8$4e(%D1izQ>bE;K-DFpLV;9JGT)w5qV4cH$PggAFyxc%4#?a1q`yxaa9du` z37B*tzd2<9eLR&>`2cV|Krr#jNTo5URA-sQ*c>h@8)Ea68TD)xw6a ztb^*63rwJr(DJ%Pu=eIIujx-TC6C+G>J6EKAS zfwN~JPW;6-oI_B=MUk^8r$f}&*LNDfq&5RoGLZ6o%La*rhk$DW%-PYJYn@SK<^?3} z{h!dM8OS4%8^SVbrrKY(u@2VVvIc_sxsu!P!iGiHHN*N_*FsQZ@Le=1M|f30Ae7Mo z$e<0D3Yq{>Cxe^Ga@>DN+0kDb;p1&9f# zC#(I;vl-^JmsjQmLR-{U9;~`=JX0q|_J-Rx8ZNAdbH8y8q#72OKsjOYYZt+We_1D` zBnl74G7a)W-rRr+WvRB&KcbwyEYg$9nXtN5Yctepjyit)`0+l73+R$GfgsO`KFN=_ zb3+3|!(k*#fXbPGL&T+2IwRZ3`~W0CegN9o_OQLI$jz&+#q2(ka7B_CfakF@&~R}B zZ20pr)dZxbgeB4G$sqASp=0aVyeyF6SjHDchJKsJ}WG~j#ETlSP#^?m z)Dvy-(lRrEnJM9nQ*_iW*|n4^8DXgrK_g`X>%XuD(#>-v(dmT&tv9s5n$L7Wkg=!1 zGx(SPA?EIl=L3|eE0hn~NxOU(Q5rluDRThO%UT+?%noE}z(YerEDGQfyU%DzB!ps| zfIj=5FO&fcPv$1GO7T}-e`U9Xh4rV~U0k^IQmUVT^({#^jW?1+6)eDZnX~L4XwZi&a*2vCpNWKtjl?j+2 zKAsTX0y4IXU?!hAj|-qmK273 za|3#_|G;pW9JN8lvXhfz5g_M81Qruee~hz<>5oJNKqvqKbmmr72;B&x{6WH^#*P;m zD{gu1VpxCc8b~!Qm;+ORwzs#!>Q8lYbO!{>dfPW+1`|omEK2^CW`AjegJwDexC*+& z9RopzOh8VIkIQ-rJgW&A17^)NfNXYbbZCgp6`zB+#>bZ>;0JHx8^uBnCr_Q+ zYl;)di9xkLK#ddxp4=cpopx#PuBdB9kyK_%~ffM@Mz>1CiAna64!= zh6PWB6iE@+dOID(L+k4oL)Rxd=S5ZDxd2Sy0)svrN|j|e!NDO&G3l=~0E*K(`d3Z=$_^ehBonzWfJl;V6FcUXr!d1@StzR&*8FeE1QyZ+ zys-4WZLsPSD~(-@4@NfmCiQGHZX+KXFH)~BllosnYN+sQ;Ka}0DM&$oe?O=>A(hnE z$v?^&$WEpbcE^q#y%5&`Fm2+uPt*d6Nd;EFT_<2xZs*SQ^&QmH7pqi7iwTHh+3X}_ z`N%+_1q5OVJQJiTcX@C`mb6|rRBF_?lC~fcv0H6pO9t=d}T!EDMPn|w} z7>x4|I{|Z0q~upn>|h{Qt*{<``qZfdA?8-7Feol+$Q*<`8W73Krm_ga`Qb&C!Fn-T zKxE`YylT0b>VqWR#qD5N=|r7#*?(CI9e=reZe*j(0cii@Ht70fCl4i?!XYjQf{vVB zA}0WSH+|6lE_o>;s_dt@h+Lva|B12v6NX;2y&vkiGx&ZY1nP+sy$1maV6@~*2=X?+ z7$+dUfva+G8|2WTLwgi!4V?mpSSw&K!5BbbN+2<9;9UAwQHTotb_!7!M5Ph)oHr1MWFdnd*I6SRVv zw*MKNPtFG=16iBL#>aHT%rF7af>WCTl3Jj5aZS+JQvk{=*1l%fH+z5va6dU|?} zhLrLnS@$11D@;<5NER9z926B$0x=*+6+u`Lt(Jnup!zo+K zmqPnZOJ8*6K>JOC_=VswlcdC>`6OAUxjDTatw2G(d9syee@X=;bT0pTTfKU2sEugozcW`KE=$KCaQL_T;^kDU^ zA{d_-hq19SYr1f@tcliD#vzm72O#coH+1CeCyCw39)n<;0&)LyB=@cQ*b3n7niYm%s6X*31(cmVO_8uRmTc=ehdqd>%4z$ zLWfp?5FSYz7&vj}%$XsGtN(aJph29skp@Z$1G-EgiC@T_P?|soSzdO;lRRo8NZ z!-@}f$S$g~EZxadu=CWI1x6c)+xNx&av-Lul^<3HD`izI;q&M{eq2Wcbak!B^e^?E zjG}fu_uMux#E)svH38yC@<1u0RMd@QJ^=Ot-~H})?>1J8R9aA3BS4P8(`U|z4@HD>$!8L+`~Tr2Q8|1@)+d8WV$fGnbYT@gRaiRnFY zLeB{(Q|aV;qX~B;L-^kJzPE)QVpUh&D1eUvxJZjZsU^X@J^=PYR4o}99v(ia5`Wah zg&|@J3Z1#hNj9m7$br^oKmga0>t-C`1zT4bNA}@_b>w9pL=(E*(Fp2%<`GI0=={hE zXnjjdWpGhJU?$Fr_b=B{PT&SR{S@xB8Y%FCZ{qq|!1;0>r*6!=n?-nK`c+)=scP?& z6B9f#CSv_yIRP~)Kqb-*o~8?{0l?@EGl60T0!=9l=-LxW8UTMG$^^QF0|RU|MyfBW zdhi4#em3XEBgmXtPv0uuq7dR>=<%Yp=(SyG_EB?);;joB67&<+Rt`z zJNbnIjQE-KH=cD99`%m0jEJRq8D?pGDK>L;@S5a|bwhtHlu`OKxH^5U^m&LRxG`$~ zXD4J0fKX-AI=TNcEJ#h~Lm&vBEyY9uX3PX|HG-H1z?Sar?q|$k2G1g2k9`zo_oP!P zG*_Tt1nc3PvLL<~h;_t5jw95`k|IpWBhQH4Nzs1wd&LKq!}33$|4e|jW5r)B*OhMt z9uPsg;XA1Idn+0H!}2LeEB%1 z2H?T1TepKlbKuti;s{BAQk;P9utPj1fNKH!_U$`)_Uzdn_2Qw*1(1_O>NWjioRBdA z91daYOM^=*_eDzK`rc%d`2FHcKzjZo;y4=Z4zC#xa)c?L!1~+PKQD~Fev0Q%}H z|9UxhYATyPG26~!h;Fu@KYzm1obYHAzP0^oHdMg*$KbN6&BE-Jey@XvdMF);x!@w? z=+hdsEU3$N_w}7Q+SAj+yysZ@CozDcdv-BlKp)_NL0A)*eC)Bueri+~oDC?m1ZBYx zW&<$>z!5HHM&RpOQV*Ar%ggcsFy!+E5Z``z75_gmT0lIiD;^>g>FaU$58ull9ROJS z`PCv>Xr92z|Jeb{{%bp62I$qWyjlQ0l-v!q2PX3EFEX(wc5Qix{|{0xg$CNUg{B*D z`Z#=~hYLWRHLD|NYRh!Ahqpa^H{D>Pg?z-X%yQMDX-5Hk7h^NPNBo=t+Lpuq9Pf@ z48gl={u6-A`{!t(A9!eB&?L=;Y8;Ks{g;wIq=J*u)A;@O-_O*4mjUEs0!6i|l&Qgd z;XrH#aMgrW3LY97JZegX8})`L&!+6*li4gB?l}x8%NYo~K0pVQKOrVx)!>+S8ezdq z*ytWJoz$}V_?L@S6BdS2dO$H&cbqzgYq8|G7;%d+kA0#O+Or zNL}+vBgdEpYM1TtkLUY)9e+tq!3s%#miSXmYPi>*QGYs}hUdGV=g}}-Nn83xbofvH z&;AAm298r<$-;k{&cG!9VB#;@`>&u>Cm?08B+7rQoO<$Lu%b zhI{txv1UePz5wPOeObEvA;G*YO_KBu_!ETe5SF=z>aL)~iQzn#O& zWY0BN`H>D-{wM8{5!zDUa)2VcU297|W~sLk4sbLeQO-qBicg^2(*NqJYoIDf^S5S9 zfVJV-9nXqHphzYCfRvfW!J(MJ-o1Mt&t|h@U^D>G0D`Tonri#oU!PK;Y=nV{&E`6B2xR>e`CT9vssGP)oT4^VzFj6&0^lL*0Ah z47Y?&n*aX0| z=h9`-Fs*q3z@q`MWo&G0^x&aG58+vYjan>q0m)#l>-{319{pllW2Wepp(Pnt)dtZn|>z&4D%ly9<`R*Ktsy zXhy7WTD1~g{MhP_p8=EjbKGMNDI`W9$_#II0zoHow z)P11)vGMV7SNi*M0A_4n02h27MeGakF@cFKTekd)6$mgX0ro5>g4v0b;ghFM^2|V$ zBoWB*0h`l*0JZe5+>odR@O^pIP1H#fz1xu)%wpB5!$ck#$DbAcvLvQ`e|BDwCa~dO z*FodvhO*|cdm24 zUzwyo>$`uDxk5Vr0zUkgW&ZW{_5!Y;1z-w+>Y^ZG3_$q6{SVwrkFfgxN$P(-+ke_l zK;O+=Ex?Ti@E6^^dw0+H=-63f&wy#H4iB2w-m#t9M5(k+2x96IE1I||bzWIMjthCG z5sOKgBCx}^3uyx8xN)dkR;YSQyzvcexvJn;l7kmH+G+r-XBMn(qr z?%&PE{wv~V>!kQUZe7`&fNC3S09GD=Tu=1(_YZbI|NQT*$fh&Bk=kYmI@Ws(h6V?8 zLJ;Al!vpw}>OU*n2XdjLxddbCD9M|-hUu4Bk{+L{yS$a>uI*=!e}KJnsxAeqKivh* z*ECfOS8SfXrSEP-giq|A;i~d-+ja(m*hDvs&TG{>LRKBlv~W(9Gch0jknreWdKCiHUFmzmfX-{M>1lSc?e2)0uNEE3kf9I z^x7BVOPInwh6If)M*J1D{ohdYMyMiHayBf{rw{DkFNwgd^$&(dkdN$J-}=^1K&bz0 z!5V;D`~$bHtWH4uFxLkVGXugf9N&N7z&!w>zNwn-1Q!Xx^9JnMvs;u&3cwT$q07~o zmqQvVQ$yS955V?(UM3*!knAt8{Rwu;D>$9iju==(Cmr0S9Jlpw*zsz<&1J+lst$BsC`(+9I zQ~*16?sS~sriiY1wMhHM_Uzm9dqzJ{ociyx|BHgD_yE*)5(7{#%U}MXhaS2o40Dkh z@PO4GJ#T;vgXHLX+r!(a>Yw7$pJh!ml69J%VQ3}?7X&p5F!OTYo*4?ri+TYdY-~+#d^Ujv~PaJhWj;jce z)K6fvw&eGC{PA(mu}Z*8tFM6ebi17Yl8yQcV9Wgv0Hp(?1xw;5?uc3D7^j4=?V)WC zfN}m|Mlfp(!1)xh&m9W~vX_41i6{0C504zf?hR8mO#BFmAO=S4M~)nU;h|wUgRqGT z+*JE#Pz9OFe8GIJ=8#`YQ0L?wIHVkd$`_hw!67wSnhNSv;t-i4w5mmEo-tUrY33p* z8@{?8THhekkP*X)#nvOIxt34BBhj&mgSCkS;`e_KvybFEZobTn;l%|O_kUmGpKHe- z(_q<*SceWB6s9d6BLko()zy0Rn*Tv9fz5wG;n8K7^z5&Me_ay*f z4PeUBpTSg}fC}&n`1}C80lRkXI(Yijspk}j(^slnDpNon+PQNF^!4>oB&K9EKp^v) z>T97IrrDuOfV@lq5~NMc*35&!1XVwBkMZBczMJba09z|yXs+(4=90T^)6^Y6%)Kefdx5(1;?9yN2*s0T}_U+xfmrebpl7AEv!1ljSthg8`3Z~-(#M`bfK$`%v z0pm|S{q(Peg9BueL#P|AwF9XYq$$_jwskAr&Y>{^1Zq>Y@R#-PFY8BiA-^Vo(t(pS z0U158op|wc)YB|U9zi^0=$p($spFPIP8_RVL7Bjp*FoLJ(#?U5|FRz1ZfLcoJTh^x zb28?*bKVoT-x?aMoq-A7dP~|TWcfwtxe4E*+{Dk|1I-_Tx}a8s{&xO!Oz)=){FSzf#kW!>l3Kr>bQW6w^KJDQN=yKyeRDst(S`WRRGx+qcV z<9pAh@8e*kzc2n@ zsQ70|FkK&jTKjwfifd_Z_MPv1=Vnv)Jd`;PM*3@;QszSc;upV=PQXCd3Si5-YTsS< z59&f8O`xb^7ie&crLy|$U#&G@qIT76oP6V?7xPV{f;XI74;#L?4ysocU;@nM|36gi ze_e|eZHU?QSaN%$y`{OJc3P^uE72pDN#=1HCTR%{?khq34E|H&do0Hv+rIP8J1t2s zqTt3xleDibrQ2`6{mWp8-_8GbCjh}Mp0XA&9R`3=jX6@H89;5DBWKQ>-etl;viKwC zfFxc;IG2M*AAOXcs>}ekURBivH`Z2upim)Az*6^p$K^S(k$xD9>YT_NAZVYG$QCp3 zF`CHPrvKG%s)KX?^_;w#z=m7bQJY_lGIZ2$#86zR>?8Upg1BD*B|2gJ#1n>+@-56c zR;+&(iT|w)Z-X_NHF6}YDEal!Lk~fY_Fp`#7j*wNS}*VEwBaXDoY;Ht;K8FH2p^jO zuKJHn?rBMX1~cIUz`xyc;W&wbHD>I=2Os=lh!CLW4^YKIm2Uu~UAJS$4r`cjAT@$F z)?N=wg0_M$I@3^?2_R3Nt0Ot*$9w~^dtvD+4&VVdmU`|=+}IZr_o-P`3+H~7GJ&P> zq1NYpb0aLiZgHH6pw?Ts@JV{qUgCLvVtgL^FQR1PN3oMRLHup0rEp{8je3qhkTd)| z^Yk;k&#LKi#c+6(>2GNO5m37LIT+%{(x0te&%fJh-|wPeCc=Pf8*?Q$8lV}#wr$&X z96fq;tG4|C^u(b!om3%YKY*+r0@Xn^+|=-=W%#6pAwLs9jz8Zy9w~39 zzCxT~=<^AFx?vuX&Ih#iS@t&~p4zpwu>P}ap{iA8S5mcq!x>CdQx_&#*iWauD%BrkCakRi z^c+6&_!Cb&!AgFQf?)#K{>R>bU-jQ9YXYfhwx2j_%uoWkKR^q6UO-iy?n^Jd?3I*5 zR_Rhm5+Q;Qn2}NJ24f>*(9qBTZEbCWuw?ICnregbXdL!s_m<<^7HBxZKN7J*3Z0`* zLYZ-i=i+O0=73%_6CmcY$XToXndQ~ca8W(B>kVtCd4wzu)BK zzY<;ShXl!`q>r%+7fDeAR@+Ivxg$oukhacT~UQ z;XltaEU7C^1bn~9P7}7IFI}3b#J}hV=RwOGTKxG6uH(^iHmbWget|sZ0QOy2p}RcU zfyObI$G0*I#NQA!z&o1Wsh!l!G-Wj{?z!h4J+X(G7B57qzfHS6JqNd)X0zoA>F-Pa zDU0o|V7d$-sayJn2`k%%t2y8N<~P4JF)?vgOMLEQQjWj~^(7&Tvbik$^rt^X*@1%V zR+DP@D#N;7LC}{NWuula<6A zf5fhh849QO_~_{1?YDpD4lt^}T9ot89rjxYizUN!O#mA&@wH+wt{K3W>}2-nnl-Dh z;!3M56e^SfMF7fc8gitw!l>2N8R+O(X}Tf3v@vLe73mImWc-mCY)&Z+chq37-;8K& zzbLZ+RCzS}FiGm?Bz7jm2^jrOx(_2Z5_t&Q#|-dw&Y4mCsrvqSPeOMl*17R#*w3ph z^Z!80hv59$^L4^ckWRy6k3I^|KD%A`0(2^{X^b|@WIjt6h2d|0``fP{J9dm^{SAYy z`r|x+q_p2@+5QS<+62HamM=4qH*(vyZBGph3_UMNT_sD(yP!QXbixk(?sxY?e}5mO zQ2ju*erfF$aAD@68EnoBU;<-GcObvrpfdGw_?={04N0&#HkT!?(Iyi#|R$ zFwpbF6Hn{_o9J=q510K;n)h$oFjE?UEB)2BZ_&;`wto2GhqqmI)m5(#NKmD-#FW=m zOqGgirH7oA?%TT;F1qj{NKwwKA_MI2WwkGd$HpFkfpB1^@KYiZNW4ROrM!{Cq~N*E z6Ns_(V=_LEVE4RiGL+c8Or{?;9RLw=f)sc56_oncxuoL6&+<<`v+QP*o=&AbHDlr5 zzxho*&A0xh(mai%7GQk5;*GPDlVe}{(wF`LgydJ!e-w-<;12$ok*q%-%#;QYdDcn3 z0F~vW`~f4+JoC)=Ksihzl_CsU`YR?NY~lz8&JMsm_xu)WYidOC5RUbL`v*R}_#-oo zqmseuoO$hDPslKzU5u_tO2)yCJ70|6NZ91X%ekZEMc>)+BgER_X`3}oS|O=F3-&&S zk1qWiS>yxwy0)ek?z-zPINN_#zL%_i9Rk>O|3EuIm|%PA>8F1TM&-x$KX&}N#6RV_ zfB9f0eEky6ECdGMP*Z&YZ#yZoXDAR8~Xq_%W!?)Ii7b4rCh> zs82P(`I!q~%jkVG+_b46qZn-folWwbo4CKQUGKBr^LYp&=e+nYS4tQ53%L7D;L=0* z3HO){sjuME?f(c})vHZPI_hGL00TkdK;)asdentG2Ik0cv-ls3Qc(qj7AoP@eS44h!VkXx12Omq$4pR!%KR3l zTQ-{=x&8LrKR-S`-VZkMs}P_&_n(sbVM#As0?af6PQ0Q1b=HUHgzT*i{fbgxm6q6)0hlu};jcy1cAo>0@S~D`-0VN!sJ~*dT{2XP0pPD5c=mH<(B0kLyJpRrwubt~ zF6r{qE!MsOxd#_gU^5GC-h4S{2+9;-AM4_pi{ZKPU2rmYvJB0f3Stse*hJOepokFT zWGk8>Oy#^JD5l#b`WrlqB+7q1L4UIa7t~w`A8h|?p5ezO75xaA>J0qbzx^BZpFJbf zeVHg^UO25F23aA zmsX`SjcPVwTuGJa%rlcVeCpIGx}1jd&p%%r3k<1TTYnuqKKeNHhka#g>QsV zM`9~d%st8tZu}n#NPFiR-|yKZdIf7U>)_@U|D?10)YNs~{qA?**&RC|6;xTm#(Hng ztRry^@cfnD|M-t@eFX&JvpWCzRR0;7@S|8L7Xy%J@UGRij~VdyId$^X?(@#u^x61r_$` z(3Gd!d5wf9;Vq)#?mOEOUjeJjAicu!w`%=fjDOwnI({^9FQbgs{3FHgg=*nN&c^_`Wh_GEY@`=xc%O97{2+< zZ|V6eK&$*R)TK25xkow-j~zYs$lZ6}{ZkM`KP1=roPKz`e<6&{2$Y)vC_E*)xxmj1 zxIf_8XPtU%ws}FJ7!i&9cr`6V$-# z8s7lh$DW41+}!aA#1U3NDwaYwMKFi>XUKEm6r6!Yw`&$*UG+M+t@F#!oLQu+`Z5Oa z{PWMlKmYSrc!65L;n~21Y%x;}WZeJk*|P_}_r33Z6>N{coA~3a_LC>^dFG)~48UEJ z0>?BH=;`U%dER;FzJk>b0A%-@3?Vtx61hu4`mvsV`Wd+NB`<-xx;n{}#Yf5n8F)?O zYhmZuPB@W0QGw=97kNbxOsVu#%=x8uyFBO5RiamLVeLimPo1BKnpBO<+Yz(*oH=s_ zZu{aFc~Ke`{zHx>9TgyYts()yMy`(i_(wm!b!=?x48-I8#S;Gu!URx|6czBDqqg}n zIyyRe`0$ZOH*DB&ZNLhMsC)nblpd_ohK-hxot%V+w>?ZXfpxHmX#xPqX+z+;hF8E) zI1GEo_f!Z4(?uXDO@fw_-U@WhlHYX};f6&wz=u0Ns?~jvg+02vyW!SbZ-t5RaWFo9 zqAh@kpm7hnw-U(Z!m&H=yz^$tJdQ!!?svWZuE)RZUVj%V#Q-Fx^g05+M&SPDIRisO zLlfC-_Rz}C&X?(9QK-?Qv88{D+vl=5cXUYP4UzVZKxN0#k$8VgQBCi}?(WA3x62siPeo9am`SPa<%q z9J8VZbc1qa=81*I#zt7Zb`1{|2I!-nTe}G^qAK9MgZESr6*G<4jY{~xNxOPgQ!6(;oqWCbX1zft{ZKl{e^?c1LOJ74!PLP)P2DjV0HCs_(Iohu%>pc_6vzH9)TbK zAH z(hNZ1Os$g`L1K^FyLa!N*4Ea{qUPp}YIv|t43hQMtkgs4A7DuwC)Yib){`Fts zzWeT@{UpW7KJpIg0qrN?`4DouyZgXh_uTW_AA#}s7eoBm=4ViG;%6`$41mFuqT1^C z{{8#+tX#RWt-ij#3(qmC@`O|=CZQ3i%Iu;p+w;`E+r4`?Tyn`v=!dVC=nnX3EtcDT zUE?dDGt&v%hPImOL<=ylfm!Sy>-byvFmeCw}& z^{fAY;)uUcynj|;wip0|BuVe9Bj82Uo;`b>T|t=u*94qOtT;?)rXCZw;${Ig0ocr~ z^jf&!f(t}7SN+ienp4g2rbRbEHp;?tW4mS%O$#tpczf$R;D4?92WZW-$^;!j#Ptnz z@XKHR62A1MFGDU0wVJOYdia0aUKJ-WS72{%@77=c`qxRspH$k5t+CUuVhKMnr8rI67pZtd-(X1PeAXnUd{xnGF7I;73~yhlBRa! zrLd{?JlHw96NbZ~Sw`0a6a&kumchq6KLM{_d_AOtv<~wHsWczU|Fy4v4etEWopR=B zutI&txsQhUD(z6J{>OTcZ@v4jyA<&!dHmg(eS9jvf?3l9W}5*pNJWOz^8d*Nf9e*-IPR*Cw3QsqyjQ!JDWpZNI4VaLv$kWS-4Jwz~m zPUpzIuLt>5Cu40C}2Fi1)gQc#d%c6WF0 zX=!cEG&MGDP;~=!H6a}(kXir{{DD1$4Gdx*eRO05s7eR5wY6~W#*Lz?Yb1t(vh$cE zxv=hHxU%62I683@dMA5l8)plE;F9`F;O|y_3a(r93aFA&pK1NPgcp_cKmXa!;pUrf z<{E&K{AN%O(NO`NHV(v!_p{BzhY#PqWy==j?Z@FhUfdS!SikG>pL4`7TQ?`b=L~cw z6G_X3)eNkbOD$dMv4#y{Dl&IlG1$L z?OB1jq5&{)nLsgRBy0np!U+nKlat+TZA&ksoIb6kKJo`d*gt?v56kn|Adp}D@)yv$ zxCPd%U8e_vC>xPEftF=D;D(kPp()h_J4SZUFP)oh{Jp4vO$qm>%iafnv-0Dxs&17D z&&iyAmdx|p-~I+Z`N>bh>C>mQYHx%(krRz#rU2%*{L5yuV^2Q$+4B@6JN)J) z@oRj{At+T7P})E(7;S)Q0(C7dEgi3Z^{a1A1wpNd5QM0JNGP-dX&SJkAg&=u1`*1+ z+}V0%XD8fx%NOL_@5YJ90MAu$>yat61N5D6?V3k}L6R44kWfC+kTGW2c)mOj2zP|n(PSha6e}WMhqL1<{xoj4yG8wr3 z`ZvN&H~lG_(@oA~Y)X`>)v@to@TiPvJzON?u&;xylVHQI}LkG5Q-TL)`fdMvV+^6#6 zVZDV$_c53=c0Y!>$N=zr6=DLeCZL#rr43L`;4c=pEWS$2${HChK$I2|-kAvd1Ek|n zO+-S!BO6)BGQ~cB%jaRu>a~!j+hz!|DpDdWm&q^-w;cH_JU;jsFHODxQ-}JX9xiX% z%su<*lnm3NibjEy`1`vLzz09@LB7p%`2$}IWmF*v>BC;}KaOU*sNAAD> z{%=CE)W=CaO7hP;;%6{d832B_BqqQXWezA!KrsQfFb1GCf(tLa@Z}pfZv2Z-6SthV z9sgF$!8%7e61lCA<6m{dIUC?ZANmlSvwl6F6JEFw%(qqP$o<)~@Vowd;NOq`e=r`6 z&o(~i6>uAW`TO8ii(k#_^D)4s%-Cjibq(y@vlni;-o5)YG=@&+$0hFHq$B6~h5H56JKY+z0_S3D~;6 zy}f-S>(>V=mYu3T_t#5)G+ujV=z6Sv9+GAi z#4m6<_aVtKsLF;ZQvmw~s=*EwTE2m6uf6uB#fulc+&BP%6MYmpl0P)&f?yUP3z3TR z!(2$EP&Hh21UE%kj~es@$~p$RgBuN{VsUp_1D9?wQFIL?o*KlqDLbFsQxgN z8-n}#eg|95-Um+&JvH0-ofWvG;U#e0;_KiQi(Uy0RgK;ZFh;0VRaLNm|9<%S&wtJ( zengop(*n$NT_*g;|58%L*Umod_)}&8rQU3Auc-lTdus~iVxS-)T|NyK&%ajNP+7g2qQHG zbSM*xj3ZDnimR@?68`$bABH7uORNMUlavh3et@5!`Wf7D;sc{{xva3FdIh{= z>AT>Dwj1RhSyDrlZ$=YtFgSVg1bpsupXUdY*iP;XL{|u~laKh#fYH&BgAZ?e z_+Q4x#!iDFel=yiPvuXVxo2KVeg*T10l4pr{R4^-q`)={6cb=;M)b-gu%ZPQTyVjw zR;*a@PTIk0>@c8Y1flW)fGj<3j&c8h#Uz+ync(ZoFTWh#bif3s z&Srdq%6vLAc?R~6?t|?^&%k4YkHMai-LsAJX~D+2jogdRhU2cUTMsQ&t@@+!S@ldT zkMCj9o&l5gKl|Cw;L%4P<#^?}`$VeqB+vwpwSYj!_=P_pkcmOU)EA6_e!H z*REanfi3M7(JPhT4e?=h-&e|O-Vwk04)YC?m;lxUlygv-1ZVn1xhx-Q{J{@?5Z>|jcksz2Svb)QT2f8HQ3RCE zN;e-F*alnr?uRD^ALn7kiEsiY=UBoKOVG&#)leVQ!DUUC!ON*?e?{{Z)`t=iJQKht zY621&${U}UfIEKh1Gw$B+c?29JXs&wa^i`i9wNcdB=2bLKps;Jg5orsn3(9Hn#3(& z6Fv6sV-LTYu?O4x?#w;&n)o$d=PCFq3A@^WYZ4@x1=>f@)zx+3+O=!{JYAJ;QsV>o z5`v5rNHZY}!3`A(Ex`68C}2JTHnw2(>eX<=jW@!(-uX`6FRp6Bb&b;|Q`RPyL`R;BQ8XneKK+-+$oW z4d%Ss{L_W`%mDEFyUf640ytcl0XumJYXr(HsJ-m6%ih!6 z)ci6kRca!o@`Fkf2K}2Q66H|%P>nh?vl_=?l1e(3Kk&AfXTnhVi% zXJEpJLLm@^O?-Wg?KwE|JP$J-9D5#m#(LoR#Br)EjKdgR*qT*0nhYnY_K>CToYhmL z@$y(CO{F+p0xHQ#hD-Ary0G=K%raP2vkF$#cEQ@(wXnK&P5eXXFF-6ahrg|i!7~+| zRcU6q`G=Us5#A2l{MzLbUc zcp36A!38i=oT zqsNZIPk#Ip`1M`ChW@^O7#J8ZPQ6k-HqO`AS$-kd*6%C*?xgCw8NJ)WCm{|Qy3C-qqoZR}=gQ8v*3{N)G%3U?o!B`4 zbOKQx>7Ng%jmj5hCR}mFm2l;iS3qZHC)W@dlVHHjkenRS91%o_xcSJdSQP3aN!XDd z2d{D$7{++*1W!-F#H+{HQ(#F_hYufto}PnzI_-zHZsl|AF)3fHq)&X?nEEfAduj;p z*yz|^s_Or|x3`zoabpDT62EfrVTtb}d@S{oChVNo#4oV+!h)pCLFFHCnE=ikaQy>{ z5vX+?mD0=4-E{6ptI}1A)Sw_09T0{5N) zVm5L-g3=n)&{w08n;)v`k+Cl#_hbjH=$@)b20HJFC!d5Z_utP;Yg6LmPCXu0Eyo9z zM2|E6vbkLUbGvqZnKBd6eUQ~29$rmO(Kdh zgRaib&8=;1uc5Z<20Kv*`1k@5J(yWw&tcI7RlKyTs|!}GS_Lasu7H&*R&ujp`SNA3 zbZI-ZwY3$cT5Bdy@H`feKM5yJ^uqCD$Kc4(BV58$Ny|!P@u{>_sE#eAs`aIUsOl?J zeJb(yoj!B=cl2FYu?|-7%pe~1uD=kS1Z6wfLHs1WQ_oa z4lxtp%z4ZVNiv6rhxK&XmI^)_Ahee# zm(BGaIB?(_RN@~7o5)?_SNoDAzN*w)OwGO*6!A-RzMvr~O5i#Paijp}4!Ax7>@d`f zpmp)$HA|K*y^h-H*G|>`F9#@Q5SuOy><}fMHQ8OTZ9f;_?Af!wr`pH^bp1Re6aEDF zZG1PT@84W+#w6bWjuhmJ7+|d+10D@w{rdH9ZD?q?k`hi6(IsXV zV5-0pcyhVi;Ly;}Bm4L7{|VT(JeKeiU`zXao_*KDpJeO1+b=kHF)#pMTYcd|A0xo# z0rnBNAw)|{pmuO0h0di*m%f@ZgO|>B!{;kd_5QIFCr;c;iT_A8n;itdboYhw-11zm z#CHk*MWOEd;KjrM-1a6V5BUZc`7#P!6G3SQmX<&@f!fZ_&R0=}u(_(LYB~K~J=;i_ zt3XYbaZ2dNDd9hU=+L42=x^r9cZq!xY$@-m_`VFjLWB?SA|!qWFE$3?Yj+{Dz)dT5 zhaLM8i>kmAQOIO64NI0Rxv;gh^$m1;#cU&CuE4~^#L-iyPTfsy`|XqgsN8(lhR17H zy?2M{`qFn_^y;<(WYzLC#CMXx%)|uy%!zvGk7sG z00sHX0>uCTlCui2d4QRL%NUXteoi`_ZlI>ZwbWF&l5V#XJuS_=he+lyoS>@xww|7z zEmF$+BzV%2Md!Kkd#vL7viAy2#QCBmd<8Fr4mMLTRYs6xBKR1BYc}|_hjevyHFF}a zsHv%0URztcmae;~$2V(Xg8Ja$C(q4N_;k{1}5Gl;&vHB62W6h zzd-m?garm*LlP5EzgTPN+w70ahY@+7Fddd*irc$YD zDqYi5TS&>J>|sY1mScH1Y@t7MVHl24;%0=tudlCfHCrQ#T5dAb^fdP~Tq=?@>tstMdkhEaJ$B~D8i;wBx_W);~3$E11`$Eq; z--3xbiBY(VkJw9<_P*Z>kN^t|VCpaxW{@wU;A0Fvzk-i>0OXha?t2shAF=r~0kz*H z;v{?BN9g%H_X|W{W>{bV(+5(-z9b@a?eqX_iS3i-#caFwekn{KiRgTix!CQbYt?S>qvSZAGi`2?+c4q`^*RY+vlxM zB6@%YX7g1qM)gm~j-EHHq%1yf}TGj*?-B+vz7 zp9iqO0Ol?f`ZhlMy;9%P_sl{>y+HJH5EdA~{DkR#x2b3V#lQlQ&ofwH055Eqsqec$ p*bA@#3$OqSumB6N052H${{i5)b&{mEGZg>;002ovPDHLkV1jMqu INFO + cp INFO $PKG_DIR/INFO + + ### Create the final spk. + # pkg_make_spk + # Please put the result spk into /image/packages + # spk name functions: pkg_get_spk_name pkg_get_spk_unified_name pkg_get_spk_family_name + mkdir -p /image/packages + pkg_make_spk $PKG_DIR "/image/packages" $(pkg_get_spk_family_name) +} + +main() { + create_package_tgz + create_spk +} + +main "$@" diff --git a/synology/package/WIZARD_UIFILES/install_uifile b/synology/package/WIZARD_UIFILES/install_uifile new file mode 100644 index 00000000..7d365864 --- /dev/null +++ b/synology/package/WIZARD_UIFILES/install_uifile @@ -0,0 +1,80 @@ +[{ + "step_title": "Shared folder configuration", + "items": [{ + "desc": "Shared folder for downloaded files." + }, { + "type": "combobox", + "desc": "Please select a shared folder", + "subitems": [{ + "key": "wizard_download_folder", + "desc": "Shared folder", + "mode": "remote", + "displayField": "name", + "valueField": "name", + "api_store": { + "api": "SYNO.Core.Share", + "method": "list", + "version": 1, + "baseParams": { + "limit": -1, + "offset": 0 + }, + "root": "shares", + "idProperty": "name", + "fields": ["name"] + }, + "validator": { + "allowBlank": false + } + } + ] + }, { + "type": "textfield", + "desc": "Download directory (shared folder sub-folder) - optional", + "subitems": [{ + "key": "wizard_download_subfolder", + "desc": "Download directory", + "defaultValue": "nzbget", + "validator": { + "allowBlank": true, + "regex": { + "expr": "/^[^<>: */?\"]*/", + "errorText": "Directory must be a folder name only. Path separators, spaces and other special chars are not allowed." + } + } + } + ] + } + ] + }, { + "step_title": "User configuration", + "items": [{ + "desc": "User Credentials for the web interface." + }, { + "type": "textfield", + "desc": "Username for web interface", + "subitems": [{ + "key": "wizard_username", + "desc": "Username. Defaults to nzbget", + "defaultValue": "nzbget", + "validator": { + "allowBlank": false + } + } + ] + }, { + "type": "password", + "desc": "Password for web interface", + "subitems": [{ + "key": "wizard_password", + "desc": "Password. Defaults to nzbget", + "defaultValue": "nzbget", + "validator": { + "allowBlank": false + } + } + ] + } + ] + } +] diff --git a/synology/package/WIZARD_UIFILES/uninstall_uifile b/synology/package/WIZARD_UIFILES/uninstall_uifile new file mode 100644 index 00000000..f8f02209 --- /dev/null +++ b/synology/package/WIZARD_UIFILES/uninstall_uifile @@ -0,0 +1,16 @@ +[{ + "step_title": "Uninstall package", + "items": [{ + "type": "singleselect", + "desc": "Keep/delete package settings.", + "subitems": [{ + "key": "wizard_keep_data", + "desc": "Uninstall only. Keep existing config files.", + "defaultValue": true + }, { + "key": "", + "desc": "Erase all of the package data files.", + "defaultValue": false + }] + }] +}] diff --git a/synology/package/WIZARD_UIFILES/upgrade_uifile b/synology/package/WIZARD_UIFILES/upgrade_uifile new file mode 100644 index 00000000..6ad34b37 --- /dev/null +++ b/synology/package/WIZARD_UIFILES/upgrade_uifile @@ -0,0 +1,12 @@ +[{ + "step_title": "Upgrade package", + "items": [{ + "type": "singleselect", + "desc": "Keep package settings.", + "subitems": [{ + "key": "wizard_keep_data", + "desc": "Keep existing config files.", + "defaultValue": true + }] + }] +}] diff --git a/synology/package/conf/privilege b/synology/package/conf/privilege new file mode 100644 index 00000000..2aafe234 --- /dev/null +++ b/synology/package/conf/privilege @@ -0,0 +1,5 @@ +{ + "defaults": { + "run-as": "package" + } +} diff --git a/synology/package/conf/resource b/synology/package/conf/resource new file mode 100644 index 00000000..ebe6f568 --- /dev/null +++ b/synology/package/conf/resource @@ -0,0 +1,19 @@ +{ + "usr-local-linker": { + "bin": ["usr/local/bin/nzbget"] + }, + "port-config": { + "protocol-file": "usr/local/bin/nzbget.sc" + }, + "data-share": { + "shares": [{ + "name": "{{wizard_download_folder}}", + "permission": { + "rw": [ + "nzbget" + ] + } + } + ] + } +} diff --git a/synology/package/nzbget.sc b/synology/package/nzbget.sc new file mode 100644 index 00000000..00f1772d --- /dev/null +++ b/synology/package/nzbget.sc @@ -0,0 +1,5 @@ +[nzbget] +title="NZBGet (HTTP)" +desc="NZBGet" +port_forward="yes" +dst.ports="6789/tcp" diff --git a/synology/package/scripts/postinst b/synology/package/scripts/postinst new file mode 100755 index 00000000..1c533724 --- /dev/null +++ b/synology/package/scripts/postinst @@ -0,0 +1,32 @@ +#!/bin/sh +. `dirname $0`/vars + +# check conf file location, copy if not exist +# and populate from synology defaults +if [ ! -f $CFG ]; then + cp $SYNOPKG_PKGDEST/usr/local/share/nzbget/nzbget.conf $CFG + if [ -z "$wizard_download_subfolder" ]; then + DOWNLOAD_PATH=$wizard_download_folder + else + DOWNLOAD_PATH=$wizard_download_folder/$wizard_download_subfolder + fi + sed -e "s|MainDir=.*$|MainDir=/var/packages/nzbget/shares/$DOWNLOAD_PATH|g" \ + -e "s/ControlUsername=.*$/ControlUsername=$wizard_username/g" \ + -e "s/ControlPassword=.*$/ControlPassword=$wizard_password/g" \ + -e "s|WebDir=.*$|WebDir=$SYNOPKG_PKGDEST/usr/local/share/nzbget/webui|g" \ + -e "s|LogFile=.*$|LogFile=$SYNOPKG_PKGVAR/nzbget.log|g" \ + -e "s|LockFile=.*$|LockFile=$SYNOPKG_PKGVAR/nzbget.lock|g" \ + -e "s|ConfigTemplate=.*$|ConfigTemplate=$SYNOPKG_PKGDEST/usr/local/share/nzbget/nzbget.conf|g" \ + -e 's|DestDir=.*$|DestDir=${MainDir}/completed|g' \ + -e 's|InterDir=.*$|InterDir=${MainDir}/intermediate|g' \ + -e 's|UnrarCmd=.*$|UnrarCmd=unrar|g' \ + -e 's|SevenZipCmd=.*$|SevenZipCmd=7z|g' \ + -e 's|UpdateCheck=.*$|UpdateCheck=none|g' \ + -e "s|CertStore=.*$|CertStore=$SYNOPKG_PKGDEST/usr/local/bin/cacert.pem|g" \ + -i $CFG + # copy bundled scripts + mkdir -p /var/packages/nzbget/shares/$DOWNLOAD_PATH/scripts/ + cp $SYNOPKG_PKGDEST/usr/local/share/nzbget/scripts/* /var/packages/nzbget/shares/$DOWNLOAD_PATH/scripts/ +fi + +exit 0 diff --git a/synology/package/scripts/postuninst b/synology/package/scripts/postuninst new file mode 100755 index 00000000..0c02027b --- /dev/null +++ b/synology/package/scripts/postuninst @@ -0,0 +1,8 @@ +#!/bin/sh +. `dirname $0`/vars + +if [ "$wizard_keep_data" != "true" ]; then + rm $CFG +fi + +exit 0 diff --git a/synology/package/scripts/postupgrade b/synology/package/scripts/postupgrade new file mode 100755 index 00000000..c52d3c26 --- /dev/null +++ b/synology/package/scripts/postupgrade @@ -0,0 +1,3 @@ +#!/bin/sh + +exit 0 diff --git a/synology/package/scripts/preinst b/synology/package/scripts/preinst new file mode 100755 index 00000000..c52d3c26 --- /dev/null +++ b/synology/package/scripts/preinst @@ -0,0 +1,3 @@ +#!/bin/sh + +exit 0 diff --git a/synology/package/scripts/preuninst b/synology/package/scripts/preuninst new file mode 100755 index 00000000..c52d3c26 --- /dev/null +++ b/synology/package/scripts/preuninst @@ -0,0 +1,3 @@ +#!/bin/sh + +exit 0 diff --git a/synology/package/scripts/preupgrade b/synology/package/scripts/preupgrade new file mode 100755 index 00000000..c52d3c26 --- /dev/null +++ b/synology/package/scripts/preupgrade @@ -0,0 +1,3 @@ +#!/bin/sh + +exit 0 diff --git a/synology/package/scripts/start-stop-status b/synology/package/scripts/start-stop-status new file mode 100755 index 00000000..2e745284 --- /dev/null +++ b/synology/package/scripts/start-stop-status @@ -0,0 +1,25 @@ +#!/bin/sh +. `dirname $0`/vars + +case $1 in + start) + ### Start this package. + $NZBGET -D -c $CFG + echo "nzbget has been started" > $SYNOPKG_TEMP_LOGFILE + exit 0 + ;; + stop) + ### Stop this package. + $NZBGET -Q -c $CFG + echo "nzbget has been stopped" > $SYNOPKG_TEMP_LOGFILE + exit 0 + ;; + status) + ### Check package alive. + if [ -z $(ps aux | grep $NZBGET | grep -v "grep $NZBGET") ]; then + exit 1; + else + exit 0; + fi + ;; +esac diff --git a/synology/package/scripts/vars b/synology/package/scripts/vars new file mode 100644 index 00000000..863498ae --- /dev/null +++ b/synology/package/scripts/vars @@ -0,0 +1,2 @@ +CFG=/usr/syno/etc/packages/nzbget/nzbget.conf +NZBGET=/usr/local/bin/nzbget From ec0756d5f63137d879f56a6bc60cab6b81238eaf Mon Sep 17 00:00:00 2001 From: Denis <146707790+dnzbk@users.noreply.github.com> Date: Fri, 15 Dec 2023 12:29:36 +0300 Subject: [PATCH 14/34] Feature/automatic search for a suitable interpreter on POSIX (#74) * added: automatic search for a suitable interpreter to run extensions on POSIX systems. * refactored: renamed Script.cpp to a more appropriate ScriptController.cpp name --- Makefile.am | 4 +- daemon/extension/NzbScript.h | 2 +- daemon/main/Maintenance.h | 2 +- daemon/postprocess/Cleanup.h | 2 +- daemon/postprocess/DirectUnpack.h | 2 +- daemon/postprocess/DupeMatcher.cpp | 2 +- daemon/postprocess/Rename.h | 2 +- daemon/postprocess/Repair.h | 2 +- daemon/postprocess/Unpack.h | 2 +- .../util/{Script.cpp => ScriptController.cpp} | 90 ++++++++++++++++--- daemon/util/{Script.h => ScriptController.h} | 10 ++- nzbget.vcxproj | 4 +- scripts/EMail.py | 2 +- scripts/Logger.py | 2 +- tests/postprocess/CMakeLists.txt | 2 +- windows/build-nzbget-vs22.bat | 9 -- 16 files changed, 97 insertions(+), 42 deletions(-) rename daemon/util/{Script.cpp => ScriptController.cpp} (90%) rename daemon/util/{Script.h => ScriptController.h} (94%) diff --git a/Makefile.am b/Makefile.am index 643186eb..473fb0fa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -150,8 +150,8 @@ nzbget_SOURCES = \ daemon/util/Container.h \ daemon/util/Observer.cpp \ daemon/util/Observer.h \ - daemon/util/Script.cpp \ - daemon/util/Script.h \ + daemon/util/ScriptController.cpp \ + daemon/util/ScriptController.h \ daemon/util/Thread.cpp \ daemon/util/Thread.h \ daemon/util/Service.cpp \ diff --git a/daemon/extension/NzbScript.h b/daemon/extension/NzbScript.h index 62acbf89..e2e7df69 100644 --- a/daemon/extension/NzbScript.h +++ b/daemon/extension/NzbScript.h @@ -21,7 +21,7 @@ #ifndef NZBSCRIPT_H #define NZBSCRIPT_H -#include "Script.h" +#include "ScriptController.h" #include "DownloadInfo.h" #include "ScriptConfig.h" diff --git a/daemon/main/Maintenance.h b/daemon/main/Maintenance.h index b49ca43f..d7f59a91 100644 --- a/daemon/main/Maintenance.h +++ b/daemon/main/Maintenance.h @@ -22,7 +22,7 @@ #include "NString.h" #include "Thread.h" -#include "Script.h" +#include "ScriptController.h" #include "Log.h" #include "Util.h" diff --git a/daemon/postprocess/Cleanup.h b/daemon/postprocess/Cleanup.h index db818650..cbb06ad0 100644 --- a/daemon/postprocess/Cleanup.h +++ b/daemon/postprocess/Cleanup.h @@ -25,7 +25,7 @@ #include "Log.h" #include "Thread.h" #include "DownloadInfo.h" -#include "Script.h" +#include "ScriptController.h" class MoveController : public Thread, public ScriptController { diff --git a/daemon/postprocess/DirectUnpack.h b/daemon/postprocess/DirectUnpack.h index 63cdb73b..792f15e1 100644 --- a/daemon/postprocess/DirectUnpack.h +++ b/daemon/postprocess/DirectUnpack.h @@ -24,7 +24,7 @@ #include "Log.h" #include "Thread.h" #include "DownloadInfo.h" -#include "Script.h" +#include "ScriptController.h" class DirectUnpack : public Thread, public ScriptController { diff --git a/daemon/postprocess/DupeMatcher.cpp b/daemon/postprocess/DupeMatcher.cpp index 6c2fec14..34205c1f 100644 --- a/daemon/postprocess/DupeMatcher.cpp +++ b/daemon/postprocess/DupeMatcher.cpp @@ -24,7 +24,7 @@ #include "Util.h" #include "FileSystem.h" #include "Options.h" -#include "Script.h" +#include "ScriptController.h" #include "Thread.h" class RarLister : public Thread, public ScriptController diff --git a/daemon/postprocess/Rename.h b/daemon/postprocess/Rename.h index c85e7acd..a692eeca 100644 --- a/daemon/postprocess/Rename.h +++ b/daemon/postprocess/Rename.h @@ -23,7 +23,7 @@ #include "Thread.h" #include "DownloadInfo.h" -#include "Script.h" +#include "ScriptController.h" #include "RarRenamer.h" #ifndef DISABLE_PARCHECK diff --git a/daemon/postprocess/Repair.h b/daemon/postprocess/Repair.h index d04ad35d..5ef1c30d 100644 --- a/daemon/postprocess/Repair.h +++ b/daemon/postprocess/Repair.h @@ -23,7 +23,7 @@ #include "DownloadInfo.h" #include "Thread.h" -#include "Script.h" +#include "ScriptController.h" #ifndef DISABLE_PARCHECK #include "ParChecker.h" diff --git a/daemon/postprocess/Unpack.h b/daemon/postprocess/Unpack.h index 53b189b8..91948b68 100644 --- a/daemon/postprocess/Unpack.h +++ b/daemon/postprocess/Unpack.h @@ -24,7 +24,7 @@ #include "Log.h" #include "Thread.h" #include "DownloadInfo.h" -#include "Script.h" +#include "ScriptController.h" class UnpackController : public Thread, public ScriptController { diff --git a/daemon/util/Script.cpp b/daemon/util/ScriptController.cpp similarity index 90% rename from daemon/util/Script.cpp rename to daemon/util/ScriptController.cpp index 05cb678b..6e26fc54 100644 --- a/daemon/util/Script.cpp +++ b/daemon/util/ScriptController.cpp @@ -14,12 +14,12 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #include "nzbget.h" -#include "Script.h" +#include "ScriptController.h" #include "Log.h" #include "Util.h" #include "FileSystem.h" @@ -236,10 +236,10 @@ void ScriptController::SetEnvVarSpecial(const char* prefix, const char* name, co void ScriptController::PrepareArgs() { + const char* extension = strrchr(m_args[0], '.'); + if (m_args.size() == 1 && !Util::EmptyStr(g_Options->GetShellOverride())) { - const char* extension = strrchr(m_args[0], '.'); - Tokenizer tok(g_Options->GetShellOverride(), ",;"); while (CString shellover = tok.Next()) { @@ -259,14 +259,17 @@ void ScriptController::PrepareArgs() } } + PrepareCmdLine(extension); +} + #ifdef WIN32 +void ScriptController::PrepareCmdLine(const char* extension) +{ *m_cmdLine = '\0'; - if (m_args.size() == 1) { // Special support for script languages: // automatically find the app registered for this extension and run it - const char* extension = strrchr(m_args[0], '.'); if (extension && strcasecmp(extension, ".exe") && strcasecmp(extension, ".bat") && strcasecmp(extension, ".cmd")) { debug("Looking for associated program for %s", extension); @@ -283,9 +286,9 @@ void ScriptController::PrepareArgs() { command[bufLen] = '\0'; CString scommand(command); - scommand.Replace("%L", "%1");// Python 3.x has %L in command instead of %1 + scommand.Replace("%L", "%1"); // Python 3.x has %L in command instead of %1 debug("Command: %s", scommand.Str()); - DWORD_PTR args[] = {(DWORD_PTR)*m_args[0], (DWORD_PTR)0}; + DWORD_PTR args[] = { (DWORD_PTR)*m_args[0], (DWORD_PTR)0 }; if (FormatMessage(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY, scommand, 0, 0, m_cmdLine, sizeof(m_cmdLine), (va_list*)args)) { @@ -299,8 +302,68 @@ void ScriptController::PrepareArgs() extension, FileSystem::BaseFileName(m_args[0])); } } +} #endif + +#ifndef WIN32 +void ScriptController::PrepareCmdLine(const char* extension) +{ + *m_cmdLine = '\0'; + m_cmdArgs.clear(); + if (m_args.size() == 1) + { + if (strcmp(extension, ".py") == 0) + { + if (std::system("python3 --version > /dev/null 2>&1") == 0) + { + strncpy(m_cmdLine, "python3", sizeof(m_cmdLine)); + m_cmdArgs.emplace_back("python3"); + debug("CmdLine: %s", m_cmdLine); + return; + } + if (std::system("python --version > /dev/null 2>&1") == 0) + { + strncpy(m_cmdLine, "python", sizeof(m_cmdLine)); + m_cmdArgs.emplace_back("python"); + debug("CmdLine: %s", m_cmdLine); + return; + } + if (std::system("py --version > /dev/null 2>&1") == 0) + { + strncpy(m_cmdLine, "py", sizeof(m_cmdLine)); + m_cmdArgs.emplace_back("py"); + debug("CmdLine: %s", m_cmdLine); + return; + } + } + if (strcmp(extension, ".sh") == 0) + { + if (std::system("bash --version > /dev/null 2>&1") == 0) + { + strncpy(m_cmdLine, "bash", sizeof(m_cmdLine)); + m_cmdArgs.emplace_back("bash"); + debug("CmdLine: %s", m_cmdLine); + return; + } + if (std::system("sh --version > /dev/null 2>&1") == 0) + { + strncpy(m_cmdLine, "sh", sizeof(m_cmdLine)); + m_cmdArgs.emplace_back("sh"); + debug("CmdLine: %s", m_cmdLine); + return; + } + } + warn("Could not find associated program for %s. Trying to execute %s directly", + extension, FileSystem::BaseFileName(m_args[0])); + strncpy(m_cmdLine, m_args[0], sizeof(m_cmdLine)); + return; + } + else + { + strncpy(m_cmdLine, m_args[0], sizeof(m_cmdLine)); + } } +#endif int ScriptController::Execute() { @@ -580,10 +643,9 @@ void ScriptController::StartProcess(int* pipein, int* pipeout) std::vector environmentStrings = m_environmentStrings.GetStrings(); char** envdata = environmentStrings.data(); - ArgList args; - std::copy(m_args.begin(), m_args.end(), std::back_inserter(args)); - args.emplace_back(nullptr); - char* const* argdata = (char* const*)args.data(); + std::copy(std::begin(m_args), std::end(m_args), std::back_inserter(m_cmdArgs)); + m_cmdArgs.emplace_back(nullptr); + char* const* argdata = (char* const*)m_cmdArgs.data(); #ifdef DEBUG debug("Starting process: %s", script); @@ -641,7 +703,7 @@ void ScriptController::StartProcess(int* pipein, int* pipeout) chdir(workingDir); environ = envdata; - execvp(script, argdata); + execvp(m_cmdLine, argdata); if (errno == EACCES) { @@ -650,7 +712,7 @@ void ScriptController::StartProcess(int* pipein, int* pipeout) write(1, "\n", 1); fsync(1); FileSystem::FixExecPermission(script); - execvp(script, argdata); + execvp(m_cmdLine, argdata); } // NOTE: the text "[ERROR] Could not start " is checked later, diff --git a/daemon/util/Script.h b/daemon/util/ScriptController.h similarity index 94% rename from daemon/util/Script.h rename to daemon/util/ScriptController.h index f8c77b8a..c4b92642 100644 --- a/daemon/util/Script.h +++ b/daemon/util/ScriptController.h @@ -14,12 +14,12 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ -#ifndef SCRIPT_H -#define SCRIPT_H +#ifndef SCRIPTCONTROLLER_H +#define SCRIPTCONTROLLER_H #include "NString.h" #include "Container.h" @@ -78,6 +78,7 @@ class ScriptController void ResetEnv(); void PrepareEnvOptions(const char* stripPrefix); void PrepareArgs(); + void PrepareCmdLine(const char* extension); virtual const char* GetOptValue(const char* name, const char* value) { return value; } void StartProcess(int* pipein, int* pipeout); int WaitProcess(); @@ -90,6 +91,7 @@ class ScriptController private: ArgList m_args; + ArgList m_cmdArgs; const char* m_workingDir = nullptr; CString m_infoName; const char* m_logPrefix = nullptr; @@ -100,10 +102,10 @@ class ScriptController bool m_needWrite = false; FILE* m_readpipe = 0; FILE* m_writepipe = 0; + char m_cmdLine[2048]; #ifdef WIN32 HANDLE m_processId = 0; DWORD m_dwProcessId = 0; - char m_cmdLine[2048]; #else pid_t m_processId = 0; #endif diff --git a/nzbget.vcxproj b/nzbget.vcxproj index 4566a45f..caedc7aa 100755 --- a/nzbget.vcxproj +++ b/nzbget.vcxproj @@ -273,7 +273,7 @@ - + @@ -392,7 +392,7 @@ - + diff --git a/scripts/EMail.py b/scripts/EMail.py index 5628f451..1932efd2 100755 --- a/scripts/EMail.py +++ b/scripts/EMail.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # # E-Mail post-processing script for NZBGet # diff --git a/scripts/Logger.py b/scripts/Logger.py index 3c111ab2..61fb4a65 100755 --- a/scripts/Logger.py +++ b/scripts/Logger.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # # Logger post-processing script for NZBGet # diff --git a/tests/postprocess/CMakeLists.txt b/tests/postprocess/CMakeLists.txt index 2d674d81..398b994f 100644 --- a/tests/postprocess/CMakeLists.txt +++ b/tests/postprocess/CMakeLists.txt @@ -20,7 +20,7 @@ file(GLOB PostprocessTestsSrc ${CMAKE_SOURCE_DIR}/daemon/util/Util.cpp ${CMAKE_SOURCE_DIR}/daemon/util/Thread.cpp ${CMAKE_SOURCE_DIR}/daemon/util/Log.cpp - ${CMAKE_SOURCE_DIR}/daemon/util/Script.cpp + ${CMAKE_SOURCE_DIR}/daemon/util/ScriptController.cpp ${CMAKE_SOURCE_DIR}/daemon/util/FileSystem.cpp ${CMAKE_SOURCE_DIR}/daemon/queue/DownloadInfo.cpp ${CMAKE_SOURCE_DIR}/daemon/queue/DiskState.cpp diff --git a/windows/build-nzbget-vs22.bat b/windows/build-nzbget-vs22.bat index 1d99fde3..79be6098 100644 --- a/windows/build-nzbget-vs22.bat +++ b/windows/build-nzbget-vs22.bat @@ -225,15 +225,6 @@ mkdir ..\distrib\NZBGet\scripts xcopy /E scripts ..\distrib\NZBGet\scripts if errorlevel 1 goto BUILD_FAILED -rem The default PATH to python changed in most POSIX systems after python2 was deprecated. -rem On Windows, it remained the same. -rem Now we need to add Windows specific shebang (#!/usr/bin/env python) to the scripts. -set "SCRIPTS=..\distrib\NZBGet\scripts\EMail.py ..\distrib\NZBGet\scripts\Logger.py" -for %%F in (%SCRIPTS%) do ( - %SED% -e "s|#!/usr/bin/env python3|#!/usr/bin/env python|" -i %%F -) -if errorlevel 1 goto BUILD_FAILED - copy ..\..\image\* ..\distrib\NZBGet copy ..\..\image\32\* ..\distrib\NZBGet\32 copy ..\..\image\64\* ..\distrib\NZBGet\64 From 341e1d43312a0a0e54ce5a182e6be04c79c870e1 Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Fri, 22 Dec 2023 14:27:14 +0300 Subject: [PATCH 15/34] Change docker unpack commands to match alpine packages (#79) --- docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 6a533a76..7128ea1c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -23,8 +23,8 @@ RUN \ -e "s#^ScriptDir=.*#ScriptDir=$\{MainDir\}/scripts#g" \ -e "s#^WebDir=.*#WebDir=$\{AppDir\}/webui#g" \ -e "s#^ConfigTemplate=.*#ConfigTemplate=$\{AppDir\}/webui/nzbget.conf.template#g" \ - -e "s#^UnrarCmd=.*#UnrarCmd=$\{AppDir\}/unrar#g" \ - -e "s#^SevenZipCmd=.*#SevenZipCmd=$\{AppDir\}/7za#g" \ + -e "s#^UnrarCmd=.*#UnrarCmd=unrar#g" \ + -e "s#^SevenZipCmd=.*#SevenZipCmd=7z#g" \ -e "s#^CertStore=.*#CertStore=$\{AppDir\}/cacert.pem#g" \ -e "s#^CertCheck=.*#CertCheck=yes#g" \ -e "s#^DestDir=.*#DestDir=$\{MainDir\}/completed#g" \ From becca5eb8bf0d37157564a0e1d578a1ed2f05dc6 Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Wed, 27 Dec 2023 14:22:44 +0300 Subject: [PATCH 16/34] Testing release update (#82) --- .github/workflows/build.yml | 22 +++--- webui/config.js | 143 +++++------------------------------- webui/index.html | 13 +--- 3 files changed, 35 insertions(+), 143 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57371068..169e12a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,13 +87,21 @@ jobs: nzbget-synology-packages make-testing-release: - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] needs: [generate-signatures] permissions: contents: write if: github.ref_name == 'develop' steps: + - name: Delete tag and release + uses: dev-drprasad/delete-tag-and-release@v0.2.1 + with: + delete_release: true + tag_name: testing + env: + GITHUB_TOKEN: ${{ github.token }} + - name: Download build artifacts uses: actions/download-artifact@v3 @@ -102,14 +110,6 @@ jobs: cp $(find nzbget-installers/ -name *linux.run) nzbget-installers/nzbget-latest-testing-bin-linux.run cp $(find nzbget-installers/ -name *windows-setup.exe) nzbget-installers/nzbget-latest-testing-bin-windows-setup.exe - - name: Delete tag and release - uses: dev-drprasad/delete-tag-and-release@v0.2.1 - with: - delete_release: true - tag_name: testing - env: - GITHUB_TOKEN: ${{ github.token }} - - name: Make release uses: ncipollo/release-action@v1 with: @@ -118,3 +118,7 @@ jobs: tag: testing allowUpdates: true prerelease: true + + - name: Update website info + run: | + bash /build/update-release-info.sh diff --git a/webui/config.js b/webui/config.js index 84a01fc1..f3fca238 100644 --- a/webui/config.js +++ b/webui/config.js @@ -2676,7 +2676,6 @@ var RestoreSettingsDialog = (new function($) /*** UPDATE DIALOG *******************************************************/ -// Version 22.0 : no check for test and develop update. For activate - uncomment commented lines and delete apropriate added lines. var UpdateDialog = (new function($) { 'use strict' @@ -2699,7 +2698,7 @@ var UpdateDialog = (new function($) this.init = function() { $UpdateDialog = $('#UpdateDialog'); - $('#UpdateDialog_InstallStable,#UpdateDialog_InstallTesting,#UpdateDialog_InstallDevel').click(install); + $('#UpdateDialog_InstallStable,#UpdateDialog_InstallTesting').click(install); $UpdateProgressDialog = $('#UpdateProgressDialog'); $UpdateProgressDialog_Log = $('#UpdateProgressDialog_Log'); $UpdateDialog_Close = $('#UpdateDialog_Close'); @@ -2776,45 +2775,7 @@ var UpdateDialog = (new function($) function loadedUpstreamInfo(data) { VersionInfo = parseJsonP(data); - if (VersionInfo['devel-version'] || !foreground) - { - loadPackageInfo(); - } - else - { - loadGitVerData(loadPackageInfo); - } - } - - // Version 22.0 : no check for test and develop update. For activate - change links to actual ones - function loadGitVerData(callback) - { - // fetching devel version number from github web-site - RPC.call('readurl', ['https://github.com/nzbget/nzbget', 'nzbget git revision info'], - function(gitRevData) - { - RPC.call('readurl', ['https://raw.githubusercontent.com/nzbget/nzbget/develop/configure.ac', 'nzbget git branch info'], - function(gitBranchData) - { - var html = document.createElement('DIV'); - html.innerHTML = gitRevData; - html = html.textContent || html.innerText || ''; - html = html.replace(/(?:\r\n|\r|\n)/g, ' '); - var rev = html.match(/([0-9\,]*)\s*commits/); - - if (rev && rev.length > 1) - { - rev = rev[1].replace(',', ''); - var ver = gitBranchData.match(/AC_INIT\(nzbget, (.*), .*/); - if (ver && ver.length > 1) - { - VersionInfo['devel-version'] = ver[1] + '-r' + rev; - } - } - - callback(); - }, callback); - }, callback); + loadPackageInfo(); } function loadPackageInfo() @@ -2845,23 +2806,6 @@ var UpdateDialog = (new function($) loadedAll(); } - function formatTesting(str) - { - return str.replace('-testing-', '-'); - } - - function revision(version) - { - var rev = version.match(/.*r(\d+)/); - return rev && rev.length > 1 ? parseInt(rev[1]) : 0; - } - - function vernumber(version) - { - var ver = version.match(/([\d.]+).*/); - return ver && ver.length > 1 ? parseFloat(ver[1]) : 0; - } - function loadedAll() { var installedVersion = Options.option('Version'); @@ -2871,37 +2815,23 @@ var UpdateDialog = (new function($) $('#UpdateDialog_InstalledInfo').show(); $('#UpdateDialog_CurStable').text(VersionInfo['stable-version'] ? VersionInfo['stable-version'] : 'no data'); - //$('#UpdateDialog_CurTesting').text(VersionInfo['testing-version'] ? formatTesting(VersionInfo['testing-version']) : 'no data'); - //$('#UpdateDialog_CurDevel').text(VersionInfo['devel-version'] ? formatTesting(VersionInfo['devel-version']) : 'no data'); - $('#UpdateDialog_CurTesting').text('N/A'); - $('#UpdateDialog_CurDevel').text('N/A'); + $('#UpdateDialog_CurTesting').text(VersionInfo['testing-version'] ? VersionInfo['testing-version'] : 'no data'); $('#UpdateDialog_CurNotesStable').attr('href', VersionInfo['stable-release-notes']); - //$('#UpdateDialog_CurNotesTesting').attr('href', VersionInfo['testing-release-notes']); - //$('#UpdateDialog_CurNotesDevel').attr('href', VersionInfo['devel-release-notes']); - $('#UpdateDialog_CurNotesTesting').attr('href', ''); - $('#UpdateDialog_CurNotesDevel').attr('href', ''); + $('#UpdateDialog_CurNotesTesting').attr('href', VersionInfo['testing-release-notes']); $('#UpdateDialog_DownloadStable').attr('href', VersionInfo['stable-download']); - //$('#UpdateDialog_DownloadTesting').attr('href', VersionInfo['testing-download']); - $('#UpdateDialog_DownloadTesting').attr('href', ''); + $('#UpdateDialog_DownloadTesting').attr('href', VersionInfo['testing-download']); Util.show('#UpdateDialog_CurNotesStable', VersionInfo['stable-release-notes']); - //Util.show('#UpdateDialog_CurNotesTesting', VersionInfo['testing-release-notes']); - //Util.show('#UpdateDialog_CurNotesDevel', VersionInfo['devel-release-notes']); - Util.show('#UpdateDialog_CurNotesTesting', ''); - Util.show('#UpdateDialog_CurNotesDevel', ''); + Util.show('#UpdateDialog_CurNotesTesting', VersionInfo['testing-release-notes']); $('#UpdateDialog_AvailStable').text(UpdateInfo['stable-version'] ? UpdateInfo['stable-version'] : 'not available'); - //$('#UpdateDialog_AvailTesting').text(UpdateInfo['testing-version'] ? formatTesting(UpdateInfo['testing-version']) : 'not available'); - //$('#UpdateDialog_AvailDevel').text(UpdateInfo['devel-version'] ? formatTesting(UpdateInfo['devel-version']) : 'not available'); - $('#UpdateDialog_AvailTesting').text(''); - $('#UpdateDialog_AvailDevel').text(''); - - + $('#UpdateDialog_AvailTesting').text(UpdateInfo['testing-version'] ? UpdateInfo['testing-version'] : 'not available'); + if (UpdateInfo['stable-version'] === VersionInfo['stable-version'] && UpdateInfo['testing-version'] === VersionInfo['testing-version']) { - $('#UpdateDialog_AvailStableBlock,#UpdateDialog_AvailTestingBlock,#UpdateDialog_AvailDevelBlock').hide(); + $('#UpdateDialog_AvailStableBlock,#UpdateDialog_AvailTestingBlock').hide(); $('#UpdateDialog_AvailRow .update-row-name').text(''); $('#UpdateDialog_AvailRow td').css('border-style', 'none'); } @@ -2909,57 +2839,35 @@ var UpdateDialog = (new function($) $('#UpdateDialog_DownloadRow td').css('border-style', 'none'); $('#UpdateDialog_AvailNotesStable').attr('href', UpdateInfo['stable-package-info']); - //$('#UpdateDialog_AvailNotesTesting').attr('href', UpdateInfo['testing-package-info']); - //$('#UpdateDialog_AvailNotesDevel').attr('href', UpdateInfo['devel-package-info']); - $('#UpdateDialog_AvailNotesTesting').attr('href', ''); - $('#UpdateDialog_AvailNotesDevel').attr('href', ''); + $('#UpdateDialog_AvailNotesTesting').attr('href', UpdateInfo['testing-package-info']); Util.show('#UpdateDialog_AvailNotesStableBlock', UpdateInfo['stable-package-info']); - //Util.show('#UpdateDialog_AvailNotesTestingBlock', UpdateInfo['testing-package-info']); - //Util.show('#UpdateDialog_AvailNotesDevelBlock', UpdateInfo['devel-package-info']); - Util.show('#UpdateDialog_AvailNotesTestingBlock', ''); - Util.show('#UpdateDialog_AvailNotesDevelBlock', ''); + Util.show('#UpdateDialog_AvailNotesTestingBlock', UpdateInfo['testing-package-info']); - var installedVer = vernumber(installedVersion); - var installedRev = revision(installedVersion); - var installedTesting = installedRev > 0 || installedVersion.indexOf('testing') > -1; + var installedVer = installedVersion; + var installedTesting = installedVersion.indexOf('testing') > -1; var canInstallStable = UpdateInfo['stable-version'] && - ((installedVer < vernumber(UpdateInfo['stable-version'])) || - (installedTesting && installedVer === vernumber(UpdateInfo['stable-version']))); + (installedVer < UpdateInfo['stable-version']); var canInstallTesting = UpdateInfo['testing-version'] && - ((installedVer < vernumber(UpdateInfo['testing-version'])) || - (installedTesting && installedVer === vernumber(UpdateInfo['testing-version'])) && - installedRev < revision(UpdateInfo['testing-version'])); - var canInstallDevel = UpdateInfo['devel-version'] && - ((installedVer < vernumber(UpdateInfo['devel-version'])) || - (installedTesting && installedVer === vernumber(UpdateInfo['devel-version'])) && - installedRev < revision(UpdateInfo['devel-version'])); + (installedVer < UpdateInfo['testing-version']); - // Version 22.0 : no check for test and develop update. For activate - delete the following line - canInstallTesting = ''; Util.show('#UpdateDialog_InstallStable', canInstallStable); Util.show('#UpdateDialog_InstallTesting', canInstallTesting); - Util.show('#UpdateDialog_InstallDevel', canInstallDevel); var canDownloadStable = - ((installedVer < vernumber(VersionInfo['stable-version'])) || - (installedTesting && installedVer === vernumber(VersionInfo['stable-version']))); + (installedVer < VersionInfo['stable-version']); var canDownloadTesting = - ((installedVer < vernumber(VersionInfo['testing-version'])) || - (installedTesting && installedVer === vernumber(VersionInfo['testing-version']) && - installedRev < revision(VersionInfo['testing-version']))); + (installedVer < VersionInfo['testing-version']); - // Version 22.0 : no check for test and develop update. For activate - delete the following line - canDownloadTesting = ''; Util.show('#UpdateDialog_DownloadStable', canDownloadStable); Util.show('#UpdateDialog_DownloadTesting', canDownloadTesting); var hasUpdateSource = PackageInfo['update-info-link'] || PackageInfo['update-info-script']; - var hasUpdateInfo = UpdateInfo['stable-version'] || UpdateInfo['testing-version'] || UpdateInfo['devel-version']; - var canUpdate = canInstallStable || canInstallTesting || canInstallDevel; + var hasUpdateInfo = UpdateInfo['stable-version'] || UpdateInfo['testing-version']; + var canUpdate = canInstallStable || canInstallTesting; var canDownload = canDownloadStable || canDownloadTesting; Util.show('#UpdateDialog_UpdateAvail', canUpdate); Util.show('#UpdateDialog_UpdateNotAvail', !canUpdate && !canDownload); @@ -2973,19 +2881,6 @@ var UpdateDialog = (new function($) (canInstallTesting || canDownloadTesting) && notificationAllowed('testing')))) { $UpdateDialog.modal({backdrop: 'static'}); - loadDevelVersionInfo(); - } - } - - function loadDevelVersionInfo() - { - if (!VersionInfo['devel-version']) - { - $('#UpdateDialog_CurDevel').text('loading...'); - loadGitVerData(function() - { - $('#UpdateDialog_CurDevel').text(VersionInfo['devel-version'] ? formatTesting(VersionInfo['devel-version']) : 'no data'); - }); } } diff --git a/webui/index.html b/webui/index.html index db5e364b..dd92be2f 100644 --- a/webui/index.html +++ b/webui/index.html @@ -2639,9 +2639,8 @@

Update NZBGet

- Stable - Testing - Development + Stable + Testing @@ -2651,8 +2650,6 @@

Update NZBGet

release notes 12.0-r870
release notes - 12.0-r880
- code log For your platform @@ -2662,15 +2659,11 @@

Update NZBGet


package info
Install -
- package info
- Install Download - Download - + Download From a96dfa87ffb6cf270925c884442795e8228a62be Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 10 Jan 2024 17:45:42 +0300 Subject: [PATCH 17/34] extra information on how to migrate (#101) * extra information on how to migrate * extra space missed --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 7d883341..6da3633b 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,12 @@ We also provide a docker image for popular architectures. [Docker readme](docker Synology DSM 7.x packages also available. [Synology readme](synology/README.md) +## Migration from older NZBGet versions + +[Migrating from NZBGet v21 or older](https://github.com/nzbgetcom/nzbget/discussions/100#discussioncomment-8080102) + +[Migrating from older Docker images](https://github.com/nzbgetcom/nzbget/issues/84#issuecomment-1884846500) + ## Supported platforms for installers `Windows`: Windows 7 and later, 32 or 64 Bit. From cf098f23b07c7b020c28c2a5c3792534bd8370f3 Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Thu, 11 Jan 2024 17:56:16 +0300 Subject: [PATCH 18/34] Add to postuninst hook full cleanup SYNOPKG_PKGVAR (#136) --- synology/package/scripts/postuninst | 1 + 1 file changed, 1 insertion(+) diff --git a/synology/package/scripts/postuninst b/synology/package/scripts/postuninst index 0c02027b..6511a1d2 100755 --- a/synology/package/scripts/postuninst +++ b/synology/package/scripts/postuninst @@ -3,6 +3,7 @@ if [ "$wizard_keep_data" != "true" ]; then rm $CFG + rm $SYNOPKG_PKGVAR/* fi exit 0 From e7de778b5996ef55c0124be52fca9b491abd1f57 Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Fri, 12 Jan 2024 15:08:58 +0300 Subject: [PATCH 19/34] Update build instructions (#137) --- README.md | 8 +- linux/{build-info.txt => build-info.md} | 143 +++++++++++++----------- 2 files changed, 86 insertions(+), 65 deletions(-) rename linux/{build-info.txt => build-info.md} (63%) diff --git a/README.md b/README.md index 6da3633b..9768c481 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,13 @@ Synology DSM 7.x packages also available. [Synology readme](synology/README.md) ## Building from sources -Please follow [instructions](https://nzbget.com/documentation/building-development-version/) on the website +[General instructions](INSTALLATION.md) + +[Linux cross-compiling / buildroot](linux/build-info.md) + +[macOS](osx/build-info.md) + +[Synology](synology/build-info.md) ## Contribution diff --git a/linux/build-info.txt b/linux/build-info.md similarity index 63% rename from linux/build-info.txt rename to linux/build-info.md index 8cb10ba1..ff767d45 100644 --- a/linux/build-info.txt +++ b/linux/build-info.md @@ -25,22 +25,22 @@ Building toolchains 2. Put the build script 'build-nzbget' into that directory; 3. Create subdirectories: - toolchain - for toolchains; - nzbget - for source code of NZBGet; - output - to store the results of build script; - setup - for extra files required for installer; + - toolchain - for toolchains; + - nzbget - for source code of NZBGet; + - output - to store the results of build script; + - setup - for extra files required for installer; 4. Build buildroot-toolchain for one CPU-architecture: - 4.1. Download Buildroot distribution archive 'buildroot-2015.08.01' from + - Download Buildroot distribution archive 'buildroot-2015.08.01' from http://buildroot.uclibc.org/download.html. If you choose other version the instructions may not apply exactly; - 4.2. Unpack the tarball into 'toolchain'-directory; - 4.3. Rename the buildroot-directory according to the target CPU-architecture name, + - Unpack the tarball into 'toolchain'-directory; + - Rename the buildroot-directory according to the target CPU-architecture name, for example 'x86_64' or 'armhf'; Be careful here, after the toolchain is built the directory cannot be renamed or moved, you will have to rebuild the toolchain if you want another name; - 4.4. Run 'make menuconfig'; - 4.5. Configure toolchain: + - Run 'make menuconfig'; + - Configure toolchain: - Target architecture: - choose your target architecture; - Build options: @@ -64,7 +64,7 @@ Building toolchains - JSON/XML: libxml2; - Text and terminal handling: ncurses; - Save configuration and exit; - 4.6. Do few extra manual adjustments: + - Do few extra manual adjustments: - in 'packages/ncurses/ncurses.mk' add extra configure parameters to option 'NCURSES_CONF_OPTS‘ (with quotation marks): "--with-fallbacks=xterm xterm-color xterm-256color xterm-16color linux vt100 vt200"; @@ -73,91 +73,101 @@ Building toolchains '--enable-static-nss'; - in directory 'packages/glibc/2.20' create new file with name 'allocatestack-pax.patch' with the following content; the patch fixes incompatibility with hardened kernels: ->>> START OF 'allocatestack-pax.patch' - this line marker is not part of the file >>> ---- a/nptl/allocatestack.c 2014-09-07 10:09:09.000000000 +0200 -+++ b/nptl/allocatestack.c 2017-11-02 18:02:47.165016000 +0100 -@@ -78,6 +78,7 @@ - #ifndef STACK_ALIGN - # define STACK_ALIGN __alignof__ (long double) - #endif -+#define PF_X 0 - - /* Default value for minimal stack size after allocating thread - descriptor and guard. */ -<<< END OF 'allocatestack-pax.patch' - this line marker is not part of the file <<< - 4.7. Run 'make' to build the toolchain. It may take an hour or less depending + ``` + >>> START OF 'allocatestack-pax.patch' - this line marker is not part of the file >>> + --- a/nptl/allocatestack.c 2014-09-07 10:09:09.000000000 +0200 + +++ b/nptl/allocatestack.c 2017-11-02 18:02:47.165016000 +0100 + @@ -78,6 +78,7 @@ + #ifndef STACK_ALIGN + # define STACK_ALIGN __alignof__ (long double) + #endif + +#define PF_X 0 + + /* Default value for minimal stack size after allocating thread + descriptor and guard. */ + <<< END OF 'allocatestack-pax.patch' - this line marker is not part of the file <<< + ``` + - Run 'make' to build the toolchain. It may take an hour or less depending on your hardware; - 4.8. If C library 'glibc' was chosen extra steps are needed to build proper + - If C library 'glibc' was chosen extra steps are needed to build proper static libraries of OpenSSL in addition to already built dynamic libraries (which are also required): - delete directory 'output/build/openssl-x.x.x'; - in 'packages/openssl/openssl.mk' replace - '$(if $(BR2_STATIC_LIBS),no-shared,shared)' with - '$(if $(BR2_STATIC_LIBS),no-shared,no-shared)' - and replace '$(if $(BR2_STATIC_LIBS),no-dso,dso)' with - '$(if $(BR2_STATIC_LIBS),no-dso,no-dso)'; + + `'$(if $(BR2_STATIC_LIBS),no-shared,shared)'` with + + `'$(if $(BR2_STATIC_LIBS),no-shared,no-shared)'` + + and replace + + `'$(if $(BR2_STATIC_LIBS),no-dso,dso)'` with + + `'$(if $(BR2_STATIC_LIBS),no-dso,no-dso)'` - from root directory of toolchain run 'make' again; - openssl will be rebuilt without shared libraries support; - installation step of openssl fails with message: - "chmod: cannot access ‘../lib/engines/lib*.so’: No such file or directory"; + + `"chmod: cannot access ‘../lib/engines/lib*.so’: No such file or directory";` + - ignore the error, static libraries of openssl are already installed and will be used by NZBGet; 5. Now you should have a working toolchain for one CPU-architecture, let's test it. - 5.1. Change to the ROOTBUILD-directory and run the build script: - + - Change to the ROOTBUILD-directory and run the build script: + ``` ./build-nzbget release bin - - 5.2. The script creates subdirectory 'nzbget/trunk' and checkouts the source + ``` + - The script creates subdirectory 'nzbget/trunk' and checkouts the source code of NZBGet from subversion repository; - 5.3. Then the source code is compiled for chosen CPU-architecture; - 5.4. After the compiling a distribution binary archive for the chosen + - Then the source code is compiled for chosen CPU-architecture; + - After the compiling a distribution binary archive for the chosen CPU-architecture is put into output-directory; 6. Build unrar and 7za for the CPU-architecture: - 6.1. Download source of unrar; Compile for target, either manually or + - Download source of unrar; Compile for target, either manually or using script 'build-unpack'; - 6.2. Put the compiled binaries of unrar and 7za into setup-directory, add + - Put the compiled binaries of unrar and 7za into setup-directory, add suffix '-arch' to unrar and 7za names, for example 'unrar-armel'; - 6.3. Copy license-files from unrar and 7-Zip projects using names + - Copy license-files from unrar and 7-Zip projects using names 'license-unrar.txt' and 'license-7zip.txt'; 7. Now you can build installer for that one CPU-architecture: - 7.1. If you build for CPU-architecture which is not supported by NZBGet's + - If you build for CPU-architecture which is not supported by NZBGet's universal installer you have to edit the script 'build-nzbget' and add the architecture name into variable 'ALLTARGETS'; - 7.2. Run the build script with: - + - Run the build script with: + ``` ./build-nzbget release installer - - 7.3. The created installer supports only one CPU-Architecture; - 7.8. Run the installer on the target machine (with target CPU-Architecture); + ``` + - The created installer supports only one CPU-Architecture; + - Run the installer on the target machine (with target CPU-Architecture); 8. Repeat step for each CPU-Architecture you intend to build the installer for; 9. To build installer for FreeBSD we need a cross-compiling toolhcain: - 9.1. Create directory 'x86_64-bsd' inside your toolchain-directory; - 9.2. Copy file 'build-toolchain-freebsd' into that directory; - 9.3. Execute the script build script: - + - Create directory 'x86_64-bsd' inside your toolchain-directory; + - Copy file 'build-toolchain-freebsd' into that directory; + - Execute the script build script: + ``` ./build-toolchain-freebsd + ``` + The script downloads and build the full cross-compiling toolchain. - The script downloads and build the full cross-compiling toolchain. - - 9.4 To test the FreeBSD toolchain start 'build-nzbget' with following parameters: - + - To test the FreeBSD toolchain start 'build-nzbget' with following parameters: + ``` ./build-nzbget x86_64-bsd release - + ``` 10. To build installer for all CPU-Architectures listed in variable 'ALLTARGETS' of the script run the script without choosing CPU-Architecture: - + ``` ./build-nzbget release - + ``` 11. When the script is run without any parameters: - 11.1. NZBGet is compiled twice for each CPU-Architecture listed in + - NZBGet is compiled twice for each CPU-Architecture listed in 'ALLTARGETS': once in release mode and once in debug mode; - 11.2. Four installers are built: one for release and another for debug for + - Four installers are built: one for release and another for debug for each supported platform - Linux and FreeBSD. @@ -166,19 +176,24 @@ Special functions By default the script builds from HEAD of develop branch. To specify another tag or branch pass it to the script, for example to build a tagged version 14.2: - ./build-nzbget release bin tags/v16.0 +``` +./build-nzbget release bin tags/v16.0 +``` Installers can be built only for version 15.0 and newer. Distribution archives can be built for older versions too. To build on certain history point pass commit SHA to the script, for example - - ./build-nzbget release bin 13f5ab738880671a8d8381ef0fabc625e269eeef +``` +./build-nzbget release bin 13f5ab738880671a8d8381ef0fabc625e269eeef +``` To cleanup the output directory before building pass parameter 'cleanup': - - ./build-nzbget release cleanup +``` +./build-nzbget release cleanup +``` To improve compilation speed activate pre-compiled headers and multicore make: - - ./build-nzbget release pch core4 +``` +./build-nzbget release pch core4 +``` From e7b3b176651922507f50bdbee5b71acd4f308884 Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Tue, 16 Jan 2024 13:13:51 +0300 Subject: [PATCH 20/34] Docker fixes: disable OCI mediatypes (#140) --- .github/workflows/docker.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 149fffed..af473898 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -68,7 +68,7 @@ jobs: provenance: false push: true tags: ${{ steps.gen_tags.outputs.tags }} - outputs: "type=image,name=${{ env.REGISTRY_IMAGE }},annotation-index.org.opencontainers.image.description=NZBGet from nzbget.com - version ${{ steps.gen_tags.outputs.version }}" + outputs: "type=image,oci-mediatypes=false,name=${{ env.REGISTRY_IMAGE }}" build-args: | "NZBGET_RELEASE=${{ github.ref_name }}" "MAKE_JOBS=2" @@ -80,3 +80,12 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} repository: ${{ env.REGISTRY_IMAGE }} readme-filepath: ./docker/README.md + + - name: Cleanup ghcr.io from outdated images + uses: miklinux/ghcr-cleanup-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + package-owner: nzbgetcom + package-name: nzbget + delete-orphans: true + dry-run: false From 1e1590ac6e8ed3ef4c882bbd8e5682b9cfce27fe Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Tue, 16 Jan 2024 16:14:33 +0300 Subject: [PATCH 21/34] Update Synology docs (#141) --- README.md | 2 +- synology/README.md | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9768c481..956ba114 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Please download binaries from our [releases](https://github.com/nzbgetcom/nzbget We also provide a docker image for popular architectures. [Docker readme](docker/README.md) -Synology DSM 7.x packages also available. [Synology readme](synology/README.md) +Synology packages are available as SynoCommunity packages and SPK packages. [Synology readme](synology/README.md) ## Migration from older NZBGet versions diff --git a/synology/README.md b/synology/README.md index 03b1b513..a0f41646 100644 --- a/synology/README.md +++ b/synology/README.md @@ -1,5 +1,28 @@ # Synology nzbget packages +We support Synology via SynoCommunity package (DSM 3.x / 6.x / 7.x) and native SPK package (DSM 7.x) for manual installation. + +* [SynoCommunity package (DSM 3.x / 6.x / 7.x)](#synocommunity-package) +* [SPK package (DSM 7.x)](#spk-package) +* [Switch between SynoCommunity package and SPK](#switch-between-synocommunity-package-and-spk) + + +# SynoCommunity package + +DSM versions: 3.x / 6.x / 7.x + +https://synocommunity.com/package/nzbget + +If you don't have SynoCommunity repository added on your device - please follow easy install instructions https://synocommunity.com/ + +If you have SynoCommunity added on your device - please simply install NZBGet under `Packages` - `Community` + +If you have installed original NZBGet version (package version `20220406-29` and below) - upgrade to nzbgetcom version (latest / `20240115-30`) + +# SPK package + +DSM versions: 7.x + ## Package versions We provide native packages for most Synology platforms (DSM 7.x). To select a correct package for yours platform please find Synology model in [Synology NAS list](https://kb.synology.com/en-us/DSM/tutorial/What_kind_of_CPU_does_my_NAS_have) and select package based on `Package Arch` field: @@ -51,3 +74,15 @@ When installed, the package adds all the necessary permissions for the selected ## Extensions You can put custom extension in `ScriptDir` directory. During installation this directory appears in `selected_shared_folder\selected_download_directory\scripts` and populates with default scripts (Email and Logger). Synology DSM 7.x bundled with python 3.8, so you must make sure that the script you are installing supports it. Our forks of VideoSort/FailureLink/FakeDetector are tested and working. + +# Switch between SynoCommunity package and SPK + +- backup settings via WebUI +- remove old package completely (with wipe settings) +- install new version +- restore needeed settings +- fix download directory permissions (if needed) + +## Known issues: + +- if you switch from our old native SPK package to SynoCommunity, you may get an error running the package. To fix - install latest testing SPK for your platform and remove it completely (this error fixed in latest SPK) OR uninstall SynoCommunity package completely (with wipe settings) and reinstall again. From fcc104dc294a905155f65e93483de4a1f40d843e Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Wed, 24 Jan 2024 14:49:29 +0300 Subject: [PATCH 22/34] Add mipseb mipsel ppc6xx ppc500 architectures to linux build (#146) --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4066c64b..be26f7f3 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -29,7 +29,7 @@ jobs: rm -rf /build/output cp -r . /build/nzbget cd /build - docker run -e ALL_ARCHS="i686 x86_64 aarch64 armhf armel" -v /build:/build nzbget-build /build/scripts/build-nzbget-ci.sh + docker run -e ALL_ARCHS="i686 x86_64 aarch64 armhf armel mipseb mipsel ppc6xx ppc500" -v /build:/build nzbget-build /build/scripts/build-nzbget-ci.sh - name: Rename build artifacts if: github.ref_name != 'main' && github.ref_name != 'develop' From 851537017fbb0ee6a6273a14fa1e4654c9834beb Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Fri, 26 Jan 2024 12:53:25 +0300 Subject: [PATCH 23/34] Update 7za link in docker container (#147) --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 7128ea1c..b0516d03 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -34,7 +34,7 @@ RUN \ /app/nzbget/share/nzbget/nzbget.conf && \ mv /app/nzbget/share/nzbget/webui /app/nzbget/ && \ cp /app/nzbget/share/nzbget/nzbget.conf /app/nzbget/webui/nzbget.conf.template && \ - ln -s /usr/bin/7za /app/nzbget/7za && \ + ln -s /usr/bin/7z /app/nzbget/7za && \ ln -s /usr/bin/unrar /app/nzbget/unrar && \ cp /nzbget/pubkey.pem /app/nzbget/pubkey.pem && \ curl -o /app/nzbget/cacert.pem -L "https://curl.se/ca/cacert.pem" && \ From 16ab25d5780c8100309c44eb60d505afe5c528db Mon Sep 17 00:00:00 2001 From: Denis <146707790+dnzbk@users.noreply.github.com> Date: Fri, 26 Jan 2024 15:23:39 +0300 Subject: [PATCH 24/34] Fix: possible memory corruption (#148) - fixed possible memory corruption inspired by reports from nzbget-ng --- daemon/util/NString.cpp | 9 ++++++++- lib/par2/reedsolomon.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/daemon/util/NString.cpp b/daemon/util/NString.cpp index 584b1320..df41ec70 100644 --- a/daemon/util/NString.cpp +++ b/daemon/util/NString.cpp @@ -155,7 +155,14 @@ void CString::AppendFmtV(const char* format, va_list ap) int curLen = Length(); int newLen = curLen + addLen; - m_data = (char*)realloc(m_data, newLen + 1); + + char* newData = (char*)realloc(m_data, newLen + 1); + if (newData == nullptr) + { + return; + } + + m_data = newData; vsnprintf(m_data + curLen, newLen + 1, format, ap2); diff --git a/lib/par2/reedsolomon.h b/lib/par2/reedsolomon.h index 306bb8d2..591d3c86 100644 --- a/lib/par2/reedsolomon.h +++ b/lib/par2/reedsolomon.h @@ -122,7 +122,7 @@ inline ReedSolomon::ReedSolomon(std::ostream& cout, std::ostream& cerr) : datamissingindex = 0; database = 0; - outputrows.empty(); + outputrows.clear(); outputcount = 0; From 5956a17e2618480dbbc423e6a515313165f817db Mon Sep 17 00:00:00 2001 From: Denis <146707790+dnzbk@users.noreply.github.com> Date: Fri, 2 Feb 2024 16:27:06 +0300 Subject: [PATCH 25/34] Feature/certificate verification levels (#150) - Added Certificate verification levels: - None: NO certificate signing check, NO certificate hostname check - Minimal: certificate signing check, NO certificate hostname check - Strict: certificate signing check, certificate hostname check - Tested on a mock nzbget NNTP nserv server with self-signed certificate and got expected results: - "Strict" -> test failed - "Minimal" -> test failed - "None" -> test passed" Co-authored-by: ureyNZB --- daemon/connect/Connection.cpp | 7 ++++++- daemon/connect/Connection.h | 9 +++++++-- daemon/connect/TlsSocket.cpp | 15 +++++++++++---- daemon/connect/TlsSocket.h | 5 +++-- daemon/main/Options.cpp | 15 +++++++++++++-- daemon/main/Options.h | 9 ++++++++- daemon/main/nzbget.cpp | 7 ++++--- daemon/nntp/ArticleDownloader.cpp | 4 ++++ daemon/nntp/NewsServer.cpp | 4 ++-- daemon/nntp/NewsServer.h | 4 +++- daemon/nntp/NntpConnection.cpp | 4 ++++ daemon/remote/XmlRpc.cpp | 13 +++++++++++-- nzbget.conf | 9 +++++++++ webui/config.js | 16 +++++++++++++++- 14 files changed, 100 insertions(+), 21 deletions(-) diff --git a/daemon/connect/Connection.cpp b/daemon/connect/Connection.cpp index 390a6523..86e5bae4 100644 --- a/daemon/connect/Connection.cpp +++ b/daemon/connect/Connection.cpp @@ -23,6 +23,7 @@ #include "Connection.h" #include "Log.h" #include "FileSystem.h" +#include "Options.h" static const int CONNECTION_READBUFFER_SIZE = 1024; #ifndef HAVE_GETADDRINFO @@ -120,6 +121,9 @@ Connection::Connection(const char* host, int port, bool tls) : debug("Creating Connection"); m_readBuf.Reserve(CONNECTION_READBUFFER_SIZE + 1); +#ifndef DISABLE_TLS + m_certVerifLevel = Options::ECertVerifLevel::cvStrict; +#endif } Connection::Connection(SOCKET socket, bool tls) @@ -138,6 +142,7 @@ Connection::Connection(SOCKET socket, bool tls) #ifndef DISABLE_TLS m_tlsSocket = nullptr; m_tlsError = false; + m_certVerifLevel = Options::ECertVerifLevel::cvStrict; #endif } @@ -992,7 +997,7 @@ bool Connection::StartTls(bool isClient, const char* certFile, const char* keyFi { debug("Starting TLS"); - m_tlsSocket = std::make_unique(m_socket, isClient, m_host, certFile, keyFile, m_cipher, this); + m_tlsSocket = std::make_unique(m_socket, isClient, m_host, certFile, keyFile, m_cipher, m_certVerifLevel, this); m_tlsSocket->SetSuppressErrors(m_suppressErrors); return m_tlsSocket->Start(); diff --git a/daemon/connect/Connection.h b/daemon/connect/Connection.h index e2c8a539..232d0384 100644 --- a/daemon/connect/Connection.h +++ b/daemon/connect/Connection.h @@ -84,6 +84,7 @@ class Connection void SetForceClose(bool forceClose) { m_forceClose = forceClose; } #ifndef DISABLE_TLS bool StartTls(bool isClient, const char* certFile, const char* keyFile); + void SetCertVerifLevel(unsigned int level) { m_certVerifLevel = level; } #endif int FetchTotalBytesRead(); @@ -104,6 +105,9 @@ class Connection int m_totalBytesRead = 0; bool m_gracefull = false; bool m_forceClose = false; +#ifndef DISABLE_TLS + unsigned int m_certVerifLevel; +#endif struct SockAddr { @@ -119,8 +123,9 @@ class Connection { public: ConTlsSocket(SOCKET socket, bool isClient, const char* host, - const char* certFile, const char* keyFile, const char* cipher, Connection* owner) : - TlsSocket(socket, isClient, host, certFile, keyFile, cipher), m_owner(owner) {} + const char* certFile, const char* keyFile, const char* cipher, + unsigned int certVerifLevel, Connection* owner) : + TlsSocket(socket, isClient, host, certFile, keyFile, cipher, certVerifLevel), m_owner(owner) {} protected: virtual void PrintError(const char* errMsg) { m_owner->PrintError(errMsg); } private: diff --git a/daemon/connect/TlsSocket.cpp b/daemon/connect/TlsSocket.cpp index 870c4e25..f23adf9a 100644 --- a/daemon/connect/TlsSocket.cpp +++ b/daemon/connect/TlsSocket.cpp @@ -27,6 +27,7 @@ #include "Log.h" #include "Util.h" #include "FileSystem.h" +#include "Options.h" CString TlsSocket::m_certStore; @@ -419,8 +420,14 @@ bool TlsSocket::Start() Close(); return false; } - - SSL_CTX_set_verify((SSL_CTX*)m_context, SSL_VERIFY_PEER, nullptr); + if (m_certVerifLevel > Options::ECertVerifLevel::cvNone) + { + SSL_CTX_set_verify((SSL_CTX*)m_context, SSL_VERIFY_PEER, nullptr); + } + else + { + SSL_CTX_set_verify((SSL_CTX*)m_context, SSL_VERIFY_NONE, nullptr); + } } m_session = SSL_new((SSL_CTX*)m_context); @@ -453,7 +460,7 @@ bool TlsSocket::Start() } int error_code = m_isClient ? SSL_connect((SSL*)m_session) : SSL_accept((SSL*)m_session); - if (error_code < 1) + if (error_code < 1 && m_certVerifLevel > Options::ECertVerifLevel::cvNone) { long verifyRes = SSL_get_verify_result((SSL*)m_session); if (verifyRes != X509_V_OK) @@ -567,7 +574,7 @@ bool TlsSocket::ValidateCert() #ifdef HAVE_X509_CHECK_HOST // hostname verification - if (!m_host.Empty() && X509_check_host(cert, m_host, m_host.Length(), 0, nullptr) != 1) + if (m_certVerifLevel > Options::ECertVerifLevel::cvMinimal && !m_host.Empty() && X509_check_host(cert, m_host, m_host.Length(), 0, nullptr) != 1) { const unsigned char* certHost = nullptr; // Find the position of the CN field in the Subject field of the certificate diff --git a/daemon/connect/TlsSocket.h b/daemon/connect/TlsSocket.h index 5b8d7d71..5a1c30d2 100644 --- a/daemon/connect/TlsSocket.h +++ b/daemon/connect/TlsSocket.h @@ -28,9 +28,9 @@ class TlsSocket { public: TlsSocket(SOCKET socket, bool isClient, const char* host, - const char* certFile, const char* keyFile, const char* cipher) : + const char* certFile, const char* keyFile, const char* cipher, int certVerifLevel) : m_socket(socket), m_isClient(isClient), m_host(host), - m_certFile(certFile), m_keyFile(keyFile), m_cipher(cipher) {} + m_certFile(certFile), m_keyFile(keyFile), m_cipher(cipher), m_certVerifLevel(certVerifLevel) {} virtual ~TlsSocket(); static void Init(); static void InitOptions(const char* certStore) { m_certStore = certStore; } @@ -56,6 +56,7 @@ class TlsSocket bool m_connected = false; int m_retCode; static CString m_certStore; + int m_certVerifLevel; // using "void*" to prevent the including of GnuTLS/OpenSSL header files into TlsSocket.h void* m_context = nullptr; diff --git a/daemon/main/Options.cpp b/daemon/main/Options.cpp index 38870473..b10b6bda 100644 --- a/daemon/main/Options.cpp +++ b/daemon/main/Options.cpp @@ -1011,6 +1011,16 @@ void Options::InitServers() m_tls |= tls; } + const char* ncertveriflevel = GetOption(BString<100>("Server%i.CertVerification", n)); + int certveriflevel = ECertVerifLevel::cvStrict; + if (ncertveriflevel) + { + const char* CertVerifNames[] = { "none", "minimal", "strict" }; + const int CertVerifValues[] = { ECertVerifLevel::cvNone, ECertVerifLevel::cvMinimal, ECertVerifLevel::cvStrict }; + const int CertVerifCount = ECertVerifLevel::Count; + certveriflevel = ParseEnumValue(BString<100>("Server%i.CertVerification", n), CertVerifCount, CertVerifNames, CertVerifValues); + } + const char* nipversion = GetOption(BString<100>("Server%i.IpVersion", n)); int ipversion = 0; if (nipversion) @@ -1048,7 +1058,7 @@ void Options::InitServers() nretention ? atoi(nretention) : 0, nlevel ? atoi(nlevel) : 0, ngroup ? atoi(ngroup) : 0, - optional); + optional, certveriflevel); } } else @@ -1539,7 +1549,8 @@ bool Options::ValidateOptionName(const char* optname, const char* optvalue) !strcasecmp(p, ".encryption") || !strcasecmp(p, ".connections") || !strcasecmp(p, ".cipher") || !strcasecmp(p, ".group") || !strcasecmp(p, ".retention") || !strcasecmp(p, ".optional") || - !strcasecmp(p, ".notes") || !strcasecmp(p, ".ipversion"))) + !strcasecmp(p, ".notes") || !strcasecmp(p, ".ipversion") || + !strcasecmp(p, ".certverification"))) { return true; } diff --git a/daemon/main/Options.h b/daemon/main/Options.h index b59c69cd..45853921 100644 --- a/daemon/main/Options.h +++ b/daemon/main/Options.h @@ -98,6 +98,13 @@ class Options nfArticle, nfNzb }; + enum ECertVerifLevel + { + cvNone, + cvMinimal, + cvStrict, + Count + }; class OptEntry { @@ -169,7 +176,7 @@ class Options virtual void AddNewsServer(int id, bool active, const char* name, const char* host, int port, int ipVersion, const char* user, const char* pass, bool joinGroup, bool tls, const char* cipher, int maxConnections, int retention, - int level, int group, bool optional) = 0; + int level, int group, bool optional, unsigned int certVerificationfLevel) = 0; virtual void AddFeed(int id, const char* name, const char* url, int interval, const char* filter, bool backlog, bool pauseNzb, const char* category, int priority, const char* extensions) {} diff --git a/daemon/main/nzbget.cpp b/daemon/main/nzbget.cpp index d1fc55db..5f778ee5 100644 --- a/daemon/main/nzbget.cpp +++ b/daemon/main/nzbget.cpp @@ -164,7 +164,7 @@ class NZBGet : public Options::Extender virtual void AddNewsServer(int id, bool active, const char* name, const char* host, int port, int ipVersion, const char* user, const char* pass, bool joinGroup, bool tls, const char* cipher, int maxConnections, int retention, - int level, int group, bool optional); + int level, int group, bool optional, unsigned int certVerificationfLevel); virtual void AddFeed(int id, const char* name, const char* url, int interval, const char* filter, bool backlog, bool pauseNzb, const char* category, int priority, const char* feedScript); @@ -991,10 +991,11 @@ void NZBGet::Daemonize() void NZBGet::AddNewsServer(int id, bool active, const char* name, const char* host, int port, int ipVersion, const char* user, const char* pass, bool joinGroup, bool tls, - const char* cipher, int maxConnections, int retention, int level, int group, bool optional) + const char* cipher, int maxConnections, int retention, int level, int group, bool optional, + unsigned int certVerificationfLevel) { m_serverPool->AddServer(std::make_unique(id, active, name, host, port, ipVersion, user, pass, joinGroup, - tls, cipher, maxConnections, retention, level, group, optional)); + tls, cipher, maxConnections, retention, level, group, optional, certVerificationfLevel)); } void NZBGet::AddFeed(int id, const char* name, const char* url, int interval, const char* filter, diff --git a/daemon/nntp/ArticleDownloader.cpp b/daemon/nntp/ArticleDownloader.cpp index 67bd79fa..780b1c27 100644 --- a/daemon/nntp/ArticleDownloader.cpp +++ b/daemon/nntp/ArticleDownloader.cpp @@ -116,6 +116,10 @@ void ArticleDownloader::Run() m_connection->SetSuppressErrors(false); +#ifndef DISABLE_TLS + m_connection->SetCertVerifLevel(lastServer->GetCertVerificationLevel()); +#endif + m_connectionName.Format("%s (%s)", m_connection->GetNewsServer()->GetName(), m_connection->GetHost()); diff --git a/daemon/nntp/NewsServer.cpp b/daemon/nntp/NewsServer.cpp index 903afc81..9fca8535 100644 --- a/daemon/nntp/NewsServer.cpp +++ b/daemon/nntp/NewsServer.cpp @@ -24,11 +24,11 @@ NewsServer::NewsServer(int id, bool active, const char* name, const char* host, int port, int ipVersion, const char* user, const char* pass, bool joinGroup, bool tls, const char* cipher, - int maxConnections, int retention, int level, int group, bool optional) : + int maxConnections, int retention, int level, int group, bool optional, unsigned int certVerificationfLevel) : m_id(id), m_active(active), m_name(name), m_host(host ? host : ""), m_port(port), m_ipVersion(ipVersion), m_user(user ? user : ""), m_password(pass ? pass : ""), m_joinGroup(joinGroup), m_tls(tls), m_cipher(cipher ? cipher : ""), m_maxConnections(maxConnections), m_retention(retention), - m_level(level), m_normLevel(level), m_group(group), m_optional(optional) + m_level(level), m_normLevel(level), m_group(group), m_optional(optional), m_certVerificationfLevel(certVerificationfLevel) { if (m_name.Empty()) { diff --git a/daemon/nntp/NewsServer.h b/daemon/nntp/NewsServer.h index 80bb27df..78886567 100644 --- a/daemon/nntp/NewsServer.h +++ b/daemon/nntp/NewsServer.h @@ -35,7 +35,7 @@ class NewsServer NewsServer(int id, bool active, const char* name, const char* host, int port, int ipVersion, const char* user, const char* pass, bool joinGroup, bool tls, const char* cipher, int maxConnections, int retention, - int level, int group, bool optional); + int level, int group, bool optional, unsigned int certVerificationfLevel); int GetId() { return m_id; } int GetStateId() { return m_stateId; } void SetStateId(int stateId) { m_stateId = stateId; } @@ -59,6 +59,7 @@ class NewsServer bool GetOptional() { return m_optional; } time_t GetBlockTime() { return m_blockTime; } void SetBlockTime(time_t blockTime) { m_blockTime = blockTime; } + unsigned int GetCertVerificationLevel() { return m_certVerificationfLevel; } private: int m_id; @@ -80,6 +81,7 @@ class NewsServer int m_group; bool m_optional = false; time_t m_blockTime = 0; + unsigned int m_certVerificationfLevel; }; typedef std::vector> Servers; diff --git a/daemon/nntp/NntpConnection.cpp b/daemon/nntp/NntpConnection.cpp index 4cf95a10..05e64637 100644 --- a/daemon/nntp/NntpConnection.cpp +++ b/daemon/nntp/NntpConnection.cpp @@ -34,6 +34,10 @@ NntpConnection::NntpConnection(NewsServer* newsServer) : SetCipher(newsServer->GetCipher()); SetIPVersion(newsServer->GetIpVersion() == 4 ? Connection::ipV4 : newsServer->GetIpVersion() == 6 ? Connection::ipV6 : Connection::ipAuto); + +#ifndef DISABLE_TLS + SetCertVerifLevel(newsServer->GetCertVerificationLevel()); +#endif } const char* NntpConnection::Request(const char* req) diff --git a/daemon/remote/XmlRpc.cpp b/daemon/remote/XmlRpc.cpp index 2f132d01..51be5ad1 100644 --- a/daemon/remote/XmlRpc.cpp +++ b/daemon/remote/XmlRpc.cpp @@ -3296,16 +3296,25 @@ void TestServerXmlCommand::Execute() bool encryption; char* cipher; int timeout; + int certVerifLevel; if (!NextParamAsStr(&host) || !NextParamAsInt(&port) || !NextParamAsStr(&username) || !NextParamAsStr(&password) || !NextParamAsBool(&encryption) || - !NextParamAsStr(&cipher) || !NextParamAsInt(&timeout)) + !NextParamAsStr(&cipher) || !NextParamAsInt(&timeout) || + !NextParamAsInt(&certVerifLevel)) { BuildErrorResponse(2, "Invalid parameter"); return; } - NewsServer server(0, true, "test server", host, port, 0, username, password, false, encryption, cipher, 1, 0, 0, 0, false); + if (certVerifLevel < 0 || certVerifLevel >= Options::ECertVerifLevel::Count) + { + BuildErrorResponse(2, "Invalid parameter (Certificate Verification Level)."); + return; + } + + NewsServer server(0, true, "test server", host, port, 0, username, password, false, + encryption, cipher, 1, 0, 0, 0, false, certVerifLevel); TestConnection connection(&server, this); connection.SetTimeout(timeout == 0 ? g_Options->GetArticleTimeout() : timeout); connection.SetSuppressErrors(false); diff --git a/nzbget.conf b/nzbget.conf index 84d75d17..3572addd 100644 --- a/nzbget.conf +++ b/nzbget.conf @@ -243,6 +243,15 @@ Server1.Connections=8 # Value "0" disables retention check. Server1.Retention=0 +# Certificate verification level (Strict, Minimal, None). +# +# None - NO certificate signing check, NO certificate hostname check +# +# Minimal - certificate signing check, NO certificate hostname check +# +# Strict - certificate signing check, certificate hostname check +Server1.CertVerification=strict + # IP protocol version (auto, ipv4, ipv6). Server1.IpVersion=auto diff --git a/webui/config.js b/webui/config.js index f3fca238..a579a44a 100644 --- a/webui/config.js +++ b/webui/config.js @@ -1581,6 +1581,7 @@ var Config = (new function($) $('#Notif_Config_TestConnectionProgress').fadeIn(function() { var multiid = parseInt($(control).attr('data-multiid')); var timeout = Math.min(parseInt(getOptionValue(findOptionByName('ArticleTimeout'))), 10); + var certStrictLevel = getCertStrictLevel(getOptionValue(findOptionByName('Server' + multiid + '.CertVerification'))); RPC.call('testserver', [ getOptionValue(findOptionByName('Server' + multiid + '.Host')), parseInt(getOptionValue(findOptionByName('Server' + multiid + '.Port'))), @@ -1588,7 +1589,8 @@ var Config = (new function($) getOptionValue(findOptionByName('Server' + multiid + '.Password')), getOptionValue(findOptionByName('Server' + multiid + '.Encryption')) === 'yes', getOptionValue(findOptionByName('Server' + multiid + '.Cipher')), - timeout + timeout, + certStrictLevel ], function(errtext) { $('#Notif_Config_TestConnectionProgress').fadeOut(function() { @@ -1799,6 +1801,18 @@ var Config = (new function($) } } + function getCertStrictLevel(strictLevel) + { + var level = strictLevel.toLowerCase(); + switch(level) + { + case "none": return 0; + case "minimal": return 1; + case "strict": return 2; + default: return 2; + } + } + function showSaveBanner() { $('#Config_Save').attr('disabled', 'disabled'); From 49908f81011a70e3c271875fcdb2ce5f2e19c172 Mon Sep 17 00:00:00 2001 From: Denis <146707790+dnzbk@users.noreply.github.com> Date: Fri, 2 Feb 2024 18:03:14 +0300 Subject: [PATCH 26/34] Fix: Options test (#151) - fixed Options tests - added the "compile" file to gitignore - improved pipeline for the tests Co-authored-by: phnzb --- .github/workflows/windows-tests.yml | 4 ++++ .gitignore | 1 + tests/main/OptionsTest.cpp | 11 ++++++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows-tests.yml b/.github/workflows/windows-tests.yml index 660da590..60f5e615 100644 --- a/.github/workflows/windows-tests.yml +++ b/.github/workflows/windows-tests.yml @@ -6,6 +6,10 @@ on: - feature/* - develop - main + pull_request: + branches: + - develop + - main workflow_call: workflow_dispatch: diff --git a/.gitignore b/.gitignore index 600afee6..a5d1eec1 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ posix/config.sub posix/depcomp posix/install-sh posix/missing +posix/compile stamp-h1 autom4te.cache/ .dirstamp diff --git a/tests/main/OptionsTest.cpp b/tests/main/OptionsTest.cpp index 178ab0b7..fd58bb99 100644 --- a/tests/main/OptionsTest.cpp +++ b/tests/main/OptionsTest.cpp @@ -34,20 +34,21 @@ class OptionsExtenderMock : public Options::Extender OptionsExtenderMock() : m_newsServers(0), m_feeds(0), m_tasks(0) {} protected: - virtual void AddNewsServer(int id, bool active, const char* name, const char* host, + void AddNewsServer(int id, bool active, const char* name, const char* host, int port, int ipVersion, const char* user, const char* pass, bool joinGroup, bool tls, - const char* cipher, int maxConnections, int retention, int level, int group, bool optional) + const char* cipher, int maxConnections, int retention, + int level, int group, bool optional, unsigned int certVerificationfLevel) override { m_newsServers++; } - virtual void AddFeed(int id, const char* name, const char* url, int interval, - const char* filter, bool backlog, bool pauseNzb, const char* category, int priority, const char* feedScript) + void AddFeed(int id, const char* name, const char* url, int interval, + const char* filter, bool backlog, bool pauseNzb, const char* category, int priority, const char* feedScript) override { m_feeds++; } - virtual void AddTask(int id, int hours, int minutes, int weekDaysBits, Options::ESchedulerCommand command, const char* param) + void AddTask(int id, int hours, int minutes, int weekDaysBits, Options::ESchedulerCommand command, const char* param) override { m_tasks++; } From 91210c7f8935a7fe6247e370bf1d69aa5ddad0cd Mon Sep 17 00:00:00 2001 From: phnzb <139914799+phnzb@users.noreply.github.com> Date: Mon, 5 Feb 2024 15:55:57 +0300 Subject: [PATCH 27/34] Remove automatic build and push docker images on main branch and tags (#152) --- .github/workflows/docker.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index af473898..6092c0ab 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,9 +4,7 @@ on: push: branches: - develop - - main - tags: - - v* + workflow_dispatch: env: REGISTRY_IMAGE: nzbgetcom/nzbget From 7348b19cf8a81739922303e3f9047d06e59670d0 Mon Sep 17 00:00:00 2001 From: Denis <146707790+dnzbk@users.noreply.github.com> Date: Mon, 5 Feb 2024 05:45:15 -0800 Subject: [PATCH 28/34] Feature/extension manager (#76) #### The new nzbget extension system, which makes it easy to download/update/delete extensions with backward compatibility with the old system. Extensions [master list](https://github.com/nzbgetcom/nzbget-extensions/). - Changed - RPC request "configtemplates" - no longer returns script templates, but only the config template. - Added - new RPC requests: - "loadextensions" - loads all extensions from {ScriptDIR} and returns an array of structures in JSON/XML formats. - "updateextension" - downloads by url and name and installs the extension. Returns 'true' or error response in JSON/XML formats. - "deleteextension" - deletes extension by name. Returns 'true' or error response in JSON/XML formats. - "downloadextension" - downloads by url and installs the extension. Returns 'true' or error response in JSON/XML formats. - "testextension" - tries to find the right executor program for the extension, e.g. Python. Returns 'true' or error response in JSON/XML formats. - "EXTENSION MANAGER" section in webui to download/delete/update extensions - Boost.Json library to work with JSON - more unit tests - Refactored - replaced raw pointers with smart pointers and const refs where possible for memory safty reasons - Updated - INSTALALTION.md - Removed - testdata_FILES from Makefile.am - EMail and Logger scripts --------- Co-authored-by: phnzb --- CMakeLists.txt | 1 + INSTALLATION.md | 22 +- Makefile.am | 68 +- configure.ac | 3 + daemon/extension/CommandScript.cpp | 8 +- daemon/extension/CommandScript.h | 2 +- daemon/extension/Extension.cpp | 436 +++++++ daemon/extension/Extension.h | 117 ++ daemon/extension/ExtensionLoader.cpp | 422 +++++++ daemon/extension/ExtensionLoader.h | 81 ++ daemon/extension/ExtensionManager.cpp | 373 ++++++ daemon/extension/ExtensionManager.h | 82 ++ daemon/extension/FeedScript.cpp | 4 +- daemon/extension/FeedScript.h | 2 +- daemon/extension/ManifestFile.cpp | 232 ++++ daemon/extension/ManifestFile.h | 82 ++ daemon/extension/NzbScript.cpp | 6 +- daemon/extension/NzbScript.h | 5 +- daemon/extension/PostScript.cpp | 22 +- daemon/extension/PostScript.h | 4 +- daemon/extension/QueueScript.cpp | 34 +- daemon/extension/QueueScript.h | 12 +- daemon/extension/ScanScript.cpp | 6 +- daemon/extension/ScanScript.h | 2 +- daemon/extension/SchedulerScript.cpp | 4 +- daemon/extension/SchedulerScript.h | 2 +- daemon/extension/ScriptConfig.cpp | 345 +----- daemon/extension/ScriptConfig.h | 61 +- daemon/main/Options.h | 8 +- daemon/main/nzbget.cpp | 16 +- daemon/main/nzbget.h | 4 +- daemon/postprocess/Unpack.cpp | 17 +- daemon/postprocess/Unpack.h | 2 +- daemon/queue/Scanner.cpp | 10 +- daemon/remote/XmlRpc.cpp | 246 +++- daemon/util/Json.cpp | 53 + daemon/util/Json.h | 39 + daemon/util/ScriptController.cpp | 59 +- daemon/util/ScriptController.h | 1 - daemon/util/Util.cpp | 109 +- daemon/util/Util.h | 4 + daemon/util/Xml.cpp | 42 + daemon/util/Xml.h | 31 + docker/Dockerfile | 4 +- nzbget.vcxproj | 21 +- osx/build-info.md | 2 +- osx/build-nzbget.sh | 28 +- posix/ax_boost_json.m4 | 123 ++ scripts/.gitkeep | 0 scripts/EMail.py | 291 ----- scripts/Logger.py | 95 -- synology/README.md | 2 +- synology/build-nzbget.sh | 16 +- synology/package/SynoBuildConf/build | 27 +- synology/package/SynoBuildConf/install | 3 +- tests/CMakeLists.txt | 3 +- tests/extension/CMakeLists.txt | 63 + tests/extension/ExtensionLoaderTest.cpp | 150 +++ tests/extension/ExtensionManagerTest.cpp | 89 ++ tests/extension/ExtensionTest.cpp | 150 +++ tests/extension/ManifestFileTest.cpp | 84 ++ tests/extension/main.cpp | 3 + tests/feed/FeedFileTest.cpp | 2 + tests/queue/NzbFileTest.cpp | 2 + tests/testdata/extension/V1/Extension.py | 54 + .../extension/manifest/invalid/manifest.json | 9 + .../extension/manifest/valid/manifest.json | 39 + .../testdata/extension/scripts/Email/email.py | 1 + .../extension/scripts/Email/manifest.json | 32 + .../testdata/extension/scripts/Extension1.py | 34 + .../scripts/Extension2/Extension2.py | 34 + .../testdata/extension/scripts/Extension3.py | 34 + tests/util/CMakeLists.txt | 4 + tests/util/JsonTest.cpp | 45 + tests/util/main.cpp | 1 + webui/config.js | 1070 +++++++++++++++-- webui/edit.js | 24 +- webui/img/download-16.ico | Bin 0 -> 1150 bytes webui/img/house-16.ico | Bin 0 -> 1150 bytes webui/img/warning-16.ico | Bin 0 -> 1150 bytes webui/index.html | 52 +- webui/index.js | 23 +- webui/style.css | 36 +- windows/nzbget-setup.nsi | 1 - 84 files changed, 4592 insertions(+), 1138 deletions(-) create mode 100644 daemon/extension/Extension.cpp create mode 100644 daemon/extension/Extension.h create mode 100644 daemon/extension/ExtensionLoader.cpp create mode 100644 daemon/extension/ExtensionLoader.h create mode 100644 daemon/extension/ExtensionManager.cpp create mode 100644 daemon/extension/ExtensionManager.h create mode 100644 daemon/extension/ManifestFile.cpp create mode 100644 daemon/extension/ManifestFile.h create mode 100644 daemon/util/Json.cpp create mode 100644 daemon/util/Json.h create mode 100644 daemon/util/Xml.cpp create mode 100644 daemon/util/Xml.h create mode 100644 posix/ax_boost_json.m4 create mode 100644 scripts/.gitkeep delete mode 100755 scripts/EMail.py delete mode 100755 scripts/Logger.py create mode 100644 tests/extension/CMakeLists.txt create mode 100644 tests/extension/ExtensionLoaderTest.cpp create mode 100644 tests/extension/ExtensionManagerTest.cpp create mode 100644 tests/extension/ExtensionTest.cpp create mode 100644 tests/extension/ManifestFileTest.cpp create mode 100644 tests/extension/main.cpp create mode 100644 tests/testdata/extension/V1/Extension.py create mode 100644 tests/testdata/extension/manifest/invalid/manifest.json create mode 100644 tests/testdata/extension/manifest/valid/manifest.json create mode 100644 tests/testdata/extension/scripts/Email/email.py create mode 100644 tests/testdata/extension/scripts/Email/manifest.json create mode 100644 tests/testdata/extension/scripts/Extension1.py create mode 100644 tests/testdata/extension/scripts/Extension2/Extension2.py create mode 100644 tests/testdata/extension/scripts/Extension3.py create mode 100644 tests/util/JsonTest.cpp create mode 100644 webui/img/download-16.ico create mode 100644 webui/img/house-16.ico create mode 100644 webui/img/warning-16.ico diff --git a/CMakeLists.txt b/CMakeLists.txt index 765acc7a..4165e27b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,7 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") find_package(OpenSSL REQUIRED) find_package(ZLIB REQUIRED) find_package(LibXml2 REQUIRED) +find_package(Boost REQUIRED COMPONENTS json) if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Weverything") diff --git a/INSTALLATION.md b/INSTALLATION.md index a08d0dab..2dd0fdef 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -1,4 +1,4 @@ -# NZBGet installation +# NZBGet installation This is a short documentation. For more information please visit NZBGet home page at @@ -62,29 +62,34 @@ NZBGet absolutely needs the following libraries: - libstdc++ (usually part of compiler) - [libxml2](https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home) + - [Boost.JSON](https://www.boost.org/doc/libs/1_84_0/libs/json/doc/html/index.html) + - [Boost.Optional](https://www.boost.org/doc/libs/1_84_0/libs/optional/doc/html/index.html) And the following libraries are optional: - - for curses-output-mode (enabled by default): + For curses-output-mode (enabled by default): - libcurses (usually part of commercial systems) or (better) - [libncurses](https://invisible-island.net/ncurses) - - for encrypted connections (TLS/SSL): + For encrypted connections (TLS/SSL): - [OpenSSL](https://www.openssl.org) or - [GnuTLS](https://gnutls.org) - - for gzip support in web-server and web-client (enabled by default): + For gzip support in web-server and web-client (enabled by default): - [zlib](https://www.zlib.net/) - - for configuration: + For configuration: - [autotools](https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html) - [autoconf](https://www.gnu.org/software/autoconf/) - - for managing package dependencies: + For managing package dependencies: - [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) + + For tests: + - [Boost.Test](https://www.boost.org/doc/libs/1_84_0/libs/test/doc/html/index.html) All these libraries are included in modern POSIX distributions and should be available as installable packages. Please note that you also @@ -219,6 +224,11 @@ Also required are: - [Regex](https://regexlib.com/) - [Zlib](https://gnuwin32.sourceforge.net/packages/zlib.htm) - [libxml2](https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home) + - [Boost.JSON](https://www.boost.org/doc/libs/1_84_0/libs/json/doc/html/index.html) + - [Boost.Optional](https://www.boost.org/doc/libs/1_84_0/libs/optional/doc/html/index.html) + +For tests: + - [Boost.Test](https://www.boost.org/doc/libs/1_84_0/libs/test/doc/html/index.html) We recommend using [vcpkg](https://vcpkg.io/) to install dependencies. diff --git a/Makefile.am b/Makefile.am index 473fb0fa..b853f8f8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,6 +42,14 @@ nzbget_SOURCES = \ daemon/extension/SchedulerScript.h \ daemon/extension/ScriptConfig.cpp \ daemon/extension/ScriptConfig.h \ + daemon/extension/Extension.cpp \ + daemon/extension/Extension.h \ + daemon/extension/ExtensionManager.cpp \ + daemon/extension/ExtensionManager.h \ + daemon/extension/ExtensionLoader.cpp \ + daemon/extension/ExtensionLoader.h \ + daemon/extension/ManifestFile.cpp \ + daemon/extension/ManifestFile.h \ daemon/feed/FeedCoordinator.cpp \ daemon/feed/FeedCoordinator.h \ daemon/feed/FeedFile.cpp \ @@ -158,6 +166,10 @@ nzbget_SOURCES = \ daemon/util/Service.h \ daemon/util/FileSystem.cpp \ daemon/util/FileSystem.h \ + daemon/util/Json.cpp \ + daemon/util/Json.h \ + daemon/util/Xml.cpp \ + daemon/util/Xml.h \ daemon/util/Util.cpp \ daemon/util/Util.h \ daemon/nserv/NServMain.h \ @@ -353,6 +365,8 @@ webui_FILES = \ webui/lib/raphael.min.js \ webui/lib/elycharts.js \ webui/lib/elycharts.min.js \ + webui/img/house-16.ico \ + webui/img/download-16.ico \ webui/img/icons.png \ webui/img/icons-2x.png \ webui/img/transmit.gif \ @@ -364,64 +378,13 @@ webui_FILES = \ webui/img/favicon-256x256-opaque.png \ webui/img/favicon-256x256.png -scripts_FILES = \ - scripts/EMail.py \ - scripts/Logger.py - -testdata_FILES = \ - tests/testdata/dupematcher1/testfile.part01.rar \ - tests/testdata/dupematcher1/testfile.part24.rar \ - tests/testdata/dupematcher2/testfile.part04.rar \ - tests/testdata/dupematcher2/testfile.part43.rar \ - tests/testdata/nzbfile/dotless.nzb \ - tests/testdata/nzbfile/dotless.txt \ - tests/testdata/nzbfile/plain.nzb \ - tests/testdata/nzbfile/plain.txt \ - tests/testdata/parchecker/crc.txt \ - tests/testdata/parchecker/testfile.dat \ - tests/testdata/parchecker/testfile.nfo \ - tests/testdata/parchecker/testfile.par2 \ - tests/testdata/parchecker/testfile.vol00+1.PAR2 \ - tests/testdata/parchecker/testfile.vol01+2.PAR2 \ - tests/testdata/parchecker/testfile.vol03+3.PAR2 \ - tests/testdata/parchecker2/crc.txt \ - tests/testdata/parchecker2/testfile.7z.001 \ - tests/testdata/parchecker2/testfile.7z.002 \ - tests/testdata/parchecker2/testfile.7z.003 \ - tests/testdata/parchecker2/testfile.7z.par2 \ - tests/testdata/parchecker2/testfile.7z.vol0+1.PAR2 \ - tests/testdata/parchecker2/testfile.7z.vol1+2.PAR2 \ - tests/testdata/parchecker2/testfile.7z.vol3+3.PAR2 \ - tests/testdata/rarrenamer/testfile3.part01.rar \ - tests/testdata/rarrenamer/testfile3.part02.rar \ - tests/testdata/rarrenamer/testfile3.part03.rar \ - tests/testdata/rarrenamer/testfile5.part01.rar \ - tests/testdata/rarrenamer/testfile5.part02.rar \ - tests/testdata/rarrenamer/testfile5.part03.rar \ - tests/testdata/rarrenamer/testfile3oldnam.rar \ - tests/testdata/rarrenamer/testfile3oldnam.r00 \ - tests/testdata/rarrenamer/testfile3oldnam.r01 \ - tests/testdata/rarrenamer/testfile3encdata.part01.rar \ - tests/testdata/rarrenamer/testfile3encdata.part02.rar \ - tests/testdata/rarrenamer/testfile3encdata.part03.rar \ - tests/testdata/rarrenamer/testfile3encnam.part01.rar \ - tests/testdata/rarrenamer/testfile3encnam.part02.rar \ - tests/testdata/rarrenamer/testfile3encnam.part03.rar \ - tests/testdata/rarrenamer/testfile5encdata.part01.rar \ - tests/testdata/rarrenamer/testfile5encdata.part02.rar \ - tests/testdata/rarrenamer/testfile5encdata.part03.rar \ - tests/testdata/rarrenamer/testfile5encnam.part01.rar \ - tests/testdata/rarrenamer/testfile5encnam.part02.rar \ - tests/testdata/rarrenamer/testfile5encnam.part03.rar - # Install dist_doc_DATA = $(doc_FILES) exampleconfdir = $(datadir)/nzbget dist_exampleconf_DATA = $(exampleconf_FILES) webuidir = $(datadir)/nzbget nobase_dist_webui_DATA = $(webui_FILES) -scriptsdir = $(datadir)/nzbget -nobase_dist_scripts_SCRIPTS = $(scripts_FILES) +scriptsdir = $(datadir)/nzbget/scripts # Note about "sed": # We need to make some changes in installed files. @@ -434,6 +397,7 @@ nobase_dist_scripts_SCRIPTS = $(scripts_FILES) # Prepare example configuration file install-data-hook: + mkdir -p "$(DESTDIR)$(scriptsdir)" rm -f "$(DESTDIR)$(exampleconfdir)/nzbget.conf.temp" cp "$(DESTDIR)$(exampleconfdir)/nzbget.conf" "$(DESTDIR)$(exampleconfdir)/nzbget.conf.temp" sed 's:^ConfigTemplate=:ConfigTemplate=$(exampleconfdir)/nzbget.conf:' < "$(DESTDIR)$(exampleconfdir)/nzbget.conf.temp" > "$(DESTDIR)$(exampleconfdir)/nzbget.conf" diff --git a/configure.ac b/configure.ac index 78d9aa48..840058c5 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,9 @@ AC_DEFINE(HAVE_CONFIG_H, 1, [Define to 1 use config.h]) AM_MAINTAINER_MODE m4_include([posix/ax_cxx_compile_stdcxx.m4]) +m4_include([posix/ax_boost_json.m4]) +AX_BOOST_JSON dnl dnl Check for programs. @@ -77,6 +79,7 @@ AC_SEARCH_LIBS([socket], [socket]) AC_SEARCH_LIBS([inet_addr], [nsl]) AC_SEARCH_LIBS([hstrerror], [resolv]) +AC_CHECK_LIB([boost_json], [main], [], [AC_MSG_ERROR([Could not find Boost.JSON library])]) dnl dnl Android NDK restrictions diff --git a/daemon/extension/CommandScript.cpp b/daemon/extension/CommandScript.cpp index 9b096ed6..1f00a581 100644 --- a/daemon/extension/CommandScript.cpp +++ b/daemon/extension/CommandScript.cpp @@ -41,9 +41,9 @@ bool CommandScriptController::StartScript(const char* scriptName, const char* co scriptController->Start(); - for (ScriptConfig::Script& script : g_ScriptConfig->GetScripts()) + for (const auto script : g_ExtensionManager->GetExtensions()) { - if (FileSystem::SameFilename(scriptName, script.GetName())) + if (strcmp(scriptName, script->GetName()) == 0) { return true; } @@ -56,11 +56,11 @@ void CommandScriptController::Run() ExecuteScriptList(m_script); } -void CommandScriptController::ExecuteScript(ScriptConfig::Script* script) +void CommandScriptController::ExecuteScript(std::shared_ptr script) { PrintMessage(Message::mkInfo, "Executing script %s with command %s", script->GetName(), *m_command); - SetArgs({script->GetLocation()}); + SetArgs({script->GetEntry()}); BString<1024> infoName("script %s with command %s", script->GetName(), *m_command); SetInfoName(infoName); diff --git a/daemon/extension/CommandScript.h b/daemon/extension/CommandScript.h index 676432b0..ed20380d 100644 --- a/daemon/extension/CommandScript.h +++ b/daemon/extension/CommandScript.h @@ -31,7 +31,7 @@ class CommandScriptController : public Thread, public NzbScriptController static bool StartScript(const char* scriptName, const char* command, std::unique_ptr modifiedOptions); protected: - virtual void ExecuteScript(ScriptConfig::Script* script); + virtual void ExecuteScript(std::shared_ptr script); virtual void AddMessage(Message::EKind kind, const char* text); virtual const char* GetOptValue(const char* name, const char* value); diff --git a/daemon/extension/Extension.cpp b/daemon/extension/Extension.cpp new file mode 100644 index 00000000..044fbad2 --- /dev/null +++ b/daemon/extension/Extension.cpp @@ -0,0 +1,436 @@ +/* + * This file is part of nzbget. See . + * + * Copyright (C) 2023 Denis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "nzbget.h" + +#include "Xml.h" +#include "Extension.h" + +namespace Extension +{ + void Script::SetEntry(std::string entry) + { + m_entry = std::move(entry); + } + + const char* Script::GetEntry() const + { + return m_entry.c_str(); + } + + void Script::SetLocation(std::string location) + { + m_location = std::move(location); + } + + void Script::SetRootDir(std::string dir) + { + m_rootDir = std::move(dir); + } + + const char* Script::GetRootDir() const + { + return m_rootDir.c_str(); + } + + const char* Script::GetLocation() const + { + return m_location.c_str(); + } + + void Script::SetAuthor(std::string author) + { + m_author = std::move(author); + } + + const char* Script::GetAuthor() const + { + return m_author.c_str(); + } + + void Script::SetHomepage(std::string homepage) + { + m_homepage = std::move(homepage); + } + + const char* Script::GetHomepage() const + { + return m_homepage.c_str(); + } + + void Script::SetVersion(std::string version) + { + m_version = std::move(version); + } + + const char* Script::GetVersion() const + { + return m_version.c_str(); + } + + void Script::SetLicense(std::string license) + { + m_license = std::move(license); + } + + const char* Script::GetLicense() const + { + return m_license.c_str(); + } + + void Script::SetName(std::string name) + { + m_name = std::move(name); + } + + const char* Script::GetName() const + { + return m_name.c_str(); + } + + void Script::SetDisplayName(std::string displayName) + { + m_displayName = std::move(displayName); + } + + const char* Script::GetDisplayName() const + { + return m_displayName.c_str(); + } + + void Script::SetAbout(std::string about) + { + m_about = std::move(about); + } + + const char* Script::GetAbout() const + { + return m_about.c_str(); + } + + void Script::SetDescription(std::vector description) + { + m_description = std::move(description); + }; + + const std::vector& Script::GetDescription() const + { + return m_description; + } + + void Script::SetKind(Kind kind) + { + m_kind = std::move(kind); + }; + + bool Script::GetPostScript() const + { + return m_kind.post; + } + + bool Script::GetScanScript() const + { + return m_kind.scan; + } + + bool Script::GetQueueScript() const + { + return m_kind.queue; + } + bool Script::GetSchedulerScript() const + { + return m_kind.scheduler; + } + bool Script::GetFeedScript() const + { + return m_kind.feed; + } + void Script::SetQueueEvents(std::string queueEvents) + { + m_queueEvents = std::move(queueEvents); + } + + const char* Script::GetQueueEvents() const + { + return m_queueEvents.c_str(); + } + + + void Script::SetTaskTime(std::string taskTime) + { + m_taskTime = std::move(taskTime); + } + + const char* Script::GetTaskTime() const + { + return m_taskTime.c_str(); + } + + void Script::SetOptions(std::vector options) + { + m_options = std::move(options); + } + + void Script::SetRequirements(std::vector requirements) + { + m_requirements = std::move(requirements); + } + + const std::vector& Script::GetRequirements() const + { + return m_requirements; + } + + const std::vector& Script::GetOptions() const + { + return m_options; + } + + void Script::SetCommands(std::vector commands) + { + m_commands = std::move(commands); + } + + const std::vector& Script::GetCommands() const + { + return m_commands; + } + + std::string ToJsonStr(const Script& script) + { + Json::JsonObject json; + Json::JsonArray descriptionJson; + Json::JsonArray requirementsJson; + Json::JsonArray optionsJson; + Json::JsonArray commandsJson; + + json["Entry"] = script.GetEntry(); + json["Location"] = script.GetLocation(); + json["RootDir"] = script.GetRootDir(); + json["Name"] = script.GetName(); + json["DisplayName"] = script.GetDisplayName(); + json["About"] = script.GetAbout(); + json["Author"] = script.GetAuthor(); + json["Homepage"] = script.GetHomepage(); + json["License"] = script.GetLicense(); + json["Version"] = script.GetVersion(); + json["PostScript"] = script.GetPostScript(); + json["ScanScript"] = script.GetScanScript(); + json["QueueScript"] = script.GetQueueScript(); + json["SchedulerScript"] = script.GetSchedulerScript(); + json["FeedScript"] = script.GetFeedScript(); + json["QueueEvents"] = script.GetQueueEvents(); + json["TaskTime"] = script.GetTaskTime(); + + for (const auto& line : script.GetDescription()) + { + descriptionJson.push_back(Json::JsonValue(line)); + } + + for (const auto& line : script.GetRequirements()) + { + requirementsJson.push_back(Json::JsonValue(line)); + } + + for (const auto& option : script.GetOptions()) + { + Json::JsonObject optionJson; + Json::JsonArray descriptionJson; + Json::JsonArray selectJson; + + optionJson["Name"] = option.name; + optionJson["DisplayName"] = option.displayName; + + if (const std::string* val = boost::variant2::get_if(&option.value)) + { + optionJson["Value"] = *val; + } + else if (const double* val = boost::variant2::get_if(&option.value)) + { + optionJson["Value"] = *val; + } + + for (const auto& line : option.description) + { + descriptionJson.push_back(Json::JsonValue(line)); + } + + for (const auto& value : option.select) + { + if (const std::string* val = boost::variant2::get_if(&value)) + { + selectJson.push_back(Json::JsonValue(*val)); + } + else if (const double* val = boost::variant2::get_if(&value)) + { + selectJson.push_back(Json::JsonValue(*val)); + } + } + + optionJson["Description"] = std::move(descriptionJson); + optionJson["Select"] = std::move(selectJson); + optionsJson.push_back(std::move(optionJson)); + } + + for (const auto& command : script.GetCommands()) + { + Json::JsonObject commandJson; + Json::JsonArray descriptionJson; + + commandJson["Name"] = command.name; + commandJson["DisplayName"] = command.displayName; + commandJson["Action"] = command.action; + + + for (const auto& line : command.description) + { + descriptionJson.push_back(Json::JsonValue(line)); + } + + commandJson["Description"] = std::move(descriptionJson); + commandsJson.push_back(std::move(commandJson)); + } + + json["Description"] = std::move(descriptionJson); + json["Requirements"] = std::move(requirementsJson); + json["Options"] = std::move(optionsJson); + json["Commands"] = std::move(commandsJson); + + return Json::Serialize(json); + } + + std::string ToXmlStr(const Script& script) + { + xmlNodePtr rootNode = xmlNewNode(NULL, BAD_CAST "value"); + xmlNodePtr structNode = xmlNewNode(NULL, BAD_CAST "struct"); + + AddNewNode(structNode, "Entry", "string", script.GetEntry()); + AddNewNode(structNode, "Location", "string", script.GetLocation()); + AddNewNode(structNode, "RootDir", "string", script.GetRootDir()); + AddNewNode(structNode, "Name", "string", script.GetName()); + AddNewNode(structNode, "DisplayName", "string", script.GetDisplayName()); + AddNewNode(structNode, "About", "string", script.GetAbout()); + AddNewNode(structNode, "Author", "string", script.GetAuthor()); + AddNewNode(structNode, "Homepage", "string", script.GetHomepage()); + AddNewNode(structNode, "License", "string", script.GetLicense()); + AddNewNode(structNode, "Version", "string", script.GetVersion()); + + AddNewNode(structNode, "PostScript", "boolean", BoolToStr(script.GetPostScript())); + AddNewNode(structNode, "ScanScript", "boolean", BoolToStr(script.GetScanScript())); + AddNewNode(structNode, "QueueScript", "boolean", BoolToStr(script.GetQueueScript())); + AddNewNode(structNode, "SchedulerScript", "boolean", BoolToStr(script.GetSchedulerScript())); + AddNewNode(structNode, "FeedScript", "boolean", BoolToStr(script.GetFeedScript())); + + AddNewNode(structNode, "QueueEvents", "string", script.GetQueueEvents()); + AddNewNode(structNode, "TaskTime", "string", script.GetTaskTime()); + + xmlNodePtr descriptionNode = xmlNewNode(NULL, BAD_CAST "Description"); + for (const std::string& line : script.GetDescription()) + { + AddNewNode(descriptionNode, "Value", "string", line.c_str()); + } + + xmlNodePtr requirementsNode = xmlNewNode(NULL, BAD_CAST "Requirements"); + for (const std::string& line : script.GetRequirements()) + { + AddNewNode(requirementsNode, "Value", "string", line.c_str()); + } + + xmlNodePtr commandsNode = xmlNewNode(NULL, BAD_CAST "Commands"); + for (const ManifestFile::Command& command : script.GetCommands()) + { + AddNewNode(commandsNode, "Name", "string", command.name.c_str()); + AddNewNode(commandsNode, "DisplayName", "string", command.displayName.c_str()); + AddNewNode(commandsNode, "Action", "string", command.action.c_str()); + + xmlNodePtr descriptionNode = xmlNewNode(NULL, BAD_CAST "Description"); + for (const std::string& line : command.description) + { + AddNewNode(descriptionNode, "Value", "string", line.c_str()); + } + xmlAddChild(commandsNode, descriptionNode); + } + + xmlNodePtr optionsNode = xmlNewNode(NULL, BAD_CAST "Options"); + for (const ManifestFile::Option& option : script.GetOptions()) + { + AddNewNode(optionsNode, "Name", "string", option.name.c_str()); + AddNewNode(optionsNode, "DisplayName", "string", option.displayName.c_str()); + + if (const std::string* val = boost::variant2::get_if(&option.value)) + { + AddNewNode(optionsNode, "Value", "string", val->c_str()); + } + else if (const double* val = boost::variant2::get_if(&option.value)) + { + AddNewNode(optionsNode, "Value", "number", std::to_string(*val).c_str()); + } + + xmlNodePtr selectNode = xmlNewNode(NULL, BAD_CAST "Select"); + for (const auto& selectOption : option.select) + { + if (const std::string* val = boost::variant2::get_if(&selectOption)) + { + AddNewNode(selectNode, "Value", "string", val->c_str()); + } + else if (const double* val = boost::variant2::get_if(&selectOption)) + { + AddNewNode(selectNode, "Value", "number", std::to_string(*val).c_str()); + } + } + + xmlNodePtr descriptionNode = xmlNewNode(NULL, BAD_CAST "Description"); + for (const std::string& line : option.description) + { + AddNewNode(descriptionNode, "Value", "string", line.c_str()); + } + + xmlAddChild(optionsNode, descriptionNode); + xmlAddChild(optionsNode, selectNode); + } + + xmlAddChild(structNode, descriptionNode); + xmlAddChild(structNode, requirementsNode); + xmlAddChild(structNode, commandsNode); + xmlAddChild(structNode, optionsNode); + xmlAddChild(rootNode, structNode); + + std::string result = Xml::Serialize(rootNode); + xmlFreeNode(rootNode); + return result; + } + + namespace + { + void AddNewNode(xmlNodePtr rootNode, const char* name, const char* type, const char* value) + { + xmlNodePtr memberNode = xmlNewNode(NULL, BAD_CAST "member"); + xmlNodePtr valueNode = xmlNewNode(NULL, BAD_CAST "value"); + xmlNewChild(memberNode, NULL, BAD_CAST "name", BAD_CAST name); + xmlNewChild(valueNode, NULL, BAD_CAST type, BAD_CAST value); + xmlAddChild(memberNode, valueNode); + xmlAddChild(rootNode, memberNode); + } + + const char* BoolToStr(bool value) + { + return value ? "true" : "false"; + } + } +} diff --git a/daemon/extension/Extension.h b/daemon/extension/Extension.h new file mode 100644 index 00000000..6e3e7ef1 --- /dev/null +++ b/daemon/extension/Extension.h @@ -0,0 +1,117 @@ +/* + * This file is part of nzbget. See . + * + * Copyright (C) 2023 Denis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef EXTENSION_H +#define EXTENSION_H + +#include "ManifestFile.h" + +namespace Extension +{ + struct Kind + { + bool post = false; + bool scan = false; + bool queue = false; + bool scheduler = false; + bool feed = false; + }; + + class Script + { + public: + Script() = default; + ~Script() = default; + + Script& operator=(const Script&) = delete; + Script(const Script&) = delete; + + Script(Script&& other) = default; + Script& operator=(Script&& other) = default; + + void SetEntry(std::string entry); + const char* GetEntry() const; + void SetLocation(std::string location); + const char* GetLocation() const; + void SetRootDir(std::string dir); + const char* GetRootDir() const; + void SetAuthor(std::string author); + const char* GetAuthor() const; + void SetVersion(std::string version); + const char* GetVersion() const; + void SetLicense(std::string license); + const char* GetLicense() const; + void SetHomepage(std::string homepage); + const char* GetHomepage() const; + void SetName(std::string name); + const char* GetName() const; + void SetDisplayName(std::string displayName); + const char* GetDisplayName() const; + void SetAbout(std::string about); + const char* GetAbout() const; + void SetDescription(std::vector description); + const std::vector& GetDescription() const; + void SetKind(Kind kind); + bool GetPostScript() const; + bool GetScanScript() const; + bool GetQueueScript() const; + bool GetSchedulerScript() const; + bool GetFeedScript() const; + void SetQueueEvents(std::string queueEvents); + const char* GetQueueEvents() const; + void SetTaskTime(std::string taskTime); + const char* GetTaskTime() const; + void SetRequirements(std::vector requirements); + const std::vector& GetRequirements() const; + void SetOptions(std::vector options); + const std::vector& GetOptions() const; + void SetCommands(std::vector commands); + const std::vector& GetCommands() const; + + private: + Kind m_kind; + std::string m_entry; + std::string m_location; + std::string m_rootDir; + std::string m_author; + std::string m_version; + std::string m_homepage; + std::string m_license; + std::string m_name; + std::string m_displayName; + std::string m_about; + std::string m_queueEvents; + std::string m_taskTime; + std::vector m_description; + std::vector m_requirements; + std::vector m_options; + std::vector m_commands; + }; + + std::string ToJsonStr(const Script& script); + std::string ToXmlStr(const Script& script); + + namespace + { + void AddNewNode(xmlNodePtr rootNode, const char* name, const char* type, const char* value); + const char* BoolToStr(bool value); + } +} + +#endif diff --git a/daemon/extension/ExtensionLoader.cpp b/daemon/extension/ExtensionLoader.cpp new file mode 100644 index 00000000..804d2c1a --- /dev/null +++ b/daemon/extension/ExtensionLoader.cpp @@ -0,0 +1,422 @@ +/* + * This file is part of nzbget. See . + * + * Copyright (C) 2023 Denis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "nzbget.h" + +#include +#include +#include "ExtensionLoader.h" +#include "ManifestFile.h" +#include "ScriptConfig.h" +#include "FileSystem.h" + +namespace ExtensionLoader +{ + const char* BEGIN_SCRIPT_SIGNATURE = "### NZBGET "; + const char* BEGIN_SCRIPT_COMMANDS_AND_OTPIONS = "### OPTIONS "; + const char* POST_SCRIPT_SIGNATURE = "POST-PROCESSING"; + const char* SCAN_SCRIPT_SIGNATURE = "SCAN"; + const char* QUEUE_SCRIPT_SIGNATURE = "QUEUE"; + const char* SCHEDULER_SCRIPT_SIGNATURE = "SCHEDULER"; + const char* FEED_SCRIPT_SIGNATURE = "FEED"; + const char* END_SCRIPT_SIGNATURE = " SCRIPT"; + const char* QUEUE_EVENTS_SIGNATURE = "### QUEUE EVENTS:"; + const char* TASK_TIME_SIGNATURE = "### TASK TIME:"; + const char* DEFINITION_SIGNATURE = "###"; + + const int BEGIN_SCRIPT_COMMANDS_AND_OTPIONS_LEN = strlen(BEGIN_SCRIPT_COMMANDS_AND_OTPIONS); + const int BEGIN_SINGNATURE_LEN = strlen(BEGIN_SCRIPT_SIGNATURE); + const int QUEUE_EVENTS_SIGNATURE_LEN = strlen(QUEUE_EVENTS_SIGNATURE); + const int TASK_TIME_SIGNATURE_LEN = strlen(TASK_TIME_SIGNATURE); + const int DEFINITION_SIGNATURE_LEN = strlen(DEFINITION_SIGNATURE); + + namespace V1 + { + bool Load(Extension::Script& script, const char* location, const char* rootDir) + { + std::ifstream file(script.GetEntry()); + if (!file.is_open()) + { + return false; + } + + std::string queueEvents; + std::string taskTime; + std::string about; + + Extension::Kind kind; + std::vector description; + std::vector requirements; + std::vector options; + std::vector commands; + + bool inBeforeConfig = false; + bool inConfig = false; + bool inAbout = false; + bool inDescription = false; + + // Declarations "QUEUE EVENT:" and "TASK TIME:" can be placed: + // - in script definition body (between opening and closing script signatures); + // - immediately before script definition (before opening script signature); + // - immediately after script definition (after closing script signature). + // The last two pissibilities are provided to increase compatibility of scripts with older + // nzbget versions which do not expect the extra declarations in the script defintion body. + std::string line; + while (std::getline(file, line)) + { + if (line.empty()) + { + continue; + } + if (!inBeforeConfig && !strncmp(line.c_str(), DEFINITION_SIGNATURE, DEFINITION_SIGNATURE_LEN)) + { + inBeforeConfig = true; + } + if (!inBeforeConfig && !inConfig) + { + continue; + } + + // if TASK TIME, e.g. ### TASK TIME: *;*:00;*:30 ### + if (!strncmp(line.c_str(), TASK_TIME_SIGNATURE, TASK_TIME_SIGNATURE_LEN)) + { + taskTime = line.substr(TASK_TIME_SIGNATURE_LEN + 1); + RemoveTailAndTrim(taskTime, "###"); + continue; + } + + if (!strncmp(line.c_str(), BEGIN_SCRIPT_SIGNATURE, BEGIN_SINGNATURE_LEN) && strstr(line.c_str(), END_SCRIPT_SIGNATURE)) + { + if (inConfig) + { + break; + } + inBeforeConfig = false; + inConfig = true; + kind = GetScriptKind(line.c_str()); + continue; + } + + // if QUEUE EVENTS, e.g. ### QUEUE EVENTS: NZB_ADDED, NZB_DOWNLOADED ### + if (!strncmp(line.c_str(), QUEUE_EVENTS_SIGNATURE, QUEUE_EVENTS_SIGNATURE_LEN)) + { + queueEvents = line.substr(QUEUE_EVENTS_SIGNATURE_LEN + 1); + RemoveTailAndTrim(queueEvents, "###"); + continue; + } + + // if about, e.g. # Sort movies and tv shows. + if (inConfig && !strncmp(line.c_str(), "# ", 2) && !inDescription) + { + inAbout = true; + about.append(line.substr(2)).push_back('\n'); + continue; + } + + if (inConfig && !strncmp(line.c_str(), "#", 1) && inAbout) + { + inAbout = false; + inDescription = true; + continue; + } + + // if requirements: e.g. NOTE: This script requires Python to be installed on your system. + if (inConfig && !strncmp(line.c_str(), "# NOTE: ", 8) && inDescription) + { + requirements.push_back(line.substr(strlen("# NOTE: "))); + continue; + } + + // if description: e.g # This is a script for downloaded TV shows and movies... + if (inConfig && !strncmp(line.c_str(), "# ", 2) && inDescription) + { + description.push_back(line.substr(2)); + continue; + } + + if (!strncmp(line.c_str(), BEGIN_SCRIPT_COMMANDS_AND_OTPIONS, BEGIN_SCRIPT_COMMANDS_AND_OTPIONS_LEN)) + { + ParseOptionsAndCommands(file, options, commands); + break; + } + } + + if (!(kind.post || kind.scan || kind.queue || kind.scheduler || kind.feed)) + { + return false; + } + + BuildDisplayName(script); + Util::TrimRight(about); + + requirements.shrink_to_fit(); + options.shrink_to_fit(); + commands.shrink_to_fit(); + + script.SetLocation(location); + script.SetRootDir(rootDir); + script.SetRequirements(std::move(requirements)); + script.SetKind(std::move(kind)); + script.SetQueueEvents(std::move(queueEvents)); + script.SetAbout(std::move(about)); + script.SetDescription(std::move(description)); + script.SetTaskTime(std::move(taskTime)); + script.SetOptions(std::move(options)); + script.SetCommands(std::move(commands)); + + return true; + } + namespace + { + void RemoveTailAndTrim(std::string& str, const char* tail) + { + size_t tailIdx = str.find(tail); + if (tailIdx != std::string::npos) + { + str = str.substr(0, tailIdx); + } + Util::TrimRight(str); + } + + void BuildDisplayName(Extension::Script& script) + { + BString<1024> shortName = script.GetName(); + if (char* ext = strrchr(shortName, '.')) *ext = '\0'; // strip file extension + + const char* displayName = FileSystem::BaseFileName(shortName); + + script.SetDisplayName(displayName); + } + + void ParseOptionsAndCommands( + std::ifstream& file, + std::vector& options, + std::vector& commands) + { + std::vector description; + std::string line; + while (getline(file, line)) + { + if (strstr(line.c_str(), END_SCRIPT_SIGNATURE)) + { + break; + } + if (line.empty()) + { + continue; + } + + size_t selectStartIdx = line.find("("); + size_t selectEndIdx = line.find(")"); + bool hasSelectOptions = selectStartIdx != std::string::npos + && selectEndIdx != std::string::npos + && selectEndIdx != std::string::npos + && !strncmp(line.c_str(), "# ", 2); + + // e.g. # When to send the message (Always, OnFailure) or # SMTP server port (1-65535). + if (hasSelectOptions) + { + std::string comma = ", "; + std::string dash = "-"; + bool foundComma = line.substr(selectStartIdx, selectEndIdx).find(comma) != std::string::npos; + bool foundDash = line.substr(selectStartIdx, selectEndIdx).find(dash) != std::string::npos; + if (!foundComma && !foundDash || !description.empty()) + { + description.push_back(line.substr(2)); + continue; + } + + std::string selectOptionsStr = line.substr(selectStartIdx + 1, selectEndIdx - selectStartIdx - 1); + + if (foundComma && !CheckCommaAfterEachWord(selectOptionsStr)) + { + description.push_back(line.substr(2)); + continue; + } + if (foundDash) + { + description.push_back(line.substr(2)); + } + else + { + description.push_back(line.substr(2, selectStartIdx - 3) + "."); + } + + ManifestFile::Option option; + std::vector selectOpts; + std::string delimiter = foundDash ? dash : comma; + ParseSelectOptions(selectOptionsStr, delimiter, selectOpts, foundDash); + option.select = std::move(selectOpts); + + while (std::getline(file, line)) + { + if (line == "#") + { + continue; + } + if (!strncmp(line.c_str(), "# ", 2)) + { + line = line.substr(2); + Util::TrimRight(line); + if (!line.empty()) + { + description.push_back(std::move(line)); + } + continue; + } + + if (strncmp(line.c_str(), "# ", 2)) + { + size_t delimPos = line.find("="); + if (delimPos != std::string::npos) + { + std::string name = line.substr(1, delimPos - 1); + std::string value = line.substr(delimPos + 1); + option.value = std::move(GetSelectOpt(value, foundDash)); + option.name = std::move(name); + option.displayName = option.name; + } + option.description = std::move(description); + options.push_back(std::move(option)); + break; + } + } + continue; + } + if (strncmp(line.c_str(), "# ", 2)) + { + // if command, e.g. #ConnectionTest@Send Test E-Mail + size_t eqPos = line.find("="); + size_t atPos = line.find("@"); + if (atPos != std::string::npos && eqPos == std::string::npos) + { + ManifestFile::Command command; + std::string name = line.substr(1, atPos - 1); + std::string action = line.substr(atPos + 1); + command.action = std::move(action); + command.name = std::move(name); + command.description = std::move(description); + command.displayName = command.name; + commands.push_back(std::move(command)); + } + else + { + if (eqPos != std::string::npos) + { + // if option, e.g. #Username=myaccount + ManifestFile::Option option; + std::string name = line.substr(1, eqPos - 1); + std::string value = line.substr(eqPos + 1); + option.value = std::move(value); + option.name = std::move(name); + option.description = std::move(description); + option.displayName = option.name; + options.push_back(std::move(option)); + } + } + } + else + { + description.push_back(line.substr(2)); + } + } + } + + void ParseSelectOptions( + std::string& line, + const std::string& delimiter, + std::vector& selectOpts, + bool isDash) + { + size_t pos = 0; + while ((pos = line.find(delimiter)) != std::string::npos) + { + std::string selectOpt = line.substr(0, pos); + selectOpts.push_back(std::move(GetSelectOpt(selectOpt, isDash))); + line.erase(0, pos + delimiter.length()); + } + selectOpts.push_back(std::move(GetSelectOpt(line, isDash))); + } + + ManifestFile::SelectOption GetSelectOpt(const std::string& val, bool isNumber) + { + if (isNumber) + return ManifestFile::SelectOption(std::stod(val)); + + return ManifestFile::SelectOption(val); + } + + bool CheckCommaAfterEachWord(const std::string& sentence) + { + std::stringstream ss(sentence); + std::string word; + + while (ss >> word) { + if (!word.empty() && word.back() != ',' && !ss.eof()) + { + return false; + } + } + + return true; + } + } + } + + bool V2::Load(Extension::Script& script, const char* location, const char* rootDir) + { + ManifestFile::Manifest manifest; + if (!ManifestFile::Load(manifest, location)) + return false; + + std::string entry = std::string(location) + PATH_SEPARATOR + manifest.main; + script.SetEntry(std::move(entry)); + script.SetLocation(location); + script.SetRootDir(rootDir); + script.SetAuthor(std::move(manifest.author)); + script.SetHomepage(std::move(manifest.homepage)); + script.SetLicense(std::move(manifest.license)); + script.SetVersion(std::move(manifest.version)); + script.SetDisplayName(std::move(manifest.displayName)); + script.SetName(std::move(manifest.name)); + script.SetAbout(std::move(manifest.about)); + script.SetDescription(std::move(manifest.description)); + script.SetKind(GetScriptKind(manifest.kind)); + script.SetQueueEvents(std::move(manifest.queueEvents)); + script.SetTaskTime(std::move(manifest.taskTime)); + script.SetRequirements(std::move(manifest.requirements)); + script.SetCommands(std::move(manifest.commands)); + script.SetOptions(std::move(manifest.options)); + return true; + } + + namespace + { + Extension::Kind GetScriptKind(const std::string& line) + { + Extension::Kind kind; + kind.post = strstr(line.c_str(), POST_SCRIPT_SIGNATURE) != nullptr; + kind.scan = strstr(line.c_str(), SCAN_SCRIPT_SIGNATURE) != nullptr; + kind.queue = strstr(line.c_str(), QUEUE_SCRIPT_SIGNATURE) != nullptr; + kind.scheduler = strstr(line.c_str(), SCHEDULER_SCRIPT_SIGNATURE) != nullptr; + kind.feed = strstr(line.c_str(), FEED_SCRIPT_SIGNATURE) != nullptr; + return kind; + } + } +} diff --git a/daemon/extension/ExtensionLoader.h b/daemon/extension/ExtensionLoader.h new file mode 100644 index 00000000..49ff4b31 --- /dev/null +++ b/daemon/extension/ExtensionLoader.h @@ -0,0 +1,81 @@ +/* + * This file is part of nzbget. See . + * + * Copyright (C) 2023 Denis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef EXTENSION_LOADER_H +#define EXTENSION_LOADER_H + +#include +#include "Extension.h" +#include "Util.h" + +namespace ExtensionLoader +{ + extern const char* BEGIN_SCRIPT_SIGNATURE; + extern const char* BEGIN_SCRIPT_COMMANDS_AND_OTPIONS; + extern const char* POST_SCRIPT_SIGNATURE; + extern const char* SCAN_SCRIPT_SIGNATURE; + extern const char* QUEUE_SCRIPT_SIGNATURE; + extern const char* SCHEDULER_SCRIPT_SIGNATURE; + extern const char* FEED_SCRIPT_SIGNATURE; + extern const char* END_SCRIPT_SIGNATURE; + extern const char* QUEUE_EVENTS_SIGNATURE; + extern const char* TASK_TIME_SIGNATURE; + extern const char* DEFINITION_SIGNATURE; + + extern const int BEGIN_SCRIPT_COMMANDS_AND_OTPIONS_LEN; + extern const int BEGIN_SINGNATURE_LEN; + extern const int QUEUE_EVENTS_SIGNATURE_LEN; + extern const int TASK_TIME_SIGNATURE_LEN; + extern const int DEFINITION_SIGNATURE_LEN; + + namespace V1 + { + bool Load(Extension::Script& script, const char* location, const char* rootDir); + namespace + { + void ParseOptionsAndCommands( + std::ifstream& file, + std::vector& options, + std::vector& commands + ); + void ParseSelectOptions( + std::string& line, + const std::string& delimiter, + std::vector& selectOpts, + bool isDash + ); + ManifestFile::SelectOption GetSelectOpt(const std::string& val, bool isNumber); + void RemoveTailAndTrim(std::string& str, const char* tail); + void BuildDisplayName(Extension::Script& script); + bool CheckCommaAfterEachWord(const std::string& sentence); + } + } + + namespace V2 + { + bool Load(Extension::Script& script, const char* location, const char* rootDir); + } + + namespace + { + Extension::Kind GetScriptKind(const std::string& line); + } +} + +#endif diff --git a/daemon/extension/ExtensionManager.cpp b/daemon/extension/ExtensionManager.cpp new file mode 100644 index 00000000..2fbebc3b --- /dev/null +++ b/daemon/extension/ExtensionManager.cpp @@ -0,0 +1,373 @@ +/* + * This file is part of nzbget. See . + * + * Copyright (C) 2023 Denis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "nzbget.h" + +#include +#include "Util.h" +#include "FileSystem.h" +#include "NString.h" +#include "Unpack.h" +#include "ExtensionLoader.h" +#include "ExtensionManager.h" + +namespace ExtensionManager +{ + const Extensions& Manager::GetExtensions() const + { + std::shared_lock lock{m_mutex}; + return m_extensions; + } + + std::pair + Manager::DownloadExtension(const std::string& url, const std::string& extName) + { + BString<1024> tmpFileName; + tmpFileName.Format("%s%cextension-%s.tmp.zip", g_Options->GetTempDir(), PATH_SEPARATOR, extName.c_str()); + + std::unique_ptr downloader = std::make_unique(); + downloader->SetUrl(url.c_str()); + downloader->SetForce(true); + downloader->SetRetry(false); + downloader->SetOutputFilename(tmpFileName); + downloader->SetInfoName(extName.c_str()); + + WebDownloader::EStatus status = downloader->DownloadWithRedirects(5); + downloader.reset(); + + return std::pair(status, tmpFileName.Str()); + } + + boost::optional + Manager::UpdateExtension(const std::string& filename, const std::string& extName) + { + std::unique_lock lock{m_mutex}; + + auto extensionIt = GetByName(extName); + if (extensionIt == std::end(m_extensions)) + { + return "Failed to find " + extName; + } + + if (extensionIt->use_count() > 1) + { + return "Failed to update: " + filename + " is executing"; + } + + const auto deleteExtError = DeleteExtension(*(*extensionIt)); + if (deleteExtError) + { + if (!FileSystem::DeleteFile(filename.c_str())) + { + return "Failed to delete extension and temp file: " + filename; + } + + return deleteExtError; + } + + const auto installExtError = InstallExtension(filename, (*extensionIt)->GetRootDir()); + if (installExtError) + { + return installExtError; + } + + m_extensions.erase(extensionIt); + return boost::none; + } + + boost::optional + Manager::InstallExtension(const std::string& filename, const std::string& dest) + { + if (Util::EmptyStr(g_Options->GetSevenZipCmd())) + { + + return std::string("\"SevenZipCmd\" is not specified"); + } + + UnpackController unpacker; + std::string outputDir = "-o" + dest; + UnpackController::ArgList args = { + g_Options->GetSevenZipCmd(), + "x", + filename.c_str(), + outputDir.c_str(), + "-y", + }; + unpacker.SetArgs(std::move(args)); + + int res = unpacker.Execute(); + + if (res != 0) + { + if (!FileSystem::DeleteFile(filename.c_str())) + { + return "Failed to unpack and delete temp file: " + filename; + } + + return "Failed to unpack " + filename; + } + + if (!FileSystem::DeleteFile(filename.c_str())) + { + return "Failed to delete temp file: " + filename; + } + + return boost::none; + } + + boost::optional + Manager::DeleteExtension(const std::string& name) + { + std::unique_lock lock{m_mutex}; + + auto extensionIt = GetByName(name); + if (extensionIt == std::end(m_extensions)) + { + return "Failed to find " + name; + } + + if (extensionIt->use_count() > 1) + { + return "Failed to delete: " + name + " is executing"; + } + + const auto err = DeleteExtension(*(*extensionIt)); + if (err) + { + return err; + } + + m_extensions.erase(extensionIt); + return boost::none; + } + + boost::optional + Manager::LoadExtensions() + { + const char* scriptDir = g_Options->GetScriptDir(); + if (Util::EmptyStr(scriptDir)) + { + return std::string("\"ScriptDir\" is not specified"); + } + + std::unique_lock lock{m_mutex}; + + m_extensions.clear(); + + Tokenizer tokDir(scriptDir, ",;"); + while (const char* extensionDir = tokDir.Next()) + { + LoadExtensionDir(extensionDir, false, extensionDir); + } + + Sort(g_Options->GetScriptOrder()); + CreateTasks(); + m_extensions.shrink_to_fit(); + + return boost::none; + } + + boost::optional + Manager::DeleteExtension(const Extension::Script& ext) + { + const char* location = ext.GetLocation(); + + CString err; + if (FileSystem::DirectoryExists(location) && FileSystem::DeleteDirectoryWithContent(location, err)) + { + if (!err.Empty()) + { + return boost::optional(err.Str()); + } + + return boost::none; + } + else if (FileSystem::FileExists(location) && FileSystem::DeleteFile(location)) + { + return boost::none; + } + + return std::string("Failed to delete ") + location; + } + + void Manager::LoadExtensionDir(const char* directory, bool isSubDir, const char* rootDir) + { + Extension::Script extension; + + if (ExtensionLoader::V2::Load(extension, directory, rootDir)) { + if (!Exists(extension.GetName())) + { + m_extensions.emplace_back(std::make_shared(std::move(extension))); + return; + } + } + + DirBrowser dir(directory); + while (const char* filename = dir.Next()) + { + if (filename[0] == '.' || filename[0] == '_') + continue; + + BString<1024> entry("%s%c%s", directory, PATH_SEPARATOR, filename); + if (!FileSystem::DirectoryExists(entry)) + { + std::string name = GetExtensionName(filename); + if (Exists(name)) + { + continue; + } + + const char* location = isSubDir ? directory : *entry; + extension.SetEntry(*entry); + extension.SetName(std::move(name)); + if (ExtensionLoader::V1::Load(extension, location, rootDir)) + { + m_extensions.emplace_back(std::make_shared(std::move(extension))); + } + } + else if (!isSubDir) + { + LoadExtensionDir(entry, true, rootDir); + } + } + } + + void Manager::CreateTasks() const + { + for (const auto extension : m_extensions) + { + if (!extension->GetSchedulerScript() || Util::EmptyStr(extension->GetTaskTime())) + { + continue; + } + Tokenizer tok(g_Options->GetExtensions(), ",;"); + while (const char* scriptName = tok.Next()) + { + if (strcmp(scriptName, extension->GetName()) == 0) + { + g_Options->CreateSchedulerTask( + 0, + extension->GetTaskTime(), + nullptr, + Options::scScript, + extension->GetName() + ); + break; + } + } + } + } + + bool Manager::Exists(const std::string& name) const + { + return GetByName(name) != std::end(m_extensions); + } + + void Manager::Sort(const char* orderStr) + { + auto comparator = [](const auto& a, const auto& b) -> bool + { + return strcmp(a->GetName(), b->GetName()) < 0; + }; + + if (Util::EmptyStr(orderStr)) + { + std::sort( + std::begin(m_extensions), + std::end(m_extensions), + comparator + ); + return; + } + + std::vector order; + Tokenizer tokOrder(orderStr, ",;"); + while (const char* extName = tokOrder.Next()) + { + auto pos = std::find( + std::begin(order), + std::end(order), + extName + ); + + if (pos == std::end(order)) + { + order.push_back(extName); + } + } + + if (order.empty()) + { + std::sort( + std::begin(m_extensions), + std::end(m_extensions), + comparator + ); + return; + } + + size_t count = 0; + for (size_t i = 0; i < order.size(); ++i) + { + const std::string& name = order[i]; + auto it = std::find_if( + std::begin(m_extensions), + std::end(m_extensions), + [&name](const auto& ext) + { + return name == ext->GetName(); + } + ); + if (it != std::end(m_extensions)) + { + std::iter_swap(std::begin(m_extensions) + count, it); + ++count; + } + } + + std::sort( + std::begin(m_extensions) + count, + std::end(m_extensions), + comparator + ); + } + + std::string Manager::GetExtensionName(const std::string& fileName) const + { + size_t lastIdx = fileName.find_last_of("."); + if (lastIdx != std::string::npos) + { + return fileName.substr(0, lastIdx); + } + + return fileName; + } + + Extensions::const_iterator Manager::GetByName(const std::string& name) const + { + return std::find_if( + std::begin(m_extensions), + std::end(m_extensions), + [&name](const auto& ext) + { + return ext->GetName() == name; + } + ); + } +} diff --git a/daemon/extension/ExtensionManager.h b/daemon/extension/ExtensionManager.h new file mode 100644 index 00000000..6a9c63f9 --- /dev/null +++ b/daemon/extension/ExtensionManager.h @@ -0,0 +1,82 @@ +/* + * This file is part of nzbget. See . + * + * Copyright (C) 2023 Denis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef EXTENSION_MANAGER_H +#define EXTENSION_MANAGER_H + +#include +#include +#include +#include +#include +#include "WebDownloader.h" +#include "Options.h" +#include "Extension.h" + +namespace ExtensionManager +{ + using Extensions = std::vector>; + + class Manager + { + public: + Manager() = default; + ~Manager() = default; + + Manager(const Manager&) = delete; + Manager& operator=(const Manager&) = delete; + + Manager(Manager&&) = delete; + Manager& operator=(Manager&&) = delete; + + boost::optional + InstallExtension(const std::string& filename, const std::string& dest); + + boost::optional + UpdateExtension(const std::string& filename, const std::string& extName); + + boost::optional + DeleteExtension(const std::string& name); + + boost::optional + LoadExtensions(); + + std::pair + DownloadExtension(const std::string& url, const std::string& info); + + const Extensions& GetExtensions() const; + + private: + void LoadExtensionDir(const char* directory, bool isSubDir, const char* rootDir); + void CreateTasks() const; + Extensions::const_iterator GetByName(const std::string& name) const; + bool Exists(const std::string& name) const; + void Sort(const char* order); + std::string GetExtensionName(const std::string& fileName) const; + boost::optional + DeleteExtension(const Extension::Script& ext); + + Extensions m_extensions; + mutable std::shared_timed_mutex m_mutex; + }; +} + +extern ExtensionManager::Manager* g_ExtensionManager; + +#endif diff --git a/daemon/extension/FeedScript.cpp b/daemon/extension/FeedScript.cpp index 03b1477d..be36a889 100644 --- a/daemon/extension/FeedScript.cpp +++ b/daemon/extension/FeedScript.cpp @@ -40,7 +40,7 @@ void FeedScriptController::ExecuteScripts(const char* feedScript, const char* fe } } -void FeedScriptController::ExecuteScript(ScriptConfig::Script* script) +void FeedScriptController::ExecuteScript(std::shared_ptr script) { if (!script->GetFeedScript()) { @@ -49,7 +49,7 @@ void FeedScriptController::ExecuteScript(ScriptConfig::Script* script) PrintMessage(Message::mkInfo, "Executing feed-script %s for Feed%i", script->GetName(), m_feedId); - SetArgs({script->GetLocation()}); + SetArgs({script->GetEntry()}); BString<1024> infoName("feed-script %s for Feed%i", script->GetName(), m_feedId); SetInfoName(infoName); diff --git a/daemon/extension/FeedScript.h b/daemon/extension/FeedScript.h index 5dc6d0e6..86a98b22 100644 --- a/daemon/extension/FeedScript.h +++ b/daemon/extension/FeedScript.h @@ -29,7 +29,7 @@ class FeedScriptController : public NzbScriptController static void ExecuteScripts(const char* feedScript, const char* feedFile, int feedId, bool* success); protected: - virtual void ExecuteScript(ScriptConfig::Script* script); + virtual void ExecuteScript(std::shared_ptr script); private: const char* m_feedFile; diff --git a/daemon/extension/ManifestFile.cpp b/daemon/extension/ManifestFile.cpp new file mode 100644 index 00000000..bed19e5e --- /dev/null +++ b/daemon/extension/ManifestFile.cpp @@ -0,0 +1,232 @@ +/* + * This file is part of nzbget. See . + * + * Copyright (C) 2023 Denis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "nzbget.h" + +#include +#include "ManifestFile.h" +#include "Json.h" +#include "FileSystem.h" + +namespace ManifestFile +{ + const char* MANIFEST_FILE = "manifest.json"; + + bool Load(Manifest& manifest, const char* directory) + { + BString<1024> path("%s%c%s", directory, PATH_SEPARATOR, MANIFEST_FILE); + std::ifstream fs(path); + if (!fs.is_open()) + return false; + + Json::ErrorCode ec; + Json::JsonValue jsonValue = Json::Deserialize(fs, ec); + if (ec) + return false; + + Json::JsonObject json = jsonValue.as_object(); + + if (!ValidateAndSet(json, manifest)) + return false; + + return true; + } + + namespace + { + bool ValidateAndSet(const Json::JsonObject& json, Manifest& manifest) + { + if (!CheckKeyAndSet(json, "author", manifest.author)) + return false; + + if (!CheckKeyAndSet(json, "main", manifest.main)) + return false; + + if (!CheckKeyAndSet(json, "homepage", manifest.homepage)) + return false; + + if (!CheckKeyAndSet(json, "about", manifest.about)) + return false; + + if (!CheckKeyAndSet(json, "version", manifest.version)) + return false; + + if (!CheckKeyAndSet(json, "name", manifest.name)) + return false; + + if (!CheckKeyAndSet(json, "displayName", manifest.displayName)) + return false; + + if (!CheckKeyAndSet(json, "kind", manifest.kind)) + return false; + + if (!CheckKeyAndSet(json, "license", manifest.license)) + return false; + + if (!CheckKeyAndSet(json, "taskTime", manifest.taskTime)) + return false; + + if (!CheckKeyAndSet(json, "queueEvents", manifest.queueEvents)) + return false; + + if (!ValidateOptionsAndSet(json, manifest.options)) + return false; + + if (!ValidateCommandsAndSet(json, manifest.commands)) + return false; + + if (!ValidateTxtAndSet(json, manifest.description, "description")) + return false; + + if (!ValidateTxtAndSet(json, manifest.requirements, "requirements")) + return false; + + return true; + } + + bool ValidateCommandsAndSet(const Json::JsonObject& json, std::vector& commands) + { + auto rawCommands = json.if_contains("commands"); + if (!rawCommands || !rawCommands->is_array()) + return false; + + for (auto& value : rawCommands->as_array()) + { + Json::JsonObject cmdJson = value.as_object(); + Command command; + + if (!CheckKeyAndSet(cmdJson, "name", command.name)) + continue; + + if (!CheckKeyAndSet(cmdJson, "displayName", command.displayName)) + continue; + + if (!ValidateTxtAndSet(cmdJson, command.description, "description")) + continue; + + if (!CheckKeyAndSet(cmdJson, "action", command.action)) + continue; + + commands.emplace_back(std::move(command)); + } + + commands.shrink_to_fit(); + + return true; + } + + bool ValidateOptionsAndSet(const Json::JsonObject& json, std::vector