Commit 4e8d21d849dc4c562d02c4aa22683296cbd314f7

Authored by Jay Berkenbilt
1 parent 026330eb

Build Windows releases with openssl; automate external libraries

External libraries for Windows are now built automatically in the
qpdf/external-libs repository and include openssl in addition to zlib
and jpeg. Use these, and update the Windows build to build with the
openssl crypto provider by default. We leave the native crypto
provider enabled in case there is a problem with openssl and also to
continue to exercise that code.
.github/workflows/main.yml
@@ -35,6 +35,11 @@ jobs: @@ -35,6 +35,11 @@ jobs:
35 with: 35 with:
36 name: distfiles 36 name: distfiles
37 path: distfiles.zip 37 path: distfiles.zip
  38 + - name: 'Upload external libs'
  39 + uses: actions/upload-artifact@v1
  40 + with:
  41 + name: external-libs
  42 + path: external-libs-dist
38 Linux: 43 Linux:
39 runs-on: ubuntu-latest 44 runs-on: ubuntu-latest
40 steps: 45 steps:
@@ -64,6 +69,11 @@ jobs: @@ -64,6 +69,11 @@ jobs:
64 uses: actions/download-artifact@v2 69 uses: actions/download-artifact@v2
65 with: 70 with:
66 name: distfiles 71 name: distfiles
  72 + - name: 'Download external libs'
  73 + uses: actions/download-artifact@v2
  74 + with:
  75 + name: external-libs
  76 + path: .
67 - name: 'Build, test, generate binary distributions' 77 - name: 'Build, test, generate binary distributions'
68 shell: cmd 78 shell: cmd
69 run: build-scripts/build-windows.bat ${{ matrix.wordsize }} ${{ matrix.tool }} 79 run: build-scripts/build-windows.bat ${{ matrix.wordsize }} ${{ matrix.tool }}
@@ -81,6 +91,11 @@ jobs: @@ -81,6 +91,11 @@ jobs:
81 uses: actions/download-artifact@v2 91 uses: actions/download-artifact@v2
82 with: 92 with:
83 name: distfiles 93 name: distfiles
  94 + - name: 'Download external libs'
  95 + uses: actions/download-artifact@v2
  96 + with:
  97 + name: external-libs
  98 + path: .
84 - name: 'Mac build and test' 99 - name: 'Mac build and test'
85 run: build-scripts/build-mac 100 run: build-scripts/build-mac
86 AppImage: 101 AppImage:
ChangeLog
  1 +2020-10-25 Jay Berkenbilt <ejb@ql.org>
  2 +
  3 + * Official Windows releases are now built using the openssl crypto
  4 + provider. The native provider is still available for selection at
  5 + runtime using the QPDF_CRYPTO_PROVIDER environment variable.
  6 +
