2017년 12월 27일 수요일

qBittorrent windows build.

우분투 빌드했으니 윈도우도 빌드.
위키가 너무 잘되어 있어서 단지, 윈도우10과 Visual Studio 2017 Enterprise에서도 잘된다는 결론을 먼저 말한다.

https://github.com/qbittorrent/qBittorrent/wiki/Compiling-with-MSVC-2017-x64-%28static-linkage%29#Info_that_applies_to_all_steps 여기 그대로 따라하면 된다. 난 빌드 순서를 좀 바꾸었다. 여러창에 걸어둔다고.

-------------------------------------------------------------------------------------------------

1. 우선 Boost 부터 빌드한다. 우리 회사 솔루션도 쓰는데 컴파일에 무지 시간이 걸리기 때문.

bootstrap.bat

실행 후 

c:\qBittorrent\boost_1_64_0> b2 -q --with-system --toolset=msvc-15.1 address-model=64 variant=release link=static runtime-link=static include="c:\QBITTORRENT\install_msvc64\base\include" library-path="c:\QBITTORRENT\install_msvc64\base\lib" --prefix="c:\QBITTORRENT\install_msvc64\base" cxxflags="-O1 -Gy -Gw -GL" linkflags="/NOLOGO /DYNAMICBASE /NXCOMPAT /LTCG /OPT:REF /OPT:ICF /MANIFEST:EMBED /INCREMENTAL:NO" --hash -j %NUMBER_OF_PROCESSORS% install

하면 마지막에

C:\qBittorrent\boost_1_64_0\boost\asio\detail\impl\win_iocp_io_service.ipp
        1개 파일이 복사되었습니다.
common.copy c:\QBITTORRENT\install_msvc64\base\include\boost-1_64\boost\asio\detail\impl\win_iocp_serial_port_service.ipp
C:\qBittorrent\boost_1_64_0\boost\asio\detail\impl\win_iocp_serial_port_service.ipp
        1개 파일이 복사되었습니다.
...updated 13523 targets...

 빌드 로그가 뜬다.

install 할 때 엔터프라이즈 버전 vcvarsall.bat 위치는

"c:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"

이다.

하지만 찾는 곳은 
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\bin\HostX64

C:\qBittorrent\boost_1_64_0\tools\build\src\engine\config_toolset.bat
C:\qBittorrent\boost_1_64_0\tools\build\src\engine\guess_toolset.bat

환경 변수를 바꾸어줘도 되지만 간단히 해당 파일들을 저 위의 경로로 옮겨줘도 된다.

c:\qBittorrent\boost_1_64_0>b2 -q --with-system --toolset=msvc-15.1 address-model=64 variant=release link=static runtime-link=static include="C:\QBITTORRENT\install_msvc64\base\include" library-path="C:\QBITTORRENT\install_msvc64\base\lib" --prefix="C:\QBITTORRENT\install_msvc64\base" cxxflags="-O1 -Gy -Gw -GL" linkflags="/NOLOGO /DYNAMICBASE /NXCOMPAT /LTCG /OPT:REF /OPT:ICF /MANIFEST:EMBED /INCREMENTAL:NO" --hash -j %NUMBER_OF_PROCESSORS% install
Performing configuration checks

    - 32-bit                   : no  (cached)
    - 64-bit                   : yes (cached)
    - arm                      : no  (cached)
    - mips1                    : no  (cached)
    - power                    : no  (cached)
    - sparc                    : no  (cached)
    - x86                      : yes (cached)
    - symlinks supported       : yes

Component configuration:

    - atomic                   : not building
    - chrono                   : not building
    - container                : not building
    - context                  : not building
    - coroutine                : not building
    - coroutine2               : not building
    - date_time                : not building
    - exception                : not building
    - fiber                    : not building
    - filesystem               : not building
    - graph                    : not building
    - graph_parallel           : not building
    - iostreams                : not building
    - locale                   : not building
    - log                      : not building
    - math                     : not building
    - metaparse                : not building
    - mpi                      : not building
    - program_options          : not building
    - python                   : not building
    - random                   : not building
    - regex                    : not building
    - serialization            : not building
    - signals                  : not building
    - system                   : building
    - test                     : not building
    - thread                   : not building
    - timer                    : not building
    - type_erasure             : not building
    - wave                     : not building

...found 26143 targets...

c:\qBittorrent\boost_1_64_0>

installation은 full 로그가 짧다.

2. Zlib 빌드

