Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

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

Rev 2 Rev 3
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
-
 
2
# LLVM/Clang toolchain cross-compilation script for QNX 8.0 by Pierre-Marie Baty <pm@pmbaty.com>
-
 
3
 
-
 
4
# NOTE TO SELF: DO NOT USE $0 AS THIS SCRIPT CAN BE RUN *OR* SOURCED! (see build-llvm.sh in the VM)
2
 
5
 
3
export QNXSDK_PATH="../qnx800"
6
export QNXSDK_PATH="../qnx800"
4
export QNXSDK_HOSTPATH="host/linux/x86_64"
7
export QNXSDK_HOSTPATH="host/linux/x86_64"
5
export QNXSDK_TARGETPATH="target/qnx"
8
export QNXSDK_TARGETPATH="target/qnx"
6
export BUILD_DIR_NAME="llvm-build"
9
export BUILD_DIR_NAME="llvm-build"
7
export LLVM_VERSION="18.1.4"
10
export LLVM_VERSION="18.1.4"
8
export LLVM_SOURCES_FILE="llvmorg-${LLVM_VERSION}.tar.gz" # name of file containing LLVM version LLVM_VERSION sources
11
export LLVM_SOURCES_FILE="llvmorg-${LLVM_VERSION}.tar.gz" # name of file containing LLVM version LLVM_VERSION sources
9
export LLVM_SOURCES_URL="https://github.com/llvm/llvm-project/archive/refs/tags/${LLVM_SOURCES_FILE}" # download URL of LLVM_SOURCES_FILE
12
export LLVM_SOURCES_URL="https://github.com/llvm/llvm-project/archive/refs/tags/${LLVM_SOURCES_FILE}" # download URL of LLVM_SOURCES_FILE
10
export LLVM_SOURCES_DIR="llvm-project-llvmorg-${LLVM_VERSION}" # name of directory created when extracting LLVM_SOURCES_FILE
13
export LLVM_SOURCES_DIR="llvm-project-llvmorg-${LLVM_VERSION}" # name of directory created when extracting LLVM_SOURCES_FILE
11
 
14
 
-
 
15
# target triple settings
12
export TARGET_ARCH="x86_64"
16
export TARGET_ARCH="x86_64"
13
export TARGET_VENDOR="pc"
-
 
14
#export TARGET_ARCH="aarch64"
17
#export TARGET_ARCH="aarch64"
15
#export TARGET_VENDOR="unknown"
18
test "${TARGET_ARCH}" = "x86_64" && export TARGET_VENDOR="pc" || export TARGET_VENDOR="unknown"
16
export TARGET_KERNEL="nto"
19
export TARGET_KERNEL="nto"
17
export TARGET_SYSTEM="qnx8.0.0"
20
export TARGET_SYSTEM="qnx8.0.0"
18
 
21
 
19
# see where we are
22
# see where we are
20
export CURRENT_DIR="$(pwd)"
23
export CURRENT_DIR="$(pwd)"
Line 31... Line 34...
31
if [ ! -d "${QNXSDK_PATH}/${QNXSDK_HOSTPATH}" ] || [ ! -d "${QNXSDK_PATH}/${QNXSDK_TARGETPATH}" ]; then
34
if [ ! -d "${QNXSDK_PATH}/${QNXSDK_HOSTPATH}" ] || [ ! -d "${QNXSDK_PATH}/${QNXSDK_TARGETPATH}" ]; then
32
        echo ""
35
        echo ""
33
        echo "Error: the ${QNXSDK_PATH} path doesn't contain a QNX SDK. It must contain the"
36
        echo "Error: the ${QNXSDK_PATH} path doesn't contain a QNX SDK. It must contain the"
34
        echo "'host' and 'target' directories of the QNX SDP for the targeted version of QNX"
37
        echo "'host' and 'target' directories of the QNX SDP for the targeted version of QNX"
35
        echo "and the ${TARGET_ARCH} platform. Please deploy these directories and try again."
38
        echo "and the ${TARGET_ARCH} platform. Please deploy these directories and try again."
36
        echo "NOTE: if you're using a VMWare virtual machine and this path points to a shared"
-
 
37
        echo "folder, you may need to initiate the share by unticking the 'Enable shared"
-
 
38
        echo "folders' checkbox and ticking it again in the VM settings (VMWare bug)."
-
 
39
        echo ""
39
        echo ""
40
        exit 1
40
        exit 1
41
fi
41
fi
42
 
42
 
43
# verify that we have wget, python3, cmake, gcc, g++ and ninja
43
# verify that we have wget, python3, cmake, gcc, g++ and ninja
Line 68... Line 68...
68
        echo "(on a POSIX machine:)"
68
        echo "(on a POSIX machine:)"
69
        echo "  cd ${QNXSDK_PATH}"
69
        echo "  cd ${QNXSDK_PATH}"
70
        echo "  find . -name symlinks.lst -exec ./symlinks.sh {} create \\; && printf 'present' > .symlinks-state"
70
        echo "  find . -name symlinks.lst -exec ./symlinks.sh {} create \\; && printf 'present' > .symlinks-state"
71
        echo "(else on a Windows machine:)"
71
        echo "(else on a Windows machine:)"
72
        echo "  cd ${QNXSDK_PATH}"
72
        echo "  cd ${QNXSDK_PATH}"
73
        echo host\\win64\\${TARGET_ARCH}\\usr\\bin\\busybox.exe sh -c \"" \
73
        echo host\\win64\\x86_64\\usr\\bin\\busybox.exe sh -c \"" \
74
               "find . -name symlinks.lst -exec ./symlinks.sh {} create \\; && printf 'present' > .symlinks-state" \
74
               "find . -name symlinks.lst -exec ./symlinks.sh {} create \\; && printf 'present' > .symlinks-state" \
75
               "\""
75
               "\""
76
        echo "Note that this step WILL take time on a Win32 machine, but is only done once."
76
        echo "Note that this step WILL take time on a Win32 machine, but is only done once."
77
        echo ""
77
        echo ""
78
        exit 1
78
        exit 1