mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
build: build specific contribs on windows
Change-Id: I2b5b0d4892d44ff861a45a2a4d7cff937b1e280f
This commit is contained in:
@ -9,6 +9,7 @@ if "%~1" == "" goto Usage
|
||||
set doFetch=N
|
||||
set doBuildContrib=N
|
||||
set doBuildDaemon=N
|
||||
set targetContrib=""
|
||||
|
||||
set SCRIPTNAME=%~nx0
|
||||
|
||||
@ -38,8 +39,14 @@ if /I "%1"=="x86" (
|
||||
set BUILD.uwp=Y
|
||||
) else if /I "%1"=="win32" (
|
||||
set BUILD.win32=Y
|
||||
) else if /I "%1" neq "" (
|
||||
if "%doBuildContrib%" neq "N" (
|
||||
set targetContrib=%1
|
||||
) else if "%doFetch%" neq "N" (
|
||||
set targetContrib=%1
|
||||
)
|
||||
) else (
|
||||
goto Usage
|
||||
goto Usage
|
||||
)
|
||||
shift
|
||||
goto ParseArgs
|
||||
@ -71,9 +78,9 @@ if "%BUILD.uwp%"=="Y" (
|
||||
if "%arch%" neq "N" (
|
||||
if "%platform%" neq "N" (
|
||||
if "%doFetch%" neq "N" (
|
||||
call %CONTRIB_DIR%\src\fetch_all.bat %platform% %arch%
|
||||
call %CONTRIB_DIR%\src\fetch_all.bat %platform% %arch% %targetContrib%
|
||||
) else if "%doBuildContrib%" neq "N" (
|
||||
call %CONTRIB_DIR%\build_all.bat %platform% %arch%
|
||||
call %CONTRIB_DIR%\build_all.bat %platform% %arch% %targetContrib%
|
||||
) else if "%doBuildDaemon%" neq "N" (
|
||||
goto buildDaemon
|
||||
)
|
||||
|
@ -4,9 +4,9 @@
|
||||
set CONTRIB_DIR=%~dp0
|
||||
|
||||
set platform=win32
|
||||
set arch=64
|
||||
set arch=x64
|
||||
if "%1"=="uwp" (
|
||||
set platform=x86
|
||||
set platform=uwp
|
||||
if "%2"=="x86" (
|
||||
set arch=x86
|
||||
goto arch_x86
|
||||
@ -51,69 +51,77 @@ if "%1"=="uwp" (
|
||||
)
|
||||
|
||||
:uwpProjs
|
||||
set TOBUILD=( ^
|
||||
build\jsoncpp\makefiles\vs2017\lib_json.vcxproj, ^
|
||||
build\argon2\vs2015\Argon2Ref\Argon2Ref.vcxproj, ^
|
||||
build\gmp\SMP\libgmp.vcxproj, ^
|
||||
build\iconv\SMP\libiconv.vcxproj, ^
|
||||
build\zlib\SMP\libzlib.vcxproj, ^
|
||||
build\nettle\SMP\libnettle.vcxproj, ^
|
||||
build\nettle\SMP\libhogweed.vcxproj, ^
|
||||
build\gnutls\SMP\libgnutls.vcxproj, ^
|
||||
build\msgpack-c\vs2017\msgpackc-static.vcxproj, ^
|
||||
build\opendht\MSVC\opendht_vs2017.vcxproj, ^
|
||||
build\pjproject\pjlib-util\build\pjlib_util.vcxproj, ^
|
||||
build\pjproject\pjmedia\build\pjmedia.vcxproj, ^
|
||||
build\pjproject\pjmedia\build\pjmedia_codec.vcxproj, ^
|
||||
build\pjproject\pjlib\build\pjlib.vcxproj, ^
|
||||
build\pjproject\pjsip\build\pjsip_core.vcxproj, ^
|
||||
build\pjproject\pjsip\build\pjsip_simple.vcxproj, ^
|
||||
build\pjproject\pjsip\build\pjsua_lib.vcxproj, ^
|
||||
build\pjproject\pjsip\build\pjsua2_lib.vcxproj, ^
|
||||
build\pjproject\pjsip\build\pjsip_ua.vcxproj, ^
|
||||
build\pjproject\pjnath\build\pjnath.vcxproj, ^
|
||||
build\pthreads\MSVC\pthreads.vcxproj, ^
|
||||
build\libupnp\build\vs2017\ixml.vcxproj, ^
|
||||
build\libupnp\build\vs2017\threadutil.vcxproj, ^
|
||||
build\libupnp\build\vs2017\libupnp.vcxproj, ^
|
||||
build\secp256k1\MSVC\secp256k1.vcxproj, ^
|
||||
build\portaudio\msvc\uwp\portaudio.vcxproj, ^
|
||||
build\yaml-cpp\msvc\yaml-cpp.vcxproj, ^
|
||||
build\pcre\msvc\pcre.vcxproj, ^
|
||||
)
|
||||
set TOBUILD= ^
|
||||
x264=build\x264\SMP\libx264.vcxproj, ^
|
||||
opus=build\opus\SMP\libopus.vcxproj, ^
|
||||
ffmpeg=ffmpeg, ^
|
||||
restbed=restbed, ^
|
||||
jsoncpp=build\jsoncpp\makefiles\vs2017\lib_json.vcxproj, ^
|
||||
argon2=build\argon2\vs2015\Argon2Ref\Argon2Ref.vcxproj, ^
|
||||
gmp=build\gmp\SMP\libgmp.vcxproj, ^
|
||||
iconv=build\iconv\SMP\libiconv.vcxproj, ^
|
||||
zlib=build\zlib\SMP\libzlib.vcxproj, ^
|
||||
nettle=build\nettle\SMP\libnettle.vcxproj, ^
|
||||
hogweed=build\nettle\SMP\libhogweed.vcxproj, ^
|
||||
gnutls=build\gnutls\SMP\libgnutls.vcxproj, ^
|
||||
msgpack=build\msgpack-c\vs2017\msgpackc-static.vcxproj, ^
|
||||
opendht=build\opendht\MSVC\opendht_vs2017.vcxproj, ^
|
||||
pjlib_util=build\pjproject\pjlib-util\build\pjlib_util.vcxproj, ^
|
||||
pjmedia=build\pjproject\pjmedia\build\pjmedia.vcxproj, ^
|
||||
pjmedia_codec=build\pjproject\pjmedia\build\pjmedia_codec.vcxproj, ^
|
||||
pjlib=build\pjproject\pjlib\build\pjlib.vcxproj, ^
|
||||
pjsip_core=build\pjproject\pjsip\build\pjsip_core.vcxproj, ^
|
||||
pjsip_simple=build\pjproject\pjsip\build\pjsip_simple.vcxproj, ^
|
||||
pjsua_lib=build\pjproject\pjsip\build\pjsua_lib.vcxproj, ^
|
||||
pjsua2_lib=build\pjproject\pjsip\build\pjsua2_lib.vcxproj, ^
|
||||
pjsip_ua=build\pjproject\pjsip\build\pjsip_ua.vcxproj, ^
|
||||
pjnath=build\pjproject\pjnath\build\pjnath.vcxproj, ^
|
||||
pthreads=build\pthreads\MSVC\pthreads.vcxproj, ^
|
||||
xml=build\libupnp\build\vs2017\ixml.vcxproj, ^
|
||||
threadutil=build\libupnp\build\vs2017\threadutil.vcxproj, ^
|
||||
upnp=build\libupnp\build\vs2017\libupnp.vcxproj, ^
|
||||
secp256k1=build\secp256k1\MSVC\secp256k1.vcxproj, ^
|
||||
portaudio=build\portaudio\msvc\portaudio.vcxproj, ^
|
||||
yaml-cpp=build\yaml-cpp\msvc\yaml-cpp.vcxproj, ^
|
||||
pcre=build\pcre\msvc\pcre.vcxproj
|
||||
goto startBuild
|
||||
|
||||
:win32Projs
|
||||
set TOBUILD=( ^
|
||||
build\jsoncpp\makefiles\vs2017\lib_json.vcxproj, ^
|
||||
build\argon2\vs2015\Argon2Ref\Argon2Ref.vcxproj, ^
|
||||
build\gmp\SMP\libgmp.vcxproj, ^
|
||||
build\iconv\SMP\libiconv.vcxproj, ^
|
||||
build\zlib\SMP\libzlib.vcxproj, ^
|
||||
build\nettle\SMP\libnettle.vcxproj, ^
|
||||
build\nettle\SMP\libhogweed.vcxproj, ^
|
||||
build\gnutls\SMP\libgnutls.vcxproj, ^
|
||||
build\msgpack-c\vs2017\msgpackc-static.vcxproj, ^
|
||||
build\opendht\MSVC\opendht_vs2017.vcxproj, ^
|
||||
build\pjproject\pjlib-util\build\pjlib_util.vcxproj, ^
|
||||
build\pjproject\pjmedia\build\pjmedia.vcxproj, ^
|
||||
build\pjproject\pjmedia\build\pjmedia_codec.vcxproj, ^
|
||||
build\pjproject\pjlib\build\pjlib.vcxproj, ^
|
||||
build\pjproject\pjsip\build\pjsip_core.vcxproj, ^
|
||||
build\pjproject\pjsip\build\pjsip_simple.vcxproj, ^
|
||||
build\pjproject\pjsip\build\pjsua_lib.vcxproj, ^
|
||||
build\pjproject\pjsip\build\pjsua2_lib.vcxproj, ^
|
||||
build\pjproject\pjsip\build\pjsip_ua.vcxproj, ^
|
||||
build\pjproject\pjnath\build\pjnath.vcxproj, ^
|
||||
build\pthreads\MSVC\pthreads.vcxproj, ^
|
||||
build\libupnp\build\vs2017\ixml.vcxproj, ^
|
||||
build\libupnp\build\vs2017\threadutil.vcxproj, ^
|
||||
build\libupnp\build\vs2017\libupnp.vcxproj, ^
|
||||
build\secp256k1\MSVC\secp256k1.vcxproj, ^
|
||||
build\portaudio\msvc\portaudio.vcxproj, ^
|
||||
build\yaml-cpp\msvc\yaml-cpp.vcxproj, ^
|
||||
build\pcre\msvc\pcre.vcxproj, ^
|
||||
)
|
||||
set TOBUILD= ^
|
||||
vpx=build\vpx\SMP\libvpx.vcxproj, ^
|
||||
x264=build\x264\SMP\libx264.vcxproj, ^
|
||||
opus=build\opus\SMP\libopus.vcxproj, ^
|
||||
ffmpeg=ffmpeg, ^
|
||||
restbed=restbed, ^
|
||||
jsoncpp=build\jsoncpp\makefiles\vs2017\lib_json.vcxproj, ^
|
||||
argon2=build\argon2\vs2015\Argon2Ref\Argon2Ref.vcxproj, ^
|
||||
gmp=build\gmp\SMP\libgmp.vcxproj, ^
|
||||
iconv=build\iconv\SMP\libiconv.vcxproj, ^
|
||||
zlib=build\zlib\SMP\libzlib.vcxproj, ^
|
||||
nettle=build\nettle\SMP\libnettle.vcxproj, ^
|
||||
hogweed=build\nettle\SMP\libhogweed.vcxproj, ^
|
||||
gnutls=build\gnutls\SMP\libgnutls.vcxproj, ^
|
||||
msgpack=build\msgpack-c\vs2017\msgpackc-static.vcxproj, ^
|
||||
opendht=build\opendht\MSVC\opendht_vs2017.vcxproj, ^
|
||||
pjlib_util=build\pjproject\pjlib-util\build\pjlib_util.vcxproj, ^
|
||||
pjmedia=build\pjproject\pjmedia\build\pjmedia.vcxproj, ^
|
||||
pjmedia_codec=build\pjproject\pjmedia\build\pjmedia_codec.vcxproj, ^
|
||||
pjlib=build\pjproject\pjlib\build\pjlib.vcxproj, ^
|
||||
pjsip_core=build\pjproject\pjsip\build\pjsip_core.vcxproj, ^
|
||||
pjsip_simple=build\pjproject\pjsip\build\pjsip_simple.vcxproj, ^
|
||||
pjsua_lib=build\pjproject\pjsip\build\pjsua_lib.vcxproj, ^
|
||||
pjsua2_lib=build\pjproject\pjsip\build\pjsua2_lib.vcxproj, ^
|
||||
pjsip_ua=build\pjproject\pjsip\build\pjsip_ua.vcxproj, ^
|
||||
pjnath=build\pjproject\pjnath\build\pjnath.vcxproj, ^
|
||||
pthreads=build\pthreads\MSVC\pthreads.vcxproj, ^
|
||||
xml=build\libupnp\build\vs2017\ixml.vcxproj, ^
|
||||
threadutil=build\libupnp\build\vs2017\threadutil.vcxproj, ^
|
||||
upnp=build\libupnp\build\vs2017\libupnp.vcxproj, ^
|
||||
secp256k1=build\secp256k1\MSVC\secp256k1.vcxproj, ^
|
||||
portaudio=build\portaudio\msvc\portaudio.vcxproj, ^
|
||||
yaml-cpp=build\yaml-cpp\msvc\yaml-cpp.vcxproj, ^
|
||||
pcre=build\pcre\msvc\pcre.vcxproj
|
||||
|
||||
goto startBuild
|
||||
|
||||
:startBuild
|
||||
@ -170,23 +178,73 @@ if not defined MSYS2_BIN (
|
||||
if exist C:\msys\usr\bin\bash.exe set MSYS2_BIN="C:\msys\usr\bin\bash.exe"
|
||||
)
|
||||
|
||||
if "%1"=="win32" (
|
||||
:: build livpx
|
||||
call :build %CONTRIB_DIR%build\vpx\SMP\libvpx.vcxproj
|
||||
if /I %3 equ "" (
|
||||
goto build_all
|
||||
) else (
|
||||
goto build_one
|
||||
)
|
||||
:: build libx264
|
||||
call :build %CONTRIB_DIR%build\x264\SMP\libx264.vcxproj
|
||||
:: build libopus
|
||||
call :build %CONTRIB_DIR%build\opus\SMP\libopus.vcxproj
|
||||
:: build ffmpeg
|
||||
%MSYS2_BIN% --login -x %CONTRIB_DIR%src/ffmpeg/windows-configure-make.sh %1 %2
|
||||
|
||||
:build_all
|
||||
set "keyname="
|
||||
for %%I in (%TOBUILD%) do (
|
||||
if not defined keyname (
|
||||
set keyname=%%I
|
||||
) else (
|
||||
echo building: !keyname!
|
||||
call :build %%I %1 %2
|
||||
set %%keyname%%=%%I
|
||||
set "keyname="
|
||||
)
|
||||
)
|
||||
goto cleanup
|
||||
|
||||
:build_one
|
||||
set found="N"
|
||||
set "keyname="
|
||||
for %%I in (%TOBUILD%) do (
|
||||
if not defined keyname (
|
||||
set keyname=%%I
|
||||
) else (
|
||||
if /I %3 equ !keyname! (
|
||||
echo building: !keyname!
|
||||
set found="Y"
|
||||
call :build %%I %1 %2
|
||||
goto cleanup
|
||||
)
|
||||
set %%keyname%%=%%I
|
||||
set "keyname="
|
||||
)
|
||||
)
|
||||
if %found%=="N" (
|
||||
echo "%3" not in listed contrib
|
||||
)
|
||||
goto cleanup
|
||||
|
||||
:parameterError
|
||||
echo "parameter error"
|
||||
goto cleanup
|
||||
|
||||
:cleanup
|
||||
endlocal
|
||||
@endlocal
|
||||
exit /B %ERRORLEVEL%
|
||||
|
||||
:build
|
||||
if /I %1 equ ffmpeg (
|
||||
%MSYS2_BIN% --login -x %CONTRIB_DIR%src/ffmpeg/windows-configure-make.sh %2 %3
|
||||
) else if /I %1 equ restbed (
|
||||
goto build_restbed %2 %3
|
||||
) else (
|
||||
msbuild %CONTRIB_DIR%%1 %MSBUILD_ARGS%
|
||||
)
|
||||
|
||||
:build_restbed
|
||||
:: build openssl
|
||||
cd %CONTRIB_DIR%build\restbed\dependency\openssl
|
||||
if "%1"=="win32" (
|
||||
cd %CONTRIB_DIR%build\restbed\dependency\openssl
|
||||
if "%2"=="win32" (
|
||||
call perl Configure VC-WIN64A
|
||||
call ms\do_win64a
|
||||
) else if "%1"=="uwp" (
|
||||
) else if "%2"=="uwp" (
|
||||
call perl Configure no-asm no-hw no-dso VC-WINUNIVERSAL
|
||||
call ms\do_winuniversal
|
||||
call ms\setVSvars universal10.0x64
|
||||
@ -200,31 +258,10 @@ mkdir build
|
||||
cd build
|
||||
setlocal
|
||||
set PATH=C:\\Program Files\\CMake\\bin\\;%PATH%
|
||||
if "%2"=="x86" (
|
||||
if "%3"=="x86" (
|
||||
cmake -DBUILD_SSL=ON -G "Visual Studio 15 2017 Win32" ..
|
||||
) else if "%2"=="x64" (
|
||||
) else if "%3"=="x64" (
|
||||
cmake -DBUILD_SSL=ON -G "Visual Studio 15 2017 Win64" ..
|
||||
)
|
||||
cmake --build . --target ALL_BUILD --config Release
|
||||
cd ..\..
|
||||
|
||||
:: build the list
|
||||
for %%I in %TOBUILD% do (
|
||||
call :build "%CONTRIB_DIR%%%I"
|
||||
)
|
||||
|
||||
goto cleanup
|
||||
|
||||
:parameterError
|
||||
echo "parameter error"
|
||||
goto cleanup
|
||||
|
||||
:cleanup
|
||||
endlocal
|
||||
@endlocal
|
||||
exit /B %ERRORLEVEL%
|
||||
|
||||
:build
|
||||
echo "building " %*
|
||||
msbuild %* %MSBUILD_ARGS%
|
||||
exit /B 0
|
||||
cd ..\..
|
@ -68,11 +68,34 @@ vpx, ^
|
||||
x264, ^
|
||||
yaml-cpp, ^
|
||||
)
|
||||
goto fetch
|
||||
|
||||
:fetch
|
||||
for %%I in %DEPENDENCIES% do (
|
||||
call %SRC%\%%I\fetch_and_patch.bat %1 %2
|
||||
if /I %3 equ "" (
|
||||
goto fetch
|
||||
) else (
|
||||
goto fetch_one
|
||||
)
|
||||
|
||||
:fetch
|
||||
if exist %SRC%\..\build rd /S /Q %SRC%\..\build
|
||||
for %%I in %DEPENDENCIES% do (
|
||||
echo fetching: %%I
|
||||
call %SRC%\%%I\fetch_and_patch.bat %1 %2
|
||||
)
|
||||
goto cleanup
|
||||
|
||||
:fetch_one
|
||||
set found="N"
|
||||
for %%I in %DEPENDENCIES% do (
|
||||
if /I %3 equ %%I (
|
||||
if exist %SRC%\..\build\%%I rd /S /Q %SRC%\..\build\%%I
|
||||
echo fetching: %%I
|
||||
set found="Y"
|
||||
call %SRC%\%%I\fetch_and_patch.bat %1 %2
|
||||
)
|
||||
)
|
||||
if %found%=="N" (
|
||||
echo "%3" not in listed contrib
|
||||
)
|
||||
|
||||
:cleanup
|
||||
@endlocal
|
Reference in New Issue
Block a user