메이크 파일에서
CFLAGS = -nologo -O1 -Gy -Gw -GL -MT $(LOC) LDFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT /LTCG /OPT:REF /OPT:ICF /MANIFEST:EMBED /INCREMENTAL:NO /NODEFAULTLIB:MSVCRT

nmake -f win32/Makefile.msc AS=ml64 LOC="-DASMV -DASMINF -I." OBJA="inffasx64.o
bj gvmat64.obj inffas8664.obj"

xcopy zlib.h c:\qBittorrent\install_msvc64\base\include\ xcopy zconf.h c:\qBittorrent\install_msvc64\base\include\ xcopy zlib.lib c:\qBittorrent\install_msvc64\base\lib\

난 G가 아니라 C로 했다. D가 용량 크지만, (용량이)부족해도 SSD니까... 다른 폴더 구조는 그대로(귀찮+일단 빌드 성공)

해당 폴더에 잘 들어간다.

3. openssl 빌드

에러를 만났다.

app_rand.obj : /GL로 컴파일한 MSIL .netmodule 또는 모듈이 있습니다. /LTCG를 지정하여 링크를 다시 시작하십시오. /LTCG를  링크 명령줄에 추가하면 링커 성능이 향상됩니다.
LINK : fatal error LNK1181: 'ZLIB1.obj' 입력 파일을 열 수 없습니다.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\link.EXE"' : '0x49d' 반환 코드입니다.
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\nmake.exe"' : '0x2' 반환 코드입니다.
Stop.

openssl-1.1.0g 를 설치했는데, 1.0.2n으로 갈아탔다.


c:\qBittorrent\openssl-1.0.2n>perl Configure VC-WIN64A no-shared zlib no-zlib-dynamic threads --openssldir=C:\openssl --prefix=C:\QBITTORRENT\install_msvc64\base -IC:\QBITTORRENT\install_msvc64\base\include -LC:\QBITTORRENT\install_msvc64\base\lib

ms\do_win64a
mk는 시킨대로 잘 고쳐준다.

EX_LIBS=/libpath:C:\QBITTORRENT\install_msvc64\base\lib ws2_32.lib gdi32.lib advapi32.lib crypt32.lib user32.lib zlib.lib

등등

        cl /Fotmp32\openssl.obj -DMONOLITH -Iinc32 -Itmp32 -IC:\QBITTORRENT\install_msvc64\base\include  /MT /Ox -DZLIB -DOPENSSL_THREADS  -DDSO_WIN32 -IC:\\QBITTORRENT\\install_msvc64\\base\\include -W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DOPENSSL_NO_RC5 -DOPENSSL_NO_MD2 -DOPENSSL_NO_SSL2 -DOPENSSL_NO_KRB5 -DOPENSSL_NO_JPAKE -DOPENSSL_NO_WEAK_SSL_CIPHERS -DZLIB -DOPENSSL_NO_DYNAMIC_ENGINE -O1 -Gy -Gw -GL -MT  -c .\apps\openssl.c
cl : 명령줄 warning D9025 : '/Ox'을(를) '/O1'(으)로 재정의합니다.
openssl.c
        link /NOLOGO /SUBSYSTEM:CONSOLE /DYNAMICBASE /NXCOMPAT /LTCG /OPT:REF /OPT:ICF /MANIFEST:EMBED /INCREMENTAL:NO /NODEFAULTLIB:MSVCRT /out:out32\openssl.exe @C:\Users\hajun\AppData\Local\Temp\nm23D4.tmp
코드를 생성하고 있습니다.
코드를 생성했습니다.
        IF EXIST out32\openssl.exe.manifest mt -nologo -manifest out32\openssl.exe.manifest -outputresource:out32\openssl.exe;1

인스톨하면

        perl util/copy.pl "out32\openssl.exe" "C:\QBITTORRENT\install_msvc64\base\bin"
Copying: out32/openssl.exe to C:/QBITTORRENT/install_msvc64/base/bin/openssl.exe
        perl util/mkdir-p.pl "C:\openssl"
