Skip to content

Commit 393b7ac

Browse files
Fix comments on pull request Xilinx#3733 (Xilinx#3740)
1 parent 8016a14 commit 393b7ac

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

build/cross_compile.sh

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ usage()
1414
echo " options:"
1515
echo " -help Print this usage"
1616
echo " -aarch Architecture <aarch32/aarch64>"
17-
echo " -sysroot Absolute path to sysroot of target architecture"
17+
echo " -sysroot Path to sysroot of target architecture"
1818
echo " -compiler [optional] Path to 'gcc' cross compiler"
1919
echo " If not specified default paths in host will be searched"
2020
echo " -clean, clean Remove build directories"
@@ -30,15 +30,16 @@ usage_and_exit()
3030
SAVED_OPTIONS=$(set +o)
3131
# Don't print all commands
3232
set +x
33-
# Get real script by read symbol link
33+
# Get the canonical file name of the current script
3434
THIS_SCRIPT=`readlink -f ${BASH_SOURCE[0]}`
3535

3636
PROGRAM=`basename $0`
3737

3838
BUILDDIR=$(readlink -f $(dirname ${BASH_SOURCE[0]}))
3939
CORE=`grep -c ^processor /proc/cpuinfo`
4040
CMAKE=cmake
41-
OS_HOST=`grep '^ID=' /etc/os-release | awk -F= '{print $2}' | tr -d '"'`
41+
source /etc/os-release
42+
OS_HOST=$ID
4243

4344
if [[ $OS_HOST == "centos" ]] || [[ $OS_HOST == "rhel" ]]; then
4445
CMAKE=cmake3
@@ -67,10 +68,10 @@ while [ $# -gt 0 ]; do
6768
-clean | clean )
6869
clean=1
6970
;;
70-
-compiler )
71-
shift
72-
COMPILER=$1
73-
;;
71+
-compiler )
72+
shift
73+
COMPILER=$1
74+
;;
7475
--* | -* )
7576
error "Unregognized option: $1"
7677
;;
@@ -100,6 +101,7 @@ if [ -z $AARCH ] || [ -z $SYSROOT ] ; then
100101
error "Please provide the required options 'aarch', 'sysroot'"
101102
fi
102103

104+
SYSROOT=`readlink -f $SYSROOT`
103105
if [ ! -d $SYSROOT ]; then
104106
error "SYSROOT is not accessible"
105107
fi
@@ -142,10 +144,11 @@ if [ ! -f ${SYSROOT}/etc/os-release ]; then
142144
OS_TARGET="CentOS"
143145
echo "INFO: Cross Compiling XRT for $AARCH"
144146
else
145-
OS_TARGET=`grep '^ID=' ${SYSROOT}/etc/os-release | awk -F= '{print $2}' | tr -d '"'`
146-
if [ $OS_TARGET == "ubuntu" ]; then
147-
OS_TARGET="Ubuntu"
148-
VERSION=`grep '^VERSION_ID=' ${SYSROOT}/etc/os-release | awk -F= '{print $2}' | tr -d '"'`
147+
source ${SYSROOT}/etc/os-release
148+
OS_TARGET=$ID
149+
if [ $OS_TARGET == "ubuntu" ] || [ $OS_TARGET == "debian" ]; then
150+
OS_TARGET=${OS_TARGET^}
151+
VERSION=$VERSION_ID
149152
else
150153
OS_TARGET=`cat ${SYSROOT}/etc/redhat-release | awk '{print $1}' | tr -d '"'`
151154
VERSION=`cat ${SYSROOT}/etc/redhat-release | awk '{print $4}' | tr -d '"'`

src/runtime_src/core/edge/drm/zocl/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ endif
2525
ccflags-y := -I$(src)/include -I$(src)/../../include -I$(src)/../../../include -I$(src)/../../../common/drv/include
2626

2727
drv_common-y := $(common_dir)/kds_core.o \
28-
$(common_dir)/cu_hls.o \
29-
$(common_dir)/xrt_cu.o \
30-
$(common_dir)/xrt_xclbin.o
28+
$(common_dir)/cu_hls.o \
29+
$(common_dir)/xrt_cu.o \
30+
$(common_dir)/xrt_xclbin.o
3131

3232
zocl-y := \
3333
$(drv_common-y) \

src/runtime_src/tools/scripts/xrtdeps.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ usage()
1212
echo "[-help] List this help"
1313
echo "[-validate] Validate that required packages are installed"
1414
echo "[-docker] Indicate that script is run within a docker container, disables select packages"
15+
echo "[-sysroot] Indicate that script is run to prepare sysroot, disables select packages"
1516

1617
exit 1
1718
}
1819

1920
validate=0
2021
docker=0
22+
sysroot=0
2123

2224
while [ $# -gt 0 ]; do
2325
case "$1" in
@@ -32,6 +34,10 @@ while [ $# -gt 0 ]; do
3234
docker=1
3335
shift
3436
;;
37+
-sysroot)
38+
sysroot=1
39+
shift
40+
;;
3541
*)
3642
echo "unknown option"
3743
usage
@@ -182,7 +188,7 @@ ub_package_list()
182188
python3-sphinx-rtd-theme \
183189
)
184190

185-
if [[ $docker == 0 ]]; then
191+
if [ $docker == 0 ] && [ $sysroot == 0 ]; then
186192
UB_LIST+=(linux-headers-$(uname -r))
187193
fi
188194

0 commit comments

Comments
 (0)