1 2020-10-23 Jay Berkenbilt <ejb@ql.org> 7 2020-10-23 Jay Berkenbilt <ejb@ql.org>
2 8
3 * Bug fix: when concatenating content streams, insert a newline if 9 * Bug fix: when concatenating content streams, insert a newline if
README-maintainer
@@ -326,20 +326,6 @@ To construct a source distribution from a pristine checkout, @@ -326,20 +326,6 @@ To construct a source distribution from a pristine checkout,
326 make build_manual 326 make build_manual
327 make distclean 327 make distclean
328 328
329 -To create a source release of external libs, do an export from the  
330 -version control system into a directory called `qpdf-external-libs`  
331 -and just make a zip file of the result called  
332 -`qpdf-external-libs-src.zip`. See the README.txt file there for  
333 -information on creating binary external libs releases. Run this from  
334 -the external-libs repository:  
335 -  
336 -git archive --prefix=external-libs/ HEAD . | (cd /tmp; tar xf -)  
337 -cd /tmp  
338 -zip -r qpdf-external-libs-src.zip external-libs  
339 -  
340 -When releasing on sourceforge, `external-libs` distributions go in  
341 -`external-libs/yyyymmdd`, and qpdf distributions go in `qpdf/vvv`.  
342 -  
343 For local iteration on the AppImage generation, it works to just 329 For local iteration on the AppImage generation, it works to just
344 ./build-scripts/build-appimage and get the resulting AppImage from 330 ./build-scripts/build-appimage and get the resulting AppImage from
345 the distribution directory. You can also pass -e SKIP_TESTS=1 331 the distribution directory. You can also pass -e SKIP_TESTS=1
README-what-to-download.md
1 To build from source for Linux or other UNIX/UNIX-like systems, it is generally sufficient to download just the source `qpdf-<version>.tar.gz` file. 1 To build from source for Linux or other UNIX/UNIX-like systems, it is generally sufficient to download just the source `qpdf-<version>.tar.gz` file.
2 2
3 -Virtually all Linux distributions include packages for qpdf. If you'd like to run the latest version of qpdf as an [AppImage](https://appimage.org/), you can download `qpdf-<version>-x86_64.AppImage`. This is a self-contained executable that you make symlink `qpdf` to and run on most reasonably recent Linux distributions. See README-appimage.md in the qpdf source distribution for additional details, or run the AppImage with the `--ai-usage` argument to get help specific to the AppImage. 3 +Windows Binaries
4 4
5 -For Windows, there are several additional files that you might want to download. 5 +You can download Windiows binaries that are statically linked with qpdf's external dependencies and use the OpenSSL crypto provider. There are several options:
6 6
7 -* `qpdf-<version>-bin-mingw32.zip` 7 +* `qpdf-<version>-bin-mingw32.zip` - 32-bit executables that should work on basically any Windows system, including 64-bit systems. The 32-bit executables are capable of handling files larger than 2 GB. If you just want to use the qpdf command line program or use the qpdf DLL's C-language interface, you can download this file. You can also download this version if you are using MINGW's gcc and want to program using the C++ interface.
8 8
9 - If you just want to use the qpdf command line program or use the qpdf DLL's C-language interface, you can download this file. You can also download this version if you are using MINGW's gcc and want to program using the C++ interface. 9 +* `qpdf-<version>-bin-mingw64.zip` - A 64-bit version built with mingw. Use this for 64-bit Windows systems. The 32-bit version will also work on Windows 64-bit. Both the 32-bit and the 64-bit version support files over 2 GB in size, but you may find it easier to integrate this with your own software if you use the 64-bit version.
10 10
11 -* `qpdf-<version>-bin-mingw64.zip` 11 +* `qpdf-<version>-bin-msvc32.zip` - If you want to program using qpdf's C++ interface and you are using a recent version of Microsoft Visual C++ in 32-bit mode, you can download this file.
12 12
13 - A 64-bit version built with mingw. Use this for 64-bit Windows systems. The 32-bit version will also work on Windows 64-bit. Both the 32-bit and the 64-bit version support files over 2 GB in size, but you may find it easier to integrate this with your own software if you use the 64-bit version. 13 +* `qpdf-<version>-bin-msvc64.zip` - If you want to program using qpdf's C++ interface and you are using a recent version of Microsoft Visual C++ in 64-bit mode, you can download this file.
14 14
15 -* `qpdf-<version>-bin-msvc32.zip` 15 +Linux Binaries
16 16
17 - If you want to program using qpdf's C++ interface and you are using Microsoft Visual C++ 2015 in 32-bit mode, you can download this file. 17 +Virtually all Linux distributions include packages for qpdf. There is also a PPA for Ubuntu at https://launchpad.net/~qpdf/+archive/ubuntu/qpdf that includes the latest version of qpdf for recent versions of Ubuntu. However, there are some downloads available for Linux as well.
18 18
19 -* `qpdf-<version>-bin-msvc64.zip` 19 +* `qpdf-<version>-x86_64.AppImage` - If you'd like to run the latest version of qpdf as an [AppImage](https://appimage.org/), you can download this. This is a self-contained executable that you make symlink `qpdf` to and run on most reasonably recent Linux distributions. See README-appimage.md in the qpdf source distribution for additional details, or run the AppImage with the `--ai-usage` argument to get help specific to the AppImage.
20 20
21 - If you want to program using qpdf's C++ interface and you are using Microsoft Visual C++ 2015 in 64-bit mode, you can download this file. 21 +* `qpdf-<version>-bin-linux-x86_64.zip` - This is a (nearly) stand-alone Linux binary, built using an Ubuntu LTS release. It contains the qpdf executables and shared libraries as well as dependent shared libraries that would not typically be present on a minimal system. This can be used to include qpdf in a minimal environment such as a docker container. It is also known to work as a layer in AWS Lambda and was initially created for that purpose.
22 22
23 -* `qpdf-external-libs-bin.zip`  
24 -  
25 - If you want to build qpdf for Windows yourself with either MINGW or MSVC 2015, you can download this file and extract it inside the qpdf source distribution. Please refer to README-windows.md in the qpdf source distribution for additional details. Note that you need the 2017-08-21 version or later to be able to build qpdf 7.0 or newer. Generally grab the `external-libs` distribution that was the latest version at the time of the release of whichever version of qpdf you are building.  
26 -  
27 -* `qpdf-external-libs-src.zip`  
28 -  
29 - If you want to build the external libraries on your own (for Windows or anything else), you can download this archive. In addition to including an unmodified distribution `zlib` and the `jpeg` library, it includes a `README` file and some scripts to help you build it for Windows. You will also have to provide those.  
30 -  
31 -If you want to build on Windows, please see also README-windows.md in the qpdf source distribution. 23 +Windows Build Support
32 24
  25 +If you are building on Windows and want to use pre-built external static libraries, you should obtain current versions from https://github.com/qpdf/external-libs/releases. The `external-libs` directory contains older versions that will not work with qpdf versions >= 10.0.2. Please see README-windows.md in the qpdf source distribution.
