Merge installer folder with internal

This commit is contained in:
2023-01-30 22:57:17 +11:00
parent 2ec0d58fab
commit a7c52c2a9c
13 changed files with 0 additions and 1388 deletions
+30
View File
@@ -0,0 +1,30 @@
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
compiler_list=(gcc clang)
for compiler in "${compiler_list[@]}"
do
version_list=()
if [[ "${compiler}" == "gcc" ]]; then
version_list+=(12.1.0)
version_list+=(11.3.0)
version_list+=(9.5.0)
cxx_compiler=g++
c_compiler=gcc
elif [[ "${compiler}" == "clang" ]]; then
version_list+=(14.0.0)
cxx_compiler=clang++
c_compiler=clang
fi
for version in "${version_list[@]}"
do
if [[ "${compiler}" == "gcc" ]];then
cmake_flags="-D CMAKE_BUILD_RPATH='/home/doyle/Developer/Tools/gcc-mostlyportable/gcc-mostlyportable-${version}/usr/lib64/'"
fi
build_dir=${script_dir}/build/${compiler}-${version}
done
cp --force ${build_dir}/compile_commands.json .
done
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
for gcc_version in "$@"
do
image_name=mostlyportable-gcc-image
container_name=mostlyportable-gcc
docker build -t ${image_name} --build-arg GCC_VERSION=${gcc_version} . || exit
docker container rm ${container_name} > /dev/null 2>&1
docker create --name ${container_name} ${image_name} || exit
mkdir --parent build || exit
docker cp ${container_name}:/usr/local/docker/mostlyportable-gcc/mostly-built/gcc-mostlyportable-${gcc_version} . || exit
docker container rm ${container_name} || exit
done
if [[ $EUID == 0 ]]; then
chown --recursive ${USER} gcc-mostlyportable-*
fi
+43
View File
@@ -0,0 +1,43 @@
FROM ubuntu:16.04 as builder
RUN set -ex \
&& apt-get update \
&& apt-get --no-install-recommends --yes install \
apt-transport-https \
eatmydata \
ca-certificates
# Build tools
RUN set -ex \
&& apt-get update \
&& eatmydata apt-get --no-install-recommends --yes install \
build-essential \
g++-multilib \
git \
libgmp-dev \
libz-dev \
m4 \
schedtool \
texinfo \
texlive \
wget
WORKDIR /usr/local/docker
ARG MOSTLY_PORTABLE_GCC_GIT_BRANCH=master
RUN set -ex \
&& git clone https://github.com/Frogging-Family/mostlyportable-gcc \
&& cd mostlyportable-gcc \
&& git checkout $MOSTLY_PORTABLE_GIT_BRANCH
ARG GCC_VERSION=11.3.0
ARG BIN_UTILS_VERSION=2.38
RUN set -ex \
&& cd mostlyportable-gcc \
&& sed --in-place "s/^_use_gcc_git=\".*\"$/_use_gcc_git=\"false\"/" mostlyportable-gcc.cfg \
&& sed --in-place "s/^_gcc_version=\".*\"$/_gcc_version=\"$GCC_VERSION\"/" mostlyportable-gcc.cfg \
&& sed --in-place "s/^_use_binutils_git=\".*\"$/_use_binutils_git=\"false\"/" mostlyportable-gcc.cfg \
&& sed --in-place "s/^_binutils=.*$/_binutils=$BIN_UTILS_VERSION/" mostlyportable-gcc.cfg \
&& sed --in-place "s/^_use_isl_git=\".*\"$/_use_isl_git=\"false\"/" mostlyportable-gcc.cfg \
&& sed --in-place -E "s/^(\s*)(.*)_ldconfmostlyportable;$/\1_ldconfmostlyportable=\"n\"/" mostlyportable-gcc.sh \
&& ./mostlyportable-gcc.sh gcc
@@ -0,0 +1,73 @@
@echo off
REM NOTE: Overview (Version 1)
REM ----------------------------------------------------------------------------
REM
REM Merge multiple compilation command files generated by clang -MJ and dump it
REM to standard output as a JSON array. This script lets you merge the output
REM files clang dumps on execution of this command without relying on any
REM external tools, just pure batch scripting.
REM
REM An entry generated by clang -MJ, looks like this:
REM
REM {
REM "directory": "/home/user/dev/llvm/build",
REM "file": "/tmp/foo.cpp",
REM "output": "foo.o",
REM "arguments": ["/usr/bin/clang-5.0", "-xc++", "/tmp/foo.cpp", "--driver-mode=g++", "-Wall", "-I", "/home/user/dev/libcpp/libcpp/include", "-c", "--target=x86_64-unknown-linux-gnu"]
REM }
REM
REM See: https://sarcasm.github.io/notes/dev/compilation-database.html#clang
REM
REM NOTE: Examples/Integration
REM ----------------------------------------------------------------------------
REM On Windows you can generate this file easily on MSVC projects by utilising
REM the Clang MSVC CL wrapper in clang-cl which converts MSVC flags into Clang
REM compatible flags.
REM
REM clang-cl -clang:-MJcompile.json -nologo -W4 -Z7 your_cpp_file.cpp
REM
REM If you already use clang on Windows
REM
REM clang -MJcompile.json your_cpp_file.cpp
REM
REM You may merge the generated files into a valid compile_commands.json via
REM this script (by default it dumps to standard out) i.e.
REM
REM clang_merge_compilation_command_files.bat compile.json > compile_commands.json
REM
REM NOTE: What's it for?
REM ----------------------------------------------------------------------------
REM Compilation commands can be used by LSP so that LSP daemons, like clangd are
REM able to semantically understand the code and provide code completion, hints
REM AST operations and so forth.
setlocal EnableDelayedExpansion
if [%1]==[] (
echo Usage: %0 [compilation command files...]
exit /b -1
)
REM Count the number of arguments we received
set arg_count=0
for %%x in (%*) do ( set /A arg_count+=1 )
REM Open a JSON array to splat the JSON compile commands objects into
echo [
REM Append the compile commands in
set arg_next_index=0
for %%x in (%*) do (
set /A arg_next_index+=1
set /P contents=<%%x
REM On the last compile command to append to the array, remove the trailing
REM comma on the JSON object
if !arg_next_index! == !arg_count! (
set contents=!contents:~0,-1!
)
echo !contents!
)
REM Close the JSON array
echo ]
+105
View File
@@ -0,0 +1,105 @@
@echo off
setlocal
REM
REM Generate Standalone MSVC17 x86/x64 Toolchain from VS Installation
REM
REM Collects the necessary includes, binaries, DLLs and libs to around ~300mb on
REM disk from a VS installation that can invoke cl, and link as you typically
REM would after calling "vcvarsall.bat x64"
REM
REM This script generates the helper scripts within the generated toolchain.
REM cl_[x64|x86].bat: Invokes the compiler with required environment variables set
REM link_[x64|x86}.bat: Invokes the linker with required environment variables set
REM msvc_env_[x64|x86].bat: Setups the environment variables for the toolchain.
REM i.e. "call msvc_env_x64.bat" to set the current
REM session's environment variables for compiling with
REM the toolchain, akin to "vcvarsall.bat x64"
REM
REM Information about the necessary files and steps adapted from
REM Krouzu's Isolating MSVC19 https://gist.github.com/krouzu/19ddd4cb989264b11c7b3ba48c159be0
REM Paul Houle's Isolating MSVC14 Script
REM
REM For other Visual Studio versions, you may need to update the version numbers.
REM
REM Configuration (NOTE: Update arch to either, "x86", "x64" or "x86 x64" for both toolchains).
set arch=x86 x64
REM Source Directories (NOTE: Update the directories for your desired version)
set vs_version=2017
set msvc_version=14.16.27023
set win_sdk_version=10.0.17763.0
set vs_root=C:\Program Files (x86)\Microsoft Visual Studio\%vs_version%\Community
set vs1=%vs_root%\VC\Tools\MSVC\%msvc_version%
set vs2=C:\Program Files (x86)\Windows Kits\10\bin\%win_sdk_version%
set vs3=C:\Program Files (x86)\Windows Kits\10\Include\%win_sdk_version%
set vs4=C:\Program Files (x86)\Windows Kits\10\Lib\%win_sdk_version%
set dll1=%vs_root%\Common7\Tools\api-ms-win-*.dll
set dll2=C:\Windows\System32\*140*.dll
set dll3=C:\Windows\System32\ucrtbase*.dll
set dll4=C:\Windows\System32\VsGraphicsHelper.dll
REM Destination Directory
set dest=%~1
if "%dest%"=="" echo Usage: %~nx0 ^<output folder^>
if "%dest%"=="" goto :eof
if exist "%dest%" echo Directory "%dest%" already exists, exiting.
if exist "%dest%" goto :eof
REM Path/File Exist Check
for %%a in ("%vs1%" "%vs2%" "%dll1%" "%dll2%" "%dll3%" "%dll4%" "%vs3%" "%vs4%") do (
if not exist %%a echo Required file or path not found: %%a
if not exist %%a goto :eof
)
set copy_cmd=xcopy /I /S
REM MSVC Includes
%copy_cmd% "%vs1%\include" "%dest%\include"
%copy_cmd% "%vs3%\ucrt\*" "%dest%\include"
%copy_cmd% "%vs3%\shared\*" "%dest%\sdk\include"
%copy_cmd% "%vs3%\um\*" "%dest%\sdk\include"
REM MSVC Binaries/Libraries/DLLs
for %%a in (%arch%) do (
%copy_cmd% "%vs1%\bin\Hostx64\%%a" "%dest%\bin\%%a"
%copy_cmd% "%vs1%\lib\%%a" "%dest%\lib\%%a"
%copy_cmd% "%vs2%\%%a" "%dest%\sdk\bin\%%a"
%copy_cmd% "%vs4%\ucrt\%%a" "%dest%\lib\%%a"
%copy_cmd% "%vs4%\um\%%a" "%dest%\sdk\lib\%%a"
%copy_cmd% "%dll1%" "%dest%\sdk\bin\%%a"
%copy_cmd% "%dll2%" "%dest%\sdk\bin\%%a"
%copy_cmd% "%dll3%" "%dest%\sdk\bin\%%a"
%copy_cmd% "%dll4%" "%dest%\sdk\bin\%%a"
REM Generate Compiler/Linker Scripts
setlocal EnableDelayedExpansion
set msvc_env_script="%dest%\msvc_env_%%a.bat"
set cl_script="%dest%\cl_%%a.bat"
set link_script="%dest%\link_%%a.bat"
for %%b in (!msvc_env_script! !cl_script! !link_script!) do (
echo @echo off>> %%b
)
for %%b in (!cl_script! !link_script!) do (
echo setlocal>> %%b
)
for %%b in (!msvc_env_script! !cl_script! !link_script!) do (
echo set msvc_root=%%~dp0>> %%b
echo set include=%%msvc_root%%\include;%%msvc_root%%\sdk\include>> %%b
echo set lib=%%msvc_root%%\lib\%%a;%%msvc_root%%\sdk\lib\%%a>> %%b
echo set path=%%msvc_root%%\bin\%%a;%%path%%>> %%b
)
echo cl %%*>> !cl_script!
echo link %%*>> !link_script!
)
+104
View File
@@ -0,0 +1,104 @@
@echo off
setlocal
REM
REM Generate Standalone MSVC 2017/2019 x86/x64 Toolchain from VS Installation
REM
REM Collects the necessary includes, binaries, DLLs and libs to around ~300mb on
REM disk from a VS installation that can invoke cl, and link as you typically
REM would after calling "vcvarsall.bat x64"
REM
REM This script generates the helper scripts within the generated toolchain.
REM cl_[x64|x86].bat: Invokes the compiler with required environment variables set
REM link_[x64|x86].bat: Invokes the linker with required environment variables set
REM msvc_env_[x64|x86].bat: Setups the environment variables for the toolchain.
REM i.e. "call msvc_env_x64.bat" to set the current
REM session's environment variables for compiling with
REM the toolchain, akin to "vcvarsall.bat x64"
REM
REM Information about the necessary files and steps adapted from
REM Krouzu's Isolating MSVC19 https://gist.github.com/krouzu/19ddd4cb989264b11c7b3ba48c159be0
REM Paul Houle's Isolating MSVC14 Script
REM
REM For other Visual Studio versions, you may need to update the version numbers.
REM
REM Configuration (NOTE: Update arch to either, "x86", "x64" or "x86 x64" for both toolchains).
set arch=x86 x64
REM Source Directories (NOTE: Update the directories for your desired version)
set vs_version=2019
set msvc_version=14.28.29910
set win_sdk_version=10.0.19041.0
set vs_root=C:\Program Files (x86)\Microsoft Visual Studio\%vs_version%\Community
set vs1=%vs_root%\VC\Tools\MSVC\%msvc_version%
set vs2=C:\Program Files (x86)\Windows Kits\10\bin\%win_sdk_version%
set vs3=C:\Program Files (x86)\Windows Kits\10\Include\%win_sdk_version%
set vs4=C:\Program Files (x86)\Windows Kits\10\Lib\%win_sdk_version%
set dll1=%vs_root%\Common7\Tools\api-ms-win-*.dll
set dll2=C:\Windows\System32\*140*.dll
set dll3=C:\Windows\System32\ucrtbase*.dll
set dll4=C:\Windows\System32\VsGraphicsHelper.dll
REM Destination Directory
set dest=%~1
if "%dest%"=="" echo Usage: %~nx0 ^<output folder^>
if "%dest%"=="" goto :eof
if exist "%dest%" echo Directory "%dest%" already exists, exiting.
if exist "%dest%" goto :eof
REM Path/File Exist Check
for %%a in ("%vs1%" "%vs2%" "%dll1%" "%dll2%" "%dll3%" "%dll4%" "%vs3%" "%vs4%") do (
if not exist %%a echo Required file or path not found: %%a
if not exist %%a goto :eof
)
set copy_cmd=xcopy /I /S
REM MSVC Includes
%copy_cmd% "%vs1%\include" "%dest%\include"
%copy_cmd% "%vs3%\ucrt\*" "%dest%\include"
%copy_cmd% "%vs3%\shared\*" "%dest%\sdk\include"
%copy_cmd% "%vs3%\um\*" "%dest%\sdk\include"
REM MSVC Binaries/Libraries/DLLs
for %%a in (%arch%) do (
%copy_cmd% "%vs1%\bin\Hostx64\%%a" "%dest%\bin\%%a"
%copy_cmd% "%vs1%\lib\%%a" "%dest%\lib\%%a"
%copy_cmd% "%vs2%\%%a" "%dest%\sdk\bin\%%a"
%copy_cmd% "%vs4%\ucrt\%%a" "%dest%\lib\%%a"
%copy_cmd% "%vs4%\um\%%a" "%dest%\sdk\lib\%%a"
%copy_cmd% "%dll1%" "%dest%\sdk\bin\%%a"
%copy_cmd% "%dll2%" "%dest%\sdk\bin\%%a"
%copy_cmd% "%dll3%" "%dest%\sdk\bin\%%a"
%copy_cmd% "%dll4%" "%dest%\sdk\bin\%%a"
REM Generate Compiler/Linker Scripts
setlocal EnableDelayedExpansion
set msvc_env_script="%dest%\msvc_env_%%a.bat"
set cl_script="%dest%\cl_%%a.bat"
set link_script="%dest%\link_%%a.bat"
for %%b in (!msvc_env_script! !cl_script! !link_script!) do (
echo @echo off>> %%b
)
for %%b in (!cl_script! !link_script!) do (
echo setlocal>> %%b
)
for %%b in (!msvc_env_script! !cl_script! !link_script!) do (
echo set msvc_root=%%~dp0>> %%b
echo set include=%%msvc_root%%\include;%%msvc_root%%\sdk\include>> %%b
echo set lib=%%msvc_root%%\lib\%%a;%%msvc_root%%\sdk\lib\%%a>> %%b
echo set path=%%msvc_root%%\bin\%%a;%%path%%>> %%b
)
echo cl %%*>> !cl_script!
echo link %%*>> !link_script!
)