Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Rev 24 | Rev 28 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 24 Rev 27
Line 1... Line 1...
1
@echo off
1
@echo off
2
setlocal enableextensions enabledelayedexpansion
2
setlocal enableextensions enabledelayedexpansion
3
 
3
 
4
rem // set the WSL distribution to use
4
rem // set the WSL distribution to use
5
set WSL_DISTR=Ubuntu-22.04
5
set WSL_DISTR=Ubuntu-22.04
-
 
6
 
-
 
7
rem // name of the QNX SDK root directory
-
 
8
set QNXSDK_DIRNAME=qnx800
6
 
9
 
7
rem // list of Linux tools required by the cross-build script
10
rem // list of Linux tools required by the cross-build script
8
set REQUIRED_TOOLS=wget python3 cmake gcc g++ ninja:ninja-build ccache
11
set REQUIRED_TOOLS=wget python3 cmake gcc g++ ninja:ninja-build ccache
9
 
12
 
10
 
13
 
Line 79... Line 82...
79
set THISDIR=%CD%
82
set THISDIR=%CD%
80
cd ..\qnx800
83
cd ..\qnx800
81
call qnxsdp-env.bat || goto :exit_error
84
call qnxsdp-env.bat || goto :exit_error
82
cd "%THISDIR%"
85
cd "%THISDIR%"
83
 
86
 
84
rem // TODO: a possible way to accelerate the build would be to copy $QNX_HOST and $QNX_TARGET into the WSL2 filesystem
87
rem // The build script will already recursively transfer the contents of $QNX_HOST and $QNX_TARGET to the WSL2 ext4 partition
-
 
88
rem // to avoid using the Plan9 NTFS to ext4 bridge (9p file protocol) implemented by Microsoft that is notoriously slow.
-
 
89
rem // However to make this faster, we could:
-
 
90
rem //   1. fire up a file packer and create a SINGLE FILE archive of the directory hierarchy to copy
-
 
91
rem //   2. copy the file over to WSL
-
 
92
rem //   3. unpack the archive in /tmp/qnxsdk and delete it - as it's much faster to migrate a single file than a folder hierarchy
-
 
93
rem // The prerequisite shall be that the archive format be *operable with the default tools on both systems*.
85
rem // instead of having the GCC compiler continuously cross the bridge back and forth between NTFS and ext4.
94
rem // We might be able to do this by using the "tar.exe" utility from the QNX8 Win64 host SDP tools and piping the data
86
rem // But hey. Let's see if the current way of doing things is acceptable first.
95
rem // through a wsl instance which would in turn untar it directly at its location. Investigate.
-
 
96
 
-
 
97
rem // NOTE: on WSL2, the QNX SDK will always be copied to $HOME, regardless of what xdg-user-dir DESKTOP says.
-
 
98
wsl --distribution %WSL_DISTR% -- mkdir -p ~/%QNXSDK_DIRNAME%/host ~/%QNXSDK_DIRNAME%/target
-
 
99
echo Deploying QNX8 Linux host SDK to WSL2 ext4 filesystem, please wait...
-
 
100
"%QNX_HOST%\usr\bin\tar.exe" c - ..\%QNXSDK_DIRNAME%\host\linux | wsl --distribution %WSL_DISTR% -- tar x --directory=~/%QNXSDK_DIRNAME%/host
-
 
101
echo Deploying QNX8 TARGET SDK to WSL2 ext4 filesystem, please wait...
-
 
102
"%QNX_HOST%\usr\bin\tar.exe" c - ..\%QNXSDK_DIRNAME%\target\qnx | wsl --distribution %WSL_DISTR% -- tar x --directory=~/%QNXSDK_DIRNAME%/target
87
 
103
 
88
rem // now run WSL from this directory and chain-call the POSIX Bourne shell build script
104
rem // now run WSL from this directory and chain-call the POSIX Bourne shell build script
89
wsl --distribution %WSL_DISTR% -- ./cross-build.sh || goto :exit_error
105
wsl --distribution %WSL_DISTR% -- ./cross-build.sh || goto :exit_error
90
 
106
 
91
rem // at this point, the story is supposed to have ended well.
107
rem // at this point, the story is supposed to have ended well.