created directory `C:/openssl'
        perl util/copy.pl apps\openssl.cnf "C:\openssl"
Copying: apps/openssl.cnf to C:/openssl/openssl.cnf
        perl util/copy.pl "out32\ssleay32.lib" "C:\QBITTORRENT\install_msvc64\base\lib"
Copying: out32/ssleay32.lib to C:/QBITTORRENT/install_msvc64/base/lib/ssleay32.lib
        perl util/copy.pl "out32\libeay32.lib" "C:\QBITTORRENT\install_msvc64\base\lib"
Copying: out32/libeay32.lib to C:/QBITTORRENT/install_msvc64/base/lib/libeay32.lib

c:\qBittorrent\openssl-1.0.2n>

4. libbittorrent src build

c:\qBittorrent\libtorrent-1.1.5>b2 -q --without-python --toolset=msvc-15.1 address-model=64 variant=release link=static runtime-link=static debug-symbols=on encryption=openssl logging=none geoip=off resolve-countries=off dht=on boost=source character-set=unicode boost-link=static -sBOOST_ROOT="C:\qBittorrent\boost_1_64_0" include="C:\QBITTORRENT\install_msvc64\base\include" library-path="C:\QBITTORRENT\install_msvc64\base\lib" --prefix="C:\QBITTORRENT\install_msvc64\base" cxxflags="-O1 -Gy -Gw -GL" define=BOOST_ASIO_DISABLE_CONNECTEX linkflags="/NOLOGO /DYNAMICBASE /NXCOMPAT /LTCG /OPT:REF /OPT:ICF /MANIFEST:EMBED /INCREMENTAL:NO" --hash -j %NUMBER_OF_PROCESSORS%


5. QT

configure -prefix C:\QBITTORRENT\install_msvc64\qt5 -I C:\QBITTORRENT\install_msvc64\base\include -L C:\QBITTORRENT\install_msvc64\base\lib -platform win32-g++ -release -opensource -confirm-license -strip -static -static-runtime -ltcg -make libs -make tools -nomake examples -no-compile-examples -no-dbus -no-qml-debug -no-icu -system-zlib -openssl-linked -no-opengl -no-angle -no-sql-sqlite -no-sql-odbc -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns ZLIB_LIBS="-lzlib" OPENSSL_LIBS="-llibeay32 -lssleay32"



# See an example build configuration in "conf.pri.windows"
exists(conf.pri) {
    include(conf.pri)
}
else {
    error("'conf.pri' does not exist. See an example configuration in 'conf.pri.windows'.")
}

ㅡㅡ; 파일명을 단순히 바꾸면 재귀호출 되니까 지워주면 된다.

나머지도 저 위 링크 따라하면 QT Creator에서 정상적으로 불러오게 되고 이상 없으면 Build All이 활성화 된다.

 후임이 이 글을 잃게 된다면(아마 내일즈음 구글링하면 여기 나올테니) 영어 공부 하고. 안된다 싶으면 무조건 버전을 바꿔보길. 전처럼 계속 디버깅 하지 말고. 네가 만든 모듈도 아니고 다른 방법이 있는데 디버깅부터 하면서 일주일씩 낭비하는 것은 어리석은 짓(물론, 학교에서는 가능)

난 최소한 스타트업에서 하는 짓처럼 어디서 가져왔는지 가르쳐 주지도 않고 자신만의 블러드 필드(노블레스)를 만들어 개짓하지는 않으니 애들이 금방 따라온다. 차라리 대기업이 가져다 써도 돈을 지불하니 훨씬 깨끗하다. 하소연하기라도 하지 스타트업은 돈되는 기업은 먹고, 새로 기업 만들면서 자기 회사에 돈 빌려주고 3~5% 이자도 받고 안된다 싶으면 망하게 하면 됨. 하긴 SK도 싸이월드 그런 식으로 보내긴 하더라. 게다가 모금까지... 대박. 완전 호로자식 집단임 ㅋㅋ(하긴 그렇게 모은 돈으로 돈주고 사람패는 회장이 있으니...) 유아인이 참 연기를 잘하더라. 요즘엔 나도 천만원씩 받고 맞을까 생각한다. 맥프로가 가지고 싶어서, 맥프로도 돈 없어서 팔았거든. 두대 부터는 병원 갈수도 있으니 한대만 맞고 맥프로 옵션 모두 선택해서 받고 싶다.

삼성 다녔으면 연말에 그냥 하나 질러도 된다.

삼성 욕하면서도 다니라고 하는건 바꾸면 되니까. 호로새끼는 몇명 안된다. 내가 볼 때 딱 5%다.

댓글 없음:

댓글 쓰기

국정원의 댓글 공작을 지탄합니다.

UPBIT is a South Korean company, and people died of suicide cause of coin investment.

 UPBIT is a South Korean company, and people died of suicide cause of coin. The company helps the people who control the market price manipu...