mirror of https://github.com/Wind4/vlmcsd
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
7.4 KiB
Bash
97 lines
7.4 KiB
Bash
#!/bin/bash
|
|
|
|
export VLMCSD_VERSION="svn`svnversion`"
|
|
|
|
msbuild='/cygdrive/c/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe'
|
|
version="$VLMCSD_VERSION, built $(date -u '+%Y-%m-%d %H:%M:%S') UTC"
|
|
|
|
rm -f cygkms*.dll libkms*.dll vlmcs-* vlmcsd-win* vlmcsd-cyg* vlmcsdmulti-* *_all.* vlmcsd.exe vlmcs.exe vlmcsdmulti.exe 2> /dev/null
|
|
|
|
export ExternalCompilerOptions="/D VERSION=\"\\\"$version\\\"\" /D BUILD_TIME=$(date '+%s')"
|
|
|
|
"$msbuild" VisualStudio/vlmcsd-2015-with-2013-c++-build-tools.sln /t:Rebuild /p:Configuration=Release /p:Platform=x86 /m /v:m
|
|
"$msbuild" VisualStudio/vlmcsd-2015-with-2013-c++-build-tools.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64 /m /v:m
|
|
|
|
export CAT=2
|
|
export VERBOSE=3
|
|
NUMCPU=`cat /proc/cpuinfo | grep "processor" | wc -l`
|
|
|
|
CF="-Wno-missing-braces -fno-common -fno-exceptions -fno-non-call-exceptions -fno-stack-protector -fmerge-all-constants -fno-unwind-tables -fno-asynchronous-unwind-tables -pipe"
|
|
CFMSRPC="-Wno-missing-braces -Wno-unused-variable $CF" # -fno-common -fno-stack-protector -fmerge-all-constants -pipe"
|
|
PF32=""
|
|
PF64="-mpreferred-stack-boundary=4 -march=nocona -mtune=generic"
|
|
LFCYG32="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware,--disable-long-section-names"
|
|
LFWIN32="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware,--disable-long-section-names,--no-seh"
|
|
LFCYG64="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware,--disable-long-section-names,--high-entropy-va"
|
|
LFWIN64="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware,--disable-long-section-names,--high-entropy-va,--no-seh"
|
|
|
|
MAKEFLAGS="-j$NUMCPU -B"
|
|
REUSEFLAGS="-j$NUMCPU"
|
|
|
|
make $MAKEFLAGS cygkms32.dll FEATURES=minimum THREADS=1 DLL_NAME=cygkms32.dll DNS_PARSER=internal CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32 -Wl,--no-seh"
|
|
make $MAKEFLAGS cygkms64.dll FEATURES=minimum THREADS=1 DLL_NAME=cygkms64.dll DNS_PARSER=internal CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64 -Wl,--no-seh"
|
|
make $MAKEFLAGS allmulti THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-x86 PROGRAM_NAME=vlmcsd-cygwin-x86 MULTI_NAME=vlmcsdmulti-cygwin-x86 CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32 -Wl,--no-seh"
|
|
make $MAKEFLAGS allmulti THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-x64 PROGRAM_NAME=vlmcsd-cygwin-x64 MULTI_NAME=vlmcsdmulti-cygwin-x64 CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64 -Wl,--no-seh"
|
|
make $MAKEFLAGS MSRPC=1 THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-msrpc-x86 PROGRAM_NAME=vlmcsd-cygwin-msrpc-x86 MULTI_NAME=vlmcsdmulti-cygwin-msrpc-x86 CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF -fasynchronous-unwind-tables" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32"
|
|
make $MAKEFLAGS MSRPC=1 THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-msrpc-x64 PROGRAM_NAME=vlmcsd-cygwin-msrpc-x64 MULTI_NAME=vlmcsdmulti-cygwin-msrpc-x64 CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
|
|
unset CAT
|
|
make $MAKEFLAGS vlmcsdmulti-cygwin-msrpc-x64 MSRPC=1 THREADS=1 DNS_PARSER=internal MULTI_NAME=vlmcsdmulti-cygwin-msrpc-x64 CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC -flto=jobserver" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
|
|
make $MAKEFLAGS vlmcsdmulti-cygwin-msrpc-x86 MSRPC=1 THREADS=1 DNS_PARSER=internal MULTI_NAME=vlmcsdmulti-cygwin-msrpc-x86 CC=i686-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC -flto=jobserver" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32"
|
|
export CAT=2
|
|
|
|
make $MAKEFLAGS THREADS=1 MSRPC=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-msrpc-x86-openssl-EXPERIMENTAL CRYPTO=openssl_with_aes PROGRAM_NAME=vlmcsd-cygwin-x86-openssl-EXPERIMENTAL CC=i686-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32"
|
|
make $MAKEFLAGS THREADS=1 MSRPC=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-msrpc-x64-openssl-EXPERIMENTAL CRYPTO=openssl_with_aes PROGRAM_NAME=vlmcsd-cygwin-x64-openssl-EXPERIMENTAL CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
|
|
|
|
export CAT=2
|
|
#unset CAT
|
|
make $MAKEFLAGS libkms32-gcc.dll CRYPTO=windows FEATURES=minimum THREADS=1 DLL_NAME=libkms32-gcc.dll CC=i686-w64-MingW32-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF32" LDFLAGS="-static-libgcc $LFWIN32"
|
|
make $MAKEFLAGS libkms64-gcc.dll CRYPTO=windows FEATURES=minimum THREADS=1 DLL_NAME=libkms64-gcc.dll CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF64" LDFLAGS="-static-libgcc $LFWIN64"
|
|
make $MAKEFLAGS allmulti THREADS=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-x86-gcc PROGRAM_NAME=vlmcsd-Windows-x86-gcc MULTI_NAME=vlmcsdmulti-Windows-x86-gcc CC=i686-w64-MingW32-gcc.exe CFLAGS="$CF -fno-lto" PLATFORMFLAGS="$PF32" LDFLAGS="$LFWIN32"
|
|
make $MAKEFLAGS allmulti THREADS=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-x64-gcc PROGRAM_NAME=vlmcsd-Windows-x64-gcc MULTI_NAME=vlmcsdmulti-Windows-x64-gcc CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CF -fno-lto" PLATFORMFLAGS="$PF64" LDFLAGS="$LFWIN64"
|
|
unset CAT
|
|
make -Bj allmulti MSRPC=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-msrpc-x86 PROGRAM_NAME=vlmcsd-Windows-msrpc-x86 MULTI_NAME=vlmcsdmulti-Windows-msrpc-x86 CC=i686-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC -fno-lto" PLATFORMFLAGS="$PF32" LDFLAGS="$LFWIN32"
|
|
make $MAKEFLAGS allmulti THREADS=1 MSRPC=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-msrpc-x64 PROGRAM_NAME=vlmcsd-Windows-msrpc-x64 MULTI_NAME=vlmcsdmulti-Windows-msrpc-x64 CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC -fno-lto" PLATFORMFLAGS="$PF64" LDFLAGS="$LFWIN64"
|
|
#unset CAT
|
|
#make $MAKEFLAGS vlmcsdmulti-Windows-msrpc-x86 THREADS=1 MSRPC=1 CRYPTO=windows MULTI_NAME=vlmcsdmulti-Windows-msrpc-x86 CC=i686-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF32" LDFLAGS="-Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware"
|
|
#make $MAKEFLAGS vlmcsdmulti-Windows-msrpc-x64 THREADS=1 MSRPC=1 CRYPTO=windows MULTI_NAME=vlmcsdmulti-Windows-msrpc-x64 CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
|
|
export CAT=2
|
|
|
|
rm -f *_all.* *.o 2> /dev/null &
|
|
|
|
#echo ""
|
|
#echo "Copying MingW binaries from distribution server"
|
|
|
|
#scp -p root@ubuntu64:x/binaries/Windows/intel/*Windows* root@ubuntu64:x/binaries/Windows/intel/libkms* .
|
|
|
|
echo ""
|
|
echo "Installing binaries"
|
|
|
|
cp -p vlmcs-cygwin-x64.exe /usr/local/bin/vlmcs &
|
|
cp -p vlmcsd-cygwin-x64.exe /usr/local/bin/vlmcsd &
|
|
cp -p cygkms64.dll /usr/local/bin/cygkms.dll &
|
|
|
|
cp -p libkms32.dll /cygdrive/c/nttools/x86 &
|
|
cp -p libkms64.dll /cygdrive/c/nttools/x64 &
|
|
cp -p vlmcsd-Windows-x86.exe /cygdrive/c/nttools/x86/vlmcsd.exe
|
|
cp -p vlmcs-Windows-x86.exe /cygdrive/c/nttools/x86/vlmcs.exe
|
|
|
|
#cmd /C mklink c:\\nttools\\x86\\vlmcsd.exe vlmcsdmulti.exe 2> /dev/null &
|
|
#cmd /C mklink c:\\nttools\\x86\\vlmcs.exe vlmcsdmulti.exe 2> /dev/null &
|
|
|
|
echo "Installing man pages"
|
|
|
|
mkdir -p /usr/share/man/man8
|
|
mkdir -p /usr/share/man/man1
|
|
mkdir -p /usr/share/man/man7
|
|
mkdir -p /usr/share/man/man5
|
|
|
|
cp -p vlmcsd.7 vlmcsd-floppy.7 /usr/share/man/man7
|
|
cp -p vlmcsd.8 /usr/share/man/man8
|
|
cp -p vlmcsd.ini.5 /usr/share/man/man5
|
|
cp -p vlmcs.1 vlmcsdmulti.1 /usr/share/man/man1
|
|
|
|
bzip2 -f /usr/share/man/man7/vlmcsd-floppy.7 /usr/share/man/man5/vlmcsd.ini.5 /usr/share/man/man7/vlmcsd.7 /usr/share/man/man8/vlmcsd.8 /usr/share/man/man1/vlmcs.1 /usr/share/man/man1/vlmcsdmulti.1 &
|
|
|
|
# Copy stuff to distribution server
|
|
scp -p vlmcsd-cyg* vlmcsd-Win* vlmcs-* vlmcsdmulti-* *.dll root@ubuntu64:x/binaries/Windows/intel
|