Skip to contentSkip to conversation

usertools: fix build with gcc

PATCH New Choonho Son 3 participants 4 messages Jun 21, 2018 – Jun 27, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usertools: fix build with gcc

If developer does not define DESTDIR variable, dpdk-setup.sh fails to build with lack of environment variable

Build complete [x86_64-native-linuxapp-gcc] Installation cannot run with T defined and DESTDIR undefined

Choonho Son (1):
usertools: fix build with gcc

 usertools/dpdk-setup.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 usertools: fix build with gcc

dpdk-setup.sh fails to build with lack of environment variable

Build complete [x86_64-native-linuxapp-gcc] Installation cannot run with T defined and DESTDIR undefined

---
 usertools/dpdk-setup.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
usertools/dpdk-setup.sh +2 -1
index 5eebbce..5248e7a 100755
@@ -65,6 +65,7 @@ setup_target()
 {
 	option=$1
 	export RTE_TARGET=${TARGETS[option]}
+	export DESTDIR=${DESTDIR:-install}
 
 	compiler=${RTE_TARGET##*-}
 	if [ "$compiler" == "icc" ] ; then
@@ -76,7 +77,7 @@ setup_target()
 		fi
 	fi
 	if [ "$QUIT" == "0" ] ; then
-		make install T=${RTE_TARGET}
+		make install T=${RTE_TARGET} DESTDIR=${DESTDIR}
 	fi
 	echo "------------------------------------------------------------------------------"
 	echo " RTE_TARGET exported as $RTE_TARGET"
Signature · 1 line
2.7.4
#2 lore raw
Quoted 23 lines · Choonho Son

dpdk-setup.sh fails to build with lack of environment variable

Build complete [x86_64-native-linuxapp-gcc] Installation cannot run with T defined and DESTDIR undefined

---
 usertools/dpdk-setup.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
usertools/dpdk-setup.sh +1 -0
index 5eebbce..5248e7a 100755
@@ -65,6 +65,7 @@ setup_target()
 {
 	option=$1
 	export RTE_TARGET=${TARGETS[option]}
+	export DESTDIR=${DESTDIR:-install}
 
 	compiler=${RTE_TARGET##*-}
 	if [ "$compiler" == "icc" ] ; then

usertools/dpdk-setup.sh setup_target() · line 83

Quoted 8 lines
usertools/dpdk-setup.sh +1 -1
@@ -76,7 +77,7 @@ setup_target()
 		fi
 	fi
 	if [ "$QUIT" == "0" ] ; then
-		make install T=${RTE_TARGET}
+		make install T=${RTE_TARGET} DESTDIR=${DESTDIR}
 	fi
 	echo "------------------------------------------------------------------------------"
 	echo " RTE_TARGET exported as $RTE_TARGET"

The message about no DESTDIR is not really an error, the build has completed successfully. I don't think copying the build over to a new directory is something we should always do as part of this script.

/Bruce

#3 lore raw

21/06/2018 11:55, Bruce Richardson:

Quoted 8 lines · Choonho Son
Quoted 7 lines

dpdk-setup.sh fails to build with lack of environment variable

Build complete [x86_64-native-linuxapp-gcc] Installation cannot run with T defined and DESTDIR undefined

---

[...]

Quoted 6 lines

usertools/dpdk-setup.sh setup_target() · line 80

Quoted 2 lines
usertools/dpdk-setup.sh +1 -1
-		make install T=${RTE_TARGET}
+		make install T=${RTE_TARGET} DESTDIR=${DESTDIR}

The message about no DESTDIR is not really an error, the build has completed successfully. I don't think copying the build over to a new directory is something we should always do as part of this script.

Absolutely!

The syntax "make install T=" is old.
It should be replaced by "make config T=" + "make".
You can look at devtools/test-build.sh to see how compilation can be done. It is also documented in various places like:
doc/guides/linux_gsg/build_dpdk.rst doc/guides/prog_guide/dev_kit_root_make_help.rst

More options:
- use meson build system in dpdk-setup.sh - maybe too early
- remove dpdk-setup.sh - maybe used by real users