README-windows.md
@@ -32,11 +32,11 @@ Image comparison tests are disabled by default, but it is possible to run them o @@ -32,11 +32,11 @@ Image comparison tests are disabled by default, but it is possible to run them o
32 32
33 # External Libraries 33 # External Libraries
34 34
35 -In order to build qpdf, you must have a copy of `zlib` and the `jpeg` library. The easy way to get it is to download the external libs from the qpdf download area. There are packages called `external-libs-bin.zip` and `external-libs-src.zip`. If you are building with MSVC 2015 or MINGW with MSYS2, you can just extract the `qpdf-external-libs-bin.zip` zip file into the top-level qpdf source tree. Note that you need the 2017-08-21 version (at least) to build qpdf 7.0 or greater since this includes jpeg. Passing `--enable-external-libs` to `./configure` (which is done automatically if you follow the instructions below) is sufficient to find them. 35 +In order to build qpdf, you must have a copy of `zlib` and the `jpeg` library. You can download [prebuilt static external libraries from the qpdf/external-libs github repository](https://github.com/qpdf/external-libs/releases). These include `zlib`, `jpeg`, and `openssl` libraries. There are packages called `external-libs-bin.zip` and `external-libs-src.zip`. If you are building with a recent MSVC or MINGW with MSYS2, you can just extract the `qpdf-external-libs-bin.zip` zip file into the top-level qpdf source tree. Note that you need the 2020-10-24 version (at least) to build qpdf 10.0.2 or greater since this includes openssl. Passing `--enable-external-libs` to `./configure` (which is done automatically if you follow the instructions below) is sufficient to find them.
36 36
37 You can also obtain `zlib` and `jpeg` directly on your own and install them. If you are using mingw, you can just set `CPPFLAGS`, `LDFLAGS`, and `LIBS` when you run ./configure so that it can find the header files and libraries. If you are building with MSVC and you want to do this, it probably won't work because `./configure` doesn't know how to interpret `LDFLAGS` and `LIBS` properly for MSVC (though qpdf's own build system does). In this case, you can probably get away with cheating by passing `--enable-external-libs` to `./configure` and then just editing `CPPFLAGS`, `LDFLAGS`, `LIBS` in the generated autoconf.mk file. Note that you should use UNIX-like syntax (`-I`, `-L`, `-l`) even though this is not what cl takes on the command line. qpdf's build rules will fix it. 37 You can also obtain `zlib` and `jpeg` directly on your own and install them. If you are using mingw, you can just set `CPPFLAGS`, `LDFLAGS`, and `LIBS` when you run ./configure so that it can find the header files and libraries. If you are building with MSVC and you want to do this, it probably won't work because `./configure` doesn't know how to interpret `LDFLAGS` and `LIBS` properly for MSVC (though qpdf's own build system does). In this case, you can probably get away with cheating by passing `--enable-external-libs` to `./configure` and then just editing `CPPFLAGS`, `LDFLAGS`, `LIBS` in the generated autoconf.mk file. Note that you should use UNIX-like syntax (`-I`, `-L`, `-l`) even though this is not what cl takes on the command line. qpdf's build rules will fix it.
38 38
39 -You can also download `qpdf-external-libs-src.zip` and follow the instructions in the README.txt there for how to build external libs. 39 +External libraries are built using GitHub Actions from the [qpdf/external-libs](https://github.com/qpdf/external-libs) repository.
40 40
41 # Building from version control 41 # Building from version control
42 42
README.md
@@ -36,7 +36,7 @@ Depending on which crypto providers are enabled, then [GnuTLS](https://www.gnutl @@ -36,7 +36,7 @@ Depending on which crypto providers are enabled, then [GnuTLS](https://www.gnutl
36 36
37 # Licensing terms of embedded software 37 # Licensing terms of embedded software
38 38
39 -QPDF makes use of zlib and jpeg libraries for its functionality. These packages can be downloaded separately from their own download locations, or they can be downloaded in the external-libs area of the qpdf download site. If the optional GnuTLS crypto provider is enabled, then GnuTLS is also required. 39 +QPDF makes use of zlib and jpeg libraries for its functionality. These packages can be downloaded separately from their own download locations. If the optional GnuTLS or OpenSSL crypto providers are enabled, then GnuTLS and/or OpenSSL are also required.
40 40
41 Please see the [NOTICE](NOTICE.md) file for information on licenses of embedded software. 41 Please see the [NOTICE](NOTICE.md) file for information on licenses of embedded software.
42 42
@@ -8,8 +8,6 @@ Candidates for upcoming release @@ -8,8 +8,6 @@ Candidates for upcoming release
8 * #446: recognize edited QDF files 8 * #446: recognize edited QDF files
9 * #436: parsing of document with form xobject 9 * #436: parsing of document with form xobject
10 10
11 -* See if we can work in Windows Build/External Libraries (below)  
12 -  
13 * QPDFObjectHandle::pipeContentStreams calls finish() after each 11 * QPDFObjectHandle::pipeContentStreams calls finish() after each
14 stream. In some code paths, Pl_Concatenate is used, which suppresses 12 stream. In some code paths, Pl_Concatenate is used, which suppresses
15 that, but in other code paths, it's not used, and the library relies 13 that, but in other code paths, it's not used, and the library relies
@@ -94,20 +92,62 @@ GitHub Actions @@ -94,20 +92,62 @@ GitHub Actions
94 but I'd rather not depend on them. Keep an eye open for this coming 92 but I'd rather not depend on them. Keep an eye open for this coming
95 to GitHub Actions. 93 to GitHub Actions.
96 94
97 -Windows Build/External Libraries  
98 -================================ 95 +External Libraries
  96 +==================
  97 +
  98 +Current state (10.0.2):
  99 +
  100 +* qpdf/external-libs repository builds external-libs on a schedule.
  101 + It detects and downloads the latest versions of zlib, jpeg, and
  102 + openssl and creates source and binary distribution zip files in an
  103 + artifact called "distribution".
  104 +
  105 +* Releases in qpdf/external-libs are made manually. They contain
  106 + qpdf-external-libs-{bin,src}.zip.
  107 +
  108 +* The qpdf build finds the latest non-prerelease release and downloads
  109 + the qpdf-external-libs-*.zip files from the releases in the setup
  110 + stage.
  111 +
  112 +* To upgrade to a new version of external-libs, create a new release
  113 + of qpdf/external-libs (see README-maintainer in external-libs) from
  114 + the distribution artifact of the most recent successful build after
  115 + ensuring that it works.
  116 +
  117 +Desired state:
  118 +
  119 +* The qpdf/external-libs repository should create release candidates.
  120 + Ideally, every scheduled run would make its zip files available.
  121 + A personal access token with actions:read scope for the
  122 + qpdf/external-libs repository is required to download the artifact
  123 + from an action run, and qpdf/qpdf's secrets.GITHUB_TOKEN doesn't
  124 + have this access. As an alternative, we could have a draft release
  125 + in qpdf/external-libs that the qpdf/external-libs build could update
  126 + with each candidate.
  127 +
  128 +* Scheduled runs of the qpdf build in the qpdf/qpdf repository (not a
  129 + fork or pull request) could download external-libs from the release
  130 + candidate area instead of the latest stable release. Pushes to the
  131 + build branch should still use the latest release so it always
  132 + matches the main branch.
  133 +
  134 +* Periodically, we would create a release of external-libs from the
  135 + release candidate zip files. This could be done safely because we
  136 + know the latest qpdf works with it. This could be done at least
  137 + before every release of qpdf, but potientially it could be done at
  138 + other times, such as when a new dependency version is available or
  139 + after some period of time.
99 140
100 -* Migrate external library build code to a separate repository. 141 +Other notes:
101 142
102 -* Automate downloading and building latest versions of external  
103 - libraries. Add openssl. 143 +* The external-libs branch in qpdf/qpdf was never documented. We might
  144 + be able to get away with deleting it.
104 145
105 -* Build external libraries on a schedule and create releases  
106 - periodically or when they change. See if we can get rid of the  
107 - external-libs branch in qpdf/qpdf. 146 +* See README-maintainer in qpdf/external-libs for information on
  147 + creating a release. This could be at least partially scripted in a
  148 + way that works for the qpdf/qpdf repository as well since they are
  149 + very similar.
108 150
109 -* Update the Windows build so that it uses current versions of  
110 - external libraries and openssl as its crypto provider.  
111 151
112 ABI Changes 152 ABI Changes
113 =========== 153 ===========
autofiles.sums
1 -cc3c7947646412e7c3152c3ef238226ede1c2199328a38df93debee26184b087 configure.ac 1 +1c8c57be01a03bc85ca49293d0212026e0e9b28a73567bda8e27462abc3ffd1a configure.ac
2 d3f9ee6f6f0846888d9a10fd3dad2e4b1258be84205426cf04d7cef02d61dad7 aclocal.m4 2 d3f9ee6f6f0846888d9a10fd3dad2e4b1258be84205426cf04d7cef02d61dad7 aclocal.m4
3 cf2c764639c4c94abc183a0976eca6ae500b80790ea25e3d0af97b23587363b7 libqpdf/qpdf/qpdf-config.h.in 3 cf2c764639c4c94abc183a0976eca6ae500b80790ea25e3d0af97b23587363b7 libqpdf/qpdf/qpdf-config.h.in
4 5297971a0ef90bcd5563eb3f7127a032bb76d3ae2af7258bf13479caf8983a60 m4/ax_cxx_compile_stdcxx.m4 4 5297971a0ef90bcd5563eb3f7127a032bb76d3ae2af7258bf13479caf8983a60 m4/ax_cxx_compile_stdcxx.m4
build-scripts/build-mac
1 #!/bin/bash 1 #!/bin/bash
2 set -ex 2 set -ex
3 -curl -L https://github.com/qpdf/qpdf/raw/external-libs/jpegsrc.v9c.tar.gz -o jpegsrc.v9c.tar.gz  
4 -tar xzf jpegsrc.v9c.tar.gz  
5 -cd jpeg-9c 3 +cd $(dirname $0)/..
  4 +unzip qpdf-external-libs-src.zip
  5 +tar xzf external-libs-src/jpegsrc*
  6 +cd jpeg-*
6 ./configure 7 ./configure
7 make -k 8 make -k
8 sudo make install 9 sudo make install
build-scripts/build-windows
@@ -23,14 +23,13 @@ fi @@ -23,14 +23,13 @@ fi
23 if [ -f distfiles/distfiles.zip ]; then 23 if [ -f distfiles/distfiles.zip ]; then
24 unzip distfiles/distfiles.zip 24 unzip distfiles/distfiles.zip
25 fi 25 fi
26 -curl -L https://github.com/qpdf/qpdf/raw/external-libs/qpdf-external-libs-bin.zip -o qpdf-external-libs-bin.zip  
27 unzip qpdf-external-libs-bin.zip 26 unzip qpdf-external-libs-bin.zip
28 cwd=`pwd` 27 cwd=`pwd`
29 PATH=$cwd/libqpdf/build:$PATH 28 PATH=$cwd/libqpdf/build:$PATH
30 29
31 installdir=install-$tool$wordsize 30 installdir=install-$tool$wordsize
32 rm -rf $installdir 31 rm -rf $installdir
33 -./config-$tool --enable-show-failed-test-output --disable-crypto-gnutls --disable-crypto-openssl 32 +./config-$tool --enable-show-failed-test-output
34 make -j$(nproc) -k 33 make -j$(nproc) -k
35 make -k check 34 make -k check
36 make install 35 make install
build-scripts/download-external-libs 0 โ†’ 100755
  1 +#!/usr/bin/env python3
  2 +import json
  3 +import os
  4 +import requests
  5 +import sys
  6 +from zipfile import ZipFile
  7 +from operator import itemgetter
  8 +
  9 +
  10 +def warn(*args, **kwargs):
  11 + print(*args, **kwargs, file=sys.stderr)
  12 +
  13 +
  14 +def download_file(url, local_filename):
  15 + # From https://stackoverflow.com/questions/16694907/
  16 + # download-large-file-in-python-with-requests
  17 + if os.path.exists(local_filename):
  18 + warn('Using existing', local_filename)
  19 + return
  20 + warn('Downloading', local_filename)
  21 + with requests.get(url, stream=True) as r:
  22 + r.raise_for_status()
  23 + with open(local_filename, 'wb') as f:
  24 + for chunk in r.iter_content(chunk_size=8192):
  25 + f.write(chunk)
  26 + return local_filename
  27 +
  28 +
  29 +bin_name = 'qpdf-external-libs-bin.zip'
  30 +src_name = 'qpdf-external-libs-src.zip'
  31 +dir_name = 'external-libs-dist'
  32 +os.makedirs(dir_name, exist_ok=True)
  33 +
  34 +r = requests.get(
  35 + 'https://api.github.com/repos/qpdf/external-libs/releases')
  36 +releases = json.loads(r.text)
  37 +by_tag = sorted(
  38 + [(r['tag_name'], r) for r in releases
  39 + if r['prerelease'] is False],
  40 + reverse=True)
  41 +latest = by_tag[0][1]
  42 +bin_url = None
  43 +src_url = None
  44 +for i in latest['assets']:
  45 + if i['name'] == bin_name:
  46 + bin_url = i['browser_download_url']
  47 + elif i['name'] == src_name:
  48 + src_url = i['browser_download_url']
  49 +print(bin_url)
  50 +download_file(bin_url, f'{dir_name}/{bin_name}')
  51 +download_file(src_url, f'{dir_name}/{src_name}')
  52 +
  53 +print('\n** external library information **')
  54 +with ZipFile(f'{dir_name}/{src_name}') as z1:
  55 + with z1.open('external-libs-src/versions') as z2:
  56 + print(z2.read().decode())
build-scripts/make-distfiles
1 #!/bin/bash 1 #!/bin/bash
  2 +cd $(dirname $0)/..
2 set -ex 3 set -ex
3 sudo apt-get update 4 sudo apt-get update
4 sudo apt-get -y install \ 5 sudo apt-get -y install \
@@ -6,3 +7,4 @@ sudo apt-get -y install \ @@ -6,3 +7,4 @@ sudo apt-get -y install \
6 docbook-xsl fop xsltproc libxml2-utils inkscape imagemagick 7 docbook-xsl fop xsltproc libxml2-utils inkscape imagemagick
7 ./configure --enable-doc-maintenance 8 ./configure --enable-doc-maintenance
8 make -j$(nproc) distfiles.zip 9 make -j$(nproc) distfiles.zip
  10 +build-scripts/download-external-libs
config-mingw
@@ -6,4 +6,4 @@ if g++ -v 2&gt;&amp;1 | grep Target: | grep -q x86_64; then @@ -6,4 +6,4 @@ if g++ -v 2&gt;&amp;1 | grep Target: | grep -q x86_64; then
6 else 6 else
7 wordsize=32 7 wordsize=32
8 fi 8 fi
9 -./configure --disable-test-compare-images --enable-external-libs --enable-werror --with-buildrules=mingw ${1+"$@"} 9 +./configure --disable-test-compare-images --enable-external-libs --enable-werror --with-buildrules=mingw ${1+"$@"} --enable-crypto-openssl --disable-crypto-gnutls
config-msvc
@@ -6,4 +6,4 @@ if cl 2&gt;&amp;1 | grep -q &#39;for x64&#39;; then @@ -6,4 +6,4 @@ if cl 2&gt;&amp;1 | grep -q &#39;for x64&#39;; then
6 else 6 else
7 wordsize=32 7 wordsize=32
8 fi 8 fi
9 -CC=cl CXX="cl -TP -GR" ./configure --disable-test-compare-images --enable-external-libs --enable-werror --with-buildrules=msvc ${1+"$@"} 9 +CC=cl CXX="cl -TP -GR" ./configure --disable-test-compare-images --enable-external-libs --enable-werror --with-buildrules=msvc ${1+"$@"} --enable-crypto-openssl --disable-crypto-gnutls
configure
@@ -17829,6 +17829,9 @@ $as_echo &quot;#define USE_CRYPTO_NATIVE 1&quot; &gt;&gt;confdefs.h @@ -17829,6 +17829,9 @@ $as_echo &quot;#define USE_CRYPTO_NATIVE 1&quot; &gt;&gt;confdefs.h
17829 fi 17829 fi
17830 17830
17831 17831
  17832 +if test "$USE_EXTERNAL_LIBS" = "1"; then
  17833 + OPENSSL_FOUND=1
  17834 +else
17832 17835
17833 pkg_failed=no 17836 pkg_failed=no
17834 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pc_openssl" >&5 17837 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pc_openssl" >&5
@@ -17900,6 +17903,7 @@ else @@ -17900,6 +17903,7 @@ else
17900 $as_echo "yes" >&6; } 17903 $as_echo "yes" >&6; }
17901 OPENSSL_FOUND=1 17904 OPENSSL_FOUND=1
17902 fi 17905 fi
  17906 +fi
17903 17907
17904 if test "$OPENSSL_FOUND" = "0"; then : 17908 if test "$OPENSSL_FOUND" = "0"; then :
17905 ac_fn_c_check_header_mongrel "$LINENO" "openssl/evp.h" "ac_cv_header_openssl_evp_h" "$ac_includes_default" 17909 ac_fn_c_check_header_mongrel "$LINENO" "openssl/evp.h" "ac_cv_header_openssl_evp_h" "$ac_includes_default"
@@ -18601,7 +18605,7 @@ if test &quot;$USE_EXTERNAL_LIBS&quot; = &quot;1&quot;; then @@ -18601,7 +18605,7 @@ if test &quot;$USE_EXTERNAL_LIBS&quot; = &quot;1&quot;; then
18601 # much trouble getting it to work with a different compiler. 18605 # much trouble getting it to work with a different compiler.
18602 CPPFLAGS="$CPPFLAGS -Iexternal-libs/include" 18606 CPPFLAGS="$CPPFLAGS -Iexternal-libs/include"
18603 LDFLAGS="$LDFLAGS -Lexternal-libs/lib-$BUILDRULES$WINDOWS_WORDSIZE" 18607 LDFLAGS="$LDFLAGS -Lexternal-libs/lib-$BUILDRULES$WINDOWS_WORDSIZE"
18604 - LIBS="$LIBS -lz -ljpeg" 18608 + LIBS="$LIBS -lz -ljpeg -lssl -lcrypto -lmsvcrt -lws2_32 -lshell32 -ladvapi32 -lgdi32 -luser32 -lcrypt32"
18605 fi 18609 fi
18606 18610
18607 cat >confcache <<\_ACEOF 18611 cat >confcache <<\_ACEOF
configure.ac
@@ -608,8 +608,12 @@ dnl If the openssl provider is not explicitly disabled, enable it if @@ -608,8 +608,12 @@ dnl If the openssl provider is not explicitly disabled, enable it if
608 dnl openssl is available. If the openssl provider is explicitly 608 dnl openssl is available. If the openssl provider is explicitly
609 dnl disabled, do not link with openssl even if present. 609 dnl disabled, do not link with openssl even if present.
610 610
611 -PKG_CHECK_MODULES([pc_openssl], [openssl >= 1.1.0],  
612 - [OPENSSL_FOUND=1], [OPENSSL_FOUND=0]) 611 +if test "$USE_EXTERNAL_LIBS" = "1"; then
  612 + OPENSSL_FOUND=1
  613 +else
  614 + PKG_CHECK_MODULES([pc_openssl], [openssl >= 1.1.0],
  615 + [OPENSSL_FOUND=1], [OPENSSL_FOUND=0])
  616 +fi
613 617
614 dnl Override pkg-config if headers and libraries are present. 618 dnl Override pkg-config if headers and libraries are present.
615 AS_IF([test "$OPENSSL_FOUND" = "0"], 619 AS_IF([test "$OPENSSL_FOUND" = "0"],
@@ -958,7 +962,7 @@ if test &quot;$USE_EXTERNAL_LIBS&quot; = &quot;1&quot;; then @@ -958,7 +962,7 @@ if test &quot;$USE_EXTERNAL_LIBS&quot; = &quot;1&quot;; then
958 # much trouble getting it to work with a different compiler. 962 # much trouble getting it to work with a different compiler.
959 CPPFLAGS="$CPPFLAGS -Iexternal-libs/include" 963 CPPFLAGS="$CPPFLAGS -Iexternal-libs/include"
960 LDFLAGS="$LDFLAGS -Lexternal-libs/lib-$BUILDRULES$WINDOWS_WORDSIZE" 964 LDFLAGS="$LDFLAGS -Lexternal-libs/lib-$BUILDRULES$WINDOWS_WORDSIZE"
961 - LIBS="$LIBS -lz -ljpeg" 965 + LIBS="$LIBS -lz -ljpeg -lssl -lcrypto -lmsvcrt -lws2_32 -lshell32 -ladvapi32 -lgdi32 -luser32 -lcrypt32"
962 fi 966 fi
963 967
964 AC_OUTPUT 968 AC_OUTPUT
copy_dlls
@@ -98,6 +98,7 @@ sub get_dlls @@ -98,6 +98,7 @@ sub get_dlls
98 my $dll = $1; 98 my $dll = $1;
99 $dll =~ tr/A-Z/a-z/; 99 $dll =~ tr/A-Z/a-z/;
100 next if $dll =~ m/^(kernel32|user32|msvcrt|advapi32)\.dll$/; 100 next if $dll =~ m/^(kernel32|user32|msvcrt|advapi32)\.dll$/;
  101 + next if $dll =~ m/^(api-ms-win.*|ws2_32|crypt32|bcrypt)\.dll$/;
101 push(@result, $dll); 102 push(@result, $dll);
102 } 103 }
103 elsif (m/^Magic.*\((PE.+?)\)/) 104 elsif (m/^Magic.*\((PE.+?)\)/)