From a7d2191649979d4e616aaf2fa195f1689d3b0aa7 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Thu, 10 May 2018 19:23:59 +0300 Subject: [PATCH] Add static libcurl (#81) --- .../PPTFormatLib/Linux/PPTFormatLib.pro | 1 + .../Linux/PPTXFormatLib/PPTXFormatLib.pro | 1 + Common/3dParty/curl/build.sh | 73 +++++++++++++++++++ Common/3dParty/curl/curl.pri | 5 ++ DesktopEditor/doctrenderer/doctrenderer.pro | 3 +- X2tConverter/build/Qt/X2tConverter.pri | 2 +- 6 files changed, 82 insertions(+), 3 deletions(-) create mode 100755 Common/3dParty/curl/build.sh create mode 100644 Common/3dParty/curl/curl.pri diff --git a/ASCOfficePPTFile/PPTFormatLib/Linux/PPTFormatLib.pro b/ASCOfficePPTFile/PPTFormatLib/Linux/PPTFormatLib.pro index 19009327a8..9187108643 100644 --- a/ASCOfficePPTFile/PPTFormatLib/Linux/PPTFormatLib.pro +++ b/ASCOfficePPTFile/PPTFormatLib/Linux/PPTFormatLib.pro @@ -15,6 +15,7 @@ PWD_ROOT_DIR = $$PWD CONFIG += core_x2t include(../../../Common/base.pri) +include(../../../Common/3dParty/curl/curl.pri) #BOOST include($$PWD/../../../Common/3dParty/boost/boost.pri) diff --git a/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro b/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro index 569bfb0d08..e9826dbabb 100644 --- a/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro +++ b/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro @@ -15,6 +15,7 @@ PWD_ROOT_DIR = $$PWD CONFIG += core_x2t include(../../../../Common/base.pri) +include(../../../../Common/3dParty/curl/curl.pri) core_windows { QMAKE_CXXFLAGS_RELEASE += -Ob0 diff --git a/Common/3dParty/curl/build.sh b/Common/3dParty/curl/build.sh new file mode 100755 index 0000000000..693a39b896 --- /dev/null +++ b/Common/3dParty/curl/build.sh @@ -0,0 +1,73 @@ +SCRIPT=$(readlink -f "$0" || grealpath "$0") +SCRIPTPATH=$(dirname "$SCRIPT") + +os=$(uname -s) +platform="" + +case "$os" in + Linux*) + platform="linux" + BUILD_PLATFORM=Linux + ;; + Darwin*) + platform="mac" + BUILD_PLATFORM=MacOSX + ;; + *) exit ;; +esac + + +architecture=$(uname -m) +arch="" + +case "$architecture" in + x86_64*) arch="_64" ;; + *) arch="_32" ;; +esac + +if [[ -d "$SCRIPTPATH/$platform$arch" ]] +then + echo +else + mkdir "$SCRIPTPATH/$platform$arch" +fi + +CURL_FOLDER=curl +cd ${CURL_FOLDER} + +if [[ ! -f configure ]] +then + ./buildconf +fi + +if [[ ! -f Makefile ]] +then + ./configure \ + --disable-shared \ + --enable-static \ + --disable-ldap \ + --disable-sspi \ + --without-librtmp \ + --disable-ftp \ + --disable-file \ + --disable-dict \ + --disable-telnet \ + --disable-tftp \ + --disable-rtsp \ + --disable-pop3 \ + --disable-imap \ + --disable-smtp \ + --disable-gopher \ + --disable-smb \ + --without-libidn +fi + +make + +if [ ! -d "$SCRIPTPATH/$platform$arch/build" ] +then + DESTDIR="$SCRIPTPATH/$platform$arch" make install + mkdir -p "$SCRIPTPATH/$platform$arch/build" + cp "$SCRIPTPATH/$platform$arch/usr/local/lib/libcurl.a" "$SCRIPTPATH/$platform$arch/build/" +fi + diff --git a/Common/3dParty/curl/curl.pri b/Common/3dParty/curl/curl.pri new file mode 100644 index 0000000000..72b2ac45eb --- /dev/null +++ b/Common/3dParty/curl/curl.pri @@ -0,0 +1,5 @@ +core_linux { + INCLUDEPATH += $$PWD/$$CORE_BUILDS_PLATFORM_PREFIX/usr/local/include + + LIBS += $$PWD/$$CORE_BUILDS_PLATFORM_PREFIX/build/libcurl.a +} diff --git a/DesktopEditor/doctrenderer/doctrenderer.pro b/DesktopEditor/doctrenderer/doctrenderer.pro index 84a3e80e13..9fb7bd2ffd 100644 --- a/DesktopEditor/doctrenderer/doctrenderer.pro +++ b/DesktopEditor/doctrenderer/doctrenderer.pro @@ -23,6 +23,7 @@ CONFIG += build_all_zlib build_zlib_as_sources include(../../OfficeUtils/OfficeUtils.pri) include(../../Common/3dParty/v8/v8.pri) +include(../../Common/3dParty/curl/curl.pri) SOURCES += \ memorystream.cpp \ @@ -55,8 +56,6 @@ core_windows { core_linux { SOURCES += \ ../../Common/FileDownloader/FileDownloader_curl.cpp - - LIBS += -lcurl } core_mac { OBJECTIVE_SOURCES += \ diff --git a/X2tConverter/build/Qt/X2tConverter.pri b/X2tConverter/build/Qt/X2tConverter.pri index 84d302aea3..608a3cd373 100755 --- a/X2tConverter/build/Qt/X2tConverter.pri +++ b/X2tConverter/build/Qt/X2tConverter.pri @@ -145,6 +145,7 @@ LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lCryptoPPLib #BOOST CONFIG += core_boost_regex include($$PWD/../../../Common/3dParty/boost/boost.pri) +include($$PWD/../../../Common/3dParty/curl/curl.pri) core_windows { LIBS += -lAdvapi32 @@ -155,7 +156,6 @@ core_windows { core_linux { LIBS += -lz LIBS += -lxml2 - LIBS += -lcurl } mac {