1. Download openssl version to update
https://www.openssl.org/source/
2. Next we have to generate the configuration files for each platform which is supported by project.
Pay attention: do not replace the file extrern/openssl/src/include/openssl/opensslconf.h in our project with the origin file of the library. It describes configuration for each platform.
For our project we use next configure flags:
no-asm threads no-shared no-buildtest-c++ no-md2 no-rc5 no-external-tests no-tests no-unit-test no-engine -static
- Linux.
It is easy to start from Linux.
From openssl folder with library new version run
./Configure no-asm threads no-shared no-buildtest-c++ no-md2 no-rc5 no-external-tests no-tests no-unit-test no-engine -static
The configuration result - openssl-X.X.X/include/openssl/configuration.h. Using result, update extrern/openssl/src/include/openssl/opensslconf_linux_x64.h
Repeat with each platform
- MacOS - the same as Linux
- Android
export ANDROID_NDK_ROOT=~/android/ndk/android-ndk-r26
export CC=clang
export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
./Configure android-arm no-asm threads no-shared no-buildtest-c++ no-md2 no-rc5 no-external-tests no-tests no-unit-test no-engine -static
- iOS
./Configure ios64-cross no-asm threads no-shared no-buildtest-c++ no-md2 no-rc5 no-external-tests no-tests no-unit-test no-engine -static
- Windows
Almost the same - instruction for introduction
https://web.archive.org/web/20161123004257/http://developer.covenanteyes.com/building-openssl-for-visual-studio//
1) Install https://strawberryperl.com/
2) In Perl command line
WIN32
perl Configure VC-WIN32 no-asm threads no-shared no-buildtest-c++ no-md2 no-rc5 no-external-tests no-tests no-unit-test -static
WIN64A
perl Configure VC-WIN64A no-asm threads no-shared no-buildtest-c++ no-md2 no-rc5 no-external-tests no-tests no-unit-test -static
3. Next step - update source_list.mak and the list of the files which are involved in the build in the librqarie's CMakeList.
For that - from the openssl folder with library new version where we configured build (for example, Linux) run make and write the result of the build in the file.
make > makelog.txt
extract all *.c file, which were involved in the build
cat makelog.txt | grep '\.c' | awk '{print $NF}' > buildFilesList.txt
Using buildFilesList.txt, update librarie's CMakeList and source_list.mak.
4. The last step - check the result of the project build for each platform.
----------------------------
OLD INSTRUCTION
----------------------------
Обновление Openssl довольно трудоемкая задача, которая в первую очередь усложняется нашей системой сборки под все платформы.
Так как под каждую платформу генерируются свои файлы конфигурации (например, opensslconf.h), то для успешной и корректной
сборки openssl под все наши платформы необходимо генерировать конфиг файлы, переименовывать и адаптировать оригинальные
конфиг файлы для включения сгенерированных под конкретную платформу.
Для генерации конфигов под Windows необходимо поставить https://strawberryperl.com/
Для работы на клиенте я использовал следующие Openssl configure flags:
no-asm threads no-shared no-buildtest-c++ no-md2 no-rc5 no-external-tests no-tests no-unit-test no-engine -static
После конфигурации необходимо получить список файлов на компиляцию.
Для этого я собирал Openssl под любую из платформ (проще всего под Linux) и с лога сборки фильтровал *.c файлы, которые затем добавлял в source_list.mak.
---------------------------------------------------
Стоит заметить, что для сборки openssl для нашего сервера я использовал следующий набор флагов (включал в сборку engines):
no-asm threads no-shared no-buildtest-c++ no-md2 no-rc5 no-external-tests no-tests no-unit-test -static
Соответственно и список файлов в source_list.mak также необходимо поправить.
Сборку для сервера делал без фиксирования изменений в системе контроля версий.
---------------------------------------------------
build openssl for Android (to get config files)
export ANDROID_NDK_HOME=/home/loki/android/ndk/android-ndk-r18b
export CC=clang
export PATH=/home/loki/android/ndk/android-ndk-r18b/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
./Configure android-arm no-asm threads no-shared no-buildtest-c++ no-md2 no-rc5 no-external-tests no-tests no-unit-test no-engine -static
---------------------------------------------------
build openssl for iOS (to get config files)
./Configure ios64-cross no-asm threads no-shared no-buildtest-c++ no-md2 no-rc5 no-external-tests no-tests no-unit-test no-